From 398879952b82fa01a2dd9f5c239701624b2c7baa Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Thu, 4 Jul 2024 14:44:52 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B8=82=E5=9C=BA=E6=B3=95=E8=A7=84?= =?UTF-8?q?=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketRegulationsFormPage.vue | 61 ++++++++++--------- .../modules/MarketRegulationsModal.vue | 49 +++++++-------- 2 files changed, 56 insertions(+), 54 deletions(-) diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue index 2d9becf..5e4eee2 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue @@ -742,36 +742,37 @@ export default { await getForeignStandardDocumentInfo({ id: item.id, type: '2' }).then(res => { if (res.success) { const result = res.result - result.standardId = result.id - result.standardNumber = result.standard_number // 标准编号 - result.standardName = result.standard_name // 标准名称 - result.standardEnglishName = result.standard_english_name // 标准英文名称 - result.stanardClass = result.standard_class // 标准类型 - result.stanardClass_dictText = result.standard_class_dictText // 标准类型 - result.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 - result.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 - result.registrationDate = result.registration_date // 注册日期 - result.applicableCountryRegion = result.applicable_market // 适用国家/地区 - result.applicableCountryRegion_dictText = result.applicable_market_dictText // 适用国家/地区 - result.mainDept = result.main_dept // 主控部门 - result.mainDept_dictText = result.main_dept_dictText // 主控部门 - result.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 - result.mainDeptProfMode_dictText = result.main_dept_prof_mode_dictText // 主控部门专业模块 - result.associateDept = result.associate_dept // 关联部门 - result.associateDept_dictText = result.associate_dept_dictText // 关联部门 - result.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 - result.associateDeptProfMode_dictText = result.associate_dept_prof_mode_dictText // 关联部门专业模块 - result.applicableVehicle = result.applicable_vehicle // 适用车型 - result.applicableVehicle_dictText = result.applicable_vehicle_dictText // 适用车型 - result.dynamicType = result.dynamic_type // 动力类型 - result.dynamicType_dictText = result.dynamic_type_dictText // 动力类型 + const form = {} + form.standardId = result.id + form.standardNumber = result.standard_number // 标准编号 + form.standardName = result.standard_name // 标准名称 + form.standardEnglishName = result.standard_english_name // 标准英文名称 + form.stanardClass = result.standard_class // 标准类型 + form.stanardClass_dictText = result.standard_class_dictText // 标准类型 + form.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 + form.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 + form.registrationDate = result.registration_date // 注册日期 + form.applicableCountryRegion = result.applicable_market // 适用国家/地区 + form.applicableCountryRegion_dictText = result.applicable_market_dictText // 适用国家/地区 + form.mainDept = result.main_dept // 主控部门 + form.mainDept_dictText = result.main_dept_dictText // 主控部门 + form.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 + form.mainDeptProfMode_dictText = result.main_dept_prof_mode_dictText // 主控部门专业模块 + form.associateDept = result.associate_dept // 关联部门 + form.associateDept_dictText = result.associate_dept_dictText // 关联部门 + form.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 + form.associateDeptProfMode_dictText = result.associate_dept_prof_mode_dictText // 关联部门专业模块 + form.applicableVehicle = result.applicable_vehicle // 适用车型 + form.applicableVehicle_dictText = result.applicable_vehicle_dictText // 适用车型 + form.dynamicType = result.dynamic_type // 动力类型 + form.dynamicType_dictText = result.dynamic_type_dictText // 动力类型 const uid = uidGenerator() this.dataSource.unshift({ - ...result, + ...form, uid }) this.dataList.unshift({ - ...result, + ...form, uid }) } @@ -793,14 +794,14 @@ export default { const idArr = ids.split(',') let repeatNum = 0 for (const id of idArr) { - await getMarketRegulationListById({ manifestId: id }).then(res => { + await marketRegulationDetailListById({ manifestId: id }).then(res => { if (res.success) { - for (const item of res.result.lists) { + for (const item of res.result) { if (!this.dataList.find(i => i.standardNumber === item.standardNumber)) { const uid = uidGenerator() // 列表中还没有该标准 - this.dataSource.unshift({ ...item, uid }) - this.dataList.unshift({ ...item, uid }) + this.dataSource.unshift({ ...item, uid, id: undefined }) + this.dataList.unshift({ ...item, uid, id: undefined }) } else { repeatNum++ } @@ -893,7 +894,7 @@ export default { // 国家/地区是树选择,需要处理格式 param.manifest.country = param.manifest.country.map(item => item.value).join(',') let func - if (this.model.manifest.id) { + if (this.model && this.model.manifest.id) { param.manifest.id = this.model.manifest.id func = marketRegulationListEdit } else { diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue b/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue index 0c5e82d..944c886 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue @@ -314,33 +314,34 @@ export default { getForeignStandardDocumentInfo({ id: value[0].id, type: '2' }).then(res => { if (res.success) { const result = res.result - result.standardId = result.id - result.standardName = result.standard_name // 标准名称 - result.standardEnglishName = result.standard_english_name // 标准英文名称 - result.stanardClass = result.standard_class // 标准类型 - result.stanardClass_dictText = result.standard_class_dictText // 标准类型 - result.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 - result.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 - result.registrationDate = result.registration_date // 注册日期 - result.applicableCountryRegion = result.applicable_market ? (result.applicable_market.split(',').map(item => { + const form = {} + form.standardId = result.id + form.standardName = result.standard_name // 标准名称 + form.standardEnglishName = result.standard_english_name // 标准英文名称 + form.stanardClass = result.standard_class // 标准类型 + form.stanardClass_dictText = result.standard_class_dictText // 标准类型 + form.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 + form.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 + form.registrationDate = result.registration_date // 注册日期 + form.applicableCountryRegion = result.applicable_market ? (result.applicable_market.split(',').map(item => { return { value: item } })) : [] // 适用国家/地区 - result.applicableCountryRegion_dictText = result.applicable_market_dictText // 适用国家/地区 - result.mainDept = result.main_dept // 主控部门 - result.mainDept_dictText = result.main_dept_dictText // 主控部门 - result.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 - result.mainDeptProfMode_dictText = result.main_dept_prof_mode_dictText // 主控部门专业模块 - result.associateDept = result.associate_dept // 关联部门 - result.associateDept_dictText = result.associate_dept_dictText // 关联部门 - result.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 - result.associateDeptProfMode_dictText = result.associate_dept_prof_mode_dictText // 关联部门专业模块 - result.applicableVehicle = result.applicable_vehicle // 适用车型 - result.applicableVehicle_dictText = result.applicable_vehicle_dictText // 适用车型 - result.dynamicType = result.dynamic_type // 动力类型 - result.dynamicType_dictText = result.dynamic_type_dictText // 动力类型 - this.model = Object.assign({}, result) + form.applicableCountryRegion_dictText = result.applicable_market_dictText // 适用国家/地区 + form.mainDept = result.main_dept // 主控部门 + form.mainDept_dictText = result.main_dept_dictText // 主控部门 + form.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 + form.mainDeptProfMode_dictText = result.main_dept_prof_mode_dictText // 主控部门专业模块 + form.associateDept = result.associate_dept // 关联部门 + form.associateDept_dictText = result.associate_dept_dictText // 关联部门 + form.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 + form.associateDeptProfMode_dictText = result.associate_dept_prof_mode_dictText // 关联部门专业模块 + form.applicableVehicle = result.applicable_vehicle // 适用车型 + form.applicableVehicle_dictText = result.applicable_vehicle_dictText // 适用车型 + form.dynamicType = result.dynamic_type // 动力类型 + form.dynamicType_dictText = result.dynamic_type_dictText // 动力类型 + this.model = Object.assign({}, form) this.$nextTick(() => { - this.form.setFieldsValue(pick(result, 'standardName', 'standardEnglishName', + this.form.setFieldsValue(pick(form, 'standardName', 'standardEnglishName', 'stanardClass', 'newProductImplDate', 'newAuthImplDate', 'registrationDate', 'applicableCountryRegion', 'mainDept', 'mainDeptProfMode', 'associateDept', 'associateDeptProfMode', 'applicableVehicle', 'dynamicType')) })