From 8bceb86ae0a71bbf10fa01148dc35778b34040b7 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 8 Jul 2024 09:53:34 +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 --- src/api/standardRegulationLibraryApi.js | 3 + .../MarketRegulationsDetailPage.vue | 16 ++-- .../MarketRegulationsFormPage.vue | 22 ++--- .../modules/MarketRegulationsModal.vue | 89 ++++++++++++------- 4 files changed, 81 insertions(+), 49 deletions(-) diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index fd2e696..4cbb1b3 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -142,6 +142,8 @@ const marketRegulationListAdd = (params) => postAction('/laws/marketStandard/add const marketRegulationListEdit = (params) => postAction('/laws/marketStandard/edit', params) // 市场法规清单-清单列表-获取详情列表分页 const marketRegulationDetailListById = (params) => getAction('/laws/marketStandardDetail/list', params) +// 市场法规清单-清单列表-调取 +const marketRegulationDetailTransfer = (params) => postAction('/laws/marketStandardDetail/batchAdd', params) // 市场法规清单-清单列表-复制 const marketRegulationDetailCopy = (params) => postAction('/laws/marketStandardDetail/copy', params) // 市场法规清单-清单列表-新增 @@ -233,6 +235,7 @@ export { marketRegulationListAdd, marketRegulationListEdit, marketRegulationDetailListById, + marketRegulationDetailTransfer, marketRegulationDetailCopy, marketRegulationDetailAdd, marketRegulationDetailEdit, diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue index d17ae57..2e9efc1 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue @@ -10,37 +10,37 @@ - {{ model.manifest.countryText || global.emptyLine }} + {{ model.countryText || global.emptyLine }} - {{ model.manifest.manifestNo || global.emptyLine }} + {{ model.manifestNo || global.emptyLine }} - {{ model.manifest.manifestName || global.emptyLine }} + {{ model.manifestName || global.emptyLine }} - {{ model.manifest.drivePositionText || global.emptyLine }} + {{ model.drivePositionText || global.emptyLine }} - {{ model.manifest.securityLevelText || global.emptyLine }} + {{ model.securityLevelText || global.emptyLine }} - {{ model.manifest.manifestDesc || global.emptyLine }} + {{ model.manifestDesc || global.emptyLine }} - + {{ global.emptyLine }} @@ -331,7 +331,7 @@ export default { param.manifestId = ids getMarketRegulationListById(param).then(res => { if (res.success) { - this.model = Object.assign({}, res.result) + this.model = Object.assign({}, res.result.manifest) } }).finally(() => { this.loading = false diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue index ae53434..546cc6f 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue @@ -556,6 +556,7 @@ export default { return } this.loading = true + const paramList = [] for (const item of list) { await getForeignStandardDocumentInfo({ id: item.id, type: '2' }).then(res => { if (res.success) { @@ -577,19 +578,20 @@ export default { form.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 form.applicableVehicle = result.applicable_vehicle // 适用车型 form.dynamicType = result.dynamic_type // 动力类型 - marketRegulationDetailAdd(form).then(res => { - if (res.success) { - this.$message.success(res.message) - this.loadData() - } else { - this.$message.warn(res.message) - } - }).finally(() => { - this.loading = false - }) + paramList.push(form) } }) } + marketRegulationDetailTransfer(paramList).then(res => { + if (res.success) { + this.$message.success(res.message) + this.loadData() + } else { + this.$message.warn(res.message) + } + }).finally(() => { + this.loading = false + }) }, // 复制 handleCopy () { diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue b/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue index 23d06b9..b11d3bc 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/modules/MarketRegulationsModal.vue @@ -308,37 +308,64 @@ export default { // 选择标准改变 selectStandardChange (value) { this.confirmLoading = true - // 根据返回的id查询企标数据 - getForeignStandardDocumentInfo({ id: value[0].id, type: '2' }).then(res => { - if (res.success) { - const result = res.result - const form = {} - form.standardId = result.id - form.standardName = result.standard_name // 标准名称 - form.standardEnglishName = result.standard_english_name // 标准英文名称 - form.type = result.type // 标准类型 - form.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 - form.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 - form.registrationDate = result.registration_date // 注册日期 - form.country = result.applicable_market ? (result.applicable_market.split(',').map(item => { - return { value: item } - })) : [] // 适用国家/地区 - form.mainDept = result.main_dept // 主控部门 - form.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 - form.associateDept = result.associate_dept // 关联部门 - form.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 - form.applicableVehicle = result.applicable_vehicle // 适用车型 - form.dynamicType = result.dynamic_type // 动力类型 - this.model = Object.assign({}, form) - this.$nextTick(() => { - this.form.setFieldsValue(pick(form, 'standardName', 'standardEnglishName', - 'type', 'newProductImplDate', 'newAuthImplDate', 'registrationDate', 'country', - 'mainDept', 'mainDeptProfMode', 'associateDept', 'associateDeptProfMode', 'applicableVehicle', 'dynamicType')) - }) - } - }).finally(() => { - this.confirmLoading = false - }) + if (value && value.length > 0) { + // 根据返回的id查询企标数据 + getForeignStandardDocumentInfo({ id: value[0].id, type: '2' }).then(res => { + if (res.success) { + const result = res.result + const form = {} + form.standardId = result.id + form.standardName = result.standard_name // 标准名称 + form.standardEnglishName = result.standard_english_name // 标准英文名称 + form.type = result.type // 标准类型 + form.newProductImplDate = result.new_product_impl_date // 新生产车实施日期 + form.newAuthImplDate = result.new_auth_impl_date // 新认证车实施日期 + form.registrationDate = result.registration_date // 注册日期 + form.country = result.applicable_market ? (result.applicable_market.split(',').map(item => { + return { value: item } + })) : [] // 适用国家/地区 + form.mainDept = result.main_dept // 主控部门 + form.mainDeptProfMode = result.main_dept_prof_mode || undefined // 主控部门专业模块 + form.associateDept = result.associate_dept // 关联部门 + form.associateDeptProfMode = result.associate_dept_prof_mode || undefined // 关联部门专业模块 + form.applicableVehicle = result.applicable_vehicle // 适用车型 + form.dynamicType = result.dynamic_type // 动力类型 + this.model = Object.assign({}, form) + this.$nextTick(() => { + this.form.setFieldsValue(pick(form, 'standardName', 'standardEnglishName', + 'type', 'newProductImplDate', 'newAuthImplDate', 'registrationDate', 'country', + 'mainDept', 'mainDeptProfMode', 'associateDept', 'associateDeptProfMode', + 'applicableVehicle', 'dynamicType')) + }) + } + }).finally(() => { + this.confirmLoading = false + }) + } else { + const form = {} + form.standardId = '' + form.standardName = '' // 标准名称 + form.standardEnglishName = '' // 标准英文名称 + form.type = undefined // 标准类型 + form.newProductImplDate = '' // 新生产车实施日期 + form.newAuthImplDate = '' // 新认证车实施日期 + form.registrationDate = '' // 注册日期 + form.country = [] // 适用国家/地区 + form.mainDept = '' // 主控部门 + form.mainDeptProfMode = undefined // 主控部门专业模块 + form.associateDept = '' // 关联部门 + form.associateDeptProfMode = undefined // 关联部门专业模块 + form.applicableVehicle = '' // 适用车型 + form.dynamicType = '' // 动力类型 + this.model = Object.assign({}, form) + this.$nextTick(() => { + this.form.setFieldsValue(pick(form, 'standardName', 'standardEnglishName', + 'type', 'newProductImplDate', 'newAuthImplDate', 'registrationDate', 'country', + 'mainDept', 'mainDeptProfMode', 'associateDept', 'associateDeptProfMode', + 'applicableVehicle', 'dynamicType')) + this.confirmLoading = false + }) + } }, handleOk () { if (this.confirmLoading) return