|
|
@ -35,7 +35,7 @@ |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" > |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="buttondata(row)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
<ButtonBase :Butttondata="buttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -221,6 +221,11 @@ const masterParmas=ref({ |
|
|
|
status: '',//主表状态 用于控制子表新增编辑按钮显示情况 |
|
|
|
}) |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = ref() |
|
|
|
// 列表-操作按钮 |
|
|
|
const buttondata = ref() |
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
|
const titleNameRef = ref() |
|
|
|
const titleValueRef = ref() |
|
|
@ -250,7 +255,16 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: |
|
|
|
getRemarkList() |
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
|
|
|
|
// 判断详情新增按钮是否显示 |
|
|
|
HeadButttondata.value = [ |
|
|
|
defaultButtons.defaultAddBtn({hide:isShowMainButton(row,['ORDER_READY','PLAN_NEW','PLAN_PURCHASE_READY','REQUEST_NEW'])}), // 新增 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
] |
|
|
|
// 动态显示操作列按钮 |
|
|
|
buttondata.value = [ |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['ORDER_READY','PLAN_NEW','PLAN_PURCHASE_READY','REQUEST_NEW'])}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['ORDER_READY','PLAN_NEW','PLAN_PURCHASE_READY','REQUEST_NEW'])}), // 删除 |
|
|
|
] |
|
|
|
} finally { |
|
|
|
detailLoading.value = false |
|
|
|
} |
|
|
@ -281,13 +295,20 @@ const getChangeRecordList = async () => { |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: props.apiPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList } = tableMethods |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = ref([ |
|
|
|
defaultButtons.defaultAddBtn(null), // 新增 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
]) |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
@ -308,13 +329,7 @@ const buttonBaseClick = (val, item) => { |
|
|
|
// const updataTableColumns = (val) => { |
|
|
|
// detailAllSchemas.tableColumns.value = val |
|
|
|
// } |
|
|
|
// 列表-操作按钮 |
|
|
|
const buttondata = (row) => { |
|
|
|
return [ |
|
|
|
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' }), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
@ -335,7 +350,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
console.log(formField); |
|
|
|
props.Echo.forEach((item)=>{ |
|
|
|
setV[item] = val[0][item] |
|
|
|
}) |
|
|
|