|
|
@ -34,7 +34,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -80,6 +80,10 @@ const tableColumns = ref(Packageunit.allSchemas.tableColumns) |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
// if(val[0].parentCode){ |
|
|
|
// message.error('该规格为子包装,请重新选择') |
|
|
|
// return |
|
|
|
// } |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
@ -92,7 +96,7 @@ const updataTableColumns = (val) => { |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: PackageunitApi.getPackageunitPage // 分页接口 |
|
|
|
getListApi: PackageunitApi.getPackageunitPageTree // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
@ -133,10 +137,23 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:packageunit:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageunit:delete'}), // 删除 |
|
|
|
] |
|
|
|
const butttondata = (row,$index) => { |
|
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:packageunit:update',hide:isShowButton(row)}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageunit:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
const isShowButton =(row)=>{ |
|
|
|
if(row.children&&row.children.length>0){ |
|
|
|
return true |
|
|
|
}else{ |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|