[update] 市场法规清单-新增编辑提交时校验表格必填项

This commit is contained in:
lideqin
2024-07-03 16:38:18 +08:00
parent 8ceb3229fb
commit d3df0c0f1c
2 changed files with 23 additions and 0 deletions
@@ -839,6 +839,27 @@ export default {
// 提交
handleSubmit () {
if (this.loading) return
const requiredField = [
'standardNumber', // 标准编号
'standardName', // 标准名称
'newProductImplDate', // 新生产车实施日期
'newAuthImplDate', // 新认证车实施日期
'registrationDate', // 注册日期
'applicableCountryRegion', // 适用国家/地区
'authenticationObject', // 认证对象
'mainDept', // 主控部门
'mainDeptProfMode', // 主控部门专业模块
'applicableVehicle', // 适用车型
'dynamicType' // 动力类型
]
for (const item of this.dataList) {
for (const filed of requiredField) {
if (!item[filed]) {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
return
}
}
}
this.form.validateFields((err, values) => {
if (!err) {
this.loading = true
@@ -290,6 +290,8 @@ export default {
this.model.applicableCountryRegion = this.model.applicableCountryRegion.split(',').map(item => {
return { value: item }
})
} else {
this.model.applicableCountryRegion = []
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'standardNumber', 'standardName', 'standardEnglishName',