|
@@ -191,6 +191,15 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #balancePayment>
|
|
|
+ <div style="width: 100%">{{ computeBalancePayment() }}</div>
|
|
|
+ </template>
|
|
|
+ <template #paymentDate>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <span v-if="supplierData && supplierData.paymentType == 1">{{ formData.data.paymentDate }}</span>
|
|
|
+ <el-date-picker v-model="formData.data.paymentDate" type="date" placeholder="请选择" value-format="YYYY-MM-DD" v-else />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #money>
|
|
|
<div style="width: 100%">
|
|
|
<div style="padding: 8px; background-color: #e9f5fb; font-size: 12px; font-weight: 700">
|
|
@@ -254,6 +263,10 @@ const formData = reactive({
|
|
|
contract: "",
|
|
|
purchaseBomList: [],
|
|
|
fileList: [],
|
|
|
+ receiveProvince: "福建省",
|
|
|
+ receiveCity: "福州市",
|
|
|
+ receiveDetailedAddress: "福清市三山镇横坑村金园路18号3号楼",
|
|
|
+ receivePostcode: "350000",
|
|
|
},
|
|
|
});
|
|
|
const judgeStatus = () => {
|
|
@@ -351,6 +364,18 @@ const formConfig = computed(() => {
|
|
|
itemWidth: 33,
|
|
|
},
|
|
|
{
|
|
|
+ type: "slot",
|
|
|
+ slotName: "balancePayment",
|
|
|
+ label: "尾款 (%)",
|
|
|
+ itemWidth: 34,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "paymentDate",
|
|
|
+ slotName: "paymentDate",
|
|
|
+ label: "付款日期",
|
|
|
+ },
|
|
|
+ {
|
|
|
type: "title",
|
|
|
title: "款项金额",
|
|
|
label: "",
|
|
@@ -401,6 +426,7 @@ const rules = ref({
|
|
|
deliveryDate: [{ required: true, message: "请选择交付日期", trigger: "change" }],
|
|
|
currency: [{ required: true, message: "请选择币种", trigger: "change" }],
|
|
|
advancePayment: [{ required: true, message: "请输入预付款", trigger: "blur" }],
|
|
|
+ paymentDate: [{ required: true, message: "请选择付款日期", trigger: "change" }],
|
|
|
});
|
|
|
const getDemandData = () => {
|
|
|
proxy.post("/supplier/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
@@ -427,17 +453,21 @@ const getDemandData = () => {
|
|
|
});
|
|
|
};
|
|
|
getDemandData();
|
|
|
+const supplierData = ref({});
|
|
|
const changeSupplier = () => {
|
|
|
if (formData.data.supplierId) {
|
|
|
let list = supplierList.value.filter((item) => item.id === formData.data.supplierId);
|
|
|
if (list && list.length > 0) {
|
|
|
+ supplierData.value = list[0];
|
|
|
formData.data.province = list[0].province;
|
|
|
formData.data.city = list[0].city;
|
|
|
formData.data.detailedAddress = list[0].detailedAddress;
|
|
|
formData.data.contactPerson = list[0].contactPerson1;
|
|
|
formData.data.contactNumber = list[0].contactNumber1;
|
|
|
+ formData.data.paymentDate = "到货后次月1号起" + list[0].nextMonthDays + "天内,结算费用";
|
|
|
}
|
|
|
} else {
|
|
|
+ supplierData.value = {};
|
|
|
formData.data.province = "";
|
|
|
formData.data.city = "";
|
|
|
formData.data.detailedAddress = "";
|
|
@@ -474,10 +504,17 @@ const clickDelete = (index) => {
|
|
|
formData.data.purchaseBomList.splice(index, 1);
|
|
|
};
|
|
|
const changeReceiveGoodsType = () => {
|
|
|
- formData.data.receiveProvince = "";
|
|
|
- formData.data.receiveCity = "";
|
|
|
- formData.data.receiveDetailedAddress = "";
|
|
|
- formData.data.receivePostcode = "";
|
|
|
+ if (formData.data.receiveGoodsType == 1) {
|
|
|
+ formData.data.receiveProvince = "福建省";
|
|
|
+ formData.data.receiveCity = "福州市";
|
|
|
+ formData.data.receiveDetailedAddress = "福清市三山镇横坑村金园路18号3号楼";
|
|
|
+ formData.data.receivePostcode = "350000";
|
|
|
+ } else {
|
|
|
+ formData.data.receiveProvince = "";
|
|
|
+ formData.data.receiveCity = "";
|
|
|
+ formData.data.receiveDetailedAddress = "";
|
|
|
+ formData.data.receivePostcode = "";
|
|
|
+ }
|
|
|
formData.data.receiveContactPerson = "";
|
|
|
formData.data.receiveContactNumber = "";
|
|
|
};
|
|
@@ -660,6 +697,13 @@ onMounted(() => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+const computeBalancePayment = () => {
|
|
|
+ let num = 100;
|
|
|
+ if (formData.data.advancePayment) {
|
|
|
+ num = Number(Math.round((num - formData.data.advancePayment) * 100) / 100);
|
|
|
+ }
|
|
|
+ return num + "%";
|
|
|
+};
|
|
|
// 向父组件暴露
|
|
|
defineExpose({ getFormData, handleSubmit });
|
|
|
</script>
|