From addafb56b304d3ff3040c4b30f82101fad0aa965 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 30 Jul 2024 11:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E4=BB=B6=E6=A3=80=E9=AA=8C=E5=8A=A0?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=EF=BC=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionRecordFirst/index.vue | 30 +++++++++++++++---- .../inspectionRecordFirstMain.data.ts | 25 ++++++++++++++-- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/src/views/qms/inspectionRecordFirst/index.vue b/src/views/qms/inspectionRecordFirst/index.vue index 75bff36cf..84d0b942a 100644 --- a/src/views/qms/inspectionRecordFirst/index.vue +++ b/src/views/qms/inspectionRecordFirst/index.vue @@ -136,8 +136,10 @@ const buttonBaseClick = (val, item) => { const butttondata = (row) => { return [ defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:update' }), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi: 'wms:inspection-recode-first-main:delete' }), // 删除 - defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, 'publish'), hasPermi:'qms:inspection-recode-first-main:pub'}), // 发布 + defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, 'publish'),hasPermi: 'wms:inspection-recode-first-main:delete' }), // 删除 + defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, 'publish'), hasPermi: 'qms:inspection-recode-first-main:pub' }), // 发布 + + defaultButtons.mainExport({ hide: !row.isPublished}), // 导出 ] } @@ -153,7 +155,10 @@ const buttonBaseClick = (val, item) => { handleDelete(row.id) }else if (val == 'mainOrderPub') { //发布 handleOrderPub(row) - } + }else if (val == 'mainExport') { + // 导出 + handleMainExport(row) + } } /** 添加/修改操作 */ const basicFormRef = ref() @@ -194,9 +199,24 @@ const buttonBaseClick = (val, item) => { } +/** 列表导出按钮操作 */ +const exportLoading = ref(false) // 导出的加载中 +const handleMainExport = async (row: any) => { + try { + await message.exportConfirm() + // 发起导出 + exportLoading.value = true + tableObject.params.number = row.number + const data = await InspectionRecordMainApi.exportInspectionRecordMain(tableObject.params) + download.excel(data, '首件检验记录.xlsx') + } catch { + } finally { + exportLoading.value = false + } +} + /** 导出按钮操作 */ - const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { try { // 导出的二次确认 @@ -204,7 +224,7 @@ const buttonBaseClick = (val, item) => { // 发起导出 exportLoading.value = true const data = await InspectionRecordMainApi.exportInspectionRecordMain(tableObject.params) - download.excel(data, '备件申领记录主.xlsx') + download.excel(data, '首件检验记录.xlsx') } catch { } finally { exportLoading.value = false diff --git a/src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts b/src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts index dfbd9c33a..83561cafe 100644 --- a/src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts +++ b/src/views/qms/inspectionRecordFirst/inspectionRecordFirstMain.data.ts @@ -35,7 +35,7 @@ export const InspectionRecordMain = useCrudSchemas( label: '物料编码', field: 'itemCode', sort: 'custom', - isSearch: false, + isSearch: true, isForm: false, table: { width: 150 @@ -90,13 +90,25 @@ export const InspectionRecordMain = useCrudSchemas( width: 130 }, isForm: false, - isTable: true + isTable: false, + isSearch: false + }, + { + label: '检验人', + field: 'creatorName', + table: { + width: 130 + }, + isForm: false, + isTable: true, + isSearch: true }, { label: '检验时间', field: 'inspectionTime', sort: 'custom', isDetail: true, + isSearch: true, isForm: false, formatter: dateFormatter, detail: { @@ -105,6 +117,15 @@ export const InspectionRecordMain = useCrudSchemas( table: { width: 180 }, + search: { + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + + } + }, form: { component: 'DatePicker', componentProps: {