Browse Source

YT-1979《供应商便次配置表》开发

intex_online20250311
zhaoyiran 1 month ago
parent
commit
4a9c1b4daa
  1. 25
      src/api/wms/supplierDeliMain/index.ts
  2. 84
      src/views/wms/supplierManage/supplierDeliMain/index.vue
  3. 18
      src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

25
src/api/wms/supplierDeliMain/index.ts

@ -17,38 +17,47 @@ export const getSupplierDeliMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basic/supplier-deli-main/senior', data })
return await request.post({ url: '/wms/supplier-deli-main/senior', data })
} else {
return await request.get({ url: `/basic/supplier-deli-main/page`, params })
return await request.get({ url: `/wms/supplier-deli-main/page`, params })
}
}
// 查询供应商便次配置主详情
export const getSupplierDeliMain = async (id: number) => {
return await request.get({ url: `/basic/supplier-deli-main/get?id=` + id })
return await request.get({ url: `/wms/supplier-deli-main/get?id=` + id })
}
// 新增供应商便次配置主
export const createSupplierDeliMain = async (data: SupplierDeliMainVO) => {
return await request.post({ url: `/basic/supplier-deli-main/create`, data })
return await request.post({ url: `/wms/supplier-deli-main/create`, data })
}
// 修改供应商便次配置主
export const updateSupplierDeliMain = async (data: SupplierDeliMainVO) => {
return await request.put({ url: `/basic/supplier-deli-main/update`, data })
return await request.put({ url: `/wms/supplier-deli-main/update`, data })
}
// 删除供应商便次配置主
export const deleteSupplierDeliMain = async (id: number) => {
return await request.delete({ url: `/basic/supplier-deli-main/delete?id=` + id })
return await request.delete({ url: `/wms/supplier-deli-main/delete?id=` + id })
}
// 导出供应商便次配置主 Excel
export const exportSupplierDeliMain = async (params) => {
return await request.download({ url: `/basic/supplier-deli-main/export-excel`, params })
return await request.download({ url: `/wms/supplier-deli-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/basic/supplier-deli-main/get-import-template' })
return request.download({ url: '/wms/supplier-deli-main/get-import-template' })
}
const getPageParams = (params)=>{
}
// 查询供应商便次配置列表
export const getPageTableHead = async (params) => {
// params = getPageParams(params)
console.log('params',params)
return await request.get({ url: `/wms/supplier-deli-main/queryPageTableHead`, params })
}

84
src/views/wms/supplierManage/supplierDeliMain/index.vue

@ -35,10 +35,6 @@
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
<template v-for="name in array" :key="name.field" #[name.field]="{row}">
<span>44</span>
</template>
</Table>
</ContentWrap>
@ -72,16 +68,70 @@ import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierDeliMain' })
// const array = [{
// field: "code1",
// isForm: false,
// isTable: true,
// isSearch: true,
// label: "1",
// sort: "custom",
// sortTableDefault: 999,
// width: 150,
// table:{
// width: 150,
// }
// }]
const orginTableColumns = ref(SupplierDeliMain.allSchemas.tableColumns)
const tableColumns = ref(SupplierDeliMain.allSchemas.tableColumns)
//
const updataTableColumns = (val: { [x: string]: any; field: string; label?: string | undefined; width?: string | number | undefined; fixed?: "left" | "right" | undefined; children?: any[] | undefined }[]) => {
orginTableColumns.value = val
}
const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable({
getListApi: SupplierDeliMainApi.getPageTableHead //
})
//
const { getList:getListHead, setSearchParams:setSearchParamsHead } = tableMethodsHead
watch(()=>tableObjectHead.tableList,()=>{
updateDateTableColumns()
},{deep:true})
const updateDateTableColumns = ()=>{
console.log('tableObjectHead',tableObjectHead)
let dateColumns = []
if(tableObjectHead.tableList.length>10){
tableObjectHead.tableList.forEach(item=>{
dateColumns.push({
width:120,
field: item,
label: item
})
})
}else{
tableObjectHead.tableList.forEach(item=>{
dateColumns.push({
field: item,
label: item
})
})
}
tableColumns.value = [...orginTableColumns.value,...dateColumns]
console.log('tableColumns',tableColumns.value)
}
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierDeliMain.allSchemas.tableColumns)
// const tableColumns = ref(SupplierDeliMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
const searchTableSuccess = (formField: string | number, searchField: string | number, val: { [x: string]: any }[], formRef: { setValues: (arg0: {}) => void }) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
@ -90,9 +140,9 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
// const updataTableColumns = (val) => {
// tableColumns.value = val
// }
const { tableObject, tableMethods } = useTable({
getListApi: SupplierDeliMainApi.getSupplierDeliMainPage //
@ -105,7 +155,7 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierDeliMain:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierDeliMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'basic:supplier-deli-main:export'}), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -120,7 +170,7 @@ const HeadButttondata = [
]
//
const buttonBaseClick = (val, item) => {
const buttonBaseClick = (val: string, item: any) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
@ -128,6 +178,7 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getListHead()
getList()
} else if (val == 'filtrate') { //
} else { //
@ -142,7 +193,7 @@ const butttondata = [
]
// -
const buttonTableClick = async (val, row) => {
const buttonTableClick = async (val: string, row: { id: number }) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
@ -157,7 +208,7 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
const formsSuccess = async (formType: string,data: SupplierDeliMainApi.SupplierDeliMainVO) => {
var isHave =SupplierDeliMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
@ -231,7 +282,7 @@ const importSuccess = () => {
}
//
const searchFormClick = (searchData) => {
const searchFormClick = (searchData: { filters: any }) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
@ -241,9 +292,8 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
isSearch: true
}
getListHead()
getList()
importTemplateData.templateUrl = await SupplierDeliMainApi.importTemplate()
})

18
src/views/wms/supplierManage/supplierDeliMain/supplierDeliMain.data.ts

@ -13,18 +13,36 @@ export const SupplierDeliMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'supplierCode',
sort: 'custom',
isSearch: true,
table:{
width : 180
}
},
{
label: '供应商地点',
field: 'supplierAddress',
sort: 'custom',
isSearch: true,
table:{
width : 180
}
},
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
table:{
width : 180
}
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: false,
table:{
width : 180
}
},
{
label: '年月',

Loading…
Cancel
Save