|
|
@@ -15,6 +15,7 @@
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="项目名称:" prop="projectname">
|
|
|
<el-input v-model="form.projectname" placeholder="请输入项目名称" @blur="nameChange(param.content.pageNumber = 1)" :disabled="flagTag != 0"></el-input>
|
|
|
+ <span style="color: red;font-size: 12px;margin-bottom: -10px" v-if="repeats.length > 0">疑似重复</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -319,7 +320,7 @@ export default {
|
|
|
unitnameList:[],
|
|
|
rules:{
|
|
|
projectname:[
|
|
|
- { required: true, validator:projectname, trigger: 'blur'},
|
|
|
+ { required: true, message: '请输入项目名称', trigger: 'blur'},
|
|
|
],
|
|
|
/*projectnum:[
|
|
|
{ required: true, message: '输入项目编号', trigger: 'blur'}
|
|
|
@@ -494,6 +495,7 @@ export default {
|
|
|
if (this.checkResults === 0){
|
|
|
this.$emit('onSuccess')
|
|
|
this.$refs['form'].resetFields();
|
|
|
+ this.repeats = []
|
|
|
this.dialogFormVisible = false
|
|
|
this.addChange = false
|
|
|
this.checkResults = ''
|
|
|
@@ -517,6 +519,7 @@ export default {
|
|
|
})
|
|
|
this.$emit('onSuccess')
|
|
|
this.$refs['form'].resetFields();
|
|
|
+ this.repeats = []
|
|
|
this.dialogFormVisible = false
|
|
|
this.checkResults = ''
|
|
|
},
|
|
|
@@ -536,8 +539,10 @@ export default {
|
|
|
},
|
|
|
onClose(){
|
|
|
this.$refs['form'].resetFields()
|
|
|
+ this.repeats = []
|
|
|
this.dialogFormVisible = false
|
|
|
this.$emit('onSuccess')
|
|
|
+ this.repeats = []
|
|
|
},
|
|
|
/*获取品牌*/
|
|
|
async queryBrand(){
|
|
|
@@ -598,18 +603,21 @@ export default {
|
|
|
},
|
|
|
/*查询项目名称是否重复*/
|
|
|
async nameChange(){
|
|
|
- this.param.content.sa_projectid = this.$route.query.id
|
|
|
- this.param.content.where.condition = this.form.projectname
|
|
|
- const res = await this.$api.requested(this.param)
|
|
|
- console.log(res.data,'是否重复')
|
|
|
- this.repeats = res.data
|
|
|
- this.total = res.total
|
|
|
- this.$refs.form.validateField('projectname')
|
|
|
- if (this.repeats.length > 0){
|
|
|
- this.dialogTableVisible = true
|
|
|
- }else {
|
|
|
- this.dialogTableVisible = false
|
|
|
+ if (this.form.projectname !== ''){
|
|
|
+ this.param.content.sa_projectid = this.$route.query.id
|
|
|
+ this.param.content.where.condition = this.form.projectname
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ console.log(res.data,'是否重复')
|
|
|
+ this.repeats = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.$refs.form.validateField('projectname')
|
|
|
+ if (this.repeats.length > 0){
|
|
|
+ this.dialogTableVisible = true
|
|
|
+ }else {
|
|
|
+ this.dialogTableVisible = false
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|