|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="formReadOnly"
|
|
|
+ <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="status === 'audit' || status === 'taskFormDetail'"
|
|
|
label-width="150px">
|
|
|
|
|
|
- <el-divider v-if="formReadOnly && commonJS.isNotEmpty(inputForm.customerId)" content-position="left">
|
|
|
+ <el-divider v-if="status === 'audit' || status === 'taskFormDetail' && commonJS.isNotEmpty(inputForm.customerId)" content-position="left">
|
|
|
<el-link type="primary" :underline="false" icon="el-icon-document" @click="viewClient(inputForm.customerId)"><b>查看客户详情</b></el-link>
|
|
|
</el-divider>
|
|
|
<el-divider v-else content-position="left"><i class="el-icon-document"></i> 客户信息</el-divider>
|
|
@@ -65,9 +65,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="合同类型" prop="contractType"
|
|
|
- :rules="[
|
|
|
- ]">
|
|
|
- <el-select v-model="inputForm.contractType" placeholder="请选择合同类型" style="width:100%;">
|
|
|
+ :rules="[{required: true, message: '合同类型不能为空', trigger: 'blur'}
|
|
|
+ ]" >
|
|
|
+ <el-select v-model="inputForm.contractType" :disabled="contractNoFlag" placeholder="请选择合同类型" style="width:100%;">
|
|
|
<el-option
|
|
|
v-for="item in $dictUtils.getDictList('cw_contract_type')"
|
|
|
:key="item.value"
|
|
@@ -218,6 +218,17 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
+ <el-form-item label="预计金额(元)" prop="predictAmount" v-if="inputForm.contractAmountType === '2'"
|
|
|
+ :rules="[
|
|
|
+ /*{required: true, message:'请输入预计金额(元)', trigger:'blur'}*/
|
|
|
+ ]">
|
|
|
+ <el-input maxlength="15" v-model="inputForm.predictAmount" placeholder="请输入预计金额(元)"
|
|
|
+ @keyup.native="inputForm.predictAmount = twoDecimalPlaces(inputForm.predictAmount)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="合同实际金额" prop="actualContractAmount">
|
|
|
<el-input maxlength="64" :disabled="true" v-model="inputForm.actualContractAmount"
|
|
|
@keyup.native="inputForm.actualContractAmount = twoDecimalPlaces(inputForm.actualContractAmount)"
|
|
@@ -241,9 +252,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col>
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="付款约定" prop="paymentAgreement">
|
|
|
- <el-input maxlength="64" type="textarea" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
|
|
|
+ <el-input maxlength="1000" type="textarea" v-model="inputForm.paymentAgreement" placeholder="请输入付款约定"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -257,7 +268,7 @@
|
|
|
<el-tab-pane label="参与签约方" name="contactParty">
|
|
|
<span slot="label"><span style="color: red;border-top: 20px">*</span> 参与签约方</span>
|
|
|
<el-row :gutter="15">
|
|
|
- <el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="formReadOnly" @click="openWorkClient">
|
|
|
+ <el-button type="primary" style="margin-bottom: 15px" size="mini" :disabled="status === 'audit' || status === 'taskFormDetail'" @click="openWorkClient">
|
|
|
新增参与签约方
|
|
|
</el-button>
|
|
|
</el-row>
|
|
@@ -290,17 +301,17 @@
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column align="center" title="操作" width="100">
|
|
|
<template v-slot="scope">
|
|
|
- <el-button size="mini" :disabled="formReadOnly" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
|
|
|
+ <el-button size="mini" :disabled="status === 'audit' || status === 'taskFormDetail'" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
</vxe-table>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="合同归档文件" name="archiveFile">
|
|
|
- <!-- 合同归档文件-->
|
|
|
- <UpLoadComponent ref="archiveFile"></UpLoadComponent>
|
|
|
- </el-tab-pane>
|
|
|
+<!-- <el-tab-pane label="合同归档文件" name="archiveFile">-->
|
|
|
+<!-- <!– 合同归档文件–>-->
|
|
|
+<!-- <UpLoadComponent ref="archiveFile"></UpLoadComponent>-->
|
|
|
+<!-- </el-tab-pane>-->
|
|
|
|
|
|
</el-tabs>
|
|
|
|
|
@@ -348,6 +359,7 @@
|
|
|
isSubmit: false,
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
+ contractNoFlag: false,
|
|
|
returnForm: {
|
|
|
customerId: '', // 客户id
|
|
|
address: '',
|
|
@@ -360,6 +372,7 @@
|
|
|
contractType: '',
|
|
|
contractAmountType: '',
|
|
|
contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
contractOpposite: '',
|
|
|
contractFees: [],
|
|
|
fees: '',
|
|
@@ -388,6 +401,7 @@
|
|
|
paymentDescribe: '',
|
|
|
signingDate: '',
|
|
|
contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
actualContractAmount: '',
|
|
|
contractNum: '2',
|
|
|
contractStatus: '新创建',
|
|
@@ -430,6 +444,10 @@
|
|
|
formReadOnly: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ status: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -461,7 +479,7 @@
|
|
|
},
|
|
|
bus: {
|
|
|
get () {
|
|
|
- this.$refs.archiveFile.setDividerName('附件', false)
|
|
|
+ // this.$refs.archiveFile.setDividerName('附件', false)
|
|
|
this.$refs.uploadComponent.setDividerName('附件', false)
|
|
|
return this.businessId
|
|
|
},
|
|
@@ -528,6 +546,7 @@
|
|
|
signingDate: '',
|
|
|
fees: '',
|
|
|
contractAmount: '',
|
|
|
+ predictAmount: '',
|
|
|
actualContractAmount: '',
|
|
|
contractNum: '',
|
|
|
contractStatus: '',
|
|
@@ -560,9 +579,14 @@
|
|
|
// if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
this.loading = true
|
|
|
this.$refs.uploadComponent.clearUpload()
|
|
|
- this.$refs.archiveFile.clearUpload()
|
|
|
+ // this.$refs.archiveFile.clearUpload()
|
|
|
this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
+ if (this.inputForm.contractNo) {
|
|
|
+ this.contractNoFlag = true
|
|
|
+ } else {
|
|
|
+ this.contractNoFlag = false
|
|
|
+ }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.contractAmountType)) {
|
|
|
this.inputForm.contractAmountType = '1'
|
|
|
}
|
|
@@ -598,11 +622,11 @@
|
|
|
})
|
|
|
}
|
|
|
this.inputForm.contractFees = f
|
|
|
- if (this.formReadOnly) {
|
|
|
+ if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
|
method = 'view'
|
|
|
}
|
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.contractProperList, 'cwWorkContract', null, null, null, null, false)
|
|
|
- this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
|
|
|
+ // this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
|
|
|
this.loading = false
|
|
|
})
|
|
|
})
|
|
@@ -737,7 +761,7 @@
|
|
|
// 表单提交
|
|
|
// 暂存
|
|
|
async saveForm (callback) {
|
|
|
- if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -761,7 +785,7 @@
|
|
|
if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
|
|
|
this.$message.error('“参与签约方”中至少有一条数据')
|
|
|
throw new Error('“参与签约方”中至少有一条数据')
|
|
|
- } else if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ } else if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -772,6 +796,7 @@
|
|
|
this.inputForm.contractProperList = this.$refs.uploadComponent.getDataList()
|
|
|
this.inputForm.fees = this.inputForm.contractFees.join(',')
|
|
|
await this.contractInfoService.save(this.inputForm).then(({data}) => {
|
|
|
+ // this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
@@ -785,7 +810,7 @@
|
|
|
},
|
|
|
// 通过
|
|
|
agreeForm (callback) {
|
|
|
- if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -939,31 +964,89 @@
|
|
|
closePop () {
|
|
|
this.visable = false
|
|
|
},
|
|
|
- updateStatusById (type) {
|
|
|
- if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ // updateStatusById (type) {
|
|
|
+ // if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadComponent.checkProgress()) {
|
|
|
+ // this.loading = false
|
|
|
+ // throw new Error()
|
|
|
+ // } else {
|
|
|
+ // if (type === 'agree') {
|
|
|
+ // this.inputForm.status = '5'
|
|
|
+ // this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ // }
|
|
|
+ // // 驳回
|
|
|
+ // if (type === 'reject') {
|
|
|
+ // this.inputForm.status = '4'
|
|
|
+ // this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ // }
|
|
|
+ // if (type === 'reback') {
|
|
|
+ // this.inputForm.status = '3'
|
|
|
+ // this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ // }
|
|
|
+ // // 流程终止,调整为暂存状态
|
|
|
+ // if (type === 'hold') {
|
|
|
+ // this.inputForm.status = '1'
|
|
|
+ // this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ async updateStatusById (type, callback) {
|
|
|
+ console.log('进入会计-合同登记 updateStatusById 方法')
|
|
|
+ if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
- if (type === 'agree') {
|
|
|
- this.inputForm.status = '5'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
- }
|
|
|
- // 驳回
|
|
|
- if (type === 'reject') {
|
|
|
- this.inputForm.status = '4'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
- }
|
|
|
- if (type === 'reback') {
|
|
|
- this.inputForm.status = '3'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
- }
|
|
|
- // 流程终止,调整为暂存状态
|
|
|
- if (type === 'hold') {
|
|
|
- this.inputForm.status = '1'
|
|
|
- this.contractInfoService.updateStatusById(this.inputForm)
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // if (type === 'agree') {
|
|
|
+ // // 同意
|
|
|
+ // this.inputForm.status = '5'
|
|
|
+ // }
|
|
|
+ if (type === 'reject') {
|
|
|
+ // 驳回
|
|
|
+ this.inputForm.status = '4'
|
|
|
+ }
|
|
|
+ if (type === 'reback') {
|
|
|
+ // 撤回
|
|
|
+ this.inputForm.status = '3'
|
|
|
+ }
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ let param = {status: this.inputForm.status, id: this.inputForm.id}
|
|
|
+ this.contractInfoService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (type === 'hold') {
|
|
|
+ this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // 终止
|
|
|
+ let param = {status: '1', id: this.inputForm.id}
|
|
|
+ this.contractInfoService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ reapplyForm (callback) {
|
|
|
+ this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startForm(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
checkData () {
|
|
|
let begin = this.inputForm.effectiveDate
|
|
|
let close = this.inputForm.closingDate
|