diff --git a/src/api/wms/packageunit/index.ts b/src/api/wms/packageunit/index.ts
index fa1718d35..9a5fd1f51 100644
--- a/src/api/wms/packageunit/index.ts
+++ b/src/api/wms/packageunit/index.ts
@@ -33,7 +33,16 @@ export const getPackageunitPage = async (params) => {
return await request.get({ url: `/wms/packageunit/page`, params })
}
}
-
+// 查询物品包装规格信息 列表树状图
+export const getPackageunitPageTree = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/wms/packageunit/seniorTree', data })
+ } else {
+ return await request.get({ url: `/wms/packageunit/pageTree`, params })
+ }
+}
// 查询物品包装规格信息 详情
export const getPackageunit = async (id: number) => {
return await request.get({ url: `/wms/packageunit/get?id=` + id })
diff --git a/src/views/wms/basicDataManage/itemManage/packageunit/index.vue b/src/views/wms/basicDataManage/itemManage/packageunit/index.vue
index 3a998d42c..1e2341a23 100644
--- a/src/views/wms/basicDataManage/itemManage/packageunit/index.vue
+++ b/src/views/wms/basicDataManage/itemManage/packageunit/index.vue
@@ -34,7 +34,7 @@
-
+
@@ -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) => {
diff --git a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
index 80332842f..fd4e685a6 100644
--- a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
+++ b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
@@ -335,7 +335,7 @@ export const Packageunit = useCrudSchemas(reactive([
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
- searchListPlaceholder: '请选择到库位代码', // 输入框占位文本
+ searchListPlaceholder: '请选择父包装代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格信息', // 查询弹窗标题
searchAllSchemas: Packageunit1.allSchemas, // 查询弹窗所需类