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