ljlong_2630
1 month ago
13 changed files with 2062 additions and 0 deletions
@ -0,0 +1,60 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface UnfinishedShipmentDetailVO { |
||||
|
id: number |
||||
|
masterId: number |
||||
|
materialCode: string |
||||
|
materialName: string |
||||
|
backNumber: string |
||||
|
materialDescription: string |
||||
|
shipmentQuantity: number |
||||
|
unitPrice: number |
||||
|
lockedQuantity: number |
||||
|
available: string |
||||
|
deletionTime: Date |
||||
|
deleterId: string |
||||
|
extraProperties: string |
||||
|
concurrencyStamp: number |
||||
|
siteId: string |
||||
|
} |
||||
|
|
||||
|
// 查询已发未结发货记录子列表
|
||||
|
export const getUnfinishedShipmentDetailPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/unfinished-shipment-detail/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/unfinished-shipment-detail/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询已发未结发货记录子详情
|
||||
|
export const getUnfinishedShipmentDetail = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/unfinished-shipment-detail/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增已发未结发货记录子
|
||||
|
export const createUnfinishedShipmentDetail = async (data: UnfinishedShipmentDetailVO) => { |
||||
|
return await request.post({ url: `/wms/unfinished-shipment-detail/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改已发未结发货记录子
|
||||
|
export const updateUnfinishedShipmentDetail = async (data: UnfinishedShipmentDetailVO) => { |
||||
|
return await request.put({ url: `/wms/unfinished-shipment-detail/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除已发未结发货记录子
|
||||
|
export const deleteUnfinishedShipmentDetail = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/unfinished-shipment-detail/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出已发未结发货记录子 Excel
|
||||
|
export const exportUnfinishedShipmentDetail = async (params) => { |
||||
|
return await request.download({ url: `/wms/unfinished-shipment-detail/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/unfinished-shipment-detail/get-import-template' }) |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface UnfinishedShipmentMainVO { |
||||
|
id: number |
||||
|
orderNumber: string |
||||
|
shipmentRecordNumber: string |
||||
|
shipmentType: string |
||||
|
customerOrderNumber: string |
||||
|
available: string |
||||
|
deletionTime: Date |
||||
|
deleterId: string |
||||
|
extraProperties: string |
||||
|
concurrencyStamp: number |
||||
|
siteId: string |
||||
|
} |
||||
|
|
||||
|
// 查询已发未结发货记录主列表
|
||||
|
export const getUnfinishedShipmentMainPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/unfinished-shipment-main/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/unfinished-shipment-main/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询已发未结发货记录主详情
|
||||
|
export const getUnfinishedShipmentMain = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/unfinished-shipment-main/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增已发未结发货记录主
|
||||
|
export const createUnfinishedShipmentMain = async (data: UnfinishedShipmentMainVO) => { |
||||
|
return await request.post({ url: `/wms/unfinished-shipment-main/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改已发未结发货记录主
|
||||
|
export const updateUnfinishedShipmentMain = async (data: UnfinishedShipmentMainVO) => { |
||||
|
return await request.put({ url: `/wms/unfinished-shipment-main/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除已发未结发货记录主
|
||||
|
export const deleteUnfinishedShipmentMain = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/unfinished-shipment-main/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出已发未结发货记录主 Excel
|
||||
|
export const exportUnfinishedShipmentMain = async (params) => { |
||||
|
return await request.download({ url: `/wms/unfinished-shipment-main/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/unfinished-shipment-main/get-import-template' }) |
||||
|
} |
@ -0,0 +1,874 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' |
||||
|
|
||||
|
/** |
||||
|
* @returns {Array} 发货记录主表 |
||||
|
*/ |
||||
|
export const DeliverRecordMain = useCrudSchemas( |
||||
|
reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180, |
||||
|
fixed: 'left' |
||||
|
}, |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '申请单号', |
||||
|
field: 'requestNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '任务单号', |
||||
|
field: 'jobNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货记录单号', |
||||
|
field: 'deliverRecordNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isSearch: false, |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
isDetail: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货计划单号', |
||||
|
field: 'deliverPlanNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: true, |
||||
|
isDetail: true |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '客户发货单号',
|
||||
|
// field: 'customerDeliverNumber',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '客户订单号', |
||||
|
field: 'customerOrderNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: true, |
||||
|
isForm: true, |
||||
|
form: { |
||||
|
component: 'Input', |
||||
|
componentProps: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '状态', |
||||
|
field: 'status', |
||||
|
dictType: DICT_TYPE.REQUEST_STATUS, |
||||
|
dictClass: 'string', |
||||
|
isSearch: false, |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
isDetail: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '客户代码', |
||||
|
field: 'customerCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货类型', |
||||
|
field: 'deliverType', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
dictType: DICT_TYPE.DELIVER_TYPE, |
||||
|
dictClass: 'string', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '客户月台代码', |
||||
|
field: 'customerDockCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '承运商', |
||||
|
field: 'carrierCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '运输方式', |
||||
|
field: 'transferMode', |
||||
|
dictType: DICT_TYPE.TRANSFER_MODE, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '车牌号', |
||||
|
field: 'vehiclePlateNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '申请时间', |
||||
|
field: 'requestTime', |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '截止时间', |
||||
|
field: 'dueTime', |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '执行时间', |
||||
|
field: 'executeTime', |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '生效日期', |
||||
|
field: 'activeDate', |
||||
|
formatter: dateFormatter2, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
style: { width: '100%' }, |
||||
|
type: 'date', |
||||
|
dateFormat: 'YYYY-MM-DD', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '从仓库代码', |
||||
|
field: 'fromWarehouseCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '到仓库代码', |
||||
|
field: 'toWarehouseCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库区类型范围', |
||||
|
field: 'fromAreaTypes', |
||||
|
dictType: DICT_TYPE.AREA_TYPE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '到库区类型范围', |
||||
|
field: 'toAreaTypes', |
||||
|
dictType: DICT_TYPE.AREA_TYPE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库区代码范围', |
||||
|
field: 'fromAreaCodes', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '到库区代码范围', |
||||
|
field: 'toAreaCodes', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '从月台代码', |
||||
|
field: 'fromDockCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '出库事务类型', |
||||
|
field: 'outTransactionType', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '入库事务类型', |
||||
|
field: 'inTransactionType', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '业务类型', |
||||
|
field: 'businessType', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '部门', |
||||
|
field: 'departmentCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '接口类型', |
||||
|
field: 'interfaceType', |
||||
|
dictType: DICT_TYPE.INTERFACE_TYPE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
}, |
||||
|
isSearch: false, |
||||
|
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')] |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建者', |
||||
|
field: 'creator', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '代码',
|
||||
|
// field: 'code',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isSearch: false, |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: 'TRUE', |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
]) |
||||
|
) |
||||
|
|
||||
|
//表单校验
|
||||
|
export const DeliverRecordMainRules = reactive({ |
||||
|
requestNumber: [ |
||||
|
{ required: true, message: '请选择申请单号', trigger: 'change' } |
||||
|
], |
||||
|
customerCode: [ |
||||
|
{ required: true, message: '请选择客户代码', trigger: 'change' } |
||||
|
], |
||||
|
customerDockCode: [ |
||||
|
{ required: true, message: '请选择客户月台代码', trigger: 'change' } |
||||
|
], |
||||
|
fromWarehouseCode: [ |
||||
|
{ required: true, message: '请选择从仓库代码', trigger: 'change' } |
||||
|
], |
||||
|
fromAreaTypes: [ |
||||
|
{ required: true, message: '请选择从库区类型范围', trigger: 'change' } |
||||
|
], |
||||
|
fromAreaCodes: [ |
||||
|
{ required: true, message: '请选择从库区代码范围', trigger: 'change' } |
||||
|
], |
||||
|
toWarehouseCode: [ |
||||
|
{ required: true, message: '请选择到仓库代码', trigger: 'change' } |
||||
|
], |
||||
|
toAreaTypes: [ |
||||
|
{ required: true, message: '请选择到库区类型范围', trigger: 'change' } |
||||
|
], |
||||
|
outTransaction: [ |
||||
|
{ required: true, message: '请输入出库事务类型', trigger: 'blur' } |
||||
|
], |
||||
|
inTransaction: [ |
||||
|
{ required: true, message: '请输入入库事务类型', trigger: 'blur' } |
||||
|
], |
||||
|
executeTime: [ |
||||
|
{ required: true, message: '请输入执行时间', trigger: 'change' } |
||||
|
], |
||||
|
activeDate: [ |
||||
|
{ required: true, message: '请输入生效日期', trigger: 'change' } |
||||
|
], |
||||
|
available: [ |
||||
|
{ required: true, message: '请输入是否可用', trigger: 'blur' } |
||||
|
], |
||||
|
departmentCode: [ |
||||
|
{ required: true, message: '请输入部门', trigger: 'blur' } |
||||
|
], |
||||
|
interfaceType: [ |
||||
|
{ required: true, message: '请选择接口类型', trigger: 'change' } |
||||
|
], |
||||
|
number: [ |
||||
|
{ required: true, message: '请输入单据号', trigger: 'blur' } |
||||
|
], |
||||
|
businessType: [ |
||||
|
{ required: true, message: '请输入业务类型', trigger: 'blur' } |
||||
|
], |
||||
|
createTime: [ |
||||
|
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
||||
|
], |
||||
|
creator: [ |
||||
|
{ required: true, message: '请输入创建者', trigger: 'blur' } |
||||
|
], |
||||
|
}) |
||||
|
|
||||
|
/** |
||||
|
* @returns {Array} 发货记录子表 |
||||
|
*/ |
||||
|
export const DeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: false |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '销售订单号',
|
||||
|
// field: 'soNumber',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// },
|
||||
|
// {
|
||||
|
// label: '销售订单行',
|
||||
|
// field: 'soLine',
|
||||
|
// 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 |
||||
|
}, |
||||
|
hiddenInMain: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '物料描述2', |
||||
|
field: 'itemDesc2', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '批次', |
||||
|
field: 'batch', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '包装号', |
||||
|
field: 'packingNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '父包装号', |
||||
|
field: 'parentPackingNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '包装规格', |
||||
|
field: 'packUnit', |
||||
|
isSearch: false, |
||||
|
isTable: false, |
||||
|
isForm:false, |
||||
|
isDetail:false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '数量', |
||||
|
field: 'qty', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '计量单位', |
||||
|
field: 'uom', |
||||
|
dictType: DICT_TYPE.UOM, |
||||
|
dictClass: 'string', |
||||
|
isTable: true, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '单价', |
||||
|
field: 'singlePrice', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '金额', |
||||
|
field: 'amount', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '在途库库位', |
||||
|
field: 'onTheWayLocationCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库位', |
||||
|
field: 'fromLocationCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '到库位', |
||||
|
field: 'toLocationCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库位组', |
||||
|
field: 'fromLocationGroupCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '到库位组', |
||||
|
field: 'toLocationGroupCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从库区', |
||||
|
field: 'fromAreaCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '到库区', |
||||
|
field: 'toAreaCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
hiddenInMain: true, |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '从器具号',
|
||||
|
// field: 'fromContainerNumber',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// isTable: false,
|
||||
|
// },
|
||||
|
// {
|
||||
|
// label: '到器具号',
|
||||
|
// field: 'toContainerNumber',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// isTable: false,
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '库存状态', |
||||
|
field: 'inventoryStatus', |
||||
|
dictType: DICT_TYPE.INVENTORY_STATUS, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '从货主代码', |
||||
|
field: 'fromOwnerCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '到货主代码', |
||||
|
field: 'toOwnerCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '项目代码', |
||||
|
field: 'projectCode', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '接口类型', |
||||
|
field: 'interfaceType', |
||||
|
dictType: DICT_TYPE.INTERFACE_TYPE, |
||||
|
dictClass: 'string', |
||||
|
isTable: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
isTable: true, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
}, |
||||
|
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')] |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建者', |
||||
|
field: 'creator', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isTable: true, |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '任务明细ID',
|
||||
|
// field: 'jobDetailId',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// },
|
||||
|
// {
|
||||
|
// label: '代码',
|
||||
|
// field: 'code',
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// },
|
||||
|
])) |
||||
|
|
||||
|
//表单校验
|
||||
|
export const DeliverRecordDetailRules = reactive({ |
||||
|
// soNumber: [
|
||||
|
// { required: true, message: '请选择销售订单号', trigger: 'change' }
|
||||
|
// ],
|
||||
|
packingNumber: [ |
||||
|
{ required: true, message: '请选择包装号', trigger: 'change' } |
||||
|
], |
||||
|
batch: [ |
||||
|
{ required: true, message: '请输入批次', trigger: 'blur' } |
||||
|
], |
||||
|
inventoryStatus: [ |
||||
|
{ required: true, message: '请选择库存状态', trigger: 'change' } |
||||
|
], |
||||
|
fromLocationCode: [ |
||||
|
{ required: true, message: '请选择从库位代码', trigger: 'change' } |
||||
|
], |
||||
|
fromLocationGroupCode: [ |
||||
|
{ required: true, message: '请选择从库位组代码', trigger: 'change' } |
||||
|
], |
||||
|
fromAreaCode: [ |
||||
|
{ required: true, message: '请选择从库区代码', trigger: 'change' } |
||||
|
], |
||||
|
toLocationCode: [ |
||||
|
{ required: true, message: '请选择到库位代码', trigger: 'change' } |
||||
|
], |
||||
|
toLocationGroupCode: [ |
||||
|
{ required: true, message: '请选择到库位组代码', trigger: 'change' } |
||||
|
], |
||||
|
toAreaCode: [ |
||||
|
{ required: true, message: '请选择到库区代码', trigger: 'change' } |
||||
|
], |
||||
|
number: [ |
||||
|
{ required: true, message: '请输入单据号', trigger: 'blur' } |
||||
|
], |
||||
|
itemCode: [ |
||||
|
{ required: true, message: '请选择物料代码', trigger: 'change' } |
||||
|
], |
||||
|
createTime: [ |
||||
|
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
||||
|
], |
||||
|
creator: [ |
||||
|
{ required: true, message: '请输入创建者', trigger: 'blur' } |
||||
|
], |
||||
|
}) |
@ -0,0 +1,253 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="[...DeliverRecordMain.allSchemas.searchSchema,...DeliverRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="DeliverRecordMain.allSchemas" |
||||
|
:detailAllSchemas="DeliverRecordDetail.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,$index }"> |
||||
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
||||
|
</template> |
||||
|
</Table> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 表单弹窗:添加/修改 --> |
||||
|
<BasicForm |
||||
|
ref="formRef" |
||||
|
@success="getList" |
||||
|
:rules="DeliverRecordMainRules" |
||||
|
:formAllSchemas="DeliverRecordMain.allSchemas" |
||||
|
:tableAllSchemas="DeliverRecordDetail.allSchemas" |
||||
|
:tableFormRules="DeliverRecordDetailRules" |
||||
|
:isBusiness="true" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail |
||||
|
ref="detailRef" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="DeliverRecordMain.allSchemas" |
||||
|
:detailAllSchemas="DeliverRecordDetail.allSchemas" |
||||
|
:detailAllSchemasRules="DeliverRecordDetailRules" |
||||
|
:apiPage="DeliverRecordDetailApi.getDeliverRecordDetailPage" |
||||
|
/> |
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { getAccessToken } from '@/utils/auth' |
||||
|
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules } from './deliverRecordMain.data' |
||||
|
import * as DeliverRecordMainApi from '@/api/wms/deliverRecordMain' |
||||
|
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
||||
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
||||
|
import { formatDate } from '@/utils/formatTime' |
||||
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
||||
|
const { loadStart, loadDone } = usePageLoading() |
||||
|
// 发货记录主 |
||||
|
defineOptions({ name: 'InducedProduct' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const businessType = ref() |
||||
|
const importFileName = ref() |
||||
|
console.log(99 , routeName.value) |
||||
|
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns]) |
||||
|
|
||||
|
const { tableObject, tableMethods } = useTable({ |
||||
|
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 判断 路由名称 进行条件过滤 |
||||
|
/** |
||||
|
* OktoholdRequestMain 合格转隔离 |
||||
|
*/ |
||||
|
if ( routeName.value == 'DeliverRecordMain') { |
||||
|
tableObject.params = { |
||||
|
businessType: 'Deliver' |
||||
|
} |
||||
|
businessType.value = 'Deliver' |
||||
|
importFileName.value = '成品发货记录' |
||||
|
} else if ( routeName.value == 'ZZBJDeliverRecordMain') { |
||||
|
tableObject.params = { |
||||
|
businessType: 'ZZBJDeliver' |
||||
|
} |
||||
|
businessType.value = 'ZZBJDeliver' |
||||
|
importFileName.value = '自制备件发货记录' |
||||
|
} |
||||
|
|
||||
|
// 字段设置 更新主列表字段 |
||||
|
const updataTableColumns = (val) => { |
||||
|
tableColumns.value = val |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultReceiptOfInclusionBtn({hasPermi:`wms:${routeName.value}:import`}), // 导入纳入受领书 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}: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 == '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 if (val == 'receiptOfInclusion') { // 导入纳入受领书 |
||||
|
receiptOfInclusion() |
||||
|
} else { // 其他按钮 |
||||
|
console.log('其他按钮', item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 列表-操作按钮 |
||||
|
const butttondata = (row,$index) => { |
||||
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
||||
|
if(findIndex>-1&&findIndex<$index){ |
||||
|
return [] |
||||
|
}else{ |
||||
|
return [defaultButtons.mainListDocumentPrintBtn(null),] // 标签打印 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 列表-操作按钮事件 |
||||
|
const buttonTableClick = async (val, row) => { |
||||
|
if (val == 'documentPrint') { // 标签打印 |
||||
|
handlePoint(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,'recordDeliverMain') |
||||
|
} |
||||
|
|
||||
|
/** 导出按钮操作 */ |
||||
|
const handleExport = async () => { |
||||
|
try { |
||||
|
// 导出的二次确认 |
||||
|
await message.exportConfirm() |
||||
|
// 发起导出 |
||||
|
loadStart() |
||||
|
const excelTitle = ref(route.meta.title) |
||||
|
const data = await DeliverRecordMainApi.exportDeliverRecordMain(tableObject.params) |
||||
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
||||
|
} catch { |
||||
|
} finally { |
||||
|
loadDone() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
const BASE_URL = getJmreportBaseUrl() |
||||
|
const src = ref(BASE_URL + '/jmreport/view/929209659733770240?token=' + getAccessToken()) |
||||
|
// 标签打印 |
||||
|
const handlePoint = async (row) => { |
||||
|
window.open(src.value+'&id='+row.masterId) |
||||
|
} |
||||
|
|
||||
|
// 筛选提交 |
||||
|
const searchFormClick = (searchData) => { |
||||
|
tableObject.params.isSearch = true |
||||
|
console.log('searchData',searchData.filters); |
||||
|
if(!searchData.filters){//重置的时候应用 |
||||
|
searchData.filters = [] |
||||
|
} |
||||
|
let filters = [...searchData.filters] |
||||
|
if(!filters.find(item=>item.column=='business_type')){ |
||||
|
if ( routeName.value == 'DeliverRecordMain') { |
||||
|
filters = [...filters,{ |
||||
|
action:'==', |
||||
|
column:'business_type', |
||||
|
value:'Deliver', |
||||
|
}] |
||||
|
} else if ( routeName.value == 'ZZBJDeliverRecordMain') { |
||||
|
filters = [...filters,{ |
||||
|
action:'==', |
||||
|
column:'business_type', |
||||
|
value:'ZZBJDeliver', |
||||
|
}] |
||||
|
} |
||||
|
} |
||||
|
tableObject.params.filters = filters |
||||
|
getList() // 刷新当前列表 |
||||
|
} |
||||
|
|
||||
|
/** 导入 */ |
||||
|
const importFormRef = ref() |
||||
|
const receiptOfInclusion = async () => { |
||||
|
importFormRef.value.open() |
||||
|
} |
||||
|
|
||||
|
const importTemplateData = reactive({ |
||||
|
templateUrl: '', |
||||
|
templateTitle: '已发未结发货记录主导入模版.xlsx' |
||||
|
}) |
||||
|
|
||||
|
/** 初始化 **/ |
||||
|
onMounted(async () => { |
||||
|
tableObject.params.businessType = 'inducedProduct' |
||||
|
getList() |
||||
|
if(routeName.value == 'InducedProduct'){ |
||||
|
importTemplateData.templateUrl = await DeliverRecordMainApi.importInducedProductTemplate() |
||||
|
} |
||||
|
}) |
||||
|
</script> |
@ -0,0 +1,244 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="UnfinishedShipmentDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="UnfinishedShipmentDetail.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="UnfinishedShipmentDetailRules" |
||||
|
:formAllSchemas="UnfinishedShipmentDetail.allSchemas" |
||||
|
:apiUpdate="UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail" |
||||
|
:apiCreate="UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="UnfinishedShipmentDetail.allSchemas" /> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from './unfinishedShipmentDetail.data' |
||||
|
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail' |
||||
|
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: 'UnfinishedShipmentDetail' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(UnfinishedShipmentDetail.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: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:unfinishedShipmentDetail:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:unfinishedShipmentDetail:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:unfinishedShipmentDetail: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:unfinishedShipmentDetail:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:unfinishedShipmentDetail: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 =UnfinishedShipmentDetail.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 UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail(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, 'basicUnfinishedShipmentDetail') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await UnfinishedShipmentDetailApi.deleteUnfinishedShipmentDetail(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 UnfinishedShipmentDetailApi.exportUnfinishedShipmentDetail(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 UnfinishedShipmentDetailApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,182 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const UnfinishedShipmentDetailRules = reactive({ |
||||
|
materialCode: [required], |
||||
|
materialName: [required], |
||||
|
backNumber: [required], |
||||
|
materialDescription: [required], |
||||
|
shipmentQuantity: [required], |
||||
|
unitPrice: [required], |
||||
|
lockedQuantity: [required], |
||||
|
available: [required], |
||||
|
concurrencyStamp: [required] |
||||
|
}) |
||||
|
|
||||
|
export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '自增主键', |
||||
|
field: 'id', |
||||
|
sort: 'custom', |
||||
|
isForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '父主键', |
||||
|
field: 'masterId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '物料代码', |
||||
|
field: 'materialCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '物料名称', |
||||
|
field: 'materialName', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '背番', |
||||
|
field: 'backNumber', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '物料描述', |
||||
|
field: 'materialDescription', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'Editor', |
||||
|
componentProps: { |
||||
|
valueHtml: '', |
||||
|
height: 200 |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货数量', |
||||
|
field: 'shipmentQuantity', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '销售单价', |
||||
|
field: 'unitPrice', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '锁定数量', |
||||
|
field: 'lockedQuantity', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
sort: 'custom', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: 'TRUE', |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: '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: 'deletionTime', |
||||
|
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: 'deleterId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '扩展属性', |
||||
|
field: 'extraProperties', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '并发乐观锁', |
||||
|
field: 'concurrencyStamp', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '地点id', |
||||
|
field: 'siteId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,252 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="UnfinishedShipmentMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="UnfinishedShipmentMain.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="UnfinishedShipmentMainRules" |
||||
|
:formAllSchemas="UnfinishedShipmentMain.allSchemas" |
||||
|
:apiUpdate="UnfinishedShipmentMainApi.updateUnfinishedShipmentMain" |
||||
|
:apiCreate="UnfinishedShipmentMainApi.createUnfinishedShipmentMain" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail |
||||
|
ref="detailRef" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="UnfinishedShipmentMain.allSchemas" |
||||
|
:detailAllSchemas="UnfinishedShipmentDetail.allSchemas" |
||||
|
:detailAllSchemasRules="UnfinishedShipmentDetailRules" |
||||
|
/> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { UnfinishedShipmentMain,UnfinishedShipmentMainRules } from './unfinishedShipmentMain.data' |
||||
|
import * as UnfinishedShipmentMainApi from '@/api/wms/unfinishedShipmentMain' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
|
import { UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from '../unfinishedShipmentDetail/unfinishedShipmentDetail.data' |
||||
|
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail' |
||||
|
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: 'UnfinishedShipmentMain' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(UnfinishedShipmentMain.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: UnfinishedShipmentMainApi.getUnfinishedShipmentMainPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:unfinishedShipmentMain:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:unfinishedShipmentMain:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:unfinishedShipmentMain: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:unfinishedShipmentMain:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:unfinishedShipmentMain: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 =UnfinishedShipmentMain.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 UnfinishedShipmentMainApi.createUnfinishedShipmentMain(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await UnfinishedShipmentMainApi.updateUnfinishedShipmentMain(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, 'basicUnfinishedShipmentMain') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await UnfinishedShipmentMainApi.deleteUnfinishedShipmentMain(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 UnfinishedShipmentMainApi.exportUnfinishedShipmentMain(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 UnfinishedShipmentMainApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,75 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const UnfinishedShipmentMainRules = reactive({ |
||||
|
orderNumber: [required], |
||||
|
shipmentRecordNumber: [required], |
||||
|
shipmentType: [required], |
||||
|
customerOrderNumber: [required], |
||||
|
available: [required], |
||||
|
concurrencyStamp: [required] |
||||
|
}) |
||||
|
|
||||
|
export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
|
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'code', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货记录单号', |
||||
|
field: 'shipmentRecordNumber', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '发货类型', |
||||
|
field: 'shipmentType', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'SelectV2' |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '客户订单号', |
||||
|
field: 'customerOrderNumber', |
||||
|
sort: 'custom', |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建人', |
||||
|
field: 'creator', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
isForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
sort: 'custom', |
||||
|
formatter: dateFormatter, |
||||
|
isSearch: true, |
||||
|
search: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
type: 'daterange', |
||||
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
||||
|
} |
||||
|
}, |
||||
|
isForm: false |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
Loading…
Reference in new issue