11 changed files with 1234 additions and 1 deletions
@ -0,0 +1,49 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ReceivedCalendarVO { |
|||
id: number |
|||
receivedNumber: string |
|||
calendarDate: Date |
|||
shift: string |
|||
} |
|||
|
|||
// 查询受入日历列表
|
|||
export const getReceivedCalendarPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/received-calendar/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/received-calendar/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询受入日历详情
|
|||
export const getReceivedCalendar = async (id: number) => { |
|||
return await request.get({ url: `/basic/received-calendar/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增受入日历
|
|||
export const createReceivedCalendar = async (data: ReceivedCalendarVO) => { |
|||
return await request.post({ url: `/basic/received-calendar/create`, data }) |
|||
} |
|||
|
|||
// 修改受入日历
|
|||
export const updateReceivedCalendar = async (data: ReceivedCalendarVO) => { |
|||
return await request.put({ url: `/basic/received-calendar/update`, data }) |
|||
} |
|||
|
|||
// 删除受入日历
|
|||
export const deleteReceivedCalendar = async (id: number) => { |
|||
return await request.delete({ url: `/basic/received-calendar/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出受入日历 Excel
|
|||
export const exportReceivedCalendar = async (params) => { |
|||
return await request.download({ url: `/basic/received-calendar/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/received-calendar/get-import-template' }) |
|||
} |
@ -0,0 +1,51 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SupplierDeliDetailsVO { |
|||
id: number |
|||
supplierCode: string |
|||
shiftDeliDate: Date |
|||
shift: string |
|||
receivedNumber: string |
|||
deli: number |
|||
} |
|||
|
|||
// 查询供应商送货便次明细列表
|
|||
export const getSupplierDeliDetailsPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/supplier-deli-details/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/supplier-deli-details/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询供应商送货便次明细详情
|
|||
export const getSupplierDeliDetails = async (id: number) => { |
|||
return await request.get({ url: `/basic/supplier-deli-details/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增供应商送货便次明细
|
|||
export const createSupplierDeliDetails = async (data: SupplierDeliDetailsVO) => { |
|||
return await request.post({ url: `/basic/supplier-deli-details/create`, data }) |
|||
} |
|||
|
|||
// 修改供应商送货便次明细
|
|||
export const updateSupplierDeliDetails = async (data: SupplierDeliDetailsVO) => { |
|||
return await request.put({ url: `/basic/supplier-deli-details/update`, data }) |
|||
} |
|||
|
|||
// 删除供应商送货便次明细
|
|||
export const deleteSupplierDeliDetails = async (id: number) => { |
|||
return await request.delete({ url: `/basic/supplier-deli-details/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出供应商送货便次明细 Excel
|
|||
export const exportSupplierDeliDetails = async (params) => { |
|||
return await request.download({ url: `/basic/supplier-deli-details/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/supplier-deli-details/get-import-template' }) |
|||
} |
@ -0,0 +1,50 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SupplierShiftDeliVO { |
|||
id: number |
|||
supplierCode: string |
|||
shiftDeliDate: Date |
|||
shift: string |
|||
deli: number |
|||
} |
|||
|
|||
// 查询供应商班次便次列表
|
|||
export const getSupplierShiftDeliPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/supplier-shift-deli/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/supplier-shift-deli/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询供应商班次便次详情
|
|||
export const getSupplierShiftDeli = async (id: number) => { |
|||
return await request.get({ url: `/basic/supplier-shift-deli/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增供应商班次便次
|
|||
export const createSupplierShiftDeli = async (data: SupplierShiftDeliVO) => { |
|||
return await request.post({ url: `/basic/supplier-shift-deli/create`, data }) |
|||
} |
|||
|
|||
// 修改供应商班次便次
|
|||
export const updateSupplierShiftDeli = async (data: SupplierShiftDeliVO) => { |
|||
return await request.put({ url: `/basic/supplier-shift-deli/update`, data }) |
|||
} |
|||
|
|||
// 删除供应商班次便次
|
|||
export const deleteSupplierShiftDeli = async (id: number) => { |
|||
return await request.delete({ url: `/basic/supplier-shift-deli/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出供应商班次便次 Excel
|
|||
export const exportSupplierShiftDeli = async (params) => { |
|||
return await request.download({ url: `/basic/supplier-shift-deli/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/supplier-shift-deli/get-import-template' }) |
|||
} |
@ -0,0 +1,245 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="ReceivedCalendar.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="ReceivedCalendar.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="ReceivedCalendarRules" |
|||
:formAllSchemas="ReceivedCalendar.allSchemas" |
|||
:apiUpdate="ReceivedCalendarApi.updateReceivedCalendar" |
|||
:apiCreate="ReceivedCalendarApi.createReceivedCalendar" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="ReceivedCalendar.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/received-calendar/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { ReceivedCalendar,ReceivedCalendarRules } from './receivedCalendar.data' |
|||
import * as ReceivedCalendarApi from '@/api/wms/receivedCalendar' |
|||
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' |
|||
import { ElCalendar } from 'element-plus' |
|||
|
|||
defineOptions({ name: 'ReceivedCalendar' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(ReceivedCalendar.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: ReceivedCalendarApi.getReceivedCalendarPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:received-calendar:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'basic:received-calendar:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'basic:received-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:receivedCalendar:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:receivedCalendar: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 =ReceivedCalendar.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 ReceivedCalendarApi.createReceivedCalendar(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await ReceivedCalendarApi.updateReceivedCalendar(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, 'basicReceivedCalendar') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ReceivedCalendarApi.deleteReceivedCalendar(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 ReceivedCalendarApi.exportReceivedCalendar(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 ReceivedCalendarApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,70 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const ReceivedCalendarRules = reactive({ |
|||
receivedNumber: [required], |
|||
calendarDate: [required], |
|||
}) |
|||
|
|||
export const ReceivedCalendar = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '受入号', |
|||
field: 'receivedNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '日期', |
|||
field: 'calendarDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '班次', |
|||
field: 'shift', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="SupplierDeliDetails.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SupplierDeliDetails.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="SupplierDeliDetailsRules" |
|||
:formAllSchemas="SupplierDeliDetails.allSchemas" |
|||
:apiUpdate="SupplierDeliDetailsApi.updateSupplierDeliDetails" |
|||
:apiCreate="SupplierDeliDetailsApi.createSupplierDeliDetails" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierDeliDetails.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/supplier-deli-details/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { SupplierDeliDetails,SupplierDeliDetailsRules } from './supplierDeliDetails.data' |
|||
import * as SupplierDeliDetailsApi from '@/api/wms/supplierDeliDetails' |
|||
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: 'SupplierDeliDetails' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SupplierDeliDetails.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: SupplierDeliDetailsApi.getSupplierDeliDetailsPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:supplier-deli-details:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'basic:supplier-deli-details:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'basic:supplier-deli-details: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:supplierDeliDetails:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierDeliDetails: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 =SupplierDeliDetails.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 SupplierDeliDetailsApi.createSupplierDeliDetails(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await SupplierDeliDetailsApi.updateSupplierDeliDetails(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, 'basicSupplierDeliDetails') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SupplierDeliDetailsApi.deleteSupplierDeliDetails(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 SupplierDeliDetailsApi.exportSupplierDeliDetails(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 SupplierDeliDetailsApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,113 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SupplierDeliDetailsRules = reactive({ |
|||
supplierCode: [required], |
|||
shiftDeliDate: [required], |
|||
shift: [required], |
|||
receivedNumber: [required], |
|||
deli: [required], |
|||
}) |
|||
|
|||
export const SupplierDeliDetails = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '供应商编码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '日期', |
|||
field: 'shiftDeliDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '班次', |
|||
field: 'shift', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
// {
|
|||
// label: '受入号',
|
|||
// field: 'receivedNumber',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '便次数', |
|||
field: 'deli', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
precision: 0, |
|||
min: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: 'creator', |
|||
isForm: false, |
|||
isTable: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,247 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="SupplierShiftDeli.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SupplierShiftDeli.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="SupplierShiftDeliRules" |
|||
:formAllSchemas="SupplierShiftDeli.allSchemas" |
|||
:apiUpdate="SupplierShiftDeliApi.updateSupplierShiftDeli" |
|||
:apiCreate="SupplierShiftDeliApi.createSupplierShiftDeli" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierShiftDeli.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/supplier-shift-deli/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { SupplierShiftDeli,SupplierShiftDeliRules } from './supplierShiftDeli.data' |
|||
import * as SupplierShiftDeliApi from '@/api/wms/supplierShiftDeli' |
|||
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: 'SupplierShiftDeli' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SupplierShiftDeli.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: SupplierShiftDeliApi.getSupplierShiftDeliPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:supplier-shift-deli:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'basic:supplier-shift-deli:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'basic:supplier-shift-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:supplierShiftDeli:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierShiftDeli: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 =SupplierShiftDeli.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 SupplierShiftDeliApi.createSupplierShiftDeli(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await SupplierShiftDeliApi.updateSupplierShiftDeli(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, 'basicSupplierShiftDeli') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SupplierShiftDeliApi.deleteSupplierShiftDeli(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 SupplierShiftDeliApi.exportSupplierShiftDeli(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 SupplierShiftDeliApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,163 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import * as SupplierApi from '@/api/wms/supplier' |
|||
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|||
import { dateFormatter, dateFormatterYM } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SupplierShiftDeliRules = reactive({ |
|||
supplierCode: [required], |
|||
shiftDeliDate: [required], |
|||
shift: [required], |
|||
deli: [required] |
|||
}) |
|||
|
|||
export const SupplierShiftDeli = 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: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '年月', |
|||
field: 'shiftDeliDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatterYM, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM', |
|||
type: 'monthrange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'monthrange', |
|||
valueFormat: 'YYYY-MM' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
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: 'deli', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0, |
|||
componentProps: { |
|||
precision: 0, |
|||
min: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: 'creator', |
|||
isForm: false, |
|||
isTable: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
]) |
|||
) |
Loading…
Reference in new issue