From e0a0569d509d5a40023cb93b7f81c9c277028f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Thu, 7 Nov 2024 10:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=B1=E7=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TemplatImport/TenantAuditStepModal.vue | 34 ++++++++++++++++--- .../ContainerManagement/TemplatImport/api.ts | 11 +++++- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue b/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue index 6edd13f4..2c21048b 100644 --- a/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue +++ b/src/views/ContainerManagement/TemplatImport/TenantAuditStepModal.vue @@ -122,7 +122,7 @@ import { BasicModal, useModalInner } from '/@/components/Modal' import { BasicForm, useForm } from '/@/components/Form/index' import { formSchema, InfoColumns } from './columns' - import { ApiEdit, ApiInfo, ApiDelDetail, ApiImport } from './api' + import { ApiEdit, ApiInfo, ApiDelDetail, ApiImport, ApiGetDSX } from './api' import { ApiDealExcel } from '/@/views/ContainerManagement/RentIn/api' import { ExportExcelByColumn } from '/@/api/common' // 字典 @@ -152,6 +152,7 @@ isUpdate.value = !!data?.isUpdate activeKey.value = '1' list.value.splice(0) + ChangeRow.value.splice(0) if (unref(isUpdate)) { rowId.value = data.record.id const res: any = await ApiInfo({ id: unref(rowId) }) @@ -175,7 +176,13 @@ async function handleSave(exit) { try { const values = await validate() - values.bodylist = list.value + let bodylist: any = [] + ChangeRow.value.forEach((e) => { + if (!bodylist.includes(list.value[e])) { + bodylist.push(list.value[e]) + } + }) + values.bodylist = bodylist setModalProps({ confirmLoading: true, loading: true }) const res: any = await ApiEdit(values) if (res.succeeded) { @@ -194,7 +201,6 @@ } else { createMessage.error(res.message) } - exit && closeModal() } finally { // loading.value = false; @@ -204,6 +210,7 @@ async function refresh(type = false) { let MessageArr: any = [] list.value.splice(0) + ChangeRow.value.splice(0) const res: any = await ApiInfo({ id: unref(rowId) }) if (res.succeeded) { setFieldsValue({ @@ -522,6 +529,7 @@ // data: 'changeTime', // }, ] + let ChangeRow = ref([]) const settings = { height: '260', readOnly: true, @@ -549,6 +557,7 @@ licenseKey: 'non-commercial-and-evaluation', // 定义所有单元格发生变化的回调处理 async afterChange(changes, source) { + ChangeRow.value.push(changes[0][0]) if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') { let dict: any = {} @@ -599,7 +608,23 @@ }) } } - function derivedExcel() { + async function derivedExcel() { + // let ids: any = [] + // list.value.forEach((e: any, i) => { + // if (e.selected) { + // if (e.id) { + // console.log(BigInt(e.id)) + + // ids.push(e.id) + // } + // } + // }) + // if (ids.length) { + // const res = await ApiGetDSX({ ids: ids }) + // if (res.succeeded) { + // console.log(res) + // } + // } else { let ApiData: any = { columnSets: [], jsonDataStr: [], @@ -634,5 +659,6 @@ document.body.appendChild(link) link.click() }) + // } } diff --git a/src/views/ContainerManagement/TemplatImport/api.ts b/src/views/ContainerManagement/TemplatImport/api.ts index 99c0b809..6d186e51 100644 --- a/src/views/ContainerManagement/TemplatImport/api.ts +++ b/src/views/ContainerManagement/TemplatImport/api.ts @@ -8,6 +8,7 @@ enum Api { del = '/containerManagementApi/CM_State_Change_TemplatImport/DeleteCM_State_Change_TemplatImport', delDetail = '/containerManagementApi/CM_State_Change_TemplatImport/DeleteCM_State_Change_Temp', import = '/containerManagementApi/CM_State_Change_TemplatImport/CM_State_Change_TemplatImport_Confirm', + GetDSX = '/containerManagementApi/CM_State_Change_TemplatImport/GetDSX_TemplatDetailList', } // 列表 (Auth) export function ApiList(data: PageRequest) { @@ -57,4 +58,12 @@ export function ApiImport(data: PageRequest) { method: 'post', data, }) -} \ No newline at end of file +} +// 获取选定业务的待上线明细 (Auth) +export function ApiGetDSX(data: PageRequest) { + return request({ + url: Api.GetDSX, + method: 'post', + data, + }) +}