Browse Source

包装规格

master_hella_20240701
zhang_li 5 months ago
parent
commit
06cd2d5663
  1. 11
      src/api/wms/packageunit/index.ts
  2. 25
      src/views/wms/basicDataManage/itemManage/packageunit/index.vue
  3. 2
      src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts

11
src/api/wms/packageunit/index.ts

@ -33,7 +33,16 @@ export const getPackageunitPage = async (params) => {
return await request.get({ url: `/wms/packageunit/page`, 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) => { export const getPackageunit = async (id: number) => {
return await request.get({ url: `/wms/packageunit/get?id=` + id }) return await request.get({ url: `/wms/packageunit/get?id=` + id })

25
src/views/wms/basicDataManage/itemManage/packageunit/index.vue

@ -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) => {

2
src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts

@ -335,7 +335,7 @@ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 searchListPlaceholder: '请选择父包装代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格信息', // 查询弹窗标题 searchTitle: '包装规格信息', // 查询弹窗标题
searchAllSchemas: Packageunit1.allSchemas, // 查询弹窗所需类 searchAllSchemas: Packageunit1.allSchemas, // 查询弹窗所需类

Loading…
Cancel
Save