From f9e0317c899e33f9c80b68a21ecd2e8072b9ed1a Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Thu, 9 Sep 2021 15:50:57 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E6=94=B6=E5=85=A5=E5=90=88=E5=90=8C?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=99=AE=E9=80=9A=E3=80=81=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=BB=84=E9=A1=B9=E7=9B=AE=E7=BB=84=E4=BB=B6=E6=8B=86=E5=88=86?= =?UTF-8?q?;=E6=94=AF=E5=87=BA=E5=90=88=E5=90=8C=E7=A8=8E=E7=8E=87?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/ExpenditureContractModule.vue | 55 +++- .../modules/RevenueContractModule.vue | 168 ++---------- .../modules/SelectProjectModule.vue | 249 ++++++++++++------ .../SelectWorkingGroupProjectModule.vue | 215 +++++++++++++++ 4 files changed, 450 insertions(+), 237 deletions(-) create mode 100644 src/views/contractManagement/revenueContract/modules/SelectWorkingGroupProjectModule.vue diff --git a/src/views/contractManagement/expenditureContract/modules/ExpenditureContractModule.vue b/src/views/contractManagement/expenditureContract/modules/ExpenditureContractModule.vue index 6e75a2a..f85266f 100644 --- a/src/views/contractManagement/expenditureContract/modules/ExpenditureContractModule.vue +++ b/src/views/contractManagement/expenditureContract/modules/ExpenditureContractModule.vue @@ -73,10 +73,15 @@ - + + + + + % + @@ -240,6 +245,7 @@ import { duplicateCheck, getAllUserList } from '../../../../api/api' import { postAction } from '../../../../api/manage' import JDate from '../../../../components/tools/JDate' import JYearDate from '../../../../components/jero/JYearDate' +import { money } from '../../../../utils/validate' export default { name: 'ExpenditureContractModule', @@ -288,7 +294,7 @@ export default { validateTrigger: 'blur' }, contractAmount: { - rules: [{ required: true, message: '请输入签订合同总金额' }], + rules: [{ required: true, validator: this.checkMoney }], validateTrigger: 'blur' }, rate: { @@ -296,11 +302,11 @@ export default { validateTrigger: 'blur' }, accountsReceivableAmount: { - rules: [{ required: true, message: '请输入应收金额' }], + rules: [{ required: true, validator: this.checkMoney }], validateTrigger: 'blur' }, amountReceived: { - rules: [{ required: true, message: '请输入已收金额' }], + rules: [{ required: true, validator: this.checkMoney }], validateTrigger: 'blur' }, pack: { @@ -499,7 +505,7 @@ export default { */ rateChange(e) { e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim() - this.rateNum = e.target.value + this.rateNum = Number(e.target.value) / 100 this.calculateNoTaxAmount() }, /** @@ -507,7 +513,10 @@ export default { */ calculateNoTaxAmount() { if (this.rateNum !== null && this.contractAmountNum !== null) { - this.model.noTaxAmount = Number(this.contractAmountNum) / (1 + Number(this.rateNum)) + let noTaxAmount = Number(this.contractAmountNum) / (1 + this.rateNum) + // 取小数点两位 + noTaxAmount = noTaxAmount.toFixed(2) + this.model.noTaxAmount = Number(noTaxAmount) this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'noTaxAmount')) }) @@ -558,7 +567,33 @@ export default { } else { this.isPackage = false } - } + }, + /** + * 校验金额格式 + * @param rules + * @param value + * @param callback + */ + checkMoney(rules, value, callback) { + if (value) { + if (money(value)) { + callback() + return + } + callback('请输入正确格式的金额') + } + switch (rules.field) { + case 'contractAmount': + callback('请输入签订合同总金额') + break + case 'accountsReceivableAmount': + callback('请输入应收金额') + break + case 'amountReceived': + callback('请输入已收金额') + break + } + }, } } diff --git a/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue b/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue index c90783d..ec6aea9 100644 --- a/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue +++ b/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue @@ -252,11 +252,23 @@ - + + + @@ -287,118 +299,7 @@ import AssociatedProject from './AssociatedProject' import SelectMeetingProjectModule from './SelectMeetingProjectModule' import SelectMemberProjectModule from './SelectMemberProjectModule' import { money } from '../../../../utils/validate' - -// 普通项目表头 -const generalProjectColumns = [ - { - title: '序号', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function (t, r, index) { - return parseInt(index) + 1 - } - }, { - title: '来款项目', - align: 'center', - width: 200, - dataIndex: 'chargeProject', - scopedSlots: { customRender: 'projectName' } - }, { - title: '来款用途', - align: 'center', - width: 180, - dataIndex: 'chargeUse_dictText', - scopedSlots: { customRender: 'text' } - }, { - title: '来款单位', - align: 'center', - width: 200, - dataIndex: 'chargeCompanyTemporaryName', - scopedSlots: { customRender: 'text' } - }, { - title: '应收金额', - align: 'center', - width: 100, - dataIndex: 'receivableAmount' - }, { - title: '实收金额', - align: 'center', - width: 100, - dataIndex: 'paidAmount' - }, { - title: '负责人', - align: 'center', - width: 140, - dataIndex: 'principalName', - scopedSlots: { customRender: 'text' } - }, { - title: '企业联系人', - align: 'center', - width: 140, - dataIndex: 'contactsTemporaryName', - scopedSlots: { customRender: 'text' } - }, { - title: '打包', - align: 'center', - width: 80, - dataIndex: 'pack', - scopedSlots: { customRender: 'status-pack' } - }, { - title: '需要发票', - align: 'center', - width: 80, - dataIndex: 'needInvoice', - scopedSlots: { customRender: 'status-pack' } - }, { - title: '到账', - align: 'center', - width: 80, - dataIndex: 'inAccount', - scopedSlots: { customRender: 'status' } - }, { - title: '开票', - align: 'center', - width: 80, - dataIndex: 'makeInvoice', - scopedSlots: { customRender: 'status' } - }, { - title: '邮寄', - align: 'center', - width: 80, - dataIndex: 'mail', - scopedSlots: { customRender: 'status' } - } -] -// 工作组项目表头 -const workingProjectColumns = [ - { - title: '序号', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function (t, r, index) { - return parseInt(index) + 1 - } - }, { - title: '工作组项目', - align: 'center', - dataIndex: 'workingGroupProject', - scopedSlots: { customRender: 'projectName' } - }, { - title: '负责人A', - align: 'center', - dataIndex: 'principalNameA' - }, { - title: '进度', - align: 'center', - dataIndex: 'obj', - width: 250, - scopedSlots: { customRender: 'rateOfProgress' } - } -] +import SelectWorkingGroupProjectModule from './SelectWorkingGroupProjectModule' export default { name: 'RevenueContractModule', @@ -414,7 +315,8 @@ export default { SelectProjectModule, AssociatedProject, SelectMeetingProjectModule, - SelectMemberProjectModule + SelectMemberProjectModule, + SelectWorkingGroupProjectModule }, data() { return { @@ -477,8 +379,6 @@ export default { url: { add: '/contract/payIncomeContract/add', edit: '/contract/payIncomeContract/edit', - generalProjectList: '/project/payCommonProject/listAll', // 普通项目 - workingGroupProjectList: '/project/payWorkingGroup/queryListByCompany', // 工作组项目 meetingProjectList: '', memberProjectList: '' }, @@ -494,7 +394,9 @@ export default { associatedProjectLoading: false, contractId: '', // 收入合同id contractNum: '', // 合同号 - isCancel: false //是否取消 + isCancel: false, // 是否取消 + departId: null, // 部门id普通项目列表查询 + projectType: null //项目类型 } }, mounted() { @@ -810,48 +712,30 @@ export default { * @param type */ selectProjectTypeOk(type) { + this.projectType = type switch (type) { // 普通项目 case 1: - this.$refs.selectProjectModule.columns = generalProjectColumns this.getUserDetailByUserId().then(res => { - console.log(this.model.pack) + this.departId = res // 混入筛选条件 this.$refs.selectProjectModule.filters = { chargeCompanyId: this.selectedCompany.id, contractId: this.contractId, - departId: res.split(',')[0] // 一个用户多部门情况下传给后端第一个部门id + departId: this.departId // 一个用户多部门情况下传给后端第一个部门id } - // 查询条件回显 - this.$refs.selectProjectModule.queryParam.departId = res.split(',') - // 获取数据list - this.$refs.selectProjectModule.url.list = this.url.generalProjectList - // 打包状态 - this.$refs.selectProjectModule.pack = this.model.pack - // 合同id - this.$refs.selectProjectModule.contractId = this.model.id - // 项目类型 - this.$refs.selectProjectModule.projectType = type - // 标题 - this.$refs.selectProjectModule.title = '普通项目列表' // 获取负责人列表 - this.$refs.selectProjectModule.departChange(res.split(',')[0]) + this.$refs.selectProjectModule.departChange(this.departId) // 打开弹窗 this.$refs.selectProjectModule.open() }) break // 工作组项目 case 2: - this.$refs.selectProjectModule.columns = workingProjectColumns - this.$refs.selectProjectModule.filters = { + this.$refs.selectWorkingGroupProjectModule.filters = { companyId: this.selectedCompany.id } - this.$refs.selectProjectModule.url.list = this.url.workingGroupProjectList - this.$refs.selectProjectModule.pack = this.model.pack - this.$refs.selectProjectModule.contractId = this.model.id - this.$refs.selectProjectModule.projectType = type - this.$refs.selectProjectModule.title = '工作组项目列表' - this.$refs.selectProjectModule.open() + this.$refs.selectWorkingGroupProjectModule.open() break // 会议项目 case 3: @@ -863,8 +747,6 @@ export default { this.$refs.selectMemberProjectModule.open(this.model) break } - - }, /** * 通过用户id获取用户信息 diff --git a/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue b/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue index f49f20f..3b2e36e 100644 --- a/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue +++ b/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue @@ -11,51 +11,38 @@ - - - - + + + + + + + + + + {{ + item.realname + }} + + + + + + + + + @@ -66,6 +53,7 @@ +
@@ -98,11 +86,6 @@ - - - @@ -116,13 +99,6 @@ :default-charge-way="2" :is-contract-num-disabled="true" @ok="modalFormOk"> - - @@ -132,8 +108,6 @@ import JYearDate from '../../../../components/jero/JYearDate' import GeneralProjectModule from '../../../projectManagement/modules/GeneralProjectModule' import StatusSlot from '../../../../components/tools/StatusSlot' import { associatedProject, queryUserByDepartId } from '../../../../api/incomePaymentsApi' -import WorkingGroupMemberUnitModule from '../../../projectManagement/modules/WorkingGroupMemberUnitModule' -import ProgressBar from '../../../../components/ProgressBar' import { queryDepartTreeList } from '../../../../api/api' export default { @@ -141,18 +115,41 @@ export default { components: { JYearDate, GeneralProjectModule, - StatusSlot, - WorkingGroupMemberUnitModule, - ProgressBar + StatusSlot }, mixins: [JeroListMixin], + props: { + // 部门id,用于查询 + departId: { + type: String, + requird: false, + default: null + }, + // 打包状态 + pack: { + type: Number, + requird: false, + default: null + }, + // 收入合同id + contractId: { + type: String, + requird: false, + default: null, + }, + // 项目类型,1--普通项目;2--工作组项目;3--会议项目;4--会员项目 + projectType: { + type: Number, + requird: false, + default: null + } + }, data() { return { - title: '操作', + title: '普通项目列表', width: 1200, visible: false, confirmLoading: false, - columns: [], labelCol: { xs: { span: 24 }, sm: { span: 5 } @@ -161,22 +158,107 @@ export default { xs: { span: 24 }, sm: { span: 10 } }, - projectType: null, // 项目类型,1--普通项目;2--工作组项目;3--会议项目;4--会员项目 disableMixinCreated: true, - contractId: '', // 收入合同id url: { - list: '' + list: '/project/payCommonProject/listAll' }, - pack: null,// 是否打包 + columns: [ + { + title: '序号', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, { + title: '来款项目', + align: 'center', + width: 200, + dataIndex: 'chargeProject', + scopedSlots: { customRender: 'projectName' } + }, { + title: '来款用途', + align: 'center', + width: 180, + dataIndex: 'chargeUse_dictText', + scopedSlots: { customRender: 'text' } + }, { + title: '来款单位', + align: 'center', + width: 200, + dataIndex: 'chargeCompanyTemporaryName', + scopedSlots: { customRender: 'text' } + }, { + title: '应收金额', + align: 'center', + width: 100, + dataIndex: 'receivableAmount' + }, { + title: '实收金额', + align: 'center', + width: 100, + dataIndex: 'paidAmount' + }, { + title: '负责人', + align: 'center', + width: 140, + dataIndex: 'principalName', + scopedSlots: { customRender: 'text' } + }, { + title: '企业联系人', + align: 'center', + width: 140, + dataIndex: 'contactsTemporaryName', + scopedSlots: { customRender: 'text' } + }, { + title: '打包', + align: 'center', + width: 80, + dataIndex: 'pack', + scopedSlots: { customRender: 'status-pack' } + }, { + title: '需要发票', + align: 'center', + width: 80, + dataIndex: 'needInvoice', + scopedSlots: { customRender: 'status-pack' } + }, { + title: '到账', + align: 'center', + width: 80, + dataIndex: 'inAccount', + scopedSlots: { customRender: 'status' } + }, { + title: '开票', + align: 'center', + width: 80, + dataIndex: 'makeInvoice', + scopedSlots: { customRender: 'status' } + }, { + title: '邮寄', + align: 'center', + width: 80, + dataIndex: 'mail', + scopedSlots: { customRender: 'status' } + } + ], treeDepartData: [], // 部门列表 - userList: [] // 用户列表 + userList: [], // 用户列表 + } + }, + // 部门id变化时绑定查询条件 + watch: { + departId(val) { + this.queryParam.departId = val } }, methods: { open() { - this.loadData() this.loadDepartTreeData() this.visible = true + this.loadData() }, /** * 获取科室(部门)数据 @@ -230,21 +312,12 @@ export default { this.close() }, /** - * 打开不同类型项目的新增module + * 打开新增module */ handleAdd() { - switch (this.projectType) { - case 1: - this.$refs.generalProjectForm.add() - this.$refs.generalProjectForm.title = '新增' - this.$refs.generalProjectForm.disableSubmit = false - break - case 2: - this.$refs.workingGroupMemberForm.add() - this.$refs.workingGroupMemberForm.title = '新增' - this.$refs.workingGroupMemberForm.disableSubmit = false - break - } + this.$refs.generalProjectForm.add() + this.$refs.generalProjectForm.title = '新增' + this.$refs.generalProjectForm.disableSubmit = false }, // 下拉框的搜索 filterOption(input, option) { @@ -267,7 +340,15 @@ export default { console.log(res.message) } }) - } + }, + /** + * 重置 + */ + searchReset() { + this.lastQueryParam = {} + this.queryParam.departId = this.departId + this.loadData(1) + }, } } diff --git a/src/views/contractManagement/revenueContract/modules/SelectWorkingGroupProjectModule.vue b/src/views/contractManagement/revenueContract/modules/SelectWorkingGroupProjectModule.vue new file mode 100644 index 0000000..335eda8 --- /dev/null +++ b/src/views/contractManagement/revenueContract/modules/SelectWorkingGroupProjectModule.vue @@ -0,0 +1,215 @@ + + + + + \ No newline at end of file