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: {