From 873823f7e5ec1c7996bdc6da67eb4214d7fc5c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Mon, 30 Oct 2023 17:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=BB=84=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 2cae59c35..c3b0f3a7a 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -22,7 +22,6 @@ :masterId="masterParmas.masterId" @button-base-click="buttonBaseClick" :routeName="routeName" - @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" /> @@ -86,7 +85,6 @@ const routeName = ref() routeName.value = route.name routeName.value = routeName.value.substring(0,routeName.value.length - 4) + 'Detail' - const props = defineProps({ // 标签参数 tabs: { @@ -215,11 +213,13 @@ const change = (item, index) => { current.value = index } - +//主表所需的参数 const masterParmas=ref({ masterId:'',//主表id number: '',//主表单据号 -})//主表所需的参数 + status: '',//主表状态 用于控制子表新增编辑按钮显示情况 +}) + /** 打开弹窗 */ const titleNameRef = ref() const titleValueRef = ref() @@ -235,6 +235,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 设置主表id masterParmas.value.masterId = row.id masterParmas.value.number = row.number + masterParmas.value.status = row.status tableObject.params = { masterId: row.id, } @@ -282,10 +283,10 @@ const { tableObject, tableMethods } = useTable({ // 获得表格的各种操作 const { getList } = tableMethods // 列表头部按钮 -const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 +const HeadButttondata = ref([ + defaultButtons.defaultAddBtn({ hide: masterParmas.value.status=='REQUEST_NEW'?false:true}), // 新增 defaultButtons.defaultFilterBtn(null), // 筛选 -] +]) // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 @@ -303,14 +304,14 @@ const buttonBaseClick = (val, item) => { } // 字段设置 更新主列表字段 -const updataTableColumns = (val) => { - tableColumns.value = val -} +// const updataTableColumns = (val) => { +// detailAllSchemas.tableColumns.value = val +// } // 列表-操作按钮 const buttondata = (row) => { return [ - defaultButtons.mainListEditBtn({ hide: false, hasPermi: 'wms:purchaseclaim-request-main:update' }), // 编辑 - defaultButtons.mainListDeleteBtn({ hide: false, hasPermi: 'wms:purchaseclaim-request-main:delete' }), // 删除 + defaultButtons.mainListEditBtn({ hide: masterParmas.value.status=='REQUEST_NEW'?false:true, hasPermi: 'wms:purchaseclaim-request-main:update' }), // 编辑 + defaultButtons.mainListDeleteBtn({ hide: masterParmas.value.status=='REQUEST_NEW'?false:true, hasPermi: 'wms:purchaseclaim-request-main:delete' }), // 删除 ] } // 列表-操作按钮事件