[update] 市场法规清单可以修改中间部分的英文缩写

This commit is contained in:
lideqin
2024-07-30 11:21:38 +08:00
parent 9e76fbbb05
commit e6c62f253c
4 changed files with 33 additions and 6 deletions
@@ -19,16 +19,17 @@
:tree-data="countryOptions"
tree-checkable
treeCheckStrictly
@change="countryChange"
:placeholder="$t('pleaseSelect')+$t('standardRegulationLibrary.marketRegulationsList.countryRegion')" />
</a-form-item>
</a-col>
<!-- 清单编号 -->
<!-- 清单编号英文缩写 -->
<a-col :span="12" v-if="model.id">
<a-form-item :label="$t('standardRegulationLibrary.marketRegulationsList.listNumber')"
<a-form-item :label="$t('standardRegulationLibrary.marketRegulationsList.listNumberEnglishPart')"
:labelCol="labelCol"
:wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.marketRegulationsList.listNumber')"
:maxLength="200"
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.marketRegulationsList.listNumberEnglishPart')"
:maxLength="192"
v-decorator="['manifestNo', validatorRules.manifestNo]" />
</a-form-item>
</a-col>
@@ -205,6 +206,7 @@ import {
getMarketRegulationListById,
marketRegulationDetailCopy,
marketRegulationDetailTransfer,
marketRegulationGetListNumber,
marketRegulationListAdd,
marketRegulationListEdit
} from '../../../api/standardRegulationLibraryApi'
@@ -496,6 +498,24 @@ export default {
}
})
},
// 国家地区改变,重新获取清单编号
countryChange (value) {
// 重新获取清单编号
// const value = this.form.getFieldValue('country')
console.log('--------value', value)
const param = {}
param.country = value && value.length > 0 ? value.map(item => item.value).join(',') : ''
marketRegulationGetListNumber(param).then(res => {
if (res.success) {
const result = {
manifestNo: res.message
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(result, 'manifestNo'))
})
}
})
},
// 获取基础信息
initData (id) {
this.pageLoading = true
@@ -511,6 +531,8 @@ export default {
return { value: item }
})
}
// 从清单编号截取英文缩写
this.model.manifestNo = this.model.manifestNo.split('-')[1]
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'country', 'manifestNo', 'customColumnName', 'drivePosition', 'securityLevel', 'manifestDesc', 'file'))
})