Browse Source

Merge branch 'intex' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into intex

intex_online20250629
张立 4 weeks ago
parent
commit
b16d7ab15a
  1. 89
      src/api/wms/balanceDifference/index.ts
  2. 62
      src/api/wms/differenceRecordDetail/index.ts
  3. 62
      src/api/wms/differenceRequestDetail/index.ts
  4. 87
      src/api/wms/differenceRequestMain/index.ts
  5. 26
      src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts
  6. 2
      src/views/wms/basicDataManage/itemPull/index.vue
  7. 39
      src/views/wms/basicDataManage/itemPull/itemPull.data.ts
  8. 23
      src/views/wms/basicDataManage/supplierManage/modelDeliTime/index.vue
  9. 623
      src/views/wms/basicDataManage/supplierManage/modelDeliTime/modelDeliTime.data.ts
  10. 3
      src/views/wms/countManage/count/countConfig/countConfig.data.ts
  11. 130
      src/views/wms/countManage/count/countConfig/index.vue
  12. 853
      src/views/wms/inventoryManage/balanceDifference/balance.data.ts
  13. 444
      src/views/wms/inventoryManage/balanceDifference/index.vue
  14. 195
      src/views/wms/inventoryManage/differenceRecord/differenceRecord.data.ts
  15. 273
      src/views/wms/inventoryManage/differenceRecord/index.vue
  16. 342
      src/views/wms/inventoryManage/differenceRequest/differenceRequest.data.ts
  17. 476
      src/views/wms/inventoryManage/differenceRequest/index.vue
  18. 47
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/packageoverRequestMain.data.ts
  19. 6
      src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue
  20. 53
      src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts
  21. 6
      src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue
  22. 90
      src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts
  23. 1
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue
  24. 19
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts
  25. 68
      src/views/wms/issueManage/repleinshItemCodeConsumeRecord/repleinshItemCodeConsumeRecord.data.ts

89
src/api/wms/balanceDifference/index.ts

@ -0,0 +1,89 @@
import request from '@/config/axios'
export interface BalanceVO {
packingNumber: string
containerNumber: string
itemCode: string
batch: string
altBatch: string
arriveDate: Date
produceDate: Date
expireDate: Date
inventoryStatus: string
locationCode: string
locationGroupCode: string
areaCode: string
warehouseCode: string
erpLocationCode: string
ownerCode: string
uom: string
qty: number
lockedQty: number
usableQty: number
singlePrice: number
amount: number
putInTime: Date
frozen: string
frozenReason: string
lastTransNumber: string
weight: number
area: number
volume: number
}
export const getTransactionBalancePage = async (params) => {
params.areaCode = "DIFF";
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/transaction/senior', data })
} else {
return await request.get({ url: `/wms/transaction/page_balance`, params })
}
}
// 查询库存余额列表(包括已冻结,已失效的物料)
export const getBalancePageAll = async (params) => {
params.locationCode = "DIFF";
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balanceDIFF/seniorAll', data })
} else {
return await request.get({ url: `/wms/balanceDIFF/pageAll`, params })
}
}
// 导出库存余额 Excel
export const exportBalance = async (params) => {
params.locationCode = "DIFF";
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/balanceDIFF/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/balanceDIFF/export-excel`, params })
}
}
// 查询库存余额列表(包括已冻结,已失效的物料)
export const getBalancePageAllDiff = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balanceDIFF/seniorAll', data })
} else {
return await request.get({ url: `/wms/balanceDIFF/pageAll`, params })
}
}
// 查询库存余额列表增加物料筛选条件
export const getBalanceItemPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balanceDIFF/seniorItems', data })
} else {
return await request.get({ url: `/wms/balanceDIFF/pageItems`, params })
}
}

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

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface DifferenceRecordDetailVO {
id: number
packingNumber: string
containerNumber: string
batch: string
fromLocationCode: string
inventoryStatus: string
masterId: number
number: string
itemCode: string
remark: string
siteId: string
itemName: string
itemDesc1: string
itemDesc2: string
qty: number
uom: string
concurrencyStamp: number
}
// 查询差异出库记录子列表
export const getDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/difference-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/difference-record-detail/page`, params })
}
}
// 查询差异出库记录子详情
export const getDetail = async (id: number) => {
return await request.get({ url: `/wms/difference-record-detail/get?id=` + id })
}
// 新增差异出库记录子
export const createDetail = async (data: DifferenceRecordDetailVO) => {
return await request.post({ url: `/wms/difference-record-detail/create`, data })
}
// 修改差异出库记录子
export const updateDetail = async (data: DifferenceRecordDetailVO) => {
return await request.put({ url: `/wms/difference-record-detail/update`, data })
}
// 删除差异出库记录子
export const deleteDetail = async (id: number) => {
return await request.delete({ url: `/wms/difference-record-detail/delete?id=` + id })
}
// 导出差异出库记录子 Excel
export const exportDetail = async (params) => {
return await request.download({ url: `/wms/difference-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/difference-record-detail/get-import-template' })
}

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

@ -0,0 +1,62 @@
import request from '@/config/axios'
export interface DifferenceRequestDetailVO {
id: number
packingNumber: string
containerNumber: string
batch: string
fromLocationCode: string
inventoryStatus: string
masterId: number
number: string
itemCode: string
remark: string
siteId: string
itemName: string
itemDesc1: string
itemDesc2: string
qty: number
uom: string
concurrencyStamp: number
}
// 查询差异出库申请子列表
export const getDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/difference-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/difference-request-detail/page`, params })
}
}
// 查询差异出库申请子详情
export const getDetail = async (id: number) => {
return await request.get({ url: `/wms/difference-request-detail/get?id=` + id })
}
// 新增差异出库申请子
export const createDetail = async (data: DifferenceRequestDetailVO) => {
return await request.post({ url: `/wms/difference-request-detail/create`, data })
}
// 修改差异出库申请子
export const updateDetail = async (data: DifferenceRequestDetailVO) => {
return await request.put({ url: `/wms/difference-request-detail/update`, data })
}
// 删除差异出库申请子
export const deleteDetail = async (id: number) => {
return await request.delete({ url: `/wms/difference-request-detail/delete?id=` + id })
}
// 导出差异出库申请子 Excel
export const exportDetail = async (params) => {
return await request.download({ url: `/wms/difference-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/difference-request-detail/get-import-template' })
}

87
src/api/wms/differenceRequestMain/index.ts

@ -0,0 +1,87 @@
import request from '@/config/axios'
export interface DifferenceRequestMainVO {
id: number
number: string
businessType: string
remark: string
reason: string
reasonCode: string
usageCode: string
usageDescription: string
departmentCode: string
status: string
autoCommit: string
autoAgree: string
autoExecute: string
extraProperties: string
siteId: string
requestTime: Date
dueTime: Date
concurrencyStamp: number
ruleUserId: number
serialNumber: string
}
// 查询差异出库申请主列表
export const getMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/difference-request-main/senior', data })
} else {
return await request.get({ url: `/wms/difference-request-main/page`, params })
}
}
// 查询差异出库申请主详情
export const getMain = async (id: number) => {
return await request.get({ url: `/wms/difference-request-main/get?id=` + id })
}
// 新增差异出库申请主
export const createMain = async (data: DifferenceRequestMainVO) => {
return await request.post({ url: `/wms/difference-request-main/create`, data })
}
// 修改差异出库申请主
export const updateMain = async (data: DifferenceRequestMainVO) => {
return await request.put({ url: `/wms/difference-request-main/update`, data })
}
// 删除差异出库申请主
export const deleteMain = async (id: number) => {
return await request.delete({ url: `/wms/difference-request-main/delete?id=` + id })
}
// 导出差异出库申请主 Excel
export const exportMain = async (params) => {
return await request.download({ url: `/wms/difference-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/difference-request-main/get-import-template' })
}
// 关闭
export const closeMain = async (id: number) => {
return await request.put({ url: `/wms/difference-request-main/close?id=` + id })
}
// 提交
export const submitMain = async (id: number) => {
return await request.put({ url: `/wms/difference-request-main/submit?id=` + id })
}
// 处理
export const handleMain = async (id: number) => {
return await request.put({ url: `/wms/difference-request-main/handle?id=` + id })
}
// 审批通过
export const agreeMain = async (id: number) => {
return await request.put({ url: `/wms/difference-request-main/agree?id=` + id })
}
//审批拒绝
export const abortMain = async (id: number) => {
return await request.put({ url: `/wms/difference-request-main/refused?id=` + id })
}

26
src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts

@ -106,19 +106,19 @@ export const Stdcostprice = useCrudSchemas(reactive<CrudSchema[]>([
isSearch : true,
isTable : true
},
// {
// label: '价格',
// field: 'price',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 0,
// precision: 6
// }
// }
// },
{
label: '价格',
field: 'price',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
}
},
{
label: '是否可用',
field: 'available',

2
src/views/wms/basicDataManage/itemPull/index.vue

@ -210,7 +210,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await ItemPullApi.exportItemPull(tableObject.params)
download.excel(data, '物料拉动配置.xlsx')
download.excel(data, '品番拉动配置.xlsx')
} catch {
} finally {
exportLoading.value = false

39
src/views/wms/basicDataManage/itemPull/itemPull.data.ts

@ -4,16 +4,50 @@ import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as AreaApi from '@/api/wms/areabasic'
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
// 表单校验
export const ItemPullRules = reactive({
itemCode: [required],
defaultErpLocationCode: [required],
replenishType: [required],
pullType: [required]
})
export const ItemPull = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: 'ERP默认收货库位',
field: 'defaultErpLocationCode',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple: true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择ERP默认收货库位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库区信息', // 查询弹窗标题
searchAllSchemas: Area.allSchemas, // 查询弹窗所需类
searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '品番',
field: 'itemCode',
@ -21,7 +55,7 @@ export const ItemPull = useCrudSchemas(
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
@ -104,7 +138,6 @@ export const ItemPull = useCrudSchemas(
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',

23
src/views/wms/basicDataManage/supplierManage/modelDeliTime/index.vue

@ -142,7 +142,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk['code'] = item['code']
tfk['shift'] = item['shift']
tfk['beginTime'] = item['begeinTime']
tfk['beginTime'] = item['beginTime']
tableData.value.push(tfk)
})
}
@ -389,17 +389,34 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicSupplierAddrDeliTimeDetail')
}
/** 删除按钮操作 */
// const handleDelete = async (id: number) => {
// try {
// //
// await message.delConfirm()
// //
// await ModelDeliTimeDetailApi.deleteSupplierAddrDeliTimeDetail(id)
// message.success(t('common.delSuccess'))
// //
// await getList()
// } catch {}
// }
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await ModelDeliTimeDetailApi.deleteSupplierAddrDeliTimeDetail(id)
message.success(t('common.delSuccess'))
//
tableObject.loading = false
//
await getList()
} catch {}
} catch {}finally{
tableObject.loading = false
}
}
/** 导出按钮操作 */

623
src/views/wms/basicDataManage/supplierManage/modelDeliTime/modelDeliTime.data.ts

@ -1,5 +1,4 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
// import {Supplier} from '@/basicDataManage/supplierManage/supplier/supplier.data'
import { Supplier } from '../supplier/supplier.data'
@ -7,312 +6,289 @@ import { DeliTimeWms } from '../DeliTimeWms/deliTimeWms.data'
import * as DeliTimeWmsApi from '@/api/wms/deliTimeWms'
import { fa } from 'element-plus/es/locale'
import * as modelDeliTimeApi from '@/api/wms/modelDeliTime'
import { dateFormatter, dateFormatterHHMMSS } from '@/utils/formatTime'
// 表单校验
export const ModelDeliTimeDetailRules = reactive({
modelShow: [required],
yearAndMonthShow: [required],
delayDeli: [required],
delayDeli: [required]
})
function getMonthArr() {
let dateArr = [];
let year = new Date().getFullYear();
let month = new Date().getMonth();
let dateArr = []
let year = new Date().getFullYear()
let month = new Date().getMonth()
const n = 12
if (n < month) {
//1.n<month的情况
for (let i = month - n + 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
let m1 = i < 10 ? '0' + i : i
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
})
}
} else {
//2.n>month的情况
for (let i = (12 - (n - month) + 1); i <= 12; i++) {
let m1 = i < 10 ? "0" + i : i;
for (let i = 12 - (n - month) + 1; i <= 12; i++) {
let m1 = i < 10 ? '0' + i : i
dateArr.push({
label: year + '-' + m1,
value: year + '-' + m1
});
})
}
for (let i = 1; i <= month; i++) {
let m1 = i < 10 ? "0" + i : i;
let m1 = i < 10 ? '0' + i : i
dateArr.push({
label: (parseFloat(year) + 1) + '-' + m1,
value: (parseFloat(year) + 1) + '-' + m1,
});
label: parseFloat(year) + 1 + '-' + m1,
value: parseFloat(year) + 1 + '-' + m1
})
}
}
return dateArr;
return dateArr
}
export const ModelList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
},
]))
export const ModelList = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true
}
])
)
export const ModelDeliTime = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '供应商代码',
// field: 'supplierCode',
// sort: 'custom',
// isSearch: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// enterSearch: true,
// searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '供应商', // 查询弹窗标题
// searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
// searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }
// ],
// // 失去焦点校验参数
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: 'true',
// isFormModel: true,
// }]
// }
// }
// },
// {
// label: '供应商名称',
// field: 'supplierName',
// sort: 'custom',
// form :{
// componentProps:{
// disabled:true
// }
// },
// },
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
isTable: true,
isDetail: true,
// form: {
// component: 'Select',
// componentProps: {
// multiple: true,
// collapseTags: true,
// collapseTagsTooltip: true,
// maxCollapseTags: "2",
// optionsAlias: {
// labelField: 'label',
// valueField: 'value'
export const ModelDeliTime = useCrudSchemas(
reactive<CrudSchema[]>([
// {
// label: '供应商代码',
// field: 'supplierCode',
// sort: 'custom',
// isSearch: true,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// enterSearch: true,
// searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '供应商', // 查询弹窗标题
// searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
// searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }
// ],
// // 失去焦点校验参数
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: 'true',
// isFormModel: true,
// }]
// }
// }
// }
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple:true,
disabled:true,
enterSearch: false,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择受入号', // 输入框占位文本
searchField: 'model', // 查询弹窗赋值字段
searchTitle: '受入号', // 查询弹窗标题
searchAllSchemas: ModelList.allSchemas, // 查询弹窗所需类
searchPage: modelDeliTimeApi.getSupplierAddrList, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
// {
// label: '受入号',
// field: 'model',
// sort: 'custom',
// isTable: true,
// isDetail: true,
// isForm: false,
// },
{
label: '年月',
field: 'yearAndMonthShow',
sort: 'custom',
isTable: false,
isDetail: false,
form: {
component: 'Select',
api: () => getMonthArr(),
value:[],
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags:"2",
optionsAlias: {
labelField: 'label',
valueField: 'value'
// },
// {
// label: '供应商名称',
// field: 'supplierName',
// sort: 'custom',
// form :{
// componentProps:{
// disabled:true
// }
// },
// },
{
label: '受入号',
field: 'model',
sort: 'custom',
isSearch: true,
isTable: true,
isDetail: true,
// form: {
// component: 'Select',
// componentProps: {
// multiple: true,
// collapseTags: true,
// collapseTagsTooltip: true,
// maxCollapseTags: "2",
// optionsAlias: {
// labelField: 'label',
// valueField: 'value'
// }
// }
// }
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple: true,
disabled: true,
enterSearch: false,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择受入号', // 输入框占位文本
searchField: 'model', // 查询弹窗赋值字段
searchTitle: '受入号', // 查询弹窗标题
searchAllSchemas: ModelList.allSchemas, // 查询弹窗所需类
searchPage: modelDeliTimeApi.getSupplierAddrList, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
}
},
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM',
},
// {
// label: '受入号',
// field: 'model',
// sort: 'custom',
// isTable: true,
// isDetail: true,
// isForm: false,
// },
{
label: '年月',
field: 'yearAndMonthShow',
sort: 'custom',
isTable: false,
isDetail: false,
form: {
component: 'Select',
api: () => getMonthArr(),
value: [],
componentProps: {
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
maxCollapseTags: '2',
optionsAlias: {
labelField: 'label',
valueField: 'value'
}
}
}
},
},
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0,
componentProps: {
min:0,
precision:0
{
label: '年月',
field: 'yearAndMonth',
sort: 'custom',
isTable: true,
isDetail: true,
isForm: false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
type: 'month',
valueFormat: 'YYYY-MM'
}
}
},
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
dictType: DICT_TYPE.DELISHIF,
dictClass: 'string',
},
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: 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')]
{
label: '延迟便次',
field: 'delayDeli',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0,
componentProps: {
min: 0,
precision: 0
}
}
},
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
dictType: DICT_TYPE.DELISHIF,
dictClass: 'string'
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail:false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const ModelDeliTimeDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: false,
tableForm:{
multiple: true,//多选
isInpuFocusShow: false, // 开启查询弹窗
disabled:true,
searchListPlaceholder: '请选择便次时间配置',// 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '便次时间配置', // 查询弹窗标题
searchAllSchemas: DeliTimeWms.allSchemas, // 查询弹窗所需类
searchPage: DeliTimeWmsApi.getDeliTimePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: 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')]
}
},
],
verificationPage: DeliTimeWmsApi.getDeliTimePage, // tableForm下方输入框校验失去焦点之后是否正确的方法
// isShowTableFormSearch: true, //tableForm下方是否出现输入框
verificationParams: [{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择品番', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
export const ModelDeliTimeDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '编号',
field: 'code',
sort: 'custom',
isForm: false,
tableForm: {
multiple: true, //多选
isInpuFocusShow: false, // 开启查询弹窗
disabled: true,
searchListPlaceholder: '请选择便次时间配置', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '便次时间配置', // 查询弹窗标题
searchAllSchemas: DeliTimeWms.allSchemas, // 查询弹窗所需类
searchPage: DeliTimeWmsApi.getDeliTimePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
}
],
verificationPage: DeliTimeWmsApi.getDeliTimePage, // tableForm下方输入框校验失去焦点之后是否正确的方法
// isShowTableFormSearch: true, //tableForm下方是否出现输入框
verificationParams: [
{
key: 'itemCode',
@ -323,40 +299,103 @@ export const ModelDeliTimeDetail = useCrudSchemas(reactive<CrudSchema[]>([
isFormModel: true
}
] // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择品番', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: DeliTimeWms.allSchemas, // 查询弹窗所需类
searchPage: DeliTimeWmsApi.getDeliTimePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
dictType: DICT_TYPE.DELISHIF,
dictClass: 'string',
tableForm: {
disabled: true,
type: 'Select'
}
},
{
label: '开始时间',
field: 'beginTime',
sort: 'custom',
formatter: dateFormatterHHMMSS,
isSearch: true,
search: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
}
},
form: {
component: 'TimePicker',
componentProps: {
disabled: true,
type: 'time',
dateFormat: 'HH:mm:ss',
valueFormat: 'x'
}
},
tableForm: {
disabled: true,
type:'FormDateTime',
format:'HH:mm:ss',
valueFormat: 'x'
},
detail: {
dateFormat: 'HH:mm:ss'
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTableForm: false,
table: {
width: 150,
fixed: 'right'
}
}
},
{
label: '班次',
field: 'shift',
sort: 'custom',
isForm: false,
dictType: DICT_TYPE.DELISHIF,
dictClass: 'string',
tableForm:{
disabled:true,
type:'Select'
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTableForm:false,
table: {
width: 150,
fixed: 'right'
}
}
// {
// label: '开始时间',
// field: 'beginTime',
// sort: 'custom',
// isForm: false,
// formatter: dateFormatter,
// tableForm:{
// disabled:true,
// formatter: dateFormatter,
// }
// },
]))
// {
// label: '开始时间',
// field: 'beginTime',
// sort: 'custom',
// isForm: false,
// formatter: dateFormatter,
// tableForm:{
// disabled:true,
// formatter: dateFormatter,
// }
// },
])
)

3
src/views/wms/countManage/count/countConfig/countConfig.data.ts

@ -146,7 +146,8 @@ export const CountConfig = useCrudSchemas(reactive<CrudSchema[]>([
component: 'InputNumber',
value: 0,
componentProps: {
min:0,
disabled: true,
min:1,
precision:2
}
},

130
src/views/wms/countManage/count/countConfig/index.vue

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountConfig.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="CountConfig.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountConfig.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountConfig.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
@ -27,13 +31,13 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<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)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
@ -47,6 +51,7 @@
:apiUpdate="CountConfigApi.updateCountConfig"
:apiCreate="CountConfigApi.createCountConfig"
@searchTableSuccess="searchTableSuccess"
@clearSearchInput="clearSearchInput"
:isBusiness="false"
/>
@ -54,7 +59,8 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountConfig.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef"
<ImportForm
ref="importFormRef"
url="/wms/count-config/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
@ -66,7 +72,7 @@
<script setup lang="ts">
import download from '@/utils/download'
import { CountConfig,CountConfigRules } from './countConfig.data'
import { CountConfig, CountConfigRules } from './countConfig.data'
import * as CountConfigApi from '@/api/wms/countConfig'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
@ -90,13 +96,17 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'itemCode') {
setV['itemName'] = val[0].name
setV['desc1'] = val[0].backNumber
setV['uom'] = val[0].uom
setV['packUnit'] = val[0].defaultPackUnit
setV['packQty'] = val[0].defaultPackQty
setV['itemName'] = val[0].name
setV['desc1'] = val[0].backNumber
setV['uom'] = val[0].uom
setV['packUnit'] = val[0].defaultPackUnit
setV['packQty'] = val[0].defaultPackQty
if (val[0].convertRate == null) {
setV['conversionRate'] = 1.0
} else {
setV['conversionRate'] = val[0].convertRate
}
}
formRef.setValues(setV)
})
}
@ -115,12 +125,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:count-config:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:count-config:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:count-config:export'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'wms:count-config:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:count-config:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-config:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -133,16 +143,22 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -150,14 +166,16 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn(), //
defaultButtons.mainListDeleteBtn(), //
defaultButtons.mainListDeleteBtn() //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
@ -165,16 +183,16 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type=='create'){
CountConfig.allSchemas.formSchema.forEach(item =>{
if(item.field == "itemCode"){
if (type == 'create') {
CountConfig.allSchemas.formSchema.forEach((item) => {
if (item.field == 'itemCode') {
item.componentProps.isSearchList = true
item.componentProps.disabled = false
}
})
} else if(type=='update'){
CountConfig.allSchemas.formSchema.forEach(item =>{
if(item.field == "itemCode"){
} else if (type == 'update') {
CountConfig.allSchemas.formSchema.forEach((item) => {
if (item.field == 'itemCode') {
item.componentProps.isSearchList = false
item.componentProps.disabled = true
}
@ -184,18 +202,18 @@ const openForm = (type: string, row?: any) => {
}
// form
const formsSuccess = async (formType,data) => {
var isHave =CountConfig.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
const formsSuccess = async (formType, data) => {
var isHave = CountConfig.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;
return
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await CountConfigApi.createCountConfig(data)
message.success(t('common.createSuccess'))
@ -257,6 +275,21 @@ const importSuccess = () => {
getList()
}
const clearSearchInput = (formField) => {
if (formField == 'itemCode') {
//
basicFormRef.value.formRef.setValues({
itemName: '',
desc1: '',
uom: '',
packUnit: '',
packQty: '',
conversionRate: 1
})
// tableData.value = []
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
@ -271,5 +304,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await CountConfigApi.importTemplate()
})
</script>

853
src/views/wms/inventoryManage/balanceDifference/balance.data.ts

@ -0,0 +1,853 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const Balance = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenSearchHigh: true,// 高级筛选中隐藏
// isSearch: true
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
hiddenSearchHigh: true,// 高级筛选中隐藏
// isSearch: true
},
{
label: '物料类型',
field: 'itemType',
sort: 'custom',
dictType: DICT_TYPE.ITEM_TYPE,
dictClass: 'string',
isSearch: true,
table: {
width: 100
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '供应商批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
isSearch: false,
isTable:false,
isDetail:false,
isForm:false
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
// isSearch: true
},
// {
// label: '包装规格',
// field: 'packUnit',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: '包装数量',
// field: 'packQty',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: '器具代码',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable:false
// },
{
label: '库存数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber'
}
},
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
// isSearch: true
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
// {
// label: '库区类型',
// field: 'areaType',
// sort: 'custom',
// dictType: DICT_TYPE.AREA_TYPE,
// dictClass: 'string',
// isTable: true,
// table: {
// width: 150
// }
// },
// {
// label: '仓库代码',
// field: 'warehouseCode',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: '库位组代码',
// field: 'locationGroupCode',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: '库区代码',
// field: 'areaCode',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: 'ERP库位代码',
// field: 'erpLocationCode',
// dictType: DICT_TYPE.ERP_LOCATION,
// dictClass: 'string',
// isTable: false,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// },
// {
// label: '标准体积',
// field: 'standardVolume',
// sort: 'custom',
// form: {
// component: 'InputNumber',
// value: 0,
// componentProps: {
// min: 0,
// precision:2
// }
// },
// table:{
// width: 120
// }
// },
// {
// label: '到货日期',
// field: 'arriveDate',
// isTable: true,
// formatter: dateFormatter2,
// detail: {
// dateFormat: 'YYYY-MM-DD'
// },
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: { width: '100%' },
// type: 'date',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x'
// }
// }
// },
// {
// label: '生产日期',
// field: 'produceDate',
// isTable: true,
// formatter: dateFormatter2,
// detail: {
// dateFormat: 'YYYY-MM-DD'
// },
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: { width: '100%' },
// type: 'date',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x'
// }
// }
// },
// {
// label: '失效日期',
// field: 'expireDate',
// isTable: true,
// formatter: dateFormatter2,
// detail: {
// dateFormat: 'YYYY-MM-DD'
// },
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: { width: '100%' },
// type: 'date',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x'
// }
// }
// },
// {
// label: '货主代码',
// field: 'ownerCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false
// },
// {
// label: '锁定数量',
// field: 'lockedQty',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// form: {
// component: 'InputNumber'
// }
// },
// {
// label: '可用数量',
// field: 'usableQty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '单价',
// field: 'singlePrice',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '金额',
// field: 'amount',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '入库时间',
// field: 'putInTime',
// isTable: true,
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// type: 'datetime',
// }
// }
// },
// {
// label: '是否冻结',
// field: 'frozen',
// 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: 'steelCoilNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// disabled: false
// },
// isTable:false,
// isDetail:false,
// isForm:false
// },
// {
// label: '炉号',
// field: 'heatNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// disabled: false
// },
// isTable:false,
// isDetail:false,
// isForm:false
// },
// {
// label: '热处理日期',
// field: 'heatTreatmentDate',
// formatter: dateFormatter2,
// detail: {
// dateFormat: 'YYYY-MM-DD'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width: '100%'},
// type: 'date',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x',
// }
// },
// tableForm: {
// type: 'FormDate',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x',
// },
// isTable:false,
// isDetail:false,
// isForm:false
// },
// {
// label: '有效日期',
// field: 'effectiveDate',
// formatter: dateFormatter2,
// detail: {
// dateFormat: 'YYYY-MM-DD'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width: '100%'},
// type: 'date',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x',
// }
// },
// tableForm: {
// type: 'FormDate',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x',
// },
// isTable:false,
// isDetail:false,
// isForm:false
// },
// {
// label: '冻结原因',
// field: 'frozenReason',
// dictType: DICT_TYPE.FROZEN_REASON,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '重量',
// field: 'weight',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '面积',
// field: 'area',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '体积',
// field: 'volume',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// }
// },
// {
// label: '最后事务号',
// field: 'lastTransNumber',
// sort: 'custom',
// table: {
// width: 150
// }
// },
{
label: '创建人',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '创建时间',
field: 'createTime',
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'
}
},
isForm: false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetimerange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}
// },
// {
// 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,
// isTable: true
// },
// {
// label: '最后更新者',
// field: 'updater',
// sort: 'custom',
// table: {
// width: 150
// },
// isForm: false,
// isTable: true
// },
// // TODO: 临时添加 方便操作
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false,
// table: {
// width: 250,
// fixed: 'right'
// }
}
])
)
export const TransactionTab = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: true,
isForm: true,
isDetail:true,
},
{
label: '创建时间',
field: 'createTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 150
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
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: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '事务类型',
field: 'transactionType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存动作',
field: 'inventoryAction',
dictType: DICT_TYPE.INVENTORY_ACTION,
dictClass: 'string',
isTable: true,
isSearch: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务记录号',
field: 'recordNumber',
sort: 'custom',
isTable: true,
isSearch: true,
table: {
width: 180
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
isSearch: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '事务号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
}
]))
export const MesRawMaterialConsumptionInfo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true
},
{
label: 'DMC码',
field: 'dmcCode',
sort: 'custom',
isSearch: true
},
{
label: '激光码',
field: 'laserCode',
sort: 'custom',
isSearch: true
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter,
isSearch: true,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
},
]))
// 表单校验
export const BalanceRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
// containerNumber: [
// { required: true, message: '请选择器具号', trigger: 'change' }
// ],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
arriveDate: [
{ required: true, message: '请选择到货日期', trigger: 'change' }
],
produceDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' }
],
})

444
src/views/wms/inventoryManage/balanceDifference/index.vue

@ -0,0 +1,444 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Balance.allSchemas.searchSchema" @search="searchList" @reset="searchList" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:route-name="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Balance.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table ref="tableRef" v-clientTable
:multiple="true"
:selection="true"
: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"
@getSelectionRows="getSelectionRows"
>
<template #itemCode="{row}">
<el-button :type="row.frozen=='TRUE'||row.expireDate<dayjs().valueOf()?'danger':'primary'" link @click="openDetail(row, '物料代码', row.itemCode)">
<span >{{ row.itemCode }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="BalanceRules"
:formAllSchemas="Balance.allSchemas"
:apiUpdate="BalanceApi.updateBalance"
:apiCreate="BalanceApi.createBalance"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="true"
:allSchemas="TransactionTab.allSchemas"
:detailAllSchemas="TransactionTab.allSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{
label: '库存事务',
prop: 'Transaction'
}]"
@changeTabs="changeTabs"
:tableObjectExtend="tableObjectExtend"
/>
<SearchTable ref="searchTableRef" :selection="false" :hiddenSubmitButton="true"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/balance/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import download from '@/utils/download'
import * as BalanceApi from '@/api/wms/balanceDifference'
import * as PackageApi from '@/api/wms/package'
import * as BarbasicApi from '@/api/wms/barbasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Balance,TransactionTab, BalanceRules,MesRawMaterialConsumptionInfo } from './balance.data'
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 { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as MesRawMaterialConsumptionInfoApi from '@/api/wms/mesRawMaterialConsumptionInfo'
import { Barbasic } from '@/views/dbc/labelManage/barbasic/barbasic.data'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'Balance' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Balance.allSchemas.tableColumns)
const tabsExtend = ref(false)
const apiPage = ref()
const tableObjectExtend = ref()
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: BalanceApi.getBalancePageAllDiff //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:balance:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:balance:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:balance:export'}), //
// defaultButtons.mainLisSelectiontPointBtn(null), //
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') { //
selectionRows.value = []
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else if (val=='selection_point'){//
handleSelectionPoint()
} else { //
console.log('其他按钮', item)
}
}
const searchList = (model)=>{
selectionRows.value = []
setSearchParams(model)
}
watch(
() => tableObject.tableList,
() => {
const currentRows = selectionRows.value.find(item=>item.currentPage==tableObject.currentPage)
if(currentRows){
nextTick(() => {
currentRows.selectionRows.forEach(item=>{
tableRef.value.toggleRowSelection(item,true)
})
})
}
}
)
const selectionRows = ref<any>([])
const tableRef = ref()
const getSelectionRows = (currentPage,currentPageSelectionRows) => {
console.log("getSelectionRows",currentPage,currentPageSelectionRows)
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage)
if(currentRows){
currentRows.selectionRows = currentPageSelectionRows
}else{
selectionRows.value.push({
currentPage,
selectionRows:currentPageSelectionRows
})
}
}
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.packingNumber)]
})
console.log('批量打印',rows.join(','))
let getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
PackageApi.getBalanceToPackageSelection(rows).then(res => {
console.log('res',res);
console.log('rows',rows);
getLoading?.close()
if(res.bcpLabel){
//
const src = ref(BASE_URL + '/jmreport/view/1064421419843481600?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.bcpLabel)
}
if (res.ccpLabel) {
//
const src = ref(BASE_URL + '/jmreport/view/1064431510835589120?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.ccpLabel)
}
if (res.cgLabel) {
//
const src = ref(BASE_URL + '/jmreport/view/1064443232879276032?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.cgLabel)
}
}).catch(err => {
console.log(err)
getLoading?.close()
})
// window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return[
{
label: '标签信息',
name: 'bqxx',
hide: false,
type: 'primary',
icon: '',
color: '',
link: true,
float:'right',
hasPermi: ''
},
defaultButtons.mainListPointBtn(null), //
{
label: '包装明细',
name: 'package-detail',
hide: row.itemType!='BCP'&&row.itemType!='CCP',
type: 'primary',
icon: '',
color: '',
link: true,
float:'right',
hasPermi: ''
},
// defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), //
]}
// -
const buttonTableClick = async (val, row) => {
if (val == 'bqxx') {
console.log(row.packingNumber)
if(row.packingNumber != ''){
const params = {
current: 1, //
size: 10, //
number: row.packingNumber
};
let bbb = await PackageApi.getPackagePage(params);
if(bbb.total == 0){
message.alert("包装号为空,不能打印标签")
}else{
console.log(row.packingNumber)
const barBasicParams = {
current: 1, //
size: 10, //
relateNumber: row.packingNumber
};
let aaa = await BarbasicApi.getBarbasicPage(barBasicParams);
if(aaa.total != 0){
message.info(aaa.list[0]['barcodeString'])
}
}
// let aaa = 'HPQ;V1.0;I'+row.itemCode+';P'+row.packingNumber+';B'+row.batch+';Q'+row.qty+';U'+row.uom
}else{
message.alert("包装号为空,不能打印标签")
}
}else if (val == 'point') { //
handlePoint(row)
}else if(val == 'package-detail'){
//
packageDetailClick(row)
}
// if (val == 'edit') { //
// // const res = await BalanceApi.getItempackaging(row.id)
// openForm('update', row)
// } else if (val == 'delete') { //
// handleDelete(row.id)
// }
}
const searchTableRef = ref()
const packageDetailClick = (row) => {
searchTableRef.value.open(
"包装明细",
MesRawMaterialConsumptionInfo.allSchemas,
MesRawMaterialConsumptionInfoApi.getMesRawMaterialConsumptionInfoPage,
"hehehe",
"hehehe",
false,
'tableForm',
null,
{
packingNumber:row.packingNumber
},
undefined,
false,
undefined
)
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue,'transactionBalance')
}
const BASE_URL = getJmreportBaseUrl()
const labelType = ref('') //
//
const handlePoint = async (row) => {
// const itemCode = row.itemCode
PackageApi.getBalanceToPackage(row.packingNumber).then(res => {
console.log(777,res);
if (res.productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
PackageApi.batchPrintingLable((res.number)).then((resLable) =>{
console.log(159,resLable )
//
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/1064443232879276032?token=' + getAccessToken())
console.log(159,resLable )
window.open(src.value+'&asn_number='+resLable)
} else {
if(row.itemType == 'BCP'){
const src = ref(BASE_URL + '/jmreport/view/1064421419843481600?token=' + getAccessToken())
window.open(src.value+'&asn_number='+resLable)
}else if(row.itemType == 'CCP'){
const src = ref(BASE_URL + '/jmreport/view/1064431510835589120?token=' + getAccessToken())
window.open(src.value+'&asn_number='+resLable)
}
}
})
}).catch(err => {
console.log(err)
})
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await BalanceApi.exportBalance(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
const filter = {};
filter.action = "like";
filter.column = "locationCode";
filter.value = "DIFF";
searchData.filters.push(filter);
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
const changeTabs = (item) => {
if (item.prop == 'Transaction') {
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
apiPage.value = BalanceApi.getTransactionBalancePage
console.log(988,tableObjectExtend.value)
} else {
tableObjectExtend.value = []
tabsExtend.value = false
apiPage.value = ''
}
}
/** 初始化 **/
onMounted(async() => {
getList()
// importTemplateData.templateUrl = await BalanceApi.importTemplate()
})
</script>

195
src/views/wms/inventoryManage/differenceRecord/differenceRecord.data.ts

@ -0,0 +1,195 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const DifferenceRecordMainRules = reactive({
autoCommit: [required],
autoAgree: [required],
autoExecute: [required],
concurrencyStamp: [required]
})
export const DifferenceRecordMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
// fixed: 'right'
}
},
{
label: '申请单据号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180,
// fixed: 'right'
}
}
// {
// 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'
// }
// }
// },
// {
// label: '截止时间',
// field: 'dueTime',
// sort: 'custom',
// formatter: dateFormatter,
// // isSearch: true,
// search: {
// component: 'DatePicker',
// componentProps: {
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
// type: 'daterange',
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
// }
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// type: 'datetime',
// valueFormat: 'x'
// }
// }
// },
])
)
// 表单校验
export const DifferenceRecordDetailRules = reactive({
batch: [required],
fromLocationCode: [required],
inventoryStatus: [required],
masterId: [required],
itemCode: [required],
concurrencyStamp: [required]
})
export const DifferenceRecordDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',table: {
width: 150
},
isSearch: true
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '物料类型',
// dictType: DICT_TYPE.ITEM_TYPE,
// field: 'itemType',
// // hiddenInMain: true,
// // isSearch: true,
// // tableForm: {
// // type: 'Select',
// // disabled: true
// // },
// width: 100
// },
{
label: '出库数量',
field: 'qty',
sort: 'custom',
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sort: 'custom',
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
form: {
component: 'Radio'
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
},
{
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
}
])
)

273
src/views/wms/inventoryManage/differenceRecord/index.vue

@ -0,0 +1,273 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...DifferenceRecordMain.allSchemas.searchSchema,...DifferenceRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DifferenceRecordMain.allSchemas"
:detailAllSchemas="DifferenceRecordDetail.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="submitForm"
:rules="DifferenceRecordDetailRules"
:formAllSchemas="Detail.allSchemas"
:apiUpdate="DifferenceRecordDetailApi.updateDetail"
:apiCreate="DifferenceRecordDetailApi.createDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:isShowDescriptions="true"
:allSchemas="DifferenceRecordMain.allSchemas"
:detailAllSchemas="DifferenceRecordDetail.allSchemas"
:apiPage="DifferenceRecordDetailApi.getDetailPage"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/differenceRecord/detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DifferenceRecordMain,DifferenceRecordMainRules,DifferenceRecordDetail,DifferenceRecordDetailRules} from './differenceRecord.data'
import * as DifferenceRecordDetailApi from '@/api/wms/differenceRecordDetail'
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 { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {mainListApproveBtn, mainListTurnDownBtn} from "@/utils/disposition/defaultButtons";
import {
abortMain,
agreeMain,
closeMain,
handleMain,
submitMain
} from "@/api/wms/differenceRequestMain";
const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'DifferenceRecordDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...DifferenceRecordMain.allSchemas.tableColumns,...DifferenceRecordDetail.allSchemas.tableColumns])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DifferenceRecordDetailApi.getDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:difference-record-detail:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:detail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:difference-record-detail: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 isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, row?: any) => {
formRef.value.open(type, row)
}
// form
const submitForm = async (formType,submitData) => {
let data = {...submitData}
try {
if (formType === 'create') {
await DifferenceRecordDetailApi.createDetail(data)
message.success(t('common.createSuccess'))
} else {
await DifferenceRecordDetailApi.updateDetail(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
getList()
}finally {
formRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DifferenceRecordDetailApi.deleteDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const excelTitle = ref(route.meta.title)
const data = await DifferenceRecordDetailApi.exportDetail(tableObject.params)
const time = formatDate(new Date())
download.excel(data, `${excelTitle.value}】【${time}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/** 导入 */
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 DifferenceRecordDetailApi.importTemplate()
})
</script>

342
src/views/wms/inventoryManage/differenceRequest/differenceRequest.data.ts

@ -0,0 +1,342 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/dbc/location'
import { Location } from '@/views/dbc/location/location.data'
import * as BalanceApi from '@/api/wms/balanceDifference'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
// 表单校验
export const DifferenceRequestMainRules = reactive({
// toLocationCode: [required]
})
export const DifferenceRequestMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 200,
// fixed: 'right'
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100,
// fixed: 'right'
}
},
// {
// label: '到库位代码',
// field: 'toLocationCode',
// sort: 'custom',
// table: {
// width: 150
// },
// // isSearch: true,
// isForm: false,
// isTable: false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: false,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择到库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '到库位代码', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'businessType',
// value: 'CustomerReject',
// isMainValue: false
// },
// {
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }
// ],
// verificationParams: [
// {
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true
// }
// ] // 失去焦点校验参数
// }
// }
// },
])
)
// 表单校验
export const DifferenceRequestDetailRules = reactive({
itemCode: [required]
})
export const DifferenceRequestDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm: {
multiple: true, //多选
disabled: true,
isInpuFocusShow: false, // 开启查询弹窗
searchListPlaceholder: '请输入包装号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'businessType',
value: 'UnplannedDeliver',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'inOrOut',
value: 'out',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'locationCode',
value: 'DIFF',
action: '==',
isSearch: true,
isMainValue: false
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请输入包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'businessType',
value: 'UnplannedDeliver',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'inOrOut',
value: 'out',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'locationCode',
value: 'DIFF',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
tableForm: {
disabled: true
}
},
// {
// label: '物料类型',
// dictType: DICT_TYPE.ITEM_TYPE,
// field: 'itemType',
// // hiddenInMain: true,
// // isSearch: true,
// // tableForm: {
// // type: 'Select',
// // disabled: true
// // },
// width: 100
// },
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '出库数量',
field: 'requestQty',
sort: 'custom',
tableForm: {
type: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
// isSearch: true,
tableForm: {
disabled: true
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
// isSearch: true,
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
// isSearch: true
isTableForm: false,
tableForm: {
disabled: 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')]
}
},
isTableForm: false,
isForm: false,
tableForm: {
disabled: true
}
},
{
label: '创建人',
field: 'creator',
isForm: false,
isDetail: false,
isTableForm: false,
tableForm: {
disabled: true
}
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 200,
fixed: 'right'
},
isTableForm: false,
tableForm: {
disabled: true
}
}
])
)

476
src/views/wms/inventoryManage/differenceRequest/index.vue

@ -0,0 +1,476 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...DifferenceRequestMain.allSchemas.searchSchema,...DifferenceRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DifferenceRequestMain.allSchemas"
:detailAllSchemas="DifferenceRequestDetail.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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@submitForm="submitForm"
:rules="DifferenceRequestMainRules"
:formAllSchemas="DifferenceRequestMain.allSchemas"
:tableAllSchemas="DifferenceRequestDetail.allSchemas"
:tableFormRules="DifferenceRequestDetailRules"
:tableData="tableData"
:apiUpdate="DifferenceRequestMainApi.updateMain"
:apiCreate="DifferenceRequestMainApi.createMain"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
:isShowDescriptions="true"
:allSchemas="DifferenceRequestMain.allSchemas"
:detailAllSchemas="DifferenceRequestDetail.allSchemas"
:apiPage="DifferenceRequestDetailApi.getDetailPage"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/difference-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DifferenceRequestMain,DifferenceRequestMainRules,DifferenceRequestDetail,DifferenceRequestDetailRules} from './differenceRequest.data'
import * as DifferenceRequestDetailApi from '@/api/wms/differenceRequestDetail'
import * as DifferenceRequestMainApi from '@/api/wms/differenceRequestMain'
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 { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'DifferenceRequestDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...DifferenceRequestMain.allSchemas.tableColumns,...DifferenceRequestDetail.allSchemas.tableMainColumns])
const fromManagementPrecision = ref('')
const tableFormKeys = {}
DifferenceRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
if(formField === 'itemCode'){
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['id']==item['id']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['id']==item['id']))
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['batch']==item['batch']&&item1['packingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['inventoryStatus']==item['inventoryStatus']))
if(val.length==0) return
val.forEach(async item=>{
let newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow[formField] =item[searchField]
tableData.value.push(newRow)
})
}else{
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
const getFormattedDate = () =>{
const a = new Date();
const year = a.getFullYear();
const month = String(a.getMonth() + 1).padStart(2, '0');
const day = String(a.getDate()).padStart(2, '0');
return `${year}${month}${day}`;
}
// //
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick(async() => {
// if (type == 'tableForm') {
// //
// if(formField === 'itemCode'){
// val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['batch']==item['batch']&&item1['packingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['inventoryStatus']==item['inventoryStatus']))
// if(val.length==0) return
// val.forEach(async item=>{
// let newRow = JSON.parse(JSON.stringify(tableFormKeys))
// newRow[formField] =item[searchField]
// newRow['packingNumber'] = item['packingNumber']
// newRow['containerNumber'] = item['containerNumber']
// newRow['batch'] = item['batch']
// //
// await ruleApi.getManagementPrecision({
// itemCodes: [item['itemCode']],
// locationCode:item['locationCode']
// }).then((res) => {
// fromManagementPrecision.value = res[0].ManagementPrecision
// })
// if (fromManagementPrecision.value == 'BY_QUANTITY') {//+
// if(newRow['batch']==''){
// newRow['batch'] = getFormattedDate(); // YYYYMMDD
// }
// newRow['batchFormItemType'] = 'FormDate'
// newRow['disabled_batch'] = false
// }else {
// newRow['bathFormItemType'] = ''
// newRow['disabled_batch'] = true
// }
// newRow['inventoryStatus'] = item['inventoryStatus']
// newRow['fromLocationCode'] = item['locationCode']
// newRow['itemCode'] = item['itemCode']
// newRow['uom'] = item['uom']
// newRow['qty'] = item['qty']
// tableData.value.push(newRow)
// })
// }else if(formField === 'costcentreCode'){
// row['costcentreCode'] = val[0]['costcentreCode']
// }else if(formField === 'qadProjectCode'){
// row['qadProjectCode'] = val[0]['projectCode']
// } else {
// row[formField] = val[0][searchField]
// }
// } else {
// const setV = {}
// if(formField === 'usageDescription'){
// setV['usageDescription'] = val[0]['usageDescription']
// setV['usageCode'] = val[0]['code']
// }
// if(formField === 'costCenterCode'){
// setV['costcentreCode'] = val[0]['costcentreCode']
// setV['costCenterType'] = val[0]['costcentreType']
// }
// if(formField === 'reasonCodeRequisition'){
// setV['reasonCodeRequisition'] = val[0]['code']
// setV['reasonDescRequisition'] = val[0]['accountingName']
// //
// if(UnplannedissueRequestMainRules['projectCode']){
// UnplannedissueRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE'
// }
// }
// if(formField === 'projectCode'){
// setV['projectCode'] = val[0]['projectCode']
// }
// setV[formField] = val[0][searchField]
// formRef.setValues(setV)
// }
// })
// }
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DifferenceRequestDetailApi.getDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:difference-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:difference-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:difference-request-detail: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 isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1','2','3','4','6']),hasPermi:'wms:difference-request-main:close'}), //
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']),hasPermi:'wms:difference-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']),hasPermi:'wms:difference-request-main:abort'}), //
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']),hasPermi:'wms:difference-request-main:agree'}), //
defaultButtons.mainListHandleBtn({ hide: isShowMainButton(row, ['3']),hasPermi:'wms:difference-request-main:handle'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'mainClose') { //
handleClose(row.masterId)
} else if (val == 'mainSubmit') { //
handleSubmit(row.masterId)
} else if (val == 'mainTurnDown') { //
handleTurnDown(row.masterId)
} else if (val == 'mainApprove') { //
handleApprove(row.masterId)
} else if (val == 'mainHandle') { //
handleHandle(row.masterId)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, row?: any) => {
tableData.value = []
formRef.value.open(type, row)
}
// form
const submitForm = async (formType,submitData) => {
let data = {...submitData}
data.subList = tableData.value
try {
if (formType === 'create') {
await DifferenceRequestMainApi.createMain(data)
message.success(t('common.createSuccess'))
} else {
await DifferenceRequestMainApi.updateMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
getList()
}finally {
formRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await DifferenceRequestDetailApi.deleteDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
//
// await message.delConfirm()
//
await DifferenceRequestMainApi.closeMain(id)
message.success(t('common.closeSuccess'))
//
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
//
// await message.delConfirm()
//
await DifferenceRequestMainApi.submitMain(id)
message.success(t('common.submitSuccess'))
//
await getList()
} catch {}
}
/** 驳回按钮操作 */
const handleTurnDown = async (id: number) => {
try {
//
// await message.delConfirm()
//
await DifferenceRequestMainApi.abortMain(id)
message.success(t('common.refusedSuccess'))
//
await getList()
} catch {}
}
/** 通过按钮操作 */
const handleApprove = async (id: number) => {
try {
//
// await message.delConfirm()
//
await DifferenceRequestMainApi.agreeMain(id)
message.success(t('common.agreeSuccess'))
//
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
//
// await message.delConfirm()
//
await DifferenceRequestMainApi.handleMain(id)
message.success(t('common.dealwithSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const excelTitle = ref(route.meta.title)
const data = await DifferenceRequestDetailApi.exportDetail(tableObject.params)
const time = formatDate(new Date())
download.excel(data, `${excelTitle.value}】【${time}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/** 导入 */
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() //
}
const tableData = ref([])
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if(itemIndex>-1){
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await DifferenceRequestMainApi.importTemplate()
})
</script>

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

@ -594,9 +594,35 @@ export const PackageoverRequestDetail = useCrudSchemas(
table: {
width: 150
},
isTableForm: false,
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
},
isTableForm: true,
isSearch: true,
isForm: false
},
{
label: '到标包数量',
field: 'toPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm: {
// disabled: true
type:'InputNumber'
},
form: {
component:'InputNumber',
componentProps: {
// disabled: true
}
}
},
{
label: '描述',
@ -835,24 +861,7 @@ export const PackageoverRequestDetail = useCrudSchemas(
}
}
},
{
label: '到标包数量',
field: 'toPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm: {
// disabled: true
type:'InputNumber'
},
form: {
component:'InputNumber',
componentProps: {
// disabled: true
}
}
},
{
label: '批次',
field: 'batch',

6
src/views/wms/issueManage/repleinsh/repleinshJobMain/index.vue

@ -75,6 +75,7 @@ import * as RepleinshJobDetailApi from '@/api/wms/repleinshJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'RepleinshJobMain' })
@ -314,10 +315,13 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}
}
//
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,"jobRepleinshMain")
}

53
src/views/wms/issueManage/repleinsh/repleinshJobMain/repleinshJobMain.data.ts

@ -1,6 +1,24 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'RepleinmentRequest',
businessTypeCode: 'Repleinment'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
import { getLocationPageRepleinsh } from '@/api/wms/location'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept]
/**
* @returns {Array}
*/
@ -23,6 +41,7 @@ export const RepleinshJobMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
isSearch:true,
sortTableDefault: 1,
},
// {
@ -224,14 +243,30 @@ export const RepleinshJobMain = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable: false,
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: 'acceptTime',

6
src/views/wms/issueManage/repleinsh/repleinshRecordMain/index.vue

@ -69,6 +69,7 @@ import * as RepleinshRecordDetailApi from '@/api/wms/repleinshRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'RepleinshRecordMain' })
@ -139,10 +140,13 @@ const butttondata = (row,$index) => {
// -
const buttonTableClick = async (val, 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,"record_repleinsh_main")
}

90
src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts

@ -1,6 +1,24 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'RepleinmentRequest',
businessTypeCode: 'Repleinment'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
import { getLocationPageRepleinsh } from '@/api/wms/location'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到
userDept.id = userDept.id.toString()
const userDeptArray: any = [userDept]
/**
* @returns {Array}
*/
@ -32,20 +50,22 @@ export const RepleinshRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch:true,
table: {
width: 180
},
sortTableDefault:1,
},
// {
// label: '任务单号',
// field: 'jobNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// sortTableDefault: 2,
// },
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180
},
isSearch:true,
sortTableDefault: 2,
},
// {
// label: '供应商代码',
// field: 'supplierCode',
@ -223,14 +243,30 @@ export const RepleinshRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '部门代码',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
table: {
width: 150
},
isTable: false,
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: 'interfaceType',
@ -771,15 +807,15 @@ export const RepleinshRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
hiddenInMain:true,
},
{
label: '背番',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenInMain:true,
},
// {
// label: '背番',
// field: 'itemDesc1',
// sort: 'custom',
// table: {
// width: 150
// },
// hiddenInMain:true,
// },
{
label: '描述',
field: 'itemDesc2',

1
src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue

@ -72,6 +72,7 @@
:apiUpdate="RepleinshRequestDetailApi.updateRepleinshRequestDetail"
:apiPage="RepleinshRequestDetailApi.getRepleinshRequestDetailPage"
:apiDelete="RepleinshRequestDetailApi.deleteRepleinshRequestDetail"
:detailButtonIsShowAdd="false"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>

19
src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts

@ -645,6 +645,7 @@ export const RepleinshRequestMainRules = reactive({
toAreaTypes: [{ required: true, message: '请选择到库区类型范围', trigger: 'change' }],
departmentCode: [{ required: true, message: '请输入部门', trigger: 'blur' }],
day: [{ required: true, message: '请选择日期时间', trigger: 'blur' }],
deliNo: [{ required: true, message: '请选择便次', trigger: 'blur' }],
autoCommit: [{ required: true, message: '请选择是否自动提交', trigger: 'change' }],
autoAgree: [{ required: true, message: '请选择是否自动通过', trigger: 'change' }],
autoExecute: [{ required: true, message: '请选择是否自动执行', trigger: 'change' }],
@ -926,6 +927,24 @@ export const RepleinshRequestDetail = useCrudSchemas(
},
isTable: true,
},
{
label: '来源库位',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
sortSearchDefault: 1000,
// isSearch: true,
sortTableDefault: 1100,
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '目标库位',
field: 'toLocationCode',

68
src/views/wms/issueManage/repleinshItemCodeConsumeRecord/repleinshItemCodeConsumeRecord.data.ts

@ -1,5 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const RepleinshItemCodeConsumeRecordRules = reactive({
@ -23,11 +23,11 @@ export const RepleinshItemCodeConsumeRecord = useCrudSchemas(reactive<CrudSchema
field: 'qty',
sort: 'custom',
},
{
label: '单位',
field: 'uom',
sort: 'custom',
},
// {
// label: '单位',
// field: 'uom',
// sort: 'custom',
// },
{
label: '车间代码',
field: 'workshop',
@ -87,6 +87,19 @@ export const RepleinshItemCodeConsumeRecord = useCrudSchemas(reactive<CrudSchema
}
},
},
{
label: '日期',
field: 'deliDate',
sort: 'custom',
formatter: dateFormatter2,
isForm: false
},
{
label: '便次',
field: 'deliNo',
sort: 'custom',
isSearch: true
},
{
label: '业务类型',
field: 'businessType',
@ -121,26 +134,35 @@ export const RepleinshItemCodeConsumeRecord = useCrudSchemas(reactive<CrudSchema
// sort: 'custom',
// },
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false
},
hiddenInMain: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
hiddenInMain: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
}
},
// {
// label: '操作',
// field: 'action',

Loading…
Cancel
Save