chenfang
8 months ago
12 changed files with 2116 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupDetailJobVO { |
|||
id: number |
|||
packingNumber: string |
|||
batch: string |
|||
inventoryStatus: string |
|||
ownerCode: string |
|||
containerNumber: string |
|||
fromLocationCode: string |
|||
toLocationCode: string |
|||
itemCode: string |
|||
itemName: string |
|||
itemDesc1: string |
|||
itemDesc2: string |
|||
projectCode: string |
|||
qty: number |
|||
uom: string |
|||
masterId: number |
|||
number: string |
|||
remark: string |
|||
siteId: string |
|||
} |
|||
|
|||
// 查询备货任务子列表
|
|||
export const getStockupDetailJobPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/stockup-detail-job/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/stockup-detail-job/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货任务子详情
|
|||
export const getStockupDetailJob = async (id: number) => { |
|||
return await request.get({ url: `/wms/stockup-detail-job/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货任务子
|
|||
export const createStockupDetailJob = async (data: StockupDetailJobVO) => { |
|||
return await request.post({ url: `/wms/stockup-detail-job/create`, data }) |
|||
} |
|||
|
|||
// 修改备货任务子
|
|||
export const updateStockupDetailJob = async (data: StockupDetailJobVO) => { |
|||
return await request.put({ url: `/wms/stockup-detail-job/update`, data }) |
|||
} |
|||
|
|||
// 删除备货任务子
|
|||
export const deleteStockupDetailJob = async (id: number) => { |
|||
return await request.delete({ url: `/wms/stockup-detail-job/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货任务子 Excel
|
|||
export const exportStockupDetailJob = async (params) => { |
|||
return await request.download({ url: `/wms/stockup-detail-job/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/stockup-detail-job/get-import-template' }) |
|||
} |
@ -0,0 +1,76 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupDetailRecordVO { |
|||
id: number |
|||
packingNumber: string |
|||
batch: string |
|||
inventoryStatus: string |
|||
fromOwnerCode: string |
|||
fromContainerNumber: string |
|||
fromLocationCode: string |
|||
fromLocationGroupCode: string |
|||
fromAreaCode: string |
|||
toOwnerCode: string |
|||
toContainerNumber: string |
|||
toLocationCode: string |
|||
toLocationGroupCode: string |
|||
toAreaCode: string |
|||
singlePrice: number |
|||
amount: number |
|||
masterId: number |
|||
number: string |
|||
itemCode: string |
|||
remark: string |
|||
siteId: string |
|||
itemName: string |
|||
itemDesc1: string |
|||
itemDesc2: string |
|||
projectCode: string |
|||
qty: number |
|||
uom: string |
|||
code: string |
|||
interfaceType: string |
|||
jobDetailId: string |
|||
available: string |
|||
} |
|||
|
|||
// 查询备货记录子列表
|
|||
export const getStockupDetailRecordPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/stockup-detail-record/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/stockup-detail-record/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货记录子详情
|
|||
export const getStockupDetailRecord = async (id: number) => { |
|||
return await request.get({ url: `/wms/stockup-detail-record/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货记录子
|
|||
export const createStockupDetailRecord = async (data: StockupDetailRecordVO) => { |
|||
return await request.post({ url: `/wms/stockup-detail-record/create`, data }) |
|||
} |
|||
|
|||
// 修改备货记录子
|
|||
export const updateStockupDetailRecord = async (data: StockupDetailRecordVO) => { |
|||
return await request.put({ url: `/wms/stockup-detail-record/update`, data }) |
|||
} |
|||
|
|||
// 删除备货记录子
|
|||
export const deleteStockupDetailRecord = async (id: number) => { |
|||
return await request.delete({ url: `/wms/stockup-detail-record/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货记录子 Excel
|
|||
export const exportStockupDetailRecord = async (params) => { |
|||
return await request.download({ url: `/wms/stockup-detail-record/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/stockup-detail-record/get-import-template' }) |
|||
} |
@ -0,0 +1,65 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupDetailRequestVO { |
|||
id: number |
|||
packingNumber: string |
|||
containerNumber: string |
|||
batch: string |
|||
inventoryStatus: string |
|||
toOwnerCode: string |
|||
toLocationCode: string |
|||
masterId: number |
|||
number: string |
|||
remark: string |
|||
siteId: number |
|||
itemCode: string |
|||
itemName: string |
|||
itemDesc1: string |
|||
itemDesc2: string |
|||
projectCode: string |
|||
qty: number |
|||
uom: string |
|||
concurrencyStamp: string |
|||
fromOwnerCode: string |
|||
} |
|||
|
|||
// 查询备货申请子列表
|
|||
export const getStockupDetailRequestPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/request/stockup-detail-request/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/request/stockup-detail-request/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货申请子详情
|
|||
export const getStockupDetailRequest = async (id: number) => { |
|||
return await request.get({ url: `/request/stockup-detail-request/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货申请子
|
|||
export const createStockupDetailRequest = async (data: StockupDetailRequestVO) => { |
|||
return await request.post({ url: `/request/stockup-detail-request/create`, data }) |
|||
} |
|||
|
|||
// 修改备货申请子
|
|||
export const updateStockupDetailRequest = async (data: StockupDetailRequestVO) => { |
|||
return await request.put({ url: `/request/stockup-detail-request/update`, data }) |
|||
} |
|||
|
|||
// 删除备货申请子
|
|||
export const deleteStockupDetailRequest = async (id: number) => { |
|||
return await request.delete({ url: `/request/stockup-detail-request/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货申请子 Excel
|
|||
export const exportStockupDetailRequest = async (params) => { |
|||
return await request.download({ url: `/request/stockup-detail-request/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/request/stockup-detail-request/get-import-template' }) |
|||
} |
@ -0,0 +1,90 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupMainJobVO { |
|||
id: number |
|||
requestNumber: string |
|||
deliverPlanNumber: string |
|||
fromWarehouseCode: string |
|||
toWarehouseCode: string |
|||
details: string |
|||
requestTime: Date |
|||
requestDueTime: Date |
|||
status: string |
|||
expiredTime: Date |
|||
concurrencyStamp: string |
|||
jobStageStatus: string |
|||
priority: number |
|||
priorityincrement: number |
|||
departmentCode: string |
|||
userGroupCode: string |
|||
acceptUserId: string |
|||
acceptUserName: string |
|||
acceptTime: Date |
|||
completeUserId: string |
|||
completeUserName: string |
|||
completeTime: Date |
|||
fromAreaTypes: string |
|||
toAreaTypes: string |
|||
number: string |
|||
businessType: string |
|||
remark: string |
|||
extraProperties: string |
|||
siteId: string |
|||
autoComplete: string |
|||
allowModifyLocation: string |
|||
allowModifyQty: string |
|||
allowBiggerQty: string |
|||
allowSmallerQty: string |
|||
allowModifyInventoryStatus: string |
|||
allowContinuousScanning: string |
|||
allowPartialComplete: string |
|||
ruleUserId: number |
|||
allowModifyBatch: string |
|||
allowModifyPackingNumber: string |
|||
fromAreaCodes: string |
|||
toAreaCodes: string |
|||
serialNumber: string |
|||
inInventoryStatuses: string |
|||
outInventoryStatuses: string |
|||
} |
|||
|
|||
// 查询备货任务主列表
|
|||
export const getStockupMainJobPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/stockup-main-job/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/stockup-main-job/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货任务主详情
|
|||
export const getStockupMainJob = async (id: number) => { |
|||
return await request.get({ url: `/wms/stockup-main-job/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货任务主
|
|||
export const createStockupMainJob = async (data: StockupMainJobVO) => { |
|||
return await request.post({ url: `/wms/stockup-main-job/create`, data }) |
|||
} |
|||
|
|||
// 修改备货任务主
|
|||
export const updateStockupMainJob = async (data: StockupMainJobVO) => { |
|||
return await request.put({ url: `/wms/stockup-main-job/update`, data }) |
|||
} |
|||
|
|||
// 删除备货任务主
|
|||
export const deleteStockupMainJob = async (id: number) => { |
|||
return await request.delete({ url: `/wms/stockup-main-job/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货任务主 Excel
|
|||
export const exportStockupMainJob = async (params) => { |
|||
return await request.download({ url: `/wms/stockup-main-job/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/stockup-main-job/get-import-template' }) |
|||
} |
@ -0,0 +1,72 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupMainRecordVO { |
|||
id: number |
|||
requestNumber: string |
|||
jobNumber: string |
|||
deliverPlanNumber: string |
|||
fromWarehouseCode: string |
|||
toWarehouseCode: string |
|||
details: string |
|||
outTransactionType: string |
|||
inTransactionType: string |
|||
executeTime: Date |
|||
activeDate: Date |
|||
available: string |
|||
requestTime: Date |
|||
dueTime: Date |
|||
departmentCode: string |
|||
userGroupCode: string |
|||
interfaceType: string |
|||
number: string |
|||
businessType: string |
|||
remark: string |
|||
extraProperties: string |
|||
siteId: string |
|||
code: string |
|||
fromAreaTypes: string |
|||
fromAreaCodes: string |
|||
toAreaTypes: string |
|||
toAreaCodes: string |
|||
} |
|||
|
|||
// 查询备货记录主列表
|
|||
export const getStockupMainRecordPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/stockup-main-record/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/stockup-main-record/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货记录主详情
|
|||
export const getStockupMainRecord = async (id: number) => { |
|||
return await request.get({ url: `/wms/stockup-main-record/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货记录主
|
|||
export const createStockupMainRecord = async (data: StockupMainRecordVO) => { |
|||
return await request.post({ url: `/wms/stockup-main-record/create`, data }) |
|||
} |
|||
|
|||
// 修改备货记录主
|
|||
export const updateStockupMainRecord = async (data: StockupMainRecordVO) => { |
|||
return await request.put({ url: `/wms/stockup-main-record/update`, data }) |
|||
} |
|||
|
|||
// 删除备货记录主
|
|||
export const deleteStockupMainRecord = async (id: number) => { |
|||
return await request.delete({ url: `/wms/stockup-main-record/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货记录主 Excel
|
|||
export const exportStockupMainRecord = async (params) => { |
|||
return await request.download({ url: `/wms/stockup-main-record/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/stockup-main-record/get-import-template' }) |
|||
} |
@ -0,0 +1,73 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StockupMainRequestVO { |
|||
id: number |
|||
deliverPlanNumber: string |
|||
fromWarehouseCode: string |
|||
toWarehouseCode: string |
|||
fromAreaTypes: string |
|||
fromAreaCodes: string |
|||
details: string |
|||
number: string |
|||
businessType: string |
|||
remark: string |
|||
extraProperties: string |
|||
siteId: number |
|||
requestTime: Date |
|||
dueTime: Date |
|||
departmentCode: string |
|||
status: string |
|||
autoCommit: string |
|||
autoAgree: string |
|||
autoExecute: string |
|||
directCreateRecord: string |
|||
concurrencyStamp: string |
|||
ruleUserId: number |
|||
toAreaTypes: string |
|||
toAreaCodes: string |
|||
serialNumber: string |
|||
deliverDate: Date |
|||
inInventoryStatuses: string |
|||
outInventoryStatuses: string |
|||
} |
|||
|
|||
// 查询备货申请主列表
|
|||
export const getStockupMainRequestPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/stockup-main-request/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/stockup-main-request/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询备货申请主详情
|
|||
export const getStockupMainRequest = async (id: number) => { |
|||
return await request.get({ url: `/wms/stockup-main-request/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增备货申请主
|
|||
export const createStockupMainRequest = async (data: StockupMainRequestVO) => { |
|||
return await request.post({ url: `/wms/stockup-main-request/create`, data }) |
|||
} |
|||
|
|||
// 修改备货申请主
|
|||
export const updateStockupMainRequest = async (data: StockupMainRequestVO) => { |
|||
return await request.put({ url: `/wms/stockup-main-request/update`, data }) |
|||
} |
|||
|
|||
// 删除备货申请主
|
|||
export const deleteStockupMainRequest = async (id: number) => { |
|||
return await request.delete({ url: `/wms/stockup-main-request/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出备货申请主 Excel
|
|||
export const exportStockupMainRequest = async (params) => { |
|||
return await request.download({ url: `/wms/stockup-main-request/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/stockup-main-request/get-import-template' }) |
|||
} |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="StockupMainJob.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="StockupMainJob.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="StockupMainJobRules" |
|||
:formAllSchemas="StockupMainJob.allSchemas" |
|||
:apiUpdate="StockupMainJobApi.updateStockupMainJob" |
|||
:apiCreate="StockupMainJobApi.createStockupMainJob" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainJob.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/job/stockup-main-job/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { StockupMainJob,StockupMainJobRules } from './stockupMainJob.data' |
|||
import * as StockupMainJobApi from '@/api/job/stockupMainJob' |
|||
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: 'StockupMainJob' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(StockupMainJob.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: StockupMainJobApi.getStockupMainJobPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainJob:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainJob:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainJob: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:stockupMainJob:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainJob: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 =StockupMainJob.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 StockupMainJobApi.createStockupMainJob(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await StockupMainJobApi.updateStockupMainJob(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, 'basicStockupMainJob') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await StockupMainJobApi.deleteStockupMainJob(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 StockupMainJobApi.exportStockupMainJob(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 StockupMainJobApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,408 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const StockupMainJobRules = reactive({ |
|||
}) |
|||
|
|||
export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发货计划单号', |
|||
field: 'deliverPlanNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '明细', |
|||
field: 'details', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
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: 'requestDueTime', |
|||
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: 'status', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '过期时间', |
|||
field: 'expiredTime', |
|||
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: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'jobStageStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '优先级', |
|||
field: 'priority', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '优先级增量', |
|||
field: 'priorityincrement', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '部门', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '用户组', |
|||
field: 'userGroupCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '承接人用户ID', |
|||
field: 'acceptUserId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '承接人用户名', |
|||
field: 'acceptUserName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '承接时间', |
|||
field: 'acceptTime', |
|||
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: '完成人用户ID', |
|||
field: 'completeUserId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '完成人用户名', |
|||
field: 'completeUserName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completeTime', |
|||
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: 'fromAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
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: 'extraProperties', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '自动完成', |
|||
field: 'autoComplete', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许修改库位', |
|||
field: 'allowModifyLocation', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许修改数量', |
|||
field: 'allowModifyQty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许大于推荐数量', |
|||
field: 'allowBiggerQty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许小于推荐数量', |
|||
field: 'allowSmallerQty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许修改库存状态', |
|||
field: 'allowModifyInventoryStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许连续扫描', |
|||
field: 'allowContinuousScanning', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许部分完成', |
|||
field: 'allowPartialComplete', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '权限所属人员id', |
|||
field: 'ruleUserId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改批次', |
|||
field: 'allowModifyBatch', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '允许修改箱码', |
|||
field: 'allowModifyPackingNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到库区代码范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '工作流流水号', |
|||
field: 'serialNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '入库库存状态范围', |
|||
field: 'inInventoryStatuses', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '出库库存状态范围', |
|||
field: 'outInventoryStatuses', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="StockupMainRecord.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="StockupMainRecord.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="StockupMainRecordRules" |
|||
:formAllSchemas="StockupMainRecord.allSchemas" |
|||
:apiUpdate="StockupMainRecordApi.updateStockupMainRecord" |
|||
:apiCreate="StockupMainRecordApi.createStockupMainRecord" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainRecord.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/record/stockup-main-record/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { StockupMainRecord,StockupMainRecordRules } from './stockupMainRecord.data' |
|||
import * as StockupMainRecordApi from '@/api/record/stockupMainRecord' |
|||
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: 'StockupMainRecord' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(StockupMainRecord.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: StockupMainRecordApi.getStockupMainRecordPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRecord:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainRecord:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRecord: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:stockupMainRecord:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRecord: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 =StockupMainRecord.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 StockupMainRecordApi.createStockupMainRecord(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await StockupMainRecordApi.updateStockupMainRecord(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, 'basicStockupMainRecord') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await StockupMainRecordApi.deleteStockupMainRecord(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 StockupMainRecordApi.exportStockupMainRecord(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 StockupMainRecordApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,272 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const StockupMainRecordRules = reactive({ |
|||
}) |
|||
|
|||
export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '任务单号', |
|||
field: 'jobNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发货计划单号', |
|||
field: 'deliverPlanNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '明细', |
|||
field: 'details', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '出库事务类型', |
|||
field: 'outTransactionType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '入库事务类型', |
|||
field: 'inTransactionType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '执行时间', |
|||
field: 'executeTime', |
|||
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: 'activeDate', |
|||
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: 'available', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
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: 'dueTime', |
|||
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: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '用户组', |
|||
field: 'userGroupCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '接口类型', |
|||
field: 'interfaceType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
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: 'extraProperties', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '代码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从库区类型范围', |
|||
field: 'fromAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到库区代码范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="StockupMainRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="StockupMainRequest.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="StockupMainRequestRules" |
|||
:formAllSchemas="StockupMainRequest.allSchemas" |
|||
:apiUpdate="StockupMainRequestApi.updateStockupMainRequest" |
|||
:apiCreate="StockupMainRequestApi.createStockupMainRequest" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainRequest.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/request/stockup-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { StockupMainRequest,StockupMainRequestRules } from './stockupMainRequest.data' |
|||
import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest/' |
|||
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: 'StockupMainRequest' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(StockupMainRequest.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: StockupMainRequestApi.getStockupMainRequestPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRequest:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainRequest:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRequest: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:stockupMainRequest:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRequest: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 =StockupMainRequest.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 StockupMainRequestApi.createStockupMainRequest(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await StockupMainRequestApi.updateStockupMainRequest(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, 'basicStockupMainRequest') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await StockupMainRequestApi.deleteStockupMainRequest(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 StockupMainRequestApi.exportStockupMainRequest(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 StockupMainRequestApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,264 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const StockupMainRequestRules = reactive({ |
|||
}) |
|||
|
|||
export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '发货计划单号', |
|||
field: 'deliverPlanNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从库区类型范围', |
|||
field: 'fromAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: 'details', |
|||
field: 'details', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
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: 'extraProperties', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
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: 'dueTime', |
|||
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: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '自动提交', |
|||
field: 'autoCommit', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '自动通过', |
|||
field: 'autoAgree', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '自动执行', |
|||
field: 'autoExecute', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '直接生成记录', |
|||
field: 'directCreateRecord', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '权限所属人员id', |
|||
field: 'ruleUserId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到库区范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '工作流流水号', |
|||
field: 'serialNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '发货日期', |
|||
field: 'deliverDate', |
|||
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: 'inInventoryStatuses', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '出库库存状态范围', |
|||
field: 'outInventoryStatuses', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
Loading…
Reference in new issue