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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} 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 { } 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) => { 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) => { 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) => { 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) => { 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 // 导出供应商便次配置主 Excel
export const exportSupplierDeliMain = async (params) => { 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 = () => { 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 }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
<template v-for="name in array" :key="name.field" #[name.field]="{row}">
<span>44</span>
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -72,16 +68,70 @@ import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierDeliMain' }) 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 message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name 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(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -90,9 +140,9 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
} }
// //
const updataTableColumns = (val) => { // const updataTableColumns = (val) => {
tableColumns.value = val // tableColumns.value = val
} // }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: SupplierDeliMainApi.getSupplierDeliMainPage // getListApi: SupplierDeliMainApi.getSupplierDeliMainPage //
@ -105,7 +155,7 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierDeliMain:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:supplierDeliMain:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierDeliMain:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:supplierDeliMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'basic:supplier-deli-main:export'}), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), // // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -120,7 +170,7 @@ const HeadButttondata = [
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val: string, item: any) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
@ -128,6 +178,7 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'export') { // } else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
getListHead()
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') { //
} else { // } else { //
@ -142,7 +193,7 @@ const butttondata = [
] ]
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val: string, row: { id: number }) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -157,7 +208,7 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType: string,data: SupplierDeliMainApi.SupplierDeliMainVO) => {
var isHave =SupplierDeliMain.allSchemas.formSchema.some(function (item) { var isHave =SupplierDeliMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
@ -231,7 +282,7 @@ const importSuccess = () => {
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData: { filters: any }) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
@ -241,9 +292,8 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
tableObject.params = { getListHead()
isSearch: true getList()
}
importTemplateData.templateUrl = await SupplierDeliMainApi.importTemplate() 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', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table:{
width : 180
}
}, },
{ {
label: '供应商地点', label: '供应商地点',
field: 'supplierAddress', field: 'supplierAddress',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table:{
width : 180
}
}, },
{ {
label: '受入号', label: '受入号',
field: 'model', field: 'model',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table:{
width : 180
}
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
isSearch: false,
table:{
width : 180
}
}, },
{ {
label: '年月', label: '年月',

Loading…
Cancel
Save