瀏覽代碼

评估合同名称校验,项目登记选择合同查询

sangwenwei 1 年之前
父節點
當前提交
a5b140e7b9

+ 8 - 0
src/api/sys/WorkContractService.js

@@ -37,4 +37,12 @@ export default class WorkContractService {
       data: param
     })
   }
+
+  checkName(name){
+	  return request({
+		  url: prefix + '/workContract/workContractInfo/checkName',
+		  method: 'get',
+		  params: {name: name}
+	  })
+  }
 }

+ 2 - 2
src/views/program/registered/ContractForm.vue

@@ -122,7 +122,7 @@
           type: '',
           filedType: '',
           contractAmounts: [],
-          createBy: this.$store.state.user.id,
+          createBy: '',
           procInsId: '',
           processDefinitionId: ''
         },
@@ -159,7 +159,7 @@
       },
       list () {
         this.loading = true
-        this.searchForm.createBy = this.$store.state.user.id
+        // this.searchForm.createBy = this.$store.state.user.id
         this.programProjectListInfoService.findContractPageList({
           'current': this.tablePage.currentPage,
           'size': this.tablePage.pageSize,

+ 16 - 2
src/views/sys/workContract/WorkContractForm.vue

@@ -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>