From b33562fb8c6dfdf5f6ab7d3e2bb602b46a77018b Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Fri, 10 Sep 2021 16:05:02 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=B0=E8=B4=A6=E5=BC=80=E7=A5=A8=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83=EF=BC=9B=E9=87=91=E9=A2=9D=E6=AD=A3=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9B=E5=88=86=E6=9C=9F=E4=BF=A1=E6=81=AF=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/incomePaymentsApi.js | 19 ++++- src/components/form/InstallmentForm.vue | 11 ++- src/utils/validate.js | 5 +- .../ArriveAndInvoivingList.vue | 33 ++++++-- .../modules/ArriveModule.vue | 11 ++- .../modules/ArriveStageModule.vue | 67 ++++++++------- .../modules/InvoicingModule.vue | 69 +++++++++++++--- .../modules/InvoicingStageModule.vue | 81 +++++++++++-------- 8 files changed, 208 insertions(+), 88 deletions(-) diff --git a/src/api/incomePaymentsApi.js b/src/api/incomePaymentsApi.js index d47b284..f328bcb 100644 --- a/src/api/incomePaymentsApi.js +++ b/src/api/incomePaymentsApi.js @@ -29,7 +29,17 @@ const queryContactByName = (param) => getAction('/company/payContactsManagement/ // 通过id获取支出合同信息 const getExpenditureContractById = (param) => getAction('/contract/paySpendingContract/queryById', param) // 添加来款阶段 -const addPaymentPhase = (param) => postAction('/paymentRecord/payPaymentRecord/addPhase', param) +const addPaymentPhase = (param) => postAction('/paymentRecord/payPaymentRecord/addAmountReceived', param) +// 编辑来款阶段 +const editAmountPhase = (param) => postAction('/paymentRecord/payPaymentRecord/editAmountReceived', param) +// 来款列表 +const amountReceivedList = (param) => postAction(`/paymentRecord/payPaymentRecord/amountReceivedList?id=${param}`) +// 开票列表 +const payBillList = (param) => postAction(`/paymentRecord/payPaymentRecord/payBillList?id=${param}`) +// 新增开票阶段 +const addPayBill = (projectId, projectType, param) => postAction(`/paymentRecord/payPaymentRecord/addPayBill?projectIds=${projectId}&projectTypes=${projectType}`, param) +// 编辑开票阶段 +const editPayBill = (param) => postAction('/paymentRecord/payPaymentRecord/editPayBill', param) export { getWorkingGroupById, @@ -46,5 +56,10 @@ export { queryUserByDepartId, queryContactByName, getExpenditureContractById, - addPaymentPhase + addPaymentPhase, + editAmountPhase, + amountReceivedList, + payBillList, + addPayBill, + editPayBill } \ No newline at end of file diff --git a/src/components/form/InstallmentForm.vue b/src/components/form/InstallmentForm.vue index 85e6d39..2f11fdf 100644 --- a/src/components/form/InstallmentForm.vue +++ b/src/components/form/InstallmentForm.vue @@ -82,17 +82,17 @@ export default { }, validatorRules: { phaseName: { - rules: [{ required: true, message: '请输入名称'}], + rules: [{ required: true, message: '请输入名称' }], validateTrigger: 'blur' }, accountsReceivableAmount: { - rules: [{ required: true, message: '请输入金额'}], + rules: [{ required: true, message: '请输入金额' }], validateTrigger: 'blur' }, paidAmount: { - rules: [{ required: false, message: '请输入金额'}], + rules: [{ required: false, message: '请输入金额' }], validateTrigger: 'blur' - }, + } }, index: 1, installmentList: [], @@ -132,7 +132,10 @@ export default { this.installmentList.push(this.defaultFormData) }, deleteInstallmentItem(index) { + let valArr = Object.values(this.form.getFieldValue(['installmentList']))[0] this.installmentList.splice(index, 1) + valArr.splice(index, 1) + this.form.setFieldsValue({ installmentList: valArr }) }, handleSave() { this.form.validateFields((err, values) => { diff --git a/src/utils/validate.js b/src/utils/validate.js index 600de6e..87dc454 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -71,10 +71,11 @@ export function number(s) { } /** - * 金额格式,小数点后两位 + * 金额格式,小数点后两位,整数部分十位 + * /^[1-9](\d{1,10})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{1,10}$|^0$/ ---- 最初的正则,能输入十一位整数 * @param s * @returns {boolean} */ export function money(s) { - return /^[1-9](\d{1,10})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{0,10}$|^0$/.test(s) + return /^[1-9](\d{1,10})?(\.\d{1,2})$|^0\.([1-9](\d{0,1})|\d[1-9])$|^[1-9]\d{1,9}$|^0$/.test(s) } diff --git a/src/views/financialManagement/arriveAndInvoicing/ArriveAndInvoivingList.vue b/src/views/financialManagement/arriveAndInvoicing/ArriveAndInvoivingList.vue index dc9973c..18c0ac5 100644 --- a/src/views/financialManagement/arriveAndInvoicing/ArriveAndInvoivingList.vue +++ b/src/views/financialManagement/arriveAndInvoicing/ArriveAndInvoivingList.vue @@ -87,7 +87,7 @@ 来款 - 开票 + 开票 @@ -95,7 +95,13 @@ - + @@ -113,7 +119,15 @@ import ProjectDetailModal from '../../../components/ProjectDetailModal' export default { name: 'ArriveAndInvoivingList', - components: { PageHeaderTitle, JYearDate, StatusSlot, ArriveStageModule, InvoicingStageModule, SelectPrincipal, ProjectDetailModal }, + components: { + PageHeaderTitle, + JYearDate, + StatusSlot, + ArriveStageModule, + InvoicingStageModule, + SelectPrincipal, + ProjectDetailModal + }, mixins: [JeroListMixin], data() { return { @@ -213,7 +227,10 @@ export default { list: '/paymentRecord/payPaymentRecord/mainList', exportXlsUrl: '' }, - selectProjectId: null + selectProjectId: null, // 选中项目id + selectProjectType: null, // 选中项目类型 + selectProjectName: null, // 选中项目名称 + selectProjectChargeCompanyName: null // 选中项目来款企业 } }, methods: { @@ -229,8 +246,12 @@ export default { * 开票 * @param id */ - invoicing(id) { - console.log(id) + invoicing(record) { + console.log(record) + this.selectProjectId = record.id + this.selectProjectType = record.projectType + this.selectProjectName = record.chargeProject + this.selectProjectChargeCompanyName = record.chargeCompanyTemporaryName this.$refs.invoicingStage.open() } } diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue index 53aac2d..6c17ba4 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveModule.vue @@ -41,7 +41,7 @@ import pick from 'lodash.pick' import { money } from '../../../../utils/validate' import JDate from '../../../../components/tools/JDate' -import { addPaymentPhase } from '../../../../api/incomePaymentsApi' +import { addPaymentPhase, editAmountPhase } from '../../../../api/incomePaymentsApi' export default { name: 'ArriveModule', @@ -87,6 +87,7 @@ export default { this.edit({}) }, edit(record) { + this.form.resetFields() this.model = Object.assign({}, record) this.visible = true this.$nextTick(() => { @@ -99,7 +100,13 @@ export default { values.projectId = this.projectId const formData = Object.assign(this.model, values) console.log('表单提交数据', formData) - addPaymentPhase(formData).then(res => { + let okHttpMethod + if (this.model.id) { + okHttpMethod = editAmountPhase + } else { + okHttpMethod = addPaymentPhase + } + okHttpMethod(formData).then(res => { if (res.success) { this.$message.success(res.message) this.$emit('ok') diff --git a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveStageModule.vue b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveStageModule.vue index c4f481e..27acd50 100644 --- a/src/views/financialManagement/arriveAndInvoicing/modules/ArriveStageModule.vue +++ b/src/views/financialManagement/arriveAndInvoicing/modules/ArriveStageModule.vue @@ -7,9 +7,8 @@ switchFullscreen @ok="handleAdd" @cancel="handleCancel" - okText="添加阶段" - cancelText="关闭"> - + okText="添加阶段"> +
第{{ item.chinaNumIndex }}阶段
@@ -32,23 +31,39 @@
-
备注:
+
备注:
{{ item.remark }}
- + + + + + +