[update] 支出合同接口联调;打包、打包成员维护页面;企业选择组件只读
This commit is contained in:
+84
-25
@@ -33,7 +33,7 @@
|
||||
@change="handleSignedCompanyChange"></company-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="6" :xl="8" :sm="12">
|
||||
<a-col :xxl="6" :xl="8" :sm="12" style="margin-bottom: 0">
|
||||
<a-form-item label="签订联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<select-contacts placeholder="请选择签订联系人"
|
||||
:selected-company="selectedCompany"
|
||||
@@ -230,13 +230,13 @@
|
||||
|
||||
<script>
|
||||
import PageHeaderTitle from '../../../../components/layouts/PageHeaderTitle'
|
||||
import { getRevenueContractById } from '../../../../api/incomePaymentsApi'
|
||||
import { getExpenditureContractById } from '../../../../api/incomePaymentsApi'
|
||||
import pick from 'lodash.pick'
|
||||
import InstallmentForm from '../../../../components/form/InstallmentForm'
|
||||
import CompanySelect from '../../../../components/company/CompanySelect'
|
||||
import SelectContacts from '../../../../components/company/SelectContacts'
|
||||
import SelectPrincipal from '../../../../components/company/SelectPrincipal'
|
||||
import { getAllUserList } from '../../../../api/api'
|
||||
import { duplicateCheck, getAllUserList } from '../../../../api/api'
|
||||
import { postAction } from '../../../../api/manage'
|
||||
import JDate from '../../../../components/tools/JDate'
|
||||
import JYearDate from '../../../../components/jero/JYearDate'
|
||||
@@ -305,7 +305,7 @@ export default {
|
||||
},
|
||||
pack: {
|
||||
rules: [{ required: true, message: '请选择是否打包' }],
|
||||
validateTrigger: 'blur'
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
},
|
||||
url: {
|
||||
@@ -333,26 +333,29 @@ export default {
|
||||
const param = {
|
||||
id: id
|
||||
}
|
||||
getRevenueContractById(param).then(res => {
|
||||
let record
|
||||
record = res.result
|
||||
this.isSaved = true
|
||||
record.signedCompany = {
|
||||
id: record.signedCompanyId,
|
||||
companyName: record.signedCompanyTemporaryName
|
||||
getExpenditureContractById(param).then(res => {
|
||||
if (res.success) {
|
||||
let record
|
||||
record = res.result
|
||||
record.signedCompany = {
|
||||
id: record.signedCompanyTemporaryId,
|
||||
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.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'))
|
||||
this.confirmLoading = false
|
||||
})
|
||||
} else {
|
||||
console.log(res.message)
|
||||
}
|
||||
this.selectedCompany = record.signedCompany
|
||||
record.signedContactsId = record.signedContactsTemporaryId
|
||||
this.selectedContact = {
|
||||
id: record.signedContactsTemporaryId,
|
||||
name: record.signedContactsTemporaryName
|
||||
}
|
||||
this.$refs.installmentForm.initInstallmentList(record.listInstallment)
|
||||
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'))
|
||||
this.confirmLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -382,8 +385,10 @@ export default {
|
||||
this.contractId = res.result.id
|
||||
this.edit(this.contractId)
|
||||
this.$message.success(res.message)
|
||||
// 保存上方表单信息,(应该在表单验证完全正确时置为true)
|
||||
this.isSaved = true
|
||||
// 跳转至支出合同list页面
|
||||
this.$router.push({
|
||||
path: '/contractManagement/ExpenditureContract'
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
@@ -402,6 +407,60 @@ export default {
|
||||
installmentFormOk(value) {
|
||||
this.installmentList = value.installmentList
|
||||
},
|
||||
/**
|
||||
* 合同编号唯一性校验
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkContractNum(rules, value, callback) {
|
||||
if (value) {
|
||||
if (!this.model.id) {
|
||||
const params = {
|
||||
confusionCode: 'pay_spending_contract_num',
|
||||
fieldVal: value
|
||||
}
|
||||
duplicateCheck(params).then(res => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback('合同编号已存在')
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
callback()
|
||||
} else {
|
||||
callback('请输入合同编号')
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 合同名称唯一性校验
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkContractName(rules, value, callback) {
|
||||
if (value) {
|
||||
if (!this.model.id) {
|
||||
const params = {
|
||||
confusionCode: 'pay_spending_contract_name',
|
||||
fieldVal: value
|
||||
}
|
||||
duplicateCheck(params).then(res => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback('合同名称已存在')
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
callback()
|
||||
} else {
|
||||
callback('请输入合同名称')
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选中企业变化
|
||||
* @param value
|
||||
|
||||
Reference in New Issue
Block a user