|
@@ -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 [
|
|
@@ -241,7 +253,7 @@ const rules = ref({
|
|
|
supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
|
|
|
invoiceType: [{ required: true, message: "请选择发票类型", trigger: "change" }],
|
|
|
payType: [{ required: true, message: "请选择付款方式", trigger: "change" }],
|
|
|
- accountManagementId: [{ required: true, message: "请选择付款账户", trigger: "change" }],
|
|
|
+ // accountManagementId: [{ required: true, message: "请选择付款账户", trigger: "change" }],
|
|
|
purchaseId: [{ required: true, message: "请选择采购合同", trigger: "change" }],
|
|
|
money: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
|
|
|
});
|
|
@@ -280,7 +292,6 @@ const getDict = () => {
|
|
|
value: item.dictKey,
|
|
|
};
|
|
|
});
|
|
|
- console.log(fundsPaymentMethod.value);
|
|
|
}
|
|
|
});
|
|
|
proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
@@ -391,6 +402,7 @@ const handleSubmit = async () => {
|
|
|
return {
|
|
|
id: item.raw.id,
|
|
|
fileName: item.raw.fileName,
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
};
|
|
|
});
|
|
|
}
|
|
@@ -406,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;
|
|
@@ -438,9 +475,12 @@ onMounted(async () => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+const getFormData = () => {
|
|
|
+ return formData.data;
|
|
|
+};
|
|
|
// 向父组件暴露
|
|
|
defineExpose({
|
|
|
- submitData: formData.data,
|
|
|
+ getFormData,
|
|
|
handleSubmit,
|
|
|
});
|
|
|
</script>
|