|
@@ -23,7 +23,7 @@
|
|
|
:rules="[
|
|
|
{required: true, message:'请输入合同名称', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input maxlength="64" v-model="inputForm.name" placeholder="请输入合同名称"></el-input>
|
|
|
+ <el-input maxlength="64" v-model="inputForm.name" placeholder="请输入合同名称" @change="checkName"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -429,6 +429,9 @@
|
|
|
this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
|
|
|
this.inputForm.status = '2'
|
|
|
this.inputForm.fees = this.inputForm.contractFees.join(',')
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.name)){
|
|
|
+ this.checkName(this.inputForm.name)
|
|
|
+ }
|
|
|
await this.workContractService.save(this.inputForm).then((data) => {
|
|
|
this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
@@ -701,7 +704,18 @@
|
|
|
this.$message.warning(`合同终止日期要大于合同开始日期`)
|
|
|
this.inputForm.closingDate = ''
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ checkName(){
|
|
|
+ console.log('data',this.inputForm.name)
|
|
|
+ this.workContractService.checkName(this.inputForm.name).then((data)=>{
|
|
|
+ if (data === true){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('合同名称已存在,请重新输入')
|
|
|
+ this.inputForm.name = ''
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|