[update] 支出合同接口联调;打包、打包成员维护页面;企业选择组件只读

This commit is contained in:
zhaoxiao
2021-09-08 19:16:13 +08:00
parent 5372161e2f
commit dff860c5be
17 changed files with 1604 additions and 48 deletions
@@ -274,7 +274,7 @@ import SelectProjectModule from './SelectProjectModule'
import pick from 'lodash.pick'
import { getAllUserList } from '../../../../api/api'
import { postAction } from '../../../../api/manage'
import { getRevenueContractById } from '../../../../api/incomePaymentsApi'
import { getRevenueContractById, queryUserByDepartId } from '../../../../api/incomePaymentsApi'
import { duplicateCheck } from '../../../../api/api'
import AssociatedProject from './AssociatedProject'
import SelectMeetingProjectModule from './SelectMeetingProjectModule'
@@ -476,17 +476,18 @@ export default {
selectedCompany: null, // 选中的企业
installmentList: [],
isSaved: false, // 是否保存上方数据
isPackage: false,
isPackage: false, // 是否打包,控制打包年份显隐
accountsReceivableNum: null, // 输入的应收金额
amountReceivedNum: null, // 输入的未收金额
contractAmountNum: null, // 输入的签订合同总金额
rateNum: null, // 输入的税率
selectedContact: null,
selectedContact: null, // 联系人回显
associatedProjectLoading: false,
contractId: '' // 收入合同id
}
},
mounted() {
// 判断是编辑还是新增
if (this.$route.query.hasOwnProperty.call(this.$route.query, 'revenueId')) {
this.contractId = this.$route.query.revenueId
this.edit(this.contractId)
@@ -505,21 +506,28 @@ export default {
const param = {
id: id
}
// 通过id获取合同信息
getRevenueContractById(param).then(res => {
let record
record = res.result
this.isSaved = true
// 处理企业信息回显
record.signedCompany = {
id: record.signedCompanyId,
companyName: record.signedCompanyTemporaryName
}
this.selectedCompany = record.signedCompany
// 处理联系人信息回显
record.signedContactsId = record.signedContactsTemporaryId
this.selectedContact = {
id: record.signedContactsTemporaryId,
name: record.signedContactsTemporaryName
}
// 处理分期信息回显
this.$refs.installmentForm.initInstallmentList(record.listInstallment)
// 获取应收金额和已收金额
this.accountsReceivableNum = record.accountsReceivableAmount
this.amountReceivedNum = record.amountReceived
this.model = 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'))
@@ -536,6 +544,7 @@ export default {
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
// 分期信息存在时可以提交
if (this.installmentList && this.installmentList.length > 0) {
let formData = {}
values.signedCompanyId = values.signedCompany.id
@@ -575,7 +584,7 @@ export default {
this.installmentList = value.installmentList
},
/**
* 选中企业变化
* 选中企业变化, 清空已选联系人信息
* @param value
*/
handleSignedCompanyChange(value) {
@@ -667,10 +676,13 @@ export default {
calculateOutstandingAmount() {
if (this.accountsReceivableNum !== null && this.amountReceivedNum !== null) {
this.model.outstandingAmount = Number(this.accountsReceivableNum) - Number(this.amountReceivedNum)
if (this.model.outstandingAmount === 0) {
// 未收金额 === 0,已付全款状态
if (this.model.outstandingAmount <= 0) {
this.model.accountStatus = '3'
// 未收金额 > 0 且 未收金额 < 应收金额,部分付款状态
} else if (this.model.outstandingAmount > 0 && this.model.outstandingAmount < Number(this.accountsReceivableNum)) {
this.model.accountStatus = '2'
// 未收金额 === 应收金额,未付款状态
} else if (this.model.outstandingAmount === Number(this.accountsReceivableNum)) {
this.model.accountStatus = '1'
}
@@ -746,11 +758,14 @@ export default {
selectProjectTypeOk(type) {
let title = ''
switch (type) {
// 普通项目
case 1:
this.$refs.selectProjectModule.columns = generalProjectColumns
this.getUserDetailByUserId()
this.$refs.selectProjectModule.filters = {
chargeCompanyId: this.selectedCompany.id,
pack: this.model.pack
pack: this.model.pack,
// contractId: this.contractId
}
this.$refs.selectProjectModule.url.list = this.url.generalProjectList
title = '普通项目列表'
@@ -759,8 +774,8 @@ export default {
this.$refs.selectProjectModule.projectType = type
this.$refs.selectProjectModule.title = title
this.$refs.selectProjectModule.open()
break
// 工作组项目
case 2:
this.$refs.selectProjectModule.columns = workingProjectColumns
this.$refs.selectProjectModule.filters = {
@@ -774,9 +789,11 @@ export default {
this.$refs.selectProjectModule.open()
title = '工作组项目列表'
break
// 会议项目
case 3:
this.$refs.selectMeetingProjectModule.open()
break
// 会员项目
case 4:
this.$refs.selectMemberProjectModule.open()
break
@@ -784,7 +801,17 @@ export default {
},
/**
* 通过用户id获取用户信息
*/
getUserDetailByUserId() {
let param = {
id: this.model.principalId
}
queryUserByDepartId(param).then(res => {
console.log(res)
})
},
/**
* 项目选中回调
*/