Browse Source

翻包申请任务记录

master_hella_20240701
陈薪名 8 months ago
parent
commit
414b78e0c1
  1. 71
      src/api/wms/packageoverJobDetail/index.ts
  2. 81
      src/api/wms/packageoverJobMain/index.ts
  3. 63
      src/api/wms/packageoverMain/index.ts
  4. 14
      src/api/wms/packageoverRecordDetail/index.ts
  5. 66
      src/api/wms/packageoverRecordMain/index.ts
  6. 70
      src/api/wms/packageoverRequestDetail/index.ts
  7. 96
      src/api/wms/packageoverRequestMain/index.ts
  8. 254
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue
  9. 816
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts
  10. 12
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue
  11. 0
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts
  12. 439
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue
  13. 889
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/packageoverRequestMain.data.ts

71
src/api/wms/packageoverJobDetail/index.ts

@ -0,0 +1,71 @@
import request from '@/config/axios'
export interface PackageoverJobDetailVO {
id: number
number: string
batch: string
itemCode: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
fromPackingNumber: string
toPackingNumber: string
fromPackUnit: string
toPackUnit: string
fromPackQty: number
toPackQty: number
fromLocationGroupCode: string
toLocationGroupCode: string
fromAreaCode: string
toAreaCode: string
fromLocationCode: string
toLocationCode: string
fromOwnerCode: string
toOwnerCode: string
inventoryStatus: string
remark: string
}
// 查询翻包任务子列表
export const getPackageoverJobDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-job-detail/senior', data })
} else {
return await request.get({ url: `/wms/packageover-job-detail/page`, params })
}
}
// 查询翻包任务子详情
export const getPackageoverJobDetail = async (id: number) => {
return await request.get({ url: `/wms/packageover-job-detail/get?id=` + id })
}
// 新增翻包任务子
export const createPackageoverJobDetail = async (data: PackageoverJobDetailVO) => {
return await request.post({ url: `/wms/packageover-job-detail/create`, data })
}
// 修改翻包任务子
export const updatePackageoverJobDetail = async (data: PackageoverJobDetailVO) => {
return await request.put({ url: `/wms/packageover-job-detail/update`, data })
}
// 删除翻包任务子
export const deletePackageoverJobDetail = async (id: number) => {
return await request.delete({ url: `/wms/packageover-job-detail/delete?id=` + id })
}
// 导出翻包任务子 Excel
export const exportPackageoverJobDetail = async (params) => {
return await request.download({ url: `/wms/packageover-job-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packageover-job-detail/get-import-template' })
}

81
src/api/wms/packageoverJobMain/index.ts

@ -0,0 +1,81 @@
import request from '@/config/axios'
export interface PackageoverJobMainVO {
id: number
requestNumber: string
status: string
requestTime: Date
requestDueTime: Date
expiredTime: Date
number: string
priority: number
priorityIncrement: number
acceptUserId: string
acceptUserName: string
acceptTime: Date
completeUserId: string
completeUserName: string
completeTime: Date
autoComplete: string
allowModifyLocation: string
allowModifyQty: string
allowBiggerQty: string
allowSmallerQty: string
allowModifyInventoryStatus: string
allowContinuousScanning: string
allowPartialComplete: string
allowModifyBatch: string
allowModifyPackingNumber: string
fromWarehouseCode: string
toWarehouseCode: string
fromAreaCodes: string
toAreaCodes: string
fromAreaTypes: string
toAreaTypes: string
inInventoryStatuses: string
outInventoryStatuses: string
businessType: string
departmentCode: string
remark: string
}
// 查询翻包任务主列表
export const getPackageoverJobMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-job-main/senior', data })
} else {
return await request.get({ url: `/wms/packageover-job-main/page`, params })
}
}
// 查询翻包任务主详情
export const getPackageoverJobMain = async (id: number) => {
return await request.get({ url: `/wms/packageover-job-main/get?id=` + id })
}
// 新增翻包任务主
export const createPackageoverJobMain = async (data: PackageoverJobMainVO) => {
return await request.post({ url: `/wms/packageover-job-main/create`, data })
}
// 修改翻包任务主
export const updatePackageoverJobMain = async (data: PackageoverJobMainVO) => {
return await request.put({ url: `/wms/packageover-job-main/update`, data })
}
// 删除翻包任务主
export const deletePackageoverJobMain = async (id: number) => {
return await request.delete({ url: `/wms/packageover-job-main/delete?id=` + id })
}
// 导出翻包任务主 Excel
export const exportPackageoverJobMain = async (params) => {
return await request.download({ url: `/wms/packageover-job-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packageover-job-main/get-import-template' })
}

63
src/api/wms/packageoverMain/index.ts

@ -1,63 +0,0 @@
import request from '@/config/axios'
export interface PackageoverMainVO {
id: number
warehouseCode: 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
}
// 查询翻包记录主列表
export const getPackageoverMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-main/senior', data })
} else {
return await request.get({ url: `/wms/packageover-main/page`, params })
}
}
// 查询翻包记录主详情
export const getPackageoverMain = async (id: number) => {
return await request.get({ url: '/wms/packageover-main/get?id=' + id })
}
// 新增翻包记录主
export const createPackageoverMain = async (data: PackageoverMainVO) => {
return await request.post({ url: '/wms/packageover-main/create', data })
}
// 修改翻包记录主
export const updatePackageoverMain = async (data: PackageoverMainVO) => {
return await request.put({ url: '/wms/packageover-main/update', data })
}
// 删除翻包记录主
export const deletePackageoverMain = async (id: number) => {
return await request.delete({ url: '/wms/packageover-main/delete?id=' + id })
}
// 导出翻包记录主 Excel
export const exportPackageoverMainApi = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/packageover-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/packageover-main/export-excel`, params })
}
}

14
src/api/wms/packageoverDetail/index.ts → src/api/wms/packageoverRecordDetail/index.ts

@ -35,33 +35,33 @@ export const getPackageoverDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-detail/senior', data })
return await request.post({ url: '/wms/packageover-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/packageover-detail/page`, params })
return await request.get({ url: `/wms/packageover-record-detail/page`, params })
}
}
// 查询翻包记录子详情
export const getPackageoverDetail = async (id: number) => {
return await request.get({ url: '/wms/packageover-detail/get?id=' + id })
return await request.get({ url: '/wms/packageover-record-detail/get?id=' + id })
}
// 新增翻包记录子
export const createPackageoverDetail = async (data: PackageoverDetailVO) => {
return await request.post({ url: '/wms/packageover-detail/create', data })
return await request.post({ url: '/wms/packageover-record-detail/create', data })
}
// 修改翻包记录子
export const updatePackageoverDetail = async (data: PackageoverDetailVO) => {
return await request.put({ url: '/wms/packageover-detail/update', data })
return await request.put({ url: '/wms/packageover-record-detail/update', data })
}
// 删除翻包记录子
export const deletePackageoverDetail = async (id: number) => {
return await request.delete({ url: '/wms/packageover-detail/delete?id=' + id })
return await request.delete({ url: '/wms/packageover-record-detail/delete?id=' + id })
}
// 导出翻包记录子 Excel
export const exportPackageoverDetailApi = async (params) => {
return await request.download({ url: '/wms/packageover-detail/export-excel', params })
return await request.download({ url: '/wms/packageover-record-detail/export-excel', params })
}

66
src/api/wms/packageoverRecordMain/index.ts

@ -0,0 +1,66 @@
import request from '@/config/axios'
export interface PackageoverMainVO {
id: number
number: string
status: string
requestTime: Date
dueTime: Date
fromWarehouseCode: string
toWarehouseCode: string
fromAreaTypes: string
toAreaTypes: string
fromAreaCodes: string
toAreaCodes: string
inInventoryStatuses: string
outInventoryStatuses: string
autoCommit: string
autoAgree: string
autoExecute: string
directCreateRecord: string
departmentCode: string
remark: string
businessType: string
concurrencyStamp: number
}
// 查询翻包申请主列表
export const getPackageoverMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-record-main/senior', data })
} else {
return await request.get({ url: `/wms/packageover-record-main/page`, params })
}
}
// 查询翻包申请主详情
export const getPackageoverMain = async (id: number) => {
return await request.get({ url: `/wms/packageover-record-main/get?id=` + id })
}
// 新增翻包申请主
export const createPackageoverMain = async (data: PackageoverMainVO) => {
return await request.post({ url: `/wms/packageover-record-main/create`, data })
}
// 修改翻包申请主
export const updatePackageoverMain = async (data: PackageoverMainVO) => {
return await request.put({ url: `/wms/packageover-record-main/update`, data })
}
// 删除翻包申请主
export const deletePackageoverMain = async (id: number) => {
return await request.delete({ url: `/wms/packageover-record-main/delete?id=` + id })
}
// 导出翻包申请主 Excel
export const exportPackageoverMain = async (params) => {
return await request.download({ url: `/wms/packageover-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packageover-record-main/get-import-template' })
}

70
src/api/wms/packageoverRequestDetail/index.ts

@ -0,0 +1,70 @@
import request from '@/config/axios'
export interface PackageoverRequestDetailVO {
id: number
number: string
batch: string
itemCode: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
fromPackUnit: string
toPackUnit: string
fromPackQty: number
toPackQty: number
fromLocationCode: string
toLocationCode: string
fromLocationGroupCode: string
toLocationGroupCode: string
fromAreaCode: string
toAreaCode: string
inventoryStatus: string
remark: string
masterId: number
fromOwnerCode: string
toOwnerCode: string
}
// 查询翻包申请子列表
export const getPackageoverRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/packageover-request-detail/page`, params })
}
}
// 查询翻包申请子详情
export const getPackageoverRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/packageover-request-detail/get?id=` + id })
}
// 新增翻包申请子
export const createPackageoverRequestDetail = async (data: PackageoverRequestDetailVO) => {
return await request.post({ url: `/wms/packageover-request-detail/create`, data })
}
// 修改翻包申请子
export const updatePackageoverRequestDetail = async (data: PackageoverRequestDetailVO) => {
return await request.put({ url: `/wms/packageover-request-detail/update`, data })
}
// 删除翻包申请子
export const deletePackageoverRequestDetail = async (id: number) => {
return await request.delete({ url: `/wms/packageover-request-detail/delete?id=` + id })
}
// 导出翻包申请子 Excel
export const exportPackageoverRequestDetail = async (params) => {
return await request.download({ url: `/wms/packageover-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packageover-request-detail/get-import-template' })
}

96
src/api/wms/packageoverRequestMain/index.ts

@ -0,0 +1,96 @@
import request from '@/config/axios'
export interface PackageoverRequestMainVO {
id: number
number: string
status: string
requestTime: Date
dueTime: Date
fromWarehouseCode: string
toWarehouseCode: string
fromAreaTypes: string
toAreaTypes: string
fromAreaCodes: string
toAreaCodes: string
inInventoryStatuses: string
outInventoryStatuses: string
autoCommit: string
autoAgree: string
autoExecute: string
directCreateRecord: string
departmentCode: string
remark: string
businessType: string
concurrencyStamp: number
}
// 查询翻包申请主列表
export const getPackageoverRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packageover-request-main/senior', data })
} else {
return await request.get({ url: `/wms/packageover-request-main/page`, params })
}
}
// 查询翻包申请主详情
export const getPackageoverRequestMain = async (id: number) => {
return await request.get({ url: `/wms/packageover-request-main/get?id=` + id })
}
// 新增翻包申请主
export const createPackageoverRequestMain = async (data: PackageoverRequestMainVO) => {
return await request.post({ url: `/wms/packageover-request-main/create`, data })
}
// 修改翻包申请主
export const updatePackageoverRequestMain = async (data: PackageoverRequestMainVO) => {
return await request.put({ url: `/wms/packageover-request-main/update`, data })
}
// 删除翻包申请主
export const deletePackageoverRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/packageover-request-main/delete?id=` + id })
}
// 导出翻包申请主 Excel
export const exportPackageoverRequestMain = async (params) => {
return await request.download({ url: `/wms/packageover-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packageover-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/packageover-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/packageover-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/packageover-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/packageover-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/packageover-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/packageover-request-main/handle?id=' + id })
}

254
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/index.vue

@ -0,0 +1,254 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PackageoverJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PackageoverJobMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<!-- <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> -->
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PackageoverJobMainRules"
:formAllSchemas="PackageoverJobMain.allSchemas"
:tableAllSchemas="PackageoverJobDetail.allSchemas"
:tableFormRules="PackageoverJobDetailRules"
:apiUpdate="PackageoverJobMainApi.updatePackageoverJobMain"
:apiCreate="PackageoverJobMainApi.createPackageoverJobMain"
:isBusiness="true"
@searchTableSuccess="searchTableSuccess"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PackageoverJobMain.allSchemas"
:detailAllSchemas="PackageoverJobDetail.allSchemas"
:detailAllSchemasRules="PackageoverJobDetailRules"
:apiPage="PackageoverJobDetailApi.getPackageoverJobDetailPage"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/packageover-job-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PackageoverJobMain,PackageoverJobMainRules,PackageoverJobDetail,PackageoverJobDetailRules } from './packageoverJobMain.data'
import * as PackageoverJobMainApi from '@/api/wms/packageoverJobMain'
import * as PackageoverJobDetailApi from '@/api/wms/packageoverJobDetail'
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: 'PackageoverJobMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PackageoverJobMain.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: PackageoverJobMainApi.getPackageoverJobMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:packageover-job-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:packageover-job-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:packageover-job-main: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:packageover-job-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:packageover-job-main: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 =PackageoverJobMain.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 PackageoverJobMainApi.createPackageoverJobMain(data)
message.success(t('common.createSuccess'))
} else {
await PackageoverJobMainApi.updatePackageoverJobMain(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, 'basicPackageoverJobMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PackageoverJobMainApi.deletePackageoverJobMain(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 PackageoverJobMainApi.exportPackageoverJobMain(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 PackageoverJobMainApi.importTemplate()
})
</script>

816
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverJobMain/packageoverJobMain.data.ts

@ -0,0 +1,816 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
export const PackageoverJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '要求截止时间',
field: 'requestDueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '过期时间',
field: 'expiredTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '自动完成',
field: 'autoComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改数量',
field: 'allowModifyQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 180
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 180
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 180
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '承接人用户名',
field: 'acceptUserId',
sort: 'custom',
table: {
width: 150
},
},
{
label: '承接时间',
field: 'acceptTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '完成人用户名',
field: 'completeUserId',
sort: 'custom',
table: {
width: 150
},
},
{
label: '完成时间',
field: 'completeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 120
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后更新者',
field: 'update',
sort: 'custom',
table: {
width: 150
},
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
// 表单校验
export const PackageoverJobMainRules = reactive({
})
export const PackageoverJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从包装号',
field: 'fromPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从包装规格',
field: 'fromPackUnit',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到包装规格',
field: 'toPackUnit',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从标包数量',
field: 'fromPackQty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到标包数量',
field: 'toPackQty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后更新者',
field: 'update',
sort: 'custom',
table: {
width: 150
},
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
// 表单校验
export const PackageoverJobDetailRules = reactive({
})

12
src/views/wms/inventoryjobManage/packageManage/packageoverMain/index.vue → src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue

@ -56,15 +56,15 @@
:allSchemas="PackageoverMain.allSchemas"
:detailAllSchemas="PackageoverDetail.allSchemas"
:detailAllSchemasRules="PackageoverDetailRules"
:apiPage="PackageoverDetailApi.getPackageoverDetailPage"
:apiPage="PackageoverRecordDetailApi.getPackageoverDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PackageoverMain,PackageoverMainRules, PackageoverDetail, PackageoverDetailRules } from './packageoverMain.data'
import * as PackageoverMainApi from '@/api/wms/packageoverMain'
import * as PackageoverDetailApi from '@/api/wms/packageoverDetail'
import { PackageoverMain,PackageoverMainRules, PackageoverDetail, PackageoverDetailRules } from './packageoverRecordMain.data'
import * as PackageoverRecordMainApi from '@/api/wms/packageoverRecordMain'
import * as PackageoverRecordDetailApi from '@/api/wms/packageoverRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
//
@ -84,7 +84,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: PackageoverMainApi.getPackageoverMainPage //
getListApi: PackageoverRecordMainApi.getPackageoverMainPage //
})
//
@ -139,7 +139,7 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await PackageoverMainApi.exportPackageoverMainApi(tableObject.params)
const data = await PackageoverRecordMainApi.exportPackageoverMainApi(tableObject.params)
download.excel(data, '翻包记录.xlsx')
} catch {
} finally {

0
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverMain.data.ts → src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts

439
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue

@ -0,0 +1,439 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PackageoverRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PackageoverRequestMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PackageoverRequestMainRules"
:formAllSchemas="PackageoverRequestMain.allSchemas"
:tableAllSchemas="PackageoverRequestDetail.allSchemas"
:tableFormRules="PackageoverRequestDetailRules"
:tableData="tableData"
:apiUpdate="PackageoverRequestMainApi.updatePackageoverRequestMain"
:apiCreate="PackageoverRequestMainApi.createPackageoverRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PackageoverRequestMain.allSchemas"
:detailAllSchemas="PackageoverRequestDetail.allSchemas"
:detailAllSchemasRules="PackageoverRequestDetailRules"
:apiCreate="PackageoverRequestDetailApi.createPackageoverRequestDetail"
:apiUpdate="PackageoverRequestDetailApi.updatePackageoverRequestDetail"
:apiPage="PackageoverRequestDetailApi.getPackageoverRequestDetailPage"
:apiDelete="PackageoverRequestDetailApi.deletePackageoverRequestDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess"
:updateIsDisable="true" :coverIsDisable="true" :mode="2"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { PackageoverRequestMain,PackageoverRequestMainRules, PackageoverRequestDetail, PackageoverRequestDetailRules } from './packageoverRequestMain.data'
import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain'
import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'PackageoverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PackageoverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
if (formField == 'itemCode') {
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['qty'] = val[0]['qty']
row['batch'] = val[0]['batch']
row['fromLocationCode'] = val[0]['locationCode']
row['toLocationCode'] = val[0]['locationCode']
row['fromLocationGroupCode'] = val[0]['locationGroupCode']
row['toLocationGroupCode'] = val[0]['locationGroupCode']
row['fromAreaCode'] = val[0]['areaCode']
row['toAreaCode'] = val[0]['areaCode']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['fromPackUnit'] = val[0]['packUnit']
row['fromPackQty'] = val[0]['packQty']
} else if (formField == 'toPackUnit') {
row['toPackUnit'] = val[0]['packUnit']
row['toPackQty'] = val[0]['packQty']
} else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'fromWarehouseCode') {
setV['fromWarehouseCode'] = val[0]['code']
setV['toWarehouseCode'] = val[0]['code']
}
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['qty'] = val[0]['qty']
setV['batch'] = val[0]['batch']
setV['fromLocationCode'] = val[0]['locationCode']
setV['toLocationCode'] = val[0]['locationCode']
setV['fromLocationGroupCode'] = val[0]['locationGroupCode']
setV['toLocationGroupCode'] = val[0]['locationGroupCode']
setV['fromAreaCode'] = val[0]['areaCode']
setV['toAreaCode'] = val[0]['areaCode']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['fromPackUnit'] = val[0]['packUnit']
setV['fromPackQty'] = val[0]['packQty']
} else if (formField == 'toPackUnit') {
setV['toPackUnit'] = val[0]['packUnit']
setV['toPackQty'] = val[0]['packQty']
} else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
const { tableObject, tableMethods } = useTable({
getListApi: PackageoverRequestMainApi.getPackageoverRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:packageover-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:packageover-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:packageover-request-main: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') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:packageover-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:packageover-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:packageover-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:packageover-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:packageover-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:packageover-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:packageover-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:issue-request-main:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
PackageoverRequestMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
await message.confirm('确认要重新添加吗?')
tableObject.loading = true
PackageoverRequestMainApi.reAdd(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainSubmit') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
PackageoverRequestMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainTurnDown') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
PackageoverRequestMainApi.refused(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainApprove') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
PackageoverRequestMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?')
tableObject.loading = true
PackageoverRequestMainApi.handle(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await PackageoverRequestMainApi.deletePackageoverRequestMain(id)
tableObject.loading = false
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 PackageoverRequestMainApi.exportPackageoverRequestMain(tableObject.params)
download.excel(data, '翻包申请.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
PackageoverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
let tableForm = JSON.parse(JSON.stringify(tableFormKeys))
tableData.value.push(tableForm)
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
if(tableData.value.find(item => (item.toPackUnit == item.fromPackUnit))) {
message.warning('从包装规格与到包装规格不能相同')
formRef.value.formLoading = false
return
}
if(tableData.value.find(item => (item.qty <= 0))) {
message.warning('数量必须大于0')
formRef.value.formLoading = false
return
}
try {
if (formType === 'create') {
await PackageoverRequestMainApi.createPackageoverRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await PackageoverRequestMainApi.updatePackageoverRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = 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 PackageoverRequestMainApi.importTemplate()
})
</script>

889
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/packageoverRequestMain.data.ts

@ -0,0 +1,889 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as WarehouseApi from '@/api/wms/warehouse'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as ItempackagingApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
// 获取自动提交自动通过自动执行,跳过任务直接生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'PackageOverRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray:any = [userDept]
export const PackageoverRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style:{width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
isTable: false,
isForm: false
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
isTable: false,
isForm: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
form: {
value: 'OverPackage',
componentProps: {
disabled: true
}
},
isForm: false
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 180,
fixed: 'right'
}
}
]))
// 表单校验
export const PackageoverRequestMainRules = reactive({
fromWarehouseCode: [
{ required: true, message: '请选择仓库代码', trigger: 'change' }
],
})
export const PackageoverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[
// {
// key: 'locationCode',
// value: 'fromLocationCode',
// message: '请填写从库位代码!',
// isMainValue: true
// },
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
}]
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition:[
// {
// key: 'locationCode',
// value: 'fromLocationCode',
// message: '请填写从库位代码!',
// isMainValue: true
// },
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
}]
},
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 100
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 120
},
tableForm:{
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从包装规格',
field: 'fromPackUnit',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
tableForm:{
isInpuFocusShow: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'itemCode',
value: 'itemCode',
message: '请先选择物料代码!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}]
}
}
},
{
label: '到包装规格',
field: 'toPackUnit',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
tableForm:{
isInpuFocusShow: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'itemCode',
value: 'itemCode',
message: '请先选择物料代码!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}]
}
}
},
{
label: '从标包数量',
field: 'fromPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到标包数量',
field: 'toPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 120
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 110
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
isForm: false,
isTable: true,
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',
}
},
isTableForm: false,
},
{
label: '创建者',
field: 'creator',
isTable: true,
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
isTableForm: false,
},
{
label: '最后更新者',
field: 'updater',
isForm: false,
isTable: true,
table: {
width: 150
},
isTableForm: false,
}
]))
// 表单校验
export const PackageoverRequestDetailRules = reactive({
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
fromPackUnit: [
{ required: true, message: '请选择从包装规格', trigger: 'change' }
],
toPackUnit: [
{ required: true, message: '请选择到包装规格', trigger: 'change' }
],
})
Loading…
Cancel
Save