From 5565b493f54ae87630e4894a3c97e1efb07d2b15 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 7 Jun 2024 16:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=85=A5=E5=BA=93=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=BB=84=E4=BB=B6=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E6=8C=89=E7=85=A7=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=A0=E5=85=A5=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=80=BC=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 12 ++++-- src/views/eam/sparepartsinlocation/index.vue | 43 +++++++++---------- .../sparePartsInLocationMain.data.ts | 5 +++ 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 77ba581a2..8b6a0636c 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -359,6 +359,12 @@ const props = defineProps({ type: Boolean, required: false, default: true + }, + // 子列表 哪个状态下展示新增修改隐藏 列表 + detailButtonIsShowAddStatusArray:{ + type: Array, + required: false, + default: () => ['1'] }, // 子列表 编辑 展示与隐藏 ,默认展示 detailButtonIsShowEdit:{ @@ -627,7 +633,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 新增 detailButtonAdd = [ defaultButtons.defaultAddBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray) }) ] } @@ -646,7 +652,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 编辑 detailButtonEdit = [ defaultButtons.mainListEditBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray) }) ] } @@ -654,7 +660,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 删除 detailButtonDelete = [ defaultButtons.mainListDeleteBtn({ - hide: isShowMainButton(row, ['1']) + hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray) }) ] } diff --git a/src/views/eam/sparepartsinlocation/index.vue b/src/views/eam/sparepartsinlocation/index.vue index 4371d9f2b..6b0d3fc8a 100644 --- a/src/views/eam/sparepartsinlocation/index.vue +++ b/src/views/eam/sparepartsinlocation/index.vue @@ -77,6 +77,7 @@ @searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="true" :detailButtonIsShowAdd="true" + :detailButtonIsShowAddStatusArray="['0']" /> @@ -124,18 +125,18 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => nextTick(() => { const setV = {} setV[formField] = val[0][searchField] - if(type == 'tableForm'){ + if (type == 'tableForm') { if (formField == 'sparePartsCode') { - row['sparePartsCode'] = val[0].itemNumber - row['currentQty'] = val[0].qty + row['sparePartsCode'] = val[0].itemNumber + row['currentQty'] = val[0].qty + } + } else { + if (formField == 'locationCode') { + setV['locationCode'] = val[0].code + setV['areaCode'] = val[0].areaCode + } } - }else{ - if (formField == 'locationCode') { - setV['locationCode'] = val[0].code - setV['areaCode'] = val[0].areaCode - } - } - + formRef.setValues(setV) }) }) @@ -144,14 +145,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => const searchTableSuccessDetail = (formField, searchField, val, formRef) => { nextTick(async () => { const setV = {} - // if(formField == 'itemCode'){ - // await ItembasicApi.getItembasicPage({ - // code: setV['itemCode'] - // }).then(res => { - // setV['uom'] = res.list[0].uom - // setV[formField] = val[0][searchField] - // }) - // } + if (formField == 'sparePartsCode') { + setV['sparePartsCode'] = val[0].itemNumber + setV['currentQty'] = val[0].qty + } formRef.setValues(setV) }) } @@ -217,8 +214,8 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }), // 编辑 - defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) // 删除 + defaultButtons.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }) // 编辑 + // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) // 删除 ] } @@ -299,7 +296,9 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(tableObject.params) + const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain( + tableObject.params + ) download.excel(data, '备件申领记录主.xlsx') } catch { } finally { @@ -328,7 +327,7 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 - console.log( formRef.value) + console.log(formRef.value) formRef.value.formLoading = true try { if (formType === 'create') { diff --git a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts index b40f19427..9a311ae27 100644 --- a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts +++ b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts @@ -276,6 +276,11 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( tableForm: { disabled: true }, + form:{ + componentProps:{ + disabled: true + } + }, isDetail:false, isTable:false },