|
@ -31,14 +31,14 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="对应数据" prop="dictionaryConfigId"> |
|
|
|
|
|
<el-input v-if="isDisabled" v-model="form.dictionaryConfigId.dicName" disabled /> |
|
|
|
|
|
|
|
|
<el-form-item label="对应数据" prop="dictionaryId"> |
|
|
|
|
|
<el-input v-if="isDisabled" v-model="form.dictionaryId.dictionaryName" disabled /> |
|
|
<!-- @change="selectDictionary" --> |
|
|
<!-- @change="selectDictionary" --> |
|
|
<div v-else class="dictionary-selected"> |
|
|
<div v-else class="dictionary-selected"> |
|
|
<el-select v-model="form.mateData" class="dictionary-left" placeholder="" value-key="id" :disabled="form.isInputClass !== 'select' && form.isInputClass !== 'popover'" @change="changeDictType"> |
|
|
<el-select v-model="form.mateData" class="dictionary-left" placeholder="" value-key="id" :disabled="form.isInputClass !== 'select' && form.isInputClass !== 'popover'" @change="changeDictType"> |
|
|
<el-option v-for="item in dataOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
<el-option v-for="item in dataOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-select v-model="form.dictionaryConfigId.id" class="dictionary-right" placeholder="" value-key="id" :disabled="form.mateData !== 3"> |
|
|
|
|
|
|
|
|
<el-select v-model="form.dictionaryId.id " class="dictionary-right" placeholder="" value-key="id" :disabled="form.mateData !== 3"> |
|
|
<el-option v-for="item in dictionaryData" :key="item.id" :label="item.dictionaryName" :value="item.id" /> |
|
|
<el-option v-for="item in dictionaryData" :key="item.id" :label="item.dictionaryName" :value="item.id" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
@ -143,7 +143,7 @@ export default { |
|
|
} |
|
|
} |
|
|
// 对应字典必填判断 |
|
|
// 对应字典必填判断 |
|
|
var checkDictionaryConfigId = (rule, value, callback) => { |
|
|
var checkDictionaryConfigId = (rule, value, callback) => { |
|
|
if ((this.form.isInputClass === 'select' || this.form.isInputClass === 'popover') && !this.form.dictionaryConfigId.id && this.form.mateData === 3) { |
|
|
|
|
|
|
|
|
if ((this.form.isInputClass === 'select' || this.form.isInputClass === 'popover') && !this.form.dictionaryId.id && this.form.mateData === 3) { |
|
|
callback(new Error('对应字典项不可为空!')) |
|
|
callback(new Error('对应字典项不可为空!')) |
|
|
} else { |
|
|
} else { |
|
|
callback() |
|
|
callback() |
|
@ -177,7 +177,7 @@ export default { |
|
|
editLength: [ |
|
|
editLength: [ |
|
|
{ validator: checkEditLength, trigger: 'blur' } |
|
|
{ validator: checkEditLength, trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
dictionaryConfigId: [ |
|
|
|
|
|
|
|
|
dictionaryId: [ |
|
|
{ validator: checkDictionaryConfigId, trigger: 'blur' } |
|
|
{ validator: checkDictionaryConfigId, trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
fillingDigit: [ |
|
|
fillingDigit: [ |
|
@ -191,7 +191,7 @@ export default { |
|
|
} |
|
|
} |
|
|
return { |
|
|
return { |
|
|
form: { |
|
|
form: { |
|
|
dictionaryConfigId: { |
|
|
|
|
|
|
|
|
dictionaryId: { |
|
|
id: null |
|
|
id: null |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -248,7 +248,7 @@ export default { |
|
|
|
|
|
|
|
|
if (this.form.mateData !== 3) { |
|
|
if (this.form.mateData !== 3) { |
|
|
this.dictionaryData = [] |
|
|
this.dictionaryData = [] |
|
|
this.form.dictionaryConfigId.id = null |
|
|
|
|
|
|
|
|
this.form.dictionaryId.id = null |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 字段类型 |
|
|
// 字段类型 |
|
@ -284,7 +284,7 @@ export default { |
|
|
this.getDictrionaryList() |
|
|
this.getDictrionaryList() |
|
|
} else { |
|
|
} else { |
|
|
this.dictionaryData = [] |
|
|
this.dictionaryData = [] |
|
|
this.form.dictionaryConfigId.id = null |
|
|
|
|
|
|
|
|
this.form.dictionaryId.id = null |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -298,7 +298,7 @@ export default { |
|
|
// this.dictionaryId = value |
|
|
// this.dictionaryId = value |
|
|
// }, |
|
|
// }, |
|
|
changeDictType(value) { |
|
|
changeDictType(value) { |
|
|
this.form.dictionaryConfigId.id = null |
|
|
|
|
|
|
|
|
this.form.dictionaryId.id = null |
|
|
}, |
|
|
}, |
|
|
// 著录形式为'下拉框'、'弹出框'的,对应字典不为空,反之为空 |
|
|
// 著录形式为'下拉框'、'弹出框'的,对应字典不为空,反之为空 |
|
|
selectInputClass(value) { |
|
|
selectInputClass(value) { |
|
@ -307,7 +307,7 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.dictionaryData = [] |
|
|
this.dictionaryData = [] |
|
|
this.form.mateData = null |
|
|
this.form.mateData = null |
|
|
this.form.dictionaryConfigId.id = null |
|
|
|
|
|
|
|
|
this.form.dictionaryId.id = null |
|
|
} |
|
|
} |
|
|
// 字段类型为数字型,且默认著录类型为数字框不可更改 |
|
|
// 字段类型为数字型,且默认著录类型为数字框不可更改 |
|
|
if (this.form.isDataType === 2 && this.form.isInputClass !== 'number') { |
|
|
if (this.form.isDataType === 2 && this.form.isInputClass !== 'number') { |
|
@ -382,7 +382,7 @@ export default { |
|
|
// submitForm(formName) { |
|
|
// submitForm(formName) { |
|
|
// // 对应字典必填判断 |
|
|
// // 对应字典必填判断 |
|
|
// if (this.form.isInputClass === 'select' || this.form.isInputClass === 'popover') { |
|
|
// if (this.form.isInputClass === 'select' || this.form.isInputClass === 'popover') { |
|
|
// if (!this.form.dictionaryConfigId.id) { |
|
|
|
|
|
|
|
|
// if (!this.form.dictionaryId.id ) { |
|
|
// this.$message.error('对应字典项不可为空!') |
|
|
// this.$message.error('对应字典项不可为空!') |
|
|
// return |
|
|
// return |
|
|
// } |
|
|
// } |
|
|