[update] 收入合同普通项目工作组项目新增带出合同号

This commit is contained in:
zhaoxiao
2021-09-09 09:28:41 +08:00
parent fb8f109405
commit edaa60ca9c
6 changed files with 87 additions and 6 deletions
+13
View File
@@ -54,6 +54,12 @@ export default {
type: String,
required: false,
default: undefined
},
// 取消时将isCancel设为true,用于重置是否为第一次展开下拉
isCancel: {
type: Boolean,
required: false,
default: false
}
},
data() {
@@ -85,6 +91,13 @@ export default {
this.isFirstOpen = true
},
deep: true
},
isCancel(val) {
if (val) {
this.isFirstOpen = true
// 取消时重新获取联系人列表,将临时联系人信息加入列表中
this.getContactsList()
}
}
},
methods: {
@@ -71,6 +71,8 @@ export default {
this.visible = true
},
close() {
this.choosedType = null
this.choosedIndex = null
this.visible = false
},
chooseProjectType(index, type) {
@@ -41,6 +41,7 @@
<select-contacts placeholder="请选择签订联系人"
:selected-company="selectedCompany"
:init-contacts="selectedContact"
:is-cancel="isCancel"
v-decorator="['signedContactsId',validatorRules.signedContactsId]"></select-contacts>
</a-form-item>
</a-col>
@@ -254,6 +255,7 @@
<!-- 项目选择-->
<select-project-module ref="selectProjectModule"
@ok="selectProjectOk"
:default-contract-num="contractNum"
:default-charge-company="selectedCompany"></select-project-module>
<!-- 会议项目选择-->
<select-meeting-project-module ref="selectMeetingProjectModule"
@@ -420,6 +422,7 @@ export default {
form: this.$form.createForm(this),
confirmLoading: false,
model: {},
temporaryModel: {}, // 编辑数据临时保存
title: '',
labelCol: {
xs: { span: 24 },
@@ -489,13 +492,16 @@ export default {
rateNum: null, // 输入的税率
selectedContact: null, // 联系人回显
associatedProjectLoading: false,
contractId: '' // 收入合同id
contractId: '', // 收入合同id
contractNum: '', // 合同号
isCancel: false //是否取消
}
},
mounted() {
// 判断是编辑还是新增
if (this.$route.query.hasOwnProperty.call(this.$route.query, 'revenueId')) {
this.contractId = this.$route.query.revenueId
this.contractNum = this.$route.query.contractNum
this.edit(this.contractId)
} else {
this.add()
@@ -529,12 +535,15 @@ export default {
id: record.signedContactsTemporaryId,
name: record.signedContactsTemporaryName
}
// 回显打包年份
this.isPackage = record.pack === 1
// 处理分期信息回显
this.$refs.installmentForm.initInstallmentList(record.listInstallment)
// 获取应收金额和已收金额
this.accountsReceivableNum = record.accountsReceivableAmount
this.amountReceivedNum = record.amountReceived
this.model = Object.assign({}, record)
this.temporaryModel = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'contractNum', 'contractName', 'signedCompany', 'signedContactsId', 'opening', 'principalId', 'departmentName', 'contractAmount', 'rate', 'noTaxAmount', 'contractDate', 'terminationDate', 'contractTimePoints', 'accountsReceivableAmount', 'amountReceived', 'outstandingAmount', 'accountStatus', 'contractPaymentTimes', 'pack', 'packYear'))
this.confirmLoading = false
@@ -584,7 +593,18 @@ export default {
})
},
handleCancle() {
this.model = {}
this.model = this.temporaryModel
// 处理联系人信息回显
this.isCancel = true
this.model.signedContactsId = this.model.signedContactsTemporaryId
this.selectedContact = {
id: this.model.signedContactsTemporaryId,
name: this.model.signedContactsTemporaryName
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'contractNum', 'contractName', 'signedCompany', 'signedContactsId', 'opening', 'principalId', 'departmentName', 'contractAmount', 'rate', 'noTaxAmount', 'contractDate', 'terminationDate', 'contractTimePoints', 'accountsReceivableAmount', 'amountReceived', 'outstandingAmount', 'accountStatus', 'contractPaymentTimes', 'pack', 'packYear'))
this.confirmLoading = false
})
},
installmentFormOk(value) {
this.installmentList = value.installmentList
@@ -795,13 +815,14 @@ export default {
case 1:
this.$refs.selectProjectModule.columns = generalProjectColumns
this.getUserDetailByUserId().then(res => {
console.log(res)
console.log(this.model.pack)
// 混入筛选条件
this.$refs.selectProjectModule.filters = {
chargeCompanyId: this.selectedCompany.id,
contractId: this.contractId,
departId: res.split(',')[0]
departId: res.split(',')[0] // 一个用户多部门情况下传给后端第一个部门id
}
// 查询条件回显
this.$refs.selectProjectModule.queryParam.departId = res.split(',')
// 获取数据list
this.$refs.selectProjectModule.url.list = this.url.generalProjectList
@@ -813,6 +834,8 @@ export default {
this.$refs.selectProjectModule.projectType = type
// 标题
this.$refs.selectProjectModule.title = '普通项目列表'
// 获取负责人列表
this.$refs.selectProjectModule.departChange(res.split(',')[0])
// 打开弹窗
this.$refs.selectProjectModule.open()
})
@@ -14,13 +14,13 @@
<template v-if="projectType === 1">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="科室" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- :disabled="pack === 0" -->
<a-tree-select
style="width:100%"
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflow-y': 'auto' }"
:treeData="treeDepartData"
v-model="queryParam.departId"
placeholder="请选择科室"
:disabled="pack === 0"
@change="departChange">
</a-tree-select>
</a-form-item>
@@ -114,12 +114,14 @@
v-bind="$attrs"
:disabled-charge-company="true"
:default-charge-way="2"
:is-contract-num-disabled="true"
@ok="modalFormOk"></general-project-module>
<!-- 工作组项目新增-->
<working-group-member-unit-module ref="workingGroupMemberForm"
@ok="modalFormOk"
v-bind="$attrs"
:disabled-charge-company="true"
:is-contract-num-disabled="true"
:default-charge-way="2"></working-group-member-unit-module>
</j-modal>
</template>
@@ -196,6 +198,7 @@ export default {
},
close() {
this.queryParam = {}
this.selectedRowKeys = []
this.visible = false
},
handleOk() {
@@ -121,6 +121,7 @@
<a-input placeholder="请输入合同号"
v-decorator="['contractNum',validatorRules.contractNum]"
:maxLength='50'
:disabled="isContractNumDisabled"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
@@ -190,11 +191,23 @@ export default {
required: false,
default: false
},
// 默认来款方式(收入合同新增工作组项目,来款方式默认为2--合同)
// 默认来款方式(收入合同新增项目,来款方式默认为2--合同)
defaultChargeWay: {
type: Number,
required: false,
default: null
},
// 收入合同新增项目时带入合同号且不可修改
defaultContractNum: {
type: String,
requirde: false,
default: null
},
// 合同号是否可编辑
isContractNumDisabled: {
type: Boolean,
required: false,
default: false
}
},
data() {
@@ -286,6 +299,12 @@ export default {
if (this.defaultChargeWay === 2) {
this.chargeWayType = 2
}
if (this.defaultContractNum && this.defaultContractNum !== '') {
this.model.contractNum = this.defaultContractNum
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'contractNum'))
})
}
},
edit(record) {
if (this.defaultChargeCompany.hasOwnProperty.call(this.defaultChargeCompany, 'id')) {
@@ -122,6 +122,7 @@
<a-input placeholder="请输入合同号"
v-decorator="['contractNum',validatorRules.contractNum]"
:maxLength='50'
:disabled="isContractNumDisabled"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
</a-col>
@@ -228,6 +229,18 @@ export default {
type: Boolean,
required: false,
default: false
},
// 收入合同新增项目时带入合同号且不可修改
defaultContractNum: {
type: String,
requirde: false,
default: null
},
// 合同号是否可编辑
isContractNumDisabled: {
type: Boolean,
required: false,
default: false
}
},
data() {
@@ -315,10 +328,18 @@ export default {
methods: {
add() {
this.edit({})
// 判断默认来款用途是否为合同(收入合同新增)
if (this.defaultChargeWay) {
this.loadWorkingGroupList()
this.chargeWayType = 2
}
// 判断是否存在默认合同号(收入合同新增)
if (this.defaultContractNum && this.defaultContractNum !== '') {
this.model.contractNum = this.defaultContractNum
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'contractNum'))
})
}
},
loadWorkingGroupList() {
let param = {