|
@@ -91,7 +91,9 @@
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
|
|
|
+const route = useRoute();
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const supplierList = ref([]);
|
|
|
const invoiceType = ref([]);
|
|
@@ -115,11 +117,21 @@ let formData = reactive({
|
|
|
},
|
|
|
});
|
|
|
const submit = ref(null);
|
|
|
+const judgeStatus = () => {
|
|
|
+ if (props.queryData.recordList && props.queryData.recordList.length > 0) {
|
|
|
+ let data = props.queryData.recordList.filter((item) => item.status === 2 && item.nodeType !== 1);
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
|
labelWidth: 100,
|
|
|
itemWidth: 100,
|
|
|
rules: [],
|
|
|
+ disabled: false,
|
|
|
});
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
@@ -390,6 +402,7 @@ const handleSubmit = async () => {
|
|
|
return {
|
|
|
id: item.raw.id,
|
|
|
fileName: item.raw.fileName,
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
@@ -405,6 +418,31 @@ const handleSubmit = async () => {
|
|
|
const props = defineProps({
|
|
|
queryData: Object,
|
|
|
});
|
|
|
+watch(
|
|
|
+ props.queryData,
|
|
|
+ () => {
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ if (props.queryData && (route.query.processType == 10 || route.query.processType == 20)) {
|
|
|
+ for (var text in props.queryData) {
|
|
|
+ formData.data[text] = props.queryData[text];
|
|
|
+ }
|
|
|
+ if (formData.data.fileList && formData.data.fileList.length > 0) {
|
|
|
+ fileList.value = formData.data.fileList.map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ fileList.value = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+);
|
|
|
onMounted(async () => {
|
|
|
if (props.queryData.supplyId) {
|
|
|
formData.data.supplyId = props.queryData.supplyId;
|