diff --git a/yxt-as-ui/src/views/purchase/procurement/procurement.vue b/yxt-as-ui/src/views/purchase/procurement/procurement.vue index 3d93269a3a..7afe53f3a3 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurement.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurement.vue @@ -31,7 +31,7 @@ - + @@ -88,11 +88,11 @@ - + - + diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue index 568e173b31..8204f452ce 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue @@ -27,11 +27,16 @@ -
*采购类型
+
*采购方式
- - - +
+ + + + + + +
@@ -55,13 +60,18 @@
*供应商
- - - +
+ + + + + + +
-
*是否需要发票
+
*是否开发票
@@ -117,16 +127,12 @@
-
*验货后付货款
- - - +
验货后付货款
+ {{ calculateGoodsMoney }}
-
*审批通过后付货款
- - - +
审批通过后付货款
+ {{ calculateGoodsMoney }}
@@ -245,9 +251,11 @@ export default { index: 0, accept: '.jpg,.jpeg,.png', procurementType_list: [], + operateBrand_list: [], procurementReason_list: [], paymentMethod_list: [], supplier_list: [], + warehouseType_list: [], account_list: [], formobj: { sid: '', @@ -288,6 +296,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', @@ -312,14 +324,13 @@ export default { pmsPurchaseBillDetailList: [] }, rules: { - purchaseTypeValue: [{ required: true, message: '采购类型不能为空', trigger: 'change' }], + purchaseTypeValue: [{ required: true, message: '采购方式不能为空', trigger: 'change' }], purchaseReasonValue: [{ required: true, message: '采购原因不能为空', trigger: 'change' }], payTypeValue: [{ required: true, message: '付款方式不能为空', trigger: 'change' }], supplierSid: [{ required: true, message: '供应商不能为空', trigger: 'change' }], - 'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否需要发票不能为空', trigger: 'change' }], + 'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否开发票不能为空', trigger: 'change' }], 'purchasePay.isFirstPay': [{ required: true, message: '是否先付货款不能为空', trigger: 'change' }], - 'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }], - 'purchasePay.goodsMoney': [{ required: true, message: '付货款不能为空', trigger: 'blur' }] + 'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }] } } }, @@ -348,10 +359,25 @@ export default { } return cg }, + // 应付金额 yfTotal() { let yf = '0' yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 return yf + }, + // 付货款 + calculateGoodsMoney() { + let goodsMoney = '0' + if (this.formobj.payTypeValue === '单笔付款') { + if (this.formobj.purchasePay.isFirstPay === '1') { + // 是否先付货款为是,计算审批通过后付货款 = 应付金额 + goodsMoney = this.yfTotal + } else if (this.formobj.purchasePay.isFirstPay === '0') { + // 是否先付货款为否,计算验货后付货款 = 应付金额 - 审批通过后付订金 + goodsMoney = parseFloat(this.yfTotal) - parseFloat(this.formobj.purchasePay.deposit !== '' ? this.formobj.purchasePay.deposit : '0') + } + } + return goodsMoney } }, methods: { @@ -361,6 +387,16 @@ export default { this.procurementType_list = res.data } }) + typeValues({ type: 'operateBrand' }).then((res) => { + if (res.success) { + this.operateBrand_list = res.data + } + }) + typeValues({ type: 'warehouseType' }).then((res) => { + if (res.success) { + this.warehouseType_list = res.data + } + }) typeValues({ type: 'procurementReason' }).then((res) => { if (res.success) { this.procurementReason_list = res.data @@ -441,6 +477,14 @@ export default { this.formobj.purchaseTypeKey = '' } }, + operateBrandChange(value) { + const choose = this.operateBrand_list.filter((item) => item.dictValue === value) + if (choose !== null && choose.length > 0) { + this.formobj.operateBrandKey = choose[0].dictKey + } else { + this.formobj.operateBrandKey = '' + } + }, purchaseReasonChange(value) { const choose = this.procurementReason_list.filter((item) => item.dictValue === value) if (choose !== null && choose.length > 0) { @@ -467,6 +511,14 @@ export default { this.account_list = [] } }, + warehouseTypeChange(value) { + const choose = this.warehouseType_list.filter((item) => item.dictValue === value) + if (choose !== null && choose.length > 0) { + this.formobj.warehouseTypeKey = choose[0].dictKey + } else { + this.formobj.warehouseTypeKey = '' + } + }, isInvoicingChange(val) { if (val === '1') { const choose = this.supplier_list.filter((item) => item.sid === this.formobj.supplierSid) @@ -538,6 +590,7 @@ export default { if (valid) { this.submitdisabled = true this.formobj.payableAmount = this.yfTotal + this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney req.saveOrUpdate(this.formobj).then((res) => { if (res.success) { this.$message({ showClose: true, type: 'success', message: '保存成功' }) @@ -556,6 +609,7 @@ export default { if (valid) { this.submitdisabled = true this.formobj.payableAmount = this.yfTotal + this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney req.submit(this.formobj).then((res) => { if (res.success) { this.$message({ showClose: true, type: 'success', message: '提交成功' }) @@ -610,6 +664,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue b/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue index 46982e5da4..05d21b6121 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue @@ -25,8 +25,8 @@ -
采购类型
- {{ formobj.purchaseTypeValue }} +
采购方式
+ {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }}
采购原因
@@ -40,10 +40,10 @@
供应商
- {{ formobj.supplierName }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }}
-
是否需要发票
+
是否开发票
{{ formobj.purchaseBillInvoice.isInvoicing == '1' ? '是' : '否' }}
@@ -212,6 +212,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', @@ -328,6 +332,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue index 232f8ffa7e..f7dc1096db 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue @@ -28,8 +28,8 @@
-
采购类型
- {{ formobj.purchaseTypeValue }} +
采购方式
+ {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }}
采购原因
@@ -43,10 +43,10 @@
供应商
- {{ formobj.supplierName }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }}
-
是否需要发票
+
是否开发票
{{ formobj.purchaseBillInvoice.isInvoicing == '1' ? '是' : '否' }}
@@ -254,6 +254,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue index 30cb4aec3b..ceb788c6f4 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue @@ -26,11 +26,16 @@
-
*采购类型
+
*采购方式
- - - +
+ + + + + + +
@@ -54,13 +59,18 @@
*供应商
- - - +
+ + + + + + +
-
*是否需要发票
+
*是否开发票
@@ -116,16 +126,12 @@
-
*验货后付货款
- - - +
验货后付货款
+ {{ calculateGoodsMoney }}
-
*审批通过后付货款
- - - +
审批通过后付货款
+ {{ calculateGoodsMoney }}
@@ -244,9 +250,11 @@ export default { index: 0, accept: '.jpg,.jpeg,.png', procurementType_list: [], + operateBrand_list: [], procurementReason_list: [], paymentMethod_list: [], supplier_list: [], + warehouseType_list: [], account_list: [], formobj: { sid: '', @@ -287,6 +295,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '', @@ -311,14 +323,13 @@ export default { pmsPurchaseBillDetailList: [] }, rules: { - purchaseTypeValue: [{ required: true, message: '采购类型不能为空', trigger: 'change' }], + purchaseTypeValue: [{ required: true, message: '采购方式不能为空', trigger: 'change' }], purchaseReasonValue: [{ required: true, message: '采购原因不能为空', trigger: 'change' }], payTypeValue: [{ required: true, message: '付款方式不能为空', trigger: 'change' }], supplierSid: [{ required: true, message: '供应商不能为空', trigger: 'change' }], - 'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否需要发票不能为空', trigger: 'change' }], + 'purchaseBillInvoice.isInvoicing': [{ required: true, message: '是否开发票不能为空', trigger: 'change' }], 'purchasePay.isFirstPay': [{ required: true, message: '是否先付货款不能为空', trigger: 'change' }], - 'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }], - 'purchasePay.goodsMoney': [{ required: true, message: '付货款不能为空', trigger: 'blur' }] + 'purchasePay.deposit': [{ required: true, message: '审批通过后付订金不能为空', trigger: 'blur' }] } } }, @@ -364,10 +375,25 @@ export default { } return cg }, + // 应付金额 yfTotal() { let yf = '0' yf = Math.round((parseFloat(yf) + parseFloat(this.cgTotal) + parseFloat(this.formobj.freight !== '' ? this.formobj.freight : '0') - parseFloat(this.formobj.discountAmount !== '' ? this.formobj.discountAmount : '0') + parseFloat(this.formobj.errorAmount !== '' ? this.formobj.errorAmount : '0')) * 100) / 100 return yf + }, + // 付货款 + calculateGoodsMoney() { + let goodsMoney = '0' + if (this.formobj.payTypeValue === '单笔付款') { + if (this.formobj.purchasePay.isFirstPay === '1') { + // 是否先付货款为是,计算审批通过后付货款 = 应付金额 + goodsMoney = this.yfTotal + } else if (this.formobj.purchasePay.isFirstPay === '0') { + // 是否先付货款为否,计算验货后付货款 = 应付金额 - 审批通过后付订金 + goodsMoney = parseFloat(this.yfTotal) - parseFloat(this.formobj.purchasePay.deposit !== '' ? this.formobj.purchasePay.deposit : '0') + } + } + return goodsMoney } }, methods: { @@ -377,6 +403,16 @@ export default { this.procurementType_list = res.data } }) + typeValues({ type: 'operateBrand' }).then((res) => { + if (res.success) { + this.operateBrand_list = res.data + } + }) + typeValues({ type: 'warehouseType' }).then((res) => { + if (res.success) { + this.warehouseType_list = res.data + } + }) typeValues({ type: 'procurementReason' }).then((res) => { if (res.success) { this.procurementReason_list = res.data @@ -432,6 +468,14 @@ export default { this.formobj.purchaseTypeKey = '' } }, + operateBrandChange(value) { + const choose = this.operateBrand_list.filter((item) => item.dictValue === value) + if (choose !== null && choose.length > 0) { + this.formobj.operateBrandKey = choose[0].dictKey + } else { + this.formobj.operateBrandKey = '' + } + }, purchaseReasonChange(value) { const choose = this.procurementReason_list.filter((item) => item.dictValue === value) if (choose !== null && choose.length > 0) { @@ -458,6 +502,14 @@ export default { this.account_list = [] } }, + warehouseTypeChange(value) { + const choose = this.warehouseType_list.filter((item) => item.dictValue === value) + if (choose !== null && choose.length > 0) { + this.formobj.warehouseTypeKey = choose[0].dictKey + } else { + this.formobj.warehouseTypeKey = '' + } + }, isInvoicingChange(val) { if (val === '1') { const choose = this.supplier_list.filter((item) => item.sid === this.formobj.supplierSid) @@ -529,6 +581,7 @@ export default { if (valid) { this.submitdisabled = true this.formobj.payableAmount = this.yfTotal + this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney req.saveOrUpdate(this.formobj).then((res) => { if (res.success) { this.$message({ showClose: true, type: 'success', message: '保存成功' }) @@ -554,6 +607,7 @@ export default { if (valid) { this.submitdisabled = true this.formobj.payableAmount = this.yfTotal + this.formobj.purchasePay.goodsMoney = this.calculateGoodsMoney req.submit(this.formobj).then((res) => { if (res.success) { this.$message({ showClose: true, type: 'success', message: '提交成功' }) diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue index c17671ae72..5a3557b170 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue @@ -25,8 +25,8 @@ -
采购类型
- {{ formobj.purchaseTypeValue }} +
采购方式
+ {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }}
采购原因
@@ -40,10 +40,10 @@
供应商
- {{ formobj.supplierName }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }}
-
是否需要发票
+
是否开发票
{{ formobj.purchaseBillInvoice.isInvoicing == '1' ? '是' : '否' }}
@@ -212,6 +212,10 @@ export default { useOrgName: '', createOrgSid: '', createOrgName: '', + operateBrandKey: '', + operateBrandValue: '', + warehouseTypeKey: '', + warehouseTypeValue: '', purchasePay: { sid: '', billSid: '',