[fix 88015] 标准主计划字段未更新
This commit is contained in:
+39
-6
@@ -600,8 +600,9 @@ import StandardResolutionSheetModal
|
|||||||
from '@views/standardRegulationLibrary/foreignStandard/detail/modules/StandardResolutionSheetModal'
|
from '@views/standardRegulationLibrary/foreignStandard/detail/modules/StandardResolutionSheetModal'
|
||||||
import { getFormDictTreeList } from '@api/api'
|
import { getFormDictTreeList } from '@api/api'
|
||||||
import STreeSelect from '@comp/STreeSelect'
|
import STreeSelect from '@comp/STreeSelect'
|
||||||
import { filterObj } from '@/utils/util'
|
|
||||||
|
|
||||||
|
// 初始化data数组,默认9个对象中有type,1-9
|
||||||
|
const initDataArr = () => new Array(9).fill(0).map((_, i) => ({ type: i + 1 }))
|
||||||
export default {
|
export default {
|
||||||
name: 'StandardMasterPlanModal',
|
name: 'StandardMasterPlanModal',
|
||||||
components: { STreeSelect, StandardResolutionSheetModal, UserSelection, StandardSelection },
|
components: { STreeSelect, StandardResolutionSheetModal, UserSelection, StandardSelection },
|
||||||
@@ -615,7 +616,7 @@ export default {
|
|||||||
disableSubmit: false,
|
disableSubmit: false,
|
||||||
model: {},
|
model: {},
|
||||||
// 默认9个对象,type 1:信息输入 2:文本入库 3:导入通知 4:法规解读 5:法规宣贯 6:市场法规清单更新 7:法规符合性排查 8:通用文件整改计划 9:车型整改
|
// 默认9个对象,type 1:信息输入 2:文本入库 3:导入通知 4:法规解读 5:法规宣贯 6:市场法规清单更新 7:法规符合性排查 8:通用文件整改计划 9:车型整改
|
||||||
data: new Array(9).fill(0).map((_, i) => ({ type: i + 1 })),
|
data: initDataArr(),
|
||||||
modelType: '',
|
modelType: '',
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
// 标准编号
|
// 标准编号
|
||||||
@@ -698,29 +699,61 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 回显页面信息
|
// 新增回显页面信息
|
||||||
updatePageInfo () {
|
updatePageInfo () {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const formData = this.form.getFieldsValue()
|
const formData = this.form.getFieldsValue()
|
||||||
if (formData.base.applicableMarket && this.model.standardId) {
|
if (formData.base.applicableMarket && this.model.standardId) {
|
||||||
|
this.confirmLoading = true
|
||||||
getStandardMasterPlanAddEcho({
|
getStandardMasterPlanAddEcho({
|
||||||
applicableMarket: formData.base.applicableMarket,
|
applicableMarket: formData.base.applicableMarket,
|
||||||
standardId: this.model.standardId
|
standardId: this.model.standardId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const data = res.result || []
|
const data = res.result || []
|
||||||
|
// 保留可输入字段
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
|
const canInputField = this.getCanInputField(Number(item.type))
|
||||||
const index = Number(item.type) - 1
|
const index = Number(item.type) - 1
|
||||||
|
// 删除可填写字段,防止覆盖
|
||||||
|
canInputField.forEach(field => delete item[field])
|
||||||
// 回显表单
|
// 回显表单
|
||||||
this.form.setFieldsValue({
|
this.form.setFieldsValue({
|
||||||
[`data[${index}]`]: Object.assign(formData.data[index], filterObj(item))
|
[`data[${index}]`]: Object.assign(formData.data[index], item)
|
||||||
})
|
})
|
||||||
// 存到页面
|
// 存到页面
|
||||||
this.data[index] = Object.assign(this.data[index], filterObj(item))
|
this.data[index] = Object.assign(this.data[index], item)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 根据type获取可输入的字段
|
||||||
|
* @param type - 类型
|
||||||
|
*/
|
||||||
|
getCanInputField (type) {
|
||||||
|
switch (type) {
|
||||||
|
// 导入通知:是否涉及、责任人、计划完成日期
|
||||||
|
case 3:
|
||||||
|
return ['isInvolved', 'responsiblePerson', 'responsiblePerson_dictText', 'plannedCompletionDate']
|
||||||
|
// 导入通知:是否涉及、计划完成日期
|
||||||
|
case 4:
|
||||||
|
return ['isInvolved', 'plannedCompletionDate']
|
||||||
|
// 市场法规清单更新:是否涉及、计划完成日期
|
||||||
|
case 6:
|
||||||
|
return ['isInvolved', 'plannedCompletionDate']
|
||||||
|
// 法规符合性排查:是否涉及、责任人、计划完成日期
|
||||||
|
case 7:
|
||||||
|
return ['isInvolved', 'responsiblePerson', 'responsiblePerson_dictText', 'plannedCompletionDate']
|
||||||
|
default:
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取国家地区、也是适用市场下拉
|
// 获取国家地区、也是适用市场下拉
|
||||||
getCountryOption () {
|
getCountryOption () {
|
||||||
getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
|
getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
|
||||||
@@ -787,7 +820,7 @@ export default {
|
|||||||
close () {
|
close () {
|
||||||
this.form.resetFields()
|
this.form.resetFields()
|
||||||
this.model = {}
|
this.model = {}
|
||||||
this.data = new Array(9).fill(0).map((_, i) => ({ type: i + 1 }))
|
this.data = initDataArr()
|
||||||
this.modelType = ''
|
this.modelType = ''
|
||||||
this.disableSubmit = false
|
this.disableSubmit = false
|
||||||
this.visible = false
|
this.visible = false
|
||||||
|
|||||||
Reference in New Issue
Block a user