Browse Source

缺陷:FWHL-45

hella_online_20250522
赵雪冰 3 weeks ago
parent
commit
1cb1a2a471
  1. 77
      src/api/wms/packagetuomergeDetail/index.ts
  2. 62
      src/api/wms/packagetuomergeMain/index.ts
  3. 252
      src/views/wms/inventoryjobManage/packageManage/packagetuomergeMain/index.vue
  4. 409
      src/views/wms/inventoryjobManage/packageManage/packagetuomergeMain/packagetuomergeMain.data.ts

77
src/api/wms/packagetuomergeDetail/index.ts

@ -0,0 +1,77 @@
import request from '@/config/axios'
export interface PackagetuomergeDetailVO {
id: number
number: string
masterId: number
itemCode: string
itemName: string
itemDesc1: string
itemDesc2: string
uom: string
fromQty: number
toQty: number
fromLocationCode: string
toLocationCode: string
fromLocationGroupCode: string
toLocationGroupCode: string
fromAreaCode: string
toAreaCode: string
fromPackingNumber: string
fromParentPackingNumber: string
fromBatch: string
toPackingNumber: string
toParentPackingNumber: string
toBatch: string
fromInventoryStatus: string
toInventoryStatus: string
fromContainerNumber: string
toContainerNumber: string
fromOwnerCode: string
toOwnerCode: string
interfaceType: string
projectCode: string
remark: string
siteId: string
}
// 查询合托记录子列表
export const getPackagetuomergeDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packagetuomerge-detail/senior', data })
} else {
return await request.get({ url: `/wms/packagetuomerge-detail/page`, params })
}
}
// 查询合托记录子详情
export const getPackagetuomergeDetail = async (id: number) => {
return await request.get({ url: `/wms/packagetuomerge-detail/get?id=` + id })
}
// 新增合托记录子
export const createPackagetuomergeDetail = async (data: PackagetuomergeDetailVO) => {
return await request.post({ url: `/wms/packagetuomerge-detail/create`, data })
}
// 修改合托记录子
export const updatePackagetuomergeDetail = async (data: PackagetuomergeDetailVO) => {
return await request.put({ url: `/wms/packagetuomerge-detail/update`, data })
}
// 删除合托记录子
export const deletePackagetuomergeDetail = async (id: number) => {
return await request.delete({ url: `/wms/packagetuomerge-detail/delete?id=` + id })
}
// 导出合托记录子 Excel
export const exportPackagetuomergeDetail = async (params) => {
return await request.download({ url: `/wms/packagetuomerge-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packagetuomerge-detail/get-import-template' })
}

62
src/api/wms/packagetuomergeMain/index.ts

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface PackagetuomergeMainVO {
id: number
number: string
warehouseCode: string
outTransactionType: string
inTransactionType: string
executeTime: Date
activeDate: Date
available: string
requestTime: Date
dueTime: Date
departmentCode: string
userGroupCode: string
interfaceType: string
businessType: string
remark: string
extraProperties: string
siteId: string
}
// 查询合托记录主列表
export const getPackagetuomergeMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/packagetuomerge-main/senior', data })
} else {
return await request.get({ url: `/wms/packagetuomerge-main/page`, params })
}
}
// 查询合托记录主详情
export const getPackagetuomergeMain = async (id: number) => {
return await request.get({ url: `/wms/packagetuomerge-main/get?id=` + id })
}
// 新增合托记录主
export const createPackagetuomergeMain = async (data: PackagetuomergeMainVO) => {
return await request.post({ url: `/wms/packagetuomerge-main/create`, data })
}
// 修改合托记录主
export const updatePackagetuomergeMain = async (data: PackagetuomergeMainVO) => {
return await request.put({ url: `/wms/packagetuomerge-main/update`, data })
}
// 删除合托记录主
export const deletePackagetuomergeMain = async (id: number) => {
return await request.delete({ url: `/wms/packagetuomerge-main/delete?id=` + id })
}
// 导出合托记录主 Excel
export const exportPackagetuomergeMain = async (params) => {
return await request.download({ url: `/wms/packagetuomerge-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/packagetuomerge-main/get-import-template' })
}

252
src/views/wms/inventoryjobManage/packageManage/packagetuomergeMain/index.vue

@ -0,0 +1,252 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PackagetuomergeMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PackagetuomergeMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
: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" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="PackagetuomergeMainRules"
:formAllSchemas="PackagetuomergeMain.allSchemas"
:apiUpdate="PackagetuomergeMainApi.updatePackagetuomergeMain"
:apiCreate="PackagetuomergeMainApi.createPackagetuomergeMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="PackagetuomergeMain.allSchemas"
:detailAllSchemas="PackagetuomergeDetail.allSchemas"
:detailAllSchemasRules="PackagetuomergeDetailRules"
:apiPage="PackagetuomergeDetailApi.getPackagetuomergeDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PackagetuomergeMain,PackagetuomergeMainRules,PackagetuomergeDetail,PackagetuomergeDetailRules } from './packagetuomergeMain.data'
import * as PackagetuomergeMainApi from '@/api/wms/packagetuomergeMain'
import * as PackagetuomergeDetailApi from '@/api/wms/packagetuomergeDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'PackagetuomergeMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PackagetuomergeMain.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: PackagetuomergeMainApi.getPackagetuomergeMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:packagetuomergeMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:packagetuomergeMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:packagetuomergeMain: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:packagetuomergeMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:packagetuomergeMain: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 =PackagetuomergeMain.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 PackagetuomergeMainApi.createPackagetuomergeMain(data)
message.success(t('common.createSuccess'))
} else {
await PackagetuomergeMainApi.updatePackagetuomergeMain(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, 'basicPackagetuomergeMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PackagetuomergeMainApi.deletePackagetuomergeMain(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 PackagetuomergeMainApi.exportPackagetuomergeMain(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 PackagetuomergeMainApi.importTemplate()
})
</script>

409
src/views/wms/inventoryjobManage/packageManage/packagetuomergeMain/packagetuomergeMain.data.ts

@ -0,0 +1,409 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const PackagetuomergeMainRules = reactive({
})
export const PackagetuomergeMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '包装号',
field: 'toPackingNumber',
sort: 'custom',
},
{
label: '批次',
field: 'batch',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
},
{
label: '标包数量',
field: 'packQty',
sort: 'custom',
},
{
label: '库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '库区代码',
field: 'toAreaCode',
sort: 'custom',
},
{
label: '仓库代码',
field: 'warehouseCode',
sort: 'custom',
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
isTable:false,
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
isTable:false,
},
{
label: '执行时间',
field: 'executeTime',
sort: 'custom',
formatter: dateFormatter,
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'
}
},
isTable:false
},
{
label: '生效日期',
field: 'activeDate',
sort: 'custom',
formatter: dateFormatter,
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'
}
},
isTable:false
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isTable:false
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
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'
}
},
isTable:false
},
{
label: '截止时间',
field: 'dueTime',
sort: 'custom',
formatter: dateFormatter,
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'
}
},
isTable:false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isTable:false
},
{
label: '用户组',
field: 'userGroupCode',
sort: 'custom',
isTable:false
},
{
label: '接口类型',
field: 'interfaceType',
sort: 'custom',
isTable:false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isTable:false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isTable:false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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',
isTable:false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable:false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const PackagetuomergeDetailRules = reactive({
})
export const PackagetuomergeDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: false,
isTable:false,
isForm:false
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
},
{
label: '从数量',
field: 'fromQty',
sort: 'custom',
},
{
label: '到数量',
field: 'toQty',
sort: 'custom',
},
{
label: '来源库位代码',
field: 'fromLocationCode',
sort: 'custom',
},
{
label: '目标库位代码',
field: 'toLocationCode',
sort: 'custom',
},
{
label: '来源库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
isTable:false,
isForm:false
},
{
label: '目标库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
isTable:false,
isForm:false
},
{
label: '来源库区代码',
field: 'fromAreaCode',
sort: 'custom',
isTable:false,
isForm:false
},
{
label: '目标库区代码',
field: 'toAreaCode',
sort: 'custom',
isTable:false,
isForm:false
},
{
label: '从包装号',
field: 'fromPackingNumber',
sort: 'custom',
},
{
label: '从父包装号',
field: 'fromParentPackingNumber',
sort: 'custom',
},
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
},
{
label: '从父包装号',
field: 'toParentPackingNumber',
sort: 'custom',
},
{
label: '从批次',
field: 'fromBatch',
sort: 'custom',
},
{
label: '到批次',
field: 'toBatch',
sort: 'custom',
},
{
label: '从库存状态',
field: 'fromInventoryStatus',
sort: 'custom',
},
{
label: '到库存状态',
field: 'toInventoryStatus',
sort: 'custom',
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
},
{
label: '标包数量',
field: 'packQty',
sort: 'custom',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isForm: false,
isTable:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
isSearch: false,
isForm: false,
isTable:false,
},
]))
Loading…
Cancel
Save