Browse Source

《供应商地点受入号便次配置表》开发

intex_online20250311
叶佳兴 1 month ago
parent
commit
0716f6c463
  1. 55
      src/api/wms/deliveryCalendar/index.ts
  2. 56
      src/api/wms/supplierAddressModelDeli/index.ts
  3. 88
      src/views/wms/basicDataManage/supplierManage/deliveryCalendar/deliveryCalendar.data.ts
  4. 244
      src/views/wms/basicDataManage/supplierManage/deliveryCalendar/index.vue
  5. 247
      src/views/wms/basicDataManage/supplierManage/supplierAddressModelDeli/index.vue
  6. 143
      src/views/wms/basicDataManage/supplierManage/supplierAddressModelDeli/supplierAddressModelDeli.data.ts

55
src/api/wms/deliveryCalendar/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface DeliveryCalendarVO {
id: number
supplierCode: string
supplierAddress: string
model: string
day: Date
shift: string
remark: string
available: string
siteId: string
concurrencyStamp: number
}
// 查询送货日历列表
export const getDeliveryCalendarPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/delivery-calendar/senior', data })
} else {
return await request.get({ url: `/wms/delivery-calendar/page`, params })
}
}
// 查询送货日历详情
export const getDeliveryCalendar = async (id: number) => {
return await request.get({ url: `/wms/delivery-calendar/get?id=` + id })
}
// 新增送货日历
export const createDeliveryCalendar = async (data: DeliveryCalendarVO) => {
return await request.post({ url: `/wms/delivery-calendar/create`, data })
}
// 修改送货日历
export const updateDeliveryCalendar = async (data: DeliveryCalendarVO) => {
return await request.put({ url: `/wms/delivery-calendar/update`, data })
}
// 删除送货日历
export const deleteDeliveryCalendar = async (id: number) => {
return await request.delete({ url: `/wms/delivery-calendar/delete?id=` + id })
}
// 导出送货日历 Excel
export const exportDeliveryCalendar = async (params) => {
return await request.download({ url: `/wms/delivery-calendar/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/delivery-calendar/get-import-template' })
}

56
src/api/wms/supplierAddressModelDeli/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface SupplierAddressModelDeliVO {
id: number
supplierCode: string
supplierAddress: string
model: string
yearAndMonth: string
shift: string
deliNo: number
remark: string
available: string
siteId: string
concurrencyStamp: number
}
// 查询供应商地点受入号便次配置列表
export const getSupplierAddressModelDeliPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplier-address-model-deli/senior', data })
} else {
return await request.get({ url: `/wms/supplier-address-model-deli/page`, params })
}
}
// 查询供应商地点受入号便次配置详情
export const getSupplierAddressModelDeli = async (id: number) => {
return await request.get({ url: `/wms/supplier-address-model-deli/get?id=` + id })
}
// 新增供应商地点受入号便次配置
export const createSupplierAddressModelDeli = async (data: SupplierAddressModelDeliVO) => {
return await request.post({ url: `/wms/supplier-address-model-deli/create`, data })
}
// 修改供应商地点受入号便次配置
export const updateSupplierAddressModelDeli = async (data: SupplierAddressModelDeliVO) => {
return await request.put({ url: `/wms/supplier-address-model-deli/update`, data })
}
// 删除供应商地点受入号便次配置
export const deleteSupplierAddressModelDeli = async (id: number) => {
return await request.delete({ url: `/wms/supplier-address-model-deli/delete?id=` + id })
}
// 导出供应商地点受入号便次配置 Excel
export const exportSupplierAddressModelDeli = async (params) => {
return await request.download({ url: `/wms/supplier-address-model-deli/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplier-address-model-deli/get-import-template' })
}

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

@ -0,0 +1,88 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
// 表单校验
export const DeliveryCalendarRules = reactive({
day: [required],
shift: [required],
concurrencyStamp: [required]
})
export const DeliveryCalendar = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: true
},
{
label: '供应商地点',
field: 'supplierAddress',
sort: 'custom',
isSearch: true
},
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true
},
{
label: '日期',
field: 'day',
sort: 'custom',
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)

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

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="DeliveryCalendar.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeliveryCalendar.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="DeliveryCalendarRules"
:formAllSchemas="DeliveryCalendar.allSchemas"
:apiUpdate="DeliveryCalendarApi.updateDeliveryCalendar"
:apiCreate="DeliveryCalendarApi.createDeliveryCalendar"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeliveryCalendar.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/delivery-calendar/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DeliveryCalendar,DeliveryCalendarRules } from './deliveryCalendar.data'
import * as DeliveryCalendarApi from '@/api/wms/deliveryCalendar'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'DeliveryCalendar' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(DeliveryCalendar.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeliveryCalendarApi.getDeliveryCalendarPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:delivery-calendar:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:delivery-calendar:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:delivery-calendar:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:delivery-calendar:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:delivery-calendar:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =DeliveryCalendar.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await DeliveryCalendarApi.createDeliveryCalendar(data)
message.success(t('common.createSuccess'))
} else {
await DeliveryCalendarApi.updateDeliveryCalendar(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeliveryCalendar')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DeliveryCalendarApi.deleteDeliveryCalendar(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeliveryCalendarApi.exportDeliveryCalendar(tableObject.params)
download.excel(data, '送货日历.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '送货日历导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DeliveryCalendarApi.importTemplate()
})
</script>

247
src/views/wms/basicDataManage/supplierManage/supplierAddressModelDeli/index.vue

@ -0,0 +1,247 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierAddressModelDeli.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierAddressModelDeli.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="SupplierAddressModelDeliRules"
:formAllSchemas="SupplierAddressModelDeli.allSchemas"
:apiUpdate="SupplierAddressModelDeliApi.updateSupplierAddressModelDeli"
:apiCreate="SupplierAddressModelDeliApi.createSupplierAddressModelDeli"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierAddressModelDeli.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/supplier-address-model-deli/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SupplierAddressModelDeli,SupplierAddressModelDeliRules } from './supplierAddressModelDeli.data'
import * as SupplierAddressModelDeliApi from '@/api/wms/supplierAddressModelDeli'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierAddressModelDeli' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierAddressModelDeli.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'supplierCode'){
setV['supplierName'] = val[0]['name']
}
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierAddressModelDeliApi.getSupplierAddressModelDeliPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplier-address-model-deli:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplier-address-model-deli:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplier-address-model-deli:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:supplier-address-model-deli:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplier-address-model-deli:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =SupplierAddressModelDeli.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SupplierAddressModelDeliApi.createSupplierAddressModelDeli(data)
message.success(t('common.createSuccess'))
} else {
await SupplierAddressModelDeliApi.updateSupplierAddressModelDeli(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierAddressModelDeli')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierAddressModelDeliApi.deleteSupplierAddressModelDeli(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierAddressModelDeliApi.exportSupplierAddressModelDeli(tableObject.params)
download.excel(data, '供应商地点受入号便次配置.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商地点受入号便次配置导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierAddressModelDeliApi.importTemplate()
})
</script>

143
src/views/wms/basicDataManage/supplierManage/supplierAddressModelDeli/supplierAddressModelDeli.data.ts

@ -0,0 +1,143 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
// 表单校验
export const SupplierAddressModelDeliRules = reactive({
yearAndMonth: [required],
shift: [required],
deliNo: [required],
concurrencyStamp: [required]
})
export const SupplierAddressModelDeli = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '供应商名称',
field: 'supplierName',
isForm: true,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 250
}
},
{
label: '供应商地点',
field: 'supplierAddress',
sort: 'custom',
isSearch: true
},
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isSearch: true
},
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true
},
{
label: '班次',
field: 'shift',
dictType: DICT_TYPE.SHIFT,
dictClass: 'string',
isTable: true,
isDetail: true,
sort: 'custom',
table: {
width: 150
},
isTableForm: true,
tableForm: {
type: 'Select'
}
},
{
label: '便次数',
field: 'deliNo',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
Loading…
Cancel
Save