Browse Source

送货日历

intex_online20250311
张立 1 month ago
parent
commit
5cec3e5e17
  1. 2
      src/api/wms/supplierDeliMain/index.ts
  2. 15
      src/views/wms/basicDataManage/supplierManage/deliveryCalendar/deliveryCalendar.data.ts
  3. 46
      src/views/wms/basicDataManage/supplierManage/deliveryCalendar/index.vue

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

@ -57,7 +57,5 @@ const getPageParams = (params)=>{
} }
// 查询供应商便次配置列表 // 查询供应商便次配置列表
export const getPageTableHead = async (params) => { export const getPageTableHead = async (params) => {
// params = getPageParams(params)
console.log('params',params)
return await request.get({ url: `/wms/supplier-deli-main/queryPageTableHead`, params }) return await request.get({ url: `/wms/supplier-deli-main/queryPageTableHead`, params })
} }

15
src/views/wms/basicDataManage/supplierManage/deliveryCalendar/deliveryCalendar.data.ts

@ -2,6 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier' import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import { formatDate } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const DeliveryCalendarRules = reactive({ export const DeliveryCalendarRules = reactive({
@ -78,9 +79,19 @@ export const DeliveryCalendar = useCrudSchemas(
}, },
{ {
label: '日期', label: '日期',
field: 'day', field: 'yearAndMonth',
sort: 'custom', sort: 'custom',
isSearch: true isTable: false,
isForm: false,
isSearch: true,
search: {
component: 'DatePicker',
value: formatDate(new Date(),'YYYYMM'),
componentProps: {
type: 'month',
valueFormat: 'YYYYMM',
}
}
}, },
{ {
label: '操作', label: '操作',

46
src/views/wms/basicDataManage/supplierManage/deliveryCalendar/index.vue

@ -32,6 +32,10 @@
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template v-for="item in dateColumns" :key="item.field" #[item.field]="{row}">
<div v-if="row[item.field]?.isDay == 'TRUE'">白班</div>
<div v-if="row[item.field]?.isNight == 'TRUE'">夜班</div>
</template>
<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>
@ -65,6 +69,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import * as SupplierDeliMainApi from '@/api/wms/supplierDeliMain'
defineOptions({ name: 'DeliveryCalendar' }) defineOptions({ name: 'DeliveryCalendar' })
@ -74,6 +79,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const orginTableColumns = ref(DeliveryCalendar.allSchemas.tableColumns)
const tableColumns = ref(DeliveryCalendar.allSchemas.tableColumns) const tableColumns = ref(DeliveryCalendar.allSchemas.tableColumns)
// //
@ -89,9 +95,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: DeliveryCalendarApi.getDeliveryCalendarPage // getListApi: DeliveryCalendarApi.getDeliveryCalendarPage //
@ -238,8 +244,42 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const { tableObject:tableObjectHead, tableMethods:tableMethodsHead } = useTable({
getListApi: SupplierDeliMainApi.getPageTableHead //
})
//
const { getList: getListHead, setSearchParams: setSearchParamsHead } = tableMethodsHead
const dateColumns = ref([])
watch(()=>tableObjectHead.tableList,()=>{
updateDateTableColumns()
},{deep:true})
const updateDateTableColumns = ()=>{
console.log('tableObjectHead', tableObjectHead)
dateColumns.value = []
if(tableObjectHead.tableList.length>10){
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
width:120,
field: item,
label: item
})
})
}else{
tableObjectHead.tableList.forEach(item=>{
dateColumns.value.push({
field: item,
label: item
})
})
}
tableColumns.value = [...orginTableColumns.value,...dateColumns.value]
console.log('tableColumns',tableColumns.value)
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getListHead()
getList() getList()
importTemplateData.templateUrl = await DeliveryCalendarApi.importTemplate() importTemplateData.templateUrl = await DeliveryCalendarApi.importTemplate()
}) })

Loading…
Cancel
Save