From fa2b70340b21e60444dbb83917a0358787b77aa8 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 1 Jul 2024 08:56:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/procurement/procurement.vue | 6 +- .../purchase/procurement/procurementAdd.vue | 98 +++++++++++++++---- .../purchase/procurement/procurementInfo.vue | 16 ++- .../workFlow/caigouFlow/procurementDaiBan.vue | 12 ++- .../workFlow/caigouFlow/procurementEdit.vue | 94 ++++++++++++++---- .../workFlow/caigouFlow/procurementYiBan.vue | 12 ++- 6 files changed, 183 insertions(+), 55 deletions(-) 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..900f076608 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..86c3e088ff 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..3c0a7df9bb 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..a6ec9e20a4 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..72cf88d284 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: '', From e68d974619cf8b5e20b7e290b197cc05fda4e75c Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 1 Jul 2024 09:13:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue | 4 ++-- yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue index 900f076608..8204f452ce 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue @@ -29,7 +29,7 @@ *采购方式 - + @@ -60,7 +60,7 @@ *供应商 - + diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue index a6ec9e20a4..ceb788c6f4 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementEdit.vue @@ -28,7 +28,7 @@ *采购方式 - + @@ -59,7 +59,7 @@ *供应商 - + From e45d3444dca3c921b12811eeba4e847066de9c8e Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 1 Jul 2024 09:20:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue | 4 ++-- yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue | 4 ++-- yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue b/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue index 86c3e088ff..05d21b6121 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementInfo.vue @@ -26,7 +26,7 @@ 采购方式 - {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} + {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} 采购原因 @@ -40,7 +40,7 @@ 供应商 - {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} 是否开发票 diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue index 3c0a7df9bb..f7dc1096db 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementDaiBan.vue @@ -29,7 +29,7 @@ 采购方式 - {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} + {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} 采购原因 @@ -43,7 +43,7 @@ 供应商 - {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} 是否开发票 diff --git a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue index 72cf88d284..5a3557b170 100644 --- a/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue +++ b/yxt-as-ui/src/views/workFlow/caigouFlow/procurementYiBan.vue @@ -26,7 +26,7 @@ 采购方式 - {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} + {{ formobj.purchaseTypeValue }}{{ formobj.operateBrandValue }} 采购原因 @@ -40,7 +40,7 @@ 供应商 - {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} + {{ formobj.supplierName }}{{ formobj.warehouseTypeValue }} 是否开发票