Browse Source

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

intex_online20241111
ljlong_2630 1 month ago
parent
commit
c0076902c1
  1. 1
      src/api/wms/business/inputBlur.ts
  2. 19
      src/api/wms/customerStatementDetail/index.ts
  3. 6
      src/api/wms/customerStatementMain/index.ts
  4. 10
      src/api/wms/package/index.ts
  5. 16
      src/api/wms/productreceiptJobMain/index.ts
  6. 12
      src/api/wms/productreceiptRequestMain/index.ts
  7. 9
      src/api/wms/purchaseBarterRecordDetail/index.ts
  8. 7
      src/api/wms/purchaseBarterRequestMain/index.ts
  9. 41
      src/api/wms/purchaseClaimRequestDetail/index.ts
  10. 55
      src/api/wms/purchaseClaimRequestMain/index.ts
  11. 66
      src/api/wms/purchaseclaimRecordDetail/index.ts
  12. 64
      src/api/wms/purchaseclaimRecordMain/index.ts
  13. 53
      src/api/wms/purchaseclaimRequestDetail/index.ts
  14. 92
      src/api/wms/purchaseclaimRequestMain/index.ts
  15. 7
      src/api/wms/switch/index.ts
  16. 34
      src/components/BasicForm/src/BasicForm.vue
  17. 30
      src/components/Detail/src/Detail.vue
  18. 1
      src/components/ImportForm/src/ImportCustomerStatementForm.vue
  19. 1
      src/components/ImportForm/src/ImportCustomerStatementShareForm.vue
  20. 1
      src/components/ImportForm/src/ImportForm.vue
  21. 5
      src/components/Search/src/Search.vue
  22. 7
      src/components/SearchHigh/src/SearchHigh.vue
  23. 15
      src/components/Table/src/Table.vue
  24. 55
      src/components/TableForm/src/TableForm.vue
  25. 2
      src/components/TableHead/src/TableHead.vue
  26. 8
      src/locales/en-US.ts
  27. 10
      src/locales/zh-CN.ts
  28. 1
      src/views/eam/locationArea/index.vue
  29. 26
      src/views/login/components/LoginForm.vue
  30. 7
      src/views/qms/inspectionRecord/addForm.vue
  31. 3
      src/views/qms/inspectionRecordFirst/addForm.vue
  32. 76
      src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue
  33. 71
      src/views/wms/basicDataManage/itemManage/itemarea/index.vue
  34. 2
      src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue
  35. 171
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/customerSaleInvoiceMain.data.ts
  36. 439
      src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue
  37. 23
      src/views/wms/deliversettlementManage/customerreturn/customerreturnJobMain/index.vue
  38. 23
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue
  39. 42
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue
  40. 10
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts
  41. 50
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  42. 449
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue
  43. 287
      src/views/wms/inventoryManage/balance/index.vue
  44. 24
      src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue
  45. 24
      src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue
  46. 25
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue
  47. 37
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue
  48. 12
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts
  49. 1
      src/views/wms/issueManage/issue/issueRequestMain/index.vue
  50. 16
      src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts
  51. 41
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  52. 14
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  53. 24
      src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue
  54. 30
      src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue
  55. 100
      src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts
  56. 56
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
  57. 8
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts
  58. 33
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue
  59. 8
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts
  60. 134
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainMOVE/index.vue
  61. 21
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainMOVE/inventorymoveRequestMain.data.ts
  62. 50
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue
  63. 11
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts
  64. 1
      src/views/wms/productionManage/productdismantle/productdismantleRecordMain/productdismantleRecordMain.data.ts
  65. 9
      src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue
  66. 25
      src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts
  67. 5
      src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue
  68. 15
      src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
  69. 4
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
  70. 15
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
  71. 3
      src/views/wms/productionManage/productputawayAssemble/productputawayAssembleJobMain/index.vue
  72. 3
      src/views/wms/productionManage/productreceipt/productreceiptJobMain/index.vue
  73. 275
      src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue
  74. 11
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue
  75. 11
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue
  76. 6
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue
  77. 136
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts
  78. 6
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  79. 7
      src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue
  80. 24
      src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue
  81. 16
      src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts
  82. 27
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue
  83. 26
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/index.vue
  84. 2
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts
  85. 1
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue
  86. 2
      src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts
  87. 261
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue
  88. 33
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMTypeMain/index.vue
  89. 341
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue
  90. 262
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordRefuseMain/index.vue
  91. 20
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  92. 4
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts
  93. 23
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnJobMain/index.vue
  94. 24
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue
  95. 36
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  96. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  97. 287
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts
  98. 408
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue
  99. 182
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/index.vue
  100. 382
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/purchaseclaimRecordMain.data.ts

1
src/api/wms/business/inputBlur.ts

@ -475,7 +475,6 @@ export const FormBlur = async (field, val, routeName, formRef, detailData, formS
// 根据下方输入框失去焦点校验信息
export const getListByBottonInput = async (headerItem, val, row, routeName, formRef, detailData, tableData, callback) => {
const tableFormSchemaObj = headerItem?.tableForm
console.log(333, tableFormSchemaObj)
if (tableFormSchemaObj.verificationPage && tableFormSchemaObj.verificationParams) {
if (!val) return;
const params = ref({})

19
src/api/wms/customerStatementDetail/index.ts

@ -55,6 +55,17 @@ export const getCustomerStatementReconciliationPage = async (params) => {
return await request.get({ url: `/wms/customer-statement-detail/page`, params })
}
}
// 查询模具分摊明细列表
export const getCustomerToolApportStatementPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/wms/customer-tool-apport-statement-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/page`, params })
}
}
// 查询客户对账单子信息表(WMS)详情
export const getCustomerStatementDetail = async (id: number) => {
return await request.get({ url: `/wms/customer-statement-detail/get?id=` + id })
@ -98,4 +109,10 @@ export const exportCustomerStatementCompareDetail = async (params) => {
}else{
return await request.download({ url: `/wms/customer-statement-detail/export-excel-compare`, params })
}
}
}
// 客户模具分摊对账单修改调整金额
export const updateAdjustmentAmount = async (id: number, masterId: number, amount: number) => {
return await request.get({ url: `/wms/customer-statement-main/updateAdjustmentAmount?id=` + id + '&masterId=' + masterId + '&amount=' + amount })
}

6
src/api/wms/customerStatementMain/index.ts

@ -108,11 +108,6 @@ export const getCustomerList = async () => {
}
// 客户模具分摊对账单修改调整金额
export const updateAdjustmentAmount = async (id:number,masterId:number,amount:number) => {
return await request.get({ url: `/wms/customer-statement-main/updateAdjustmentAmount?id=` + id+'&masterId='+masterId+'&amount='+amount})
}
// 导出客户对账单Excel
export const exportCustomerStatementMain = async (params) => {
if (params.isSearch) {
@ -133,3 +128,4 @@ export const exportCustomerStatementShareMain = async (params) => {
}
}

10
src/api/wms/package/index.ts

@ -126,12 +126,20 @@ export const getLabelDetailPageByRecordId = async (params) => {
export const getProductreceiptLabelDetailPage = async (params) => {
return await request.get({ url: `/wms/package/getProductreceiptLabelDetailPage`,params})
}
// 根据库存余额获取包装信息进行打印标签
export const getBalanceToPackage = async (packingNumber: String) => {
return await request.get({ url: `/wms/package/getBalanceToPackage?packingNumber=` + packingNumber})
}
// 根据库存余额获取包装信息进行打印标签(英泰)
export const getBalanceToPackageByIntex = async (itemCode: String,batch: String) => {
const data = {
itemCode: itemCode,
batch: batch
}
return await request.put({ url: `/wms/package/getBalanceToPackageByIntex`, data: data})
}
// 根据库存余额获取包装信息进行打印标签--批量打印
export const getBalanceToPackageSelection = async (data: any) => {
return await request.post({ url: `/wms/balance/batchPrintLabel` ,data})

16
src/api/wms/productreceiptJobMain/index.ts

@ -101,6 +101,22 @@ export const deleteProductreceiptJobMain = async (id: number) => {
// 导出制品收货任务主 Excel
export const exportProductreceiptJobMain = async (params) => {
params.type = 'scrap'
if (params.isSearch) {
const cmd = {
'column':'type',
'action':'==',
'value':'scrap'
}
params.filters.push(cmd)
const data = {...params}
return await request.downloadPost({ url: `/wms/productreceipt-job-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productreceipt-job-main/export-excel`, params })
}
}
export const exportProductreceiptJobMainPredict = async (params) => {
params.type = 'predict'
if (params.isSearch) {
const cmd = {

12
src/api/wms/productreceiptRequestMain/index.ts

@ -93,6 +93,16 @@ export const exportProductreceiptRequestMain = async (params) => {
}
}
export const exportProductreceiptRequestMainPredict = async (params) => {
params.type = 'predict'
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/productreceipt-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/productreceipt-request-main/export-excel`, params })
}
}
// 导出制品收货申请主 Excel
export const exportProductreceiptRequestMainAssemble = async (params) => {
params.type = 'assemble'
@ -143,4 +153,4 @@ export const handle = (id) => {
// 创建标签
export const productCreateLabel = async (data: ProductreceiptRequestMainVO) => {
return await request.post({ url: `/wms/productreceipt-request-main/productCreateLabel`, data })
}
}

9
src/api/wms/purchaseBarterRecordDetail/index.ts

@ -22,6 +22,11 @@ export const getPurchaseBarterRecordDetailPage = async (params) => {
}
}
export async function exportPurchaseBarterRecord(params: any) {
export async function exportPurchaseBarterRecord(params) {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchase-barter-record-detail/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchase-barter-record-detail/export-excel`, params })
}
}

7
src/api/wms/purchaseBarterRequestMain/index.ts

@ -47,7 +47,12 @@ export const deletePurchaseBarterRequestMain = async (id: number) => {
// 导出采购换货申请主 Excel
export const exportPurchaseBarterRequestMain = async (params) => {
return await request.download({ url: `/wms/purchase-barter-request-main/export-excel`, params })
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchase-barter-request-main/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchase-barter-request-main/export-excel`, params })
}
}
// 下载用户导入模板

41
src/api/wms/purchaseClaimRequestDetail/index.ts

@ -0,0 +1,41 @@
import request from '@/config/axios'
// 获得采购索赔子分页
export const getPurchaseClaimRequestDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-claim-request-detai/senior', data })
} else {
return await request.get({ url: `/wms/purchase-claim-request-detai/page`, params })
}
}
// 创建采购索赔子
export const createPurchaseClaimRequestDetail = async (data) => {
return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data })
}
// 修改采购索赔子
export const updatePurchaseClaimRequestDetail = async (data) => {
return await request.put({ url: `/wms/purchase-claim-request-detail/update`, data })
}
// 删除采购索赔子
export const deletePurchaseClaimRequestDetail = async (id) => {
return await request.delete({ url: `/wms/purchase-claim-request-detail/delete?id=` + id })
}
// 获得采购索赔子
export const getPurchaseClaimRequestDetail = async (id) => {
return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id })
}
// 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchase-claim-request-detail/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchase-claim-request-detail/export-excel`, params })
}
}

55
src/api/wms/purchaseClaimRequestMain/index.ts

@ -0,0 +1,55 @@
import request from '@/config/axios'
export interface PurchaseClaimRequestMainVO {
id: number
number: string
supplierCode: string
claimTime: Date
status: string
supplierinvoiceNumber: string
remark: string
available: string
siteId: string
concurrencyStamp: string
}
// 查询采购索赔主列表
export const getPurchaseClaimRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchaseClaim-request-main/senior', data })
} else {
return await request.get({ url: `/wms/purchaseClaim-request-main/page`, params })
}
}
// 查询采购索赔主详情
export const getPurchaseClaimRequestMain = async (id: number) => {
return await request.get({ url: `/wms/purchaseClaim-request-main/get?id=` + id })
}
// 新增采购索赔主
export const createPurchaseClaimRequestMain = async (data: PurchaseClaimRequestMainVO) => {
return await request.post({ url: `/wms/purchaseClaim-request-main/create`, data })
}
// 修改采购索赔主
export const updatePurchaseClaimRequestMain = async (data: PurchaseClaimRequestMainVO) => {
return await request.put({ url: `/wms/purchaseClaim-request-main/update`, data })
}
// 删除采购索赔主
export const deletePurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/delete?id=` + id })
}
// 导出采购索赔主 Excel
export const exportPurchaseClaimRequestMain = async (params) => {
return await request.download({ url: `/wms/purchaseClaim-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseClaim-request-main/get-import-template' })
}

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

@ -1,66 +0,0 @@
import request from '@/config/axios'
export interface PurchaseclaimRecordDetailVO {
batch: string
altBatch: string
poNumber: string
poLine: string
reason: string
singlePrice: number
amount: number
number: string
itemCode: string
remark: string
createTime: Date
creator: string
itemName: string
itemDesc1: string
itemDesc2: string
projectCode: string
qty: number
uom: string
code: string
interfaceType: string
jobDetailId: string
}
// 查询采购索赔记录子列表
export const getPurchaseclaimRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchaseclaim-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchaseclaim-record-detail/page`, params })
}
}
// 查询采购索赔记录子详情
export const getPurchaseclaimRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/purchaseclaim-record-detail/get?id=` + id })
}
// 新增采购索赔记录子
export const createPurchaseclaimRecordDetail = async (data: PurchaseclaimRecordDetailVO) => {
return await request.post({ url: `/wms/purchaseclaim-record-detail/create`, data })
}
// 修改采购索赔记录子
export const updatePurchaseclaimRecordDetail = async (data: PurchaseclaimRecordDetailVO) => {
return await request.put({ url: `/wms/purchaseclaim-record-detail/update`, data })
}
// 删除采购索赔记录子
export const deletePurchaseclaimRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/purchaseclaim-record-detail/delete?id=` + id })
}
// 导出采购索赔记录子 Excel
export const exportPurchaseclaimRecordDetail = async (params) => {
return await request.download({ url: `/wms/purchaseclaim-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseclaim-record-detail/get-import-template' })
}

64
src/api/wms/purchaseclaimRecordMain/index.ts

@ -1,64 +0,0 @@
import request from '@/config/axios'
export interface PurchaseclaimRecordMainVO {
requestNumber: string
asnNumber: string
ppNumber: string
supplierCode: string
outTransactionType: string
inTransactionType: string
executeTime: Date
activeDate: Date
requestTime: Date
dueTime: Date
departmentCode: string
interfaceType: string
number: string
businessType: string
remark: string
createTime: Date
creator: string
code: string
available: string
}
// 查询采购索赔记录主列表
export const getPurchaseclaimRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchaseclaim-record-main/senior', data })
} else {
return await request.get({ url: `/wms/purchaseclaim-record-main/page`, params })
}
}
// 查询采购索赔记录主详情
export const getPurchaseclaimRecordMain = async (id: number) => {
return await request.get({ url: `/wms/purchaseclaim-record-main/get?id=` + id })
}
// 新增采购索赔记录主
export const createPurchaseclaimRecordMain = async (data: PurchaseclaimRecordMainVO) => {
return await request.post({ url: `/wms/purchaseclaim-record-main/create`, data })
}
// 修改采购索赔记录主
export const updatePurchaseclaimRecordMain = async (data: PurchaseclaimRecordMainVO) => {
return await request.put({ url: `/wms/purchaseclaim-record-main/update`, data })
}
// 删除采购索赔记录主
export const deletePurchaseclaimRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseclaim-record-main/delete?id=` + id })
}
// 导出采购索赔记录主 Excel
export const exportPurchaseclaimRecordMain = async (params) => {
return await request.download({ url: `/wms/purchaseclaim-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseclaim-record-main/get-import-template' })
}

53
src/api/wms/purchaseclaimRequestDetail/index.ts

@ -1,53 +0,0 @@
import request from '@/config/axios'
export interface PurchaseclaimRequestDetailVO {
altBatch: string
amount: Number
batch: Number
id: string
itemCode: string
itemDesc1: string
itemDesc2: string
itemName: string
number: string
poLine: string
poNumber: string
projectCode: string
qty: Number
reason: string
remark: string
singlePrice: Number
uom: string
}
// 查询采购索赔申请子列表
export const getPurchaseclaimRequestDetailPage = async (params) => {
// return await request.get({ url: `/wms/purchaseclaim-request-detail/page`, params })
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/purchaseclaim-request-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchaseclaim-request-detail/page`, params })
}
}
// 查询采购索赔申请子详情
export const getPurchaseclaimRequesDetail = async (id: number) => {
return await request.get({ url: `/wms/purchaseclaim-request-detail/get?id=` + id })
}
// 新增采购索赔申请子
export const createPurchaseclaimRequestDetail = async (data: PurchaseclaimRequestDetailVO) => {
return await request.post({ url: `/wms/purchaseclaim-request-detail/create`, data })
}
// 修改采购索赔申请子
export const updatePurchaseclaimRequestDetail = async (data: PurchaseclaimRequestDetailVO) => {
return await request.put({ url: `/wms/purchaseclaim-request-detail/update`, data })
}
// 删除采购索赔申请子
export const deletePurchaseclaimRequestDetail = async (id: number) => {
return await request.delete({ url: `/wms/purchaseclaim-request-detail/delete?id=` + id })
}

92
src/api/wms/purchaseclaimRequestMain/index.ts

@ -1,92 +0,0 @@
import request from '@/config/axios'
export interface PurchaseclaimRequestMainVO {
asnNumber: string
ppNumber: string
supplierCode: string
number: string
businessType: string
remark: string
createTime: Date
creator: string
requestTime: Date
dueTime: Date
departmentCode: string
status: string
updateTime: Date
updater: string
autoCommit: string
autoAgree: string
autoExecute: string
directCreateRecord: string
}
// 查询采购索赔申请主列表
export const getPurchaseclaimRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/purchaseclaim-request-main/senior', data })
} else {
return await request.get({ url: `/wms/purchaseclaim-request-main/page`, params })
}
}
// 查询采购索赔申请主详情
export const getPurchaseclaimRequestMain = async (id: number) => {
return await request.get({ url: `/wms/purchaseclaim-request-main/get?id=` + id })
}
// 新增采购索赔申请主
export const createPurchaseclaimRequestMain = async (data: PurchaseclaimRequestMainVO) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/create`, data })
}
// 修改采购索赔申请主
export const updatePurchaseclaimRequestMain = async (data: PurchaseclaimRequestMainVO) => {
return await request.put({ url: `/wms/purchaseclaim-request-main/update`, data })
}
// 删除采购索赔申请主
export const deletePurchaseclaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseclaim-request-main/delete?id=` + id })
}
// 打开供应商发货申请主
export const opePurchaseclaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/open?id=` + id })
}
// 关闭供应商发货申请主
export const cloPurchaseclaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/close?id=` + id })
}
// 提交审批供应商发货申请主
export const subPurchaseclaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/sub?id=` + id })
}
// 审批通过供应商发货申请主
export const appPurchaseclaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/app?id=` + id })
}
// 驳回供应商发货申请主
export const rejPurchaseclaimRequestMain = async (id: number) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/rej?id=` + id })
}
// 处理
export const genRecordsPurchaseclaimRequestMain = async (id) => {
return await request.post({ url: `/wms/purchaseclaim-request-main/genRecords?id=` + id })
}
// 导出采购索赔申请主 Excel
export const exportPurchaseclaimRequestMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.downloadPost({ url: `/wms/purchaseclaim-request-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/purchaseclaim-request-main/export-excel`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseclaim-request-main/get-import-template' })
}

7
src/api/wms/switch/index.ts

@ -52,5 +52,10 @@ export const exportSwitch = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/switch/get-import-template' })
return request.download({ url: '/wms/switch/get-import-template'})
}
// 获取开关详情
export const getSwitchByCode = async (code) => {
return await request.get({ url: '/wms/switch/getByCode?code=' + code })
}

34
src/components/BasicForm/src/BasicForm.vue

@ -164,6 +164,7 @@
</SearchTable>
</template>
<script setup lang="ts">
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { SearchTable } from '@/components/SearchTable'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import ButtonBase from '@/components/XButton/src/ButtonBase.vue'
@ -173,6 +174,7 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { tableFormBlurVer, FormBlur, getListByBottonInput } from '@/api/wms/business/inputBlur'
import CollectionTable from '@/components/CollectionTable/src/CollectionTable.vue'
import { isString } from 'min-dash'
const { wsCache } = useCache()
const count = ref(0)
const props = defineProps({
@ -430,21 +432,37 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema)
const rules = ref(props.rules)
const tableAllSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules)
const route = useRoute() //
const routeName = ref('')
const sureDisabled = ref(false)
const tabSheet = ref('TableForm')
console.log(555,props.tableAllSchemas)
routeName.value = route.name
const formHeight = ref({})
if (!wsCache.get('ShowPackingNumber')) {
if (formSchema.value) {
formSchema.value = formSchema.value.filter(item => item.field != 'packingNumber')
}
if (rules.value && rules.value.packingNumber) {
delete rules.value.packingNumber
}
if (props.tableAllSchemas) {
tableAllSchemas.value.tableFormColumns = props.tableAllSchemas.tableFormColumns.filter(item => item.field != 'packingNumber')
if (tableFormRules.value && tableFormRules.value.packingNumber) {
delete tableFormRules.value.packingNumber
}
}
}
const tabChange = (item) => {
tabSheet.value = item.prop
}
// -
// const buttondata = [
// defaultButtons.mainListEditBtn(null), //
@ -733,6 +751,7 @@ const open = async (
}
}
}
if (row?.id || row?.masterId) {
formLoading.value = true
try {
@ -801,6 +820,7 @@ const submitForm = async () => {
if (!elForm) return
const valid = await elForm.validate()
if (!valid) return
//
if (props.isBusiness) {
// formLoading.value = true
@ -818,6 +838,9 @@ const submitForm = async () => {
//
try {
const data = unref(formRef)?.formModel
if (!wsCache.get('ShowPackingNumber') ) {
data.packingNumber=''
}
emit('submitForm', formType.value, data)
} finally {
// formLoading.value = false
@ -826,6 +849,11 @@ const submitForm = async () => {
//
try {
const data = unref(formRef)?.formModel
if (!wsCache.get('ShowPackingNumber') ) {
data.packingNumber=''
}
console.log(data);
emit('submitForm', formType.value, data)
} finally {
// formLoading.value = false
@ -836,6 +864,10 @@ const submitForm = async () => {
// formLoading.value = true
try {
const data = unref(formRef)?.formModel
//
if (!wsCache.get('ShowPackingNumber') ) {
data.packingNumber=''
}
emit('success', formType.value, data)
} finally {
// formLoading.value = false

30
src/components/Detail/src/Detail.vue

@ -41,6 +41,7 @@
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
:key="updateKey"
/>
<!-- 默认单表展现 -->
<Descriptions
@ -187,7 +188,7 @@
ref="formRef"
@success="submitForm"
:rules="detailAllSchemasRules"
:formAllSchemas="detailAllSchemas"
:formAllSchemas="detailAllSchemasRef"
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
@ -221,6 +222,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import { SearchTable } from '@/components/SearchTable'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
defineOptions({ name: 'Detail' })
@ -455,6 +457,21 @@ const props = defineProps({
default: 8
},
})
const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas)
const detailAllSchemasRules = ref(props.detailAllSchemasRules)
if (!wsCache.get('ShowPackingNumber')) {
if (allSchemas.value) {
allSchemas.value.detailSchema = props.allSchemas.detailSchema.filter(item => item.field != 'packingNumber')
}
if (detailAllSchemasRef.value) {
detailAllSchemasRef.value.tableColumns = props.detailAllSchemas.tableColumns.filter(item => item.field != 'packingNumber')
}
if (detailAllSchemasRules.value&&detailAllSchemasRules.value.packingNumber) {
delete detailAllSchemasRules.value.packingNumber
}
}
const filterPermissionAnnexTable = ()=>{
return props.annexTable.filter(item=>{
const { wsCache } = useCache()
@ -738,7 +755,9 @@ const formRef = ref()
const titleNameRef = ref()
const titleValueRef = ref()
const count =ref(0)
const curRow =ref({})
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
curRow.value = row
if(tabRef.value){
tabRef.value.changeCurrent(0)
}
@ -836,7 +855,7 @@ const updateList = ()=>{
filters: tableObjectRef.value.params.filters
})
} else {
getList()
tableMethodsRef.value.getList()
}
}
@ -862,7 +881,6 @@ const getChangeRecordList = async () => {
const tableObjectRef = ref()
const tableMethodsRef = ref()
const detailAllSchemasRef = ref()
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
@ -922,7 +940,6 @@ const buttonBaseClick = (val, item) => {
//
} else {
//
console.log('其他按钮', item)
emit('buttonBaseClick',val, item)
}
}
@ -1170,9 +1187,12 @@ watch(
() => props.otherHeadButttonData,
(val) => {
HeadButttondata.value = [...HeadButttondataBackups.value, ...props.otherHeadButttonData]
},
{
deep: true
}
)
defineExpose({ openDetail, formRef ,updateList,submitUpdateList,changeTabCurrent,openForm}) // open
defineExpose({ openDetail, formRef ,updateList,submitUpdateList,changeTabCurrent,openForm,tableObjectRef}) // open
</script>
<style lang="scss">

1
src/components/ImportForm/src/ImportCustomerStatementForm.vue

@ -267,7 +267,6 @@ const props = defineProps({
}
})
const importTemplateData = ref(props.importTemplateData)
console.log(333,props.importTemplateData.dataType)
const dataType = ref('')
dataType.value = props.importTemplateData.dataType ?'&dataType=' + props.importTemplateData.dataType :''
const accept = ref(props.accept)

1
src/components/ImportForm/src/ImportCustomerStatementShareForm.vue

@ -232,7 +232,6 @@ const props = defineProps({
}
})
const importTemplateData = ref(props.importTemplateData)
console.log(333,props.importTemplateData.dataType)
const dataType = ref('')
dataType.value = props.importTemplateData.dataType ?'&dataType=' + props.importTemplateData.dataType :''
const accept = ref(props.accept)

1
src/components/ImportForm/src/ImportForm.vue

@ -230,7 +230,6 @@ const props = defineProps({
}
})
const importTemplateData = ref(props.importTemplateData)
console.log(333,props.importTemplateData.dataType)
const dataType = ref('')
dataType.value = props.importTemplateData.dataType ?'&dataType=' + props.importTemplateData.dataType :''
const accept = ref(props.accept)

5
src/components/Search/src/Search.vue

@ -77,6 +77,11 @@ const visible = ref(true)
const newSchema = computed(() => {
let schema: FormSchema[] = cloneDeep(props.schema)
if (!wsCache.get('ShowPackingNumber')) {
if (schema) {
schema = schema.filter(item => item.field != 'packingNumber')
}
}
if (props.expand && props.expandField && !unref(visible)) {
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
if (index > -1) {

7
src/components/SearchHigh/src/SearchHigh.vue

@ -77,6 +77,8 @@ import { Minus } from '@element-plus/icons-vue'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user'
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
const { t } = useI18n()
const userListAll = ref([])
@ -119,6 +121,11 @@ const searchOption_high = ref(props.allSchemas?.tableColumns.filter(item => (ite
const moreListData = ref({
filters:[]
})
if (!wsCache.get('ShowPackingNumber')) {
if (searchOption_high.value) {
searchOption_high.value = searchOption_high.value.filter(item => item.field != 'packingNumber')
}
}
// -
const butttondata = [
defaultButtons.defaultSearchBtn(null), //

15
src/components/Table/src/Table.vue

@ -102,7 +102,13 @@ export default defineComponent({
}
const setColumn = (columnProps: TableSetPropsType[], columnsChildren?: TableColumn[]) => {
const { columns } = unref(getProps)
let { columns } = unref(getProps)
if (!wsCache.get('ShowPackingNumber')) {
if (columns) {
columns = columns.filter(item => item.field != 'packingNumber')
}
}
for (const v of columnsChildren || columns) {
for (const item of columnProps) {
if (v.field === item.field) {
@ -329,7 +335,7 @@ export default defineComponent({
const rnderTableColumn = (columnsChildren?: TableColumn[]) => {
const {
let {
columns,
reserveIndex,
pageSize,
@ -339,6 +345,11 @@ export default defineComponent({
showOverflowTooltip,
border
} = unref(getProps)
if (!wsCache.get('ShowPackingNumber')) {
if (columns) {
columns = columns.filter(item => item.field != 'packingNumber')
}
}
//
// updateSort(columns)
return [...[renderTableExpand()], ...[renderTableSelection()]].concat(

55
src/components/TableForm/src/TableForm.vue

@ -86,7 +86,7 @@
>
<!-- 字符串输入框 -->
<el-form-item
v-if="!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString'"
v-if="!getFormItemType(row,headerItem)&&(!headerItem?.tableForm?.type || headerItem?.tableForm?.type == 'InputString')"
:prop="headerItem.field"
style="display: flex; align-items: center"
>
@ -123,11 +123,11 @@
><Icon icon="ep:search" size="14"
/></el-button>
</el-form-item>
<el-form-item v-if="headerItem?.tableForm?.type == 'slot'">
<el-form-item v-if="getFormItemType(row,headerItem) == 'slot'">
<slot :row="row"></slot>
</el-form-item>
<!-- 金额输入框 -->
<el-form-item v-if="headerItem?.tableForm?.type == 'number'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'number'" :prop="headerItem.field">
<el-input
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
@ -160,7 +160,7 @@
/>
</el-form-item>
<!-- 下拉框 -->
<el-form-item v-if="headerItem?.tableForm?.type == 'Select'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'Select'" :prop="headerItem.field">
<el-select
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
@ -224,11 +224,11 @@
</el-select>
</el-form-item>
<!-- 时间选择器 -->
<el-form-item v-if="headerItem?.tableForm?.type == 'FormTime'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'FormTime'" :prop="headerItem.field">
<el-time-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
:clearable="headerItem?.tableForm?.clearable"
:placeholder="headerItem?.tableForm?.placeholder || '选择时间'"
style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)"
@ -237,11 +237,11 @@
/>
</el-form-item>
<!-- 日期选择器 -->
<el-form-item v-if="headerItem?.tableForm?.type == 'FormDate'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'FormDate'" :prop="headerItem.field">
<el-date-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
:clearable="headerItem?.tableForm?.clearable"
style="width: 100%"
:disabled="itemIsDisabled(headerItem, row)"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期'"
@ -258,7 +258,7 @@
<el-date-picker
:key="headerItem.field + $index"
type="datetime"
:clearable="true"
:clearable="headerItem?.tableForm?.clearable"
v-model="row[headerItem.field]"
:placeholder="headerItem?.tableForm?.placeholder || '选择日期时间'"
style="width: 100%"
@ -275,7 +275,7 @@
<el-date-picker
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
:clearable="true"
:clearable="headerItem?.tableForm?.clearable"
:disabled="itemIsDisabled(headerItem, row)"
:type="headerItem?.tableForm?.timeType || 'datetimerange'"
range-separator="至"
@ -286,7 +286,7 @@
/>
</el-form-item>
<!-- Switch 开关 -->
<el-form-item v-if="headerItem?.tableForm?.type == 'Switch'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'Switch'" :prop="headerItem.field">
<el-switch
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
@ -304,7 +304,7 @@
/>
</el-form-item>
<!-- Radio 单选-->
<el-form-item v-if="headerItem?.tableForm?.type == 'Radio'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'Radio'" :prop="headerItem.field">
<el-radio-group
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
@ -328,7 +328,7 @@
</el-radio-group>
</el-form-item>
<!-- Checkbox 多选-->
<el-form-item v-if="headerItem?.tableForm?.type == 'Checkbox'" :prop="headerItem.field">
<el-form-item v-if="getFormItemType(row,headerItem) == 'Checkbox'" :prop="headerItem.field">
<el-checkbox-group
:key="headerItem.field + $index"
v-model="row[headerItem.field]"
@ -529,7 +529,6 @@ const props = defineProps({
}
})
let isShowTableFormSearch = ref({})
console.log(33333, props.tableFields)
isShowTableFormSearch.value = props.tableFields.find((item) => item.isShowTableFormSearch)
//
@ -627,11 +626,21 @@ const handleTableSelect = (row, column, event) => {
// item
const itemIsDisabled = (colum, row) => {
return (
Boolean(colum.tableForm?.disabled) ||
Boolean(row.disabled) ||
Boolean(row['disabled_' + colum.field])
)
console.log(row['disabled_' + colum.field])
if (row['disabled_' + colum.field] === true || row['disabled_' + colum.field] === false) {
return Boolean(row['disabled_' + colum.field])
}
else if (!row['disabled_' + colum.field] && (colum.tableForm?.disabled === true || colum.tableForm?.disabled === false)) {
return Boolean(colum.tableForm?.disabled)
}else {
return Boolean(row.disabled)
}
// return (
// Boolean(colum.tableForm?.disabled) ||
// Boolean(row.disabled) ||
// Boolean(row['disabled_' + colum.field])
// )
}
// const { t } = useI18n() //
@ -762,6 +771,14 @@ const isFullscreen = ref(false)
const reloadFullscreen = (fullscreen)=>{
isFullscreen.value = fullscreen
}
//
const getFormItemType = (row, headerItem) => {
if (headerItem.field&&row[headerItem.field + 'FormItemType'] != undefined) {
return row[headerItem.field + 'FormItemType']
} else {
return headerItem?.tableForm?.type ? headerItem?.tableForm?.type :''
}
}
// setup
defineExpose({
TableBaseComponents_Ref,

2
src/components/TableHead/src/TableHead.vue

@ -76,7 +76,7 @@ import rowDrop from "@/components/rowDrop/index.vue"
const updataTableColumns = (val) => {
emit('updataTableColumns', val)
}
console.log(3444,props.HeadButttondata)
// const defaultButtons = inject('global').defaultButtons
//
const buttonsLeftOrRight = () => {

8
src/locales/en-US.ts

@ -1301,13 +1301,15 @@ export default {
: 'Last Updated By',
: 'The range of invoices is',
: 'Re compare',
: 'Re comparison successful',
: 'Confirm the comparison results',
: 'Confirmed successful',
: 'Confirm the shared amount',
: 'Import mold allocation statement',
: 'Do you want to re compare?',
: 'Do you want to re compare?',
: 'Are you sure about the comparison results?',
退: 'Do you want to return it?',
: 'Do you want to invalidate it?',
"是否退回所选中数据?": 'Do you want to return the selected data?',
退: 'Returned successfully',
: 'Do you want to confirm the allocation amount?',
: 'Create an invoice request?',
},

10
src/locales/zh-CN.ts

@ -1302,13 +1302,15 @@ export default {
:'最后更新人',
: '可开票数量范围是',
: '重新对比',
: '重新对比成功',
: '确认对比结果',
: '确认成功',
: '确认分摊金额',
: '导入模具分摊对账单',
: '是否重新对?',
: "是否确认对比结果?",
退: '是否退回?',
: '是否作废?',
: '是否重新对?',
"是否确认对比结果": "是否确认对比结果?",
"是否退回所选中数据?": '是否退回所选中数据?',
退: '退回成功',
: '是否确认分摊金额?',
: '创建开票申请',
},

1
src/views/eam/locationArea/index.vue

@ -127,7 +127,6 @@
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
console.log('33333', row )
basicFormRef.value.open(type, row)
}

26
src/views/login/components/LoginForm.vue

@ -99,6 +99,7 @@
import { getSystermUpdateAlert,getSystermUpdateUrl,getNeedCode } from '@/utils/systemParam'
import {validateResetTime} from "@/api/system/password";
import { Verify } from '@/components/Verifition'
import { getSwitchByCode } from '@/api/wms/switch'
const needCode = ref(getNeedCode()==true||getNeedCode()=='true')
@ -262,7 +263,17 @@
switch (differenceDays){
case null:
break
case 0 || 1:
case 0:
await ElMessageBox.alert(
'<strong>密码到期,请立即修改</strong>',
'重要提示',
{
dangerouslyUseHTMLString: true,
}
)
router.push({path:"/updatePasswordNewTips",query:{username:loginData.loginForm.username}})
return
case 1:
await ElMessageBox.alert(
'<strong>密码到期,请立即修改</strong>',
'重要提示',
@ -272,15 +283,6 @@
)
router.push({path:"/updatePasswordNewTips",query:{username:loginData.loginForm.username}})
return
// case 1:
// await ElMessageBox.alert(
// '<strong></strong>',
// '',
// {
// dangerouslyUseHTMLString: true,
// }
// )
// return
default:
await ElMessageBox.alert(
'密码'+differenceDays+'到期,请尽快修改。',
@ -303,6 +305,7 @@
})
if (loginData.loginForm.rememberMe) {
authUtil.setLoginForm(loginData.loginForm)
} else {
authUtil.removeLoginForm()
}
@ -330,6 +333,9 @@
//
const { wsCache } = useCache()
wsCache.set(CACHE_KEY.DEPT, await DeptApi.getSimpleDeptList())
await getSwitchByCode("ShowPackingNumber").then((res) => {
wsCache.set('ShowPackingNumber', res == 'TRUE' ? true : false)
})
}catch (e){
if(e.code === 1002000008){
setTimeout(function (){

7
src/views/qms/inspectionRecord/addForm.vue

@ -1526,13 +1526,6 @@ const inspectionValueInput = (item, cur) => {
.inspectionValue
) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
console.log(parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue
))
console.log( parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
console.log( parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping))
console.log(333)
item.isPass = false
return
}

3
src/views/qms/inspectionRecordFirst/addForm.vue

@ -831,7 +831,6 @@ const processList = async (InspectionSchemeObj, list) => {
}
} else {
//
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
@ -1233,7 +1232,6 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
}
} else {
//
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required =
false
@ -1307,7 +1305,6 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
}
} else {
//
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required =
false

76
src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue

@ -49,6 +49,7 @@
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onBlur="onBlur"
@onChange="onChange"
/>
<!-- 详情 -->
@ -189,29 +190,39 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "update"){
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
if (item.field == 'warehouseCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
})
}else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}
if (item.field == 'warehouseCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}
})
}
basicFormRef.value.open(type, row)
nextTick(() => {
if (type == "update") {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}else if (item.field == 'warehouseCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
} else if (item.field == 'manageMode') {
// if (row.type == 'WIP') {
// item.componentProps.options = manageModeOptions.value
// } else {
// item.componentProps.options =manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
// }
item.componentProps.options = manageModeOptions.value
}
})
}else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}else if (item.field == 'warehouseCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}else if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
//item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
})
}
// form
@ -320,6 +331,27 @@ const searchFormClick = (searchData) => {
const onBlur = (field, e)=>{
}
const manageModeOptions = ref(JSON.parse(JSON.stringify(Area.allSchemas.formSchema.find(item=>item.field == 'manageMode').componentProps.options)))
const onChange = (field, e)=>{
if (field == 'type') {
if (e == 'WIP') {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
} else {
Area.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
basicFormRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
}
}
/** 初始化 **/
onMounted(async() => {

71
src/views/wms/basicDataManage/itemManage/itemarea/index.vue

@ -118,6 +118,7 @@ const isShowButton = ref(true)
const updataTableColumns = (val) => {
tableColumns.value = val
}
const manageModeOptions = ref(JSON.parse(JSON.stringify(Itemarea.allSchemas.formSchema.find(item=>item.field == 'manageMode').componentProps.options)))
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -147,6 +148,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['areaCode'] = val[0]['code']
setV['areaType'] = val[0]['type']
setV['manageMode'] = val[0]['manageMode']
if (val[0]['type'] == 'WIP') {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
setV['manageMode'] = item.componentProps.options[0].value
}
})
} else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
// item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
setV['manageMode'] = item.componentProps.options[0].value
}
})
}
}else if(formField == 'inPackUnit') {
setV['inPackUnit'] = val[0]['packUnit']
@ -305,28 +322,40 @@ const handleDisable = async (id: number) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
if(type == "update"){
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}
if (item.field == 'itemCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}})
}else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = true
}
if (item.field == 'itemCode') {
item.componentProps.isSearchList = true
}
})
}
tableData.value = [] //
formRef.value.open(type, row)
nextTick(() => {
if(type == "update"){
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
}else if (item.field == 'itemCode') {
item.componentProps.isSearchList = false,
item.componentProps.disabled = true
} else if (item.field == 'manageMode') {
// if (row.areaType == 'WIP') {
// item.componentProps.options = manageModeOptions.value
// } else {
// item.componentProps.options =manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
// }
item.componentProps.options = manageModeOptions.value
}
})
}else {
Itemarea.allSchemas.formSchema.forEach((item) => {
if (item.field == 'areaCode') {
item.componentProps.isSearchList = true
}else if (item.field == 'itemCode') {
item.componentProps.isSearchList = true
}else if (item.field == 'manageMode') {
item.componentProps.options = manageModeOptions.value
//item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY')
formRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value
}
})
}
})
tableData.value = [] //
}
/**

2
src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue

@ -294,9 +294,7 @@ const handleExport = async () => {
const BASE_URL = getJmreportBaseUrl()
const labelType = ref('') //
const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555);
PackageApi.getBalanceToPackage(row.relateNumber).then(res => {
console.log(777,res);
if (res.productionLineCode != null) {
labelType.value = 'zz'
} else {

171
src/views/wms/deliversettlementManage/customerSaleInvoiceMain/customerSaleInvoiceMain.data.ts

@ -1,5 +1,9 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {
CustomerStatementMain,
} from '../../deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
// 表单校验
export const CustomerSaleInvoiceMainRules = reactive({
@ -15,49 +19,100 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
} ,{
isForm: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm:false,
// 0:新增1:已发布2已作废
},
{
label: '客户对账单单据号',
label: '客户对账单',
field: 'customerStatementNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '客户代码',
field: 'customer',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled:true
}
}
},
{
label: '客户名称',
field: 'customerName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '未税金额',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '税率',
label: '税率(%)',
field: 'taxRate',
dictType: DICT_TYPE.TAX_RATE_DICT,
dictClass: 'string',
sortTableDefault: 3,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '价税合计金额',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '金税票号',
@ -95,7 +150,8 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isTable:false
isTable: false,
isForm:false
},
{
label: '创建时间',
@ -122,3 +178,110 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
// 表单校验
export const CustomerSaleInvoiceDetailRules = reactive({
beforeTaxAmount: [required],
taxRate: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '品番',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
tableForm: {
disabled:true
}
},
{
label: '品号',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
isForm: false,
// 0:新增1:已发布2已作废
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '销售单价',
field: 'price',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '合计单价',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '未税金额',
field: 'taxRate',
sort: 'custom',
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '含税金额',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
]))

439
src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerSaleInvoiceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="[...CustomerSaleInvoiceMain.allSchemas.searchSchema,...CustomerSaleInvoiceDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
@ -12,11 +12,12 @@
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerSaleInvoiceMain.allSchemas"
:detailAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -27,46 +28,72 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="CustomerSaleInvoiceMainRules"
:formAllSchemas="CustomerSaleInvoiceMain.allSchemas"
:tableAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
:tableFormRules="CustomerSaleInvoiceDetailRules"
:tableData="tableData"
:apiUpdate="CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain"
:apiCreate="CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerSaleInvoiceMain.allSchemas" />
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CustomerSaleInvoiceMain.allSchemas"
:detailAllSchemas="CustomerSaleInvoiceDetail.allSchemas"
:detailAllSchemasRules="CustomerSaleInvoiceDetailRules"
:apiCreate="CustomerSaleInvoiceDetailApi.createCustomerSaleInvoiceDetail"
:apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail"
:apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage"
:apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/customer-sale-invoice-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules } from './customerSaleInvoiceMain.data'
import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceMain.data'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
import * as CustomerSaleInvoiceDetailApi from '@/api/wms/customerSaleInvoiceDetail'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'CustomerSaleInvoiceMain' })
import * as AreabasicApi from '@/api/wms/areabasic'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
//
defineOptions({ name: 'customerSaleInvoiceMain' })
const message = useMessage() //
const { t } = useI18n() //
@ -74,34 +101,126 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CustomerSaleInvoiceMain.allSchemas.tableColumns)
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
const customerCode = ref()
const tableColumns = ref([...CustomerSaleInvoiceMain.allSchemas.tableColumns,...CustomerSaleInvoiceDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceDetailPage //
})
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0) return
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
row[formField] = item[searchField]
newRow['uom'] = item['customerUom']
newRow['id'] = item['id']
.push(newRow)
})
}else{
row[formField] = val[0][searchField]
}
// if(formField == 'itemCode') {
// row['uom'] = val[0]['customerUom']
// }
//
} else {
const setV = {}
if(formField == 'customerStatementNumber') {
//
setV['customer'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1,
pageNSize: 100,
masterId:val[0]['id']
}).then((res) => {
console.log(55,res)
tableData.value = res.list && res.list.length > 0 ?res.list : []
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
// setV['soLine'] = val[0]['lineNumber']
// setV['lineNumber'] = val[0]['lineNumber']
// setV['itemCode'] = val[0]['itemCode']
setV['remark'] = val[0]['remark']
setV['uom'] = val[0]['customerUom']
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
// tableform
CustomerSaleInvoiceDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode' ,
isMainValue: true
}]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
},
{
key: 'customerCode',
value: 'customerCode' ,
isMainValue: true
}]
}
})
const { tableObject, tableMethods } = useTable({
getListApi: CustomerSaleInvoiceMainApi.getCustomerSaleInvoiceMainPage //
})
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:customerSaleInvoiceMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customerSaleInvoiceMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customerSaleInvoiceMain:export'}), //
defaultButtons.defaultAddBtn({hasPermi:`wms:${routeName.value}:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -124,63 +243,142 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:customerSaleInvoiceMain:update'}), //
defaultButtons.mainListOrderPubBtn({hasPermi:'wms:customerSaleInvoiceMain:publish'}), //
defaultButtons.mainListOrderPubBtn({hasPermi:'wms:mainListCancelBtn:cancle'}), //
]
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.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'mainPlanOpe') { //
tableObject.loading = true
CustomerSaleInvoiceMainApi.open(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.close(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanSub') { //
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.submit(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.reject(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanApp') { //
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.agree(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.publish(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
tableObject.loading = true
CustomerSaleInvoiceMainApi.resetting(row.masterId).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
handleDelete(row.masterId)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =CustomerSaleInvoiceMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerSaleInvoiceMain')
detailRef.value.openDetail(row, titleName, titleValue,'planDeliverMain')
}
/** 删除按钮操作 */
@ -188,27 +386,121 @@ const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await CustomerSaleInvoiceMainApi.deleteCustomerSaleInvoiceMain(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
await getList()
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CustomerSaleInvoiceMainApi.exportCustomerSaleInvoiceMain(tableObject.params)
download.excel(data, '客户销售开票主信息表(WMS).xlsx')
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
loadDone()
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
CustomerSaleInvoiceDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
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))
}
//true0
const flag = ref(false)
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
data.subList = tableData.value //
data.subList.forEach(item=>{
item.toWarehouseCode = data.toWarehouseCode
item.toLocationCode = data.toLocationCode
})
data.businessType = businessType.value
//
let isExist = false
tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true
})
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach(obj => {
if(obj.qty == 0){
message.error(`数量不能为0!`)
flag.value = true
return;
}
})
if(flag.value){
return
}
var isHave =CustomerSaleInvoiceMain.allSchemas.formSchema.some(function (item) {
return item.field === 'beginTime' || item.field === 'endTime';
});
if(isHave){
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){
message.error('结束时间要大于开始时间')
return;
}
}
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null;
formRef.value.formLoading = true
try {
if (formType === 'create') {
await CustomerSaleInvoiceMainApi.createCustomerSaleInvoiceMain(data)
message.success(t('common.createSuccess'))
} else {
await CustomerSaleInvoiceMainApi.updateCustomerSaleInvoiceMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
@ -217,11 +509,13 @@ const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '客户销售开票主信息表(WMS)导入模版.xlsx'
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
@ -241,5 +535,4 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await CustomerSaleInvoiceMainApi.importTemplate()
})
</script>

23
src/views/wms/deliversettlementManage/customerreturn/customerreturnJobMain/index.vue

@ -75,6 +75,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'CustomerreturnJobMain' })
@ -86,6 +88,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...CustomerreturnJobMain.allSchemas.tableColumns,...CustomerreturnJobDetail.allSchemas.tableMainColumns])
const CustomerreturnJobMainAllSchema = ref(cloneDeep(CustomerreturnJobMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
CustomerreturnJobMain.allSchemas = CustomerreturnJobMainAllSchema.value.allSchemas
} else {
CustomerreturnJobMain.allSchemas.formSchema = CustomerreturnJobMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number')
CustomerreturnJobMain.allSchemas.tableColumns = CustomerreturnJobMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number')
CustomerreturnJobMain.allSchemas.tableFormColumns = CustomerreturnJobMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number')
CustomerreturnJobMain.allSchemas.tableMainColumns = CustomerreturnJobMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number')
CustomerreturnJobMain.allSchemas.detailSchema = CustomerreturnJobMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number')
CustomerreturnJobMain.allSchemas.searchSchema = CustomerreturnJobMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {

23
src/views/wms/deliversettlementManage/customerreturn/customerreturnRecordMain/index.vue

@ -72,6 +72,8 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'CustomerreturnRecordMain' })
@ -83,6 +85,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...CustomerreturnRecordMain.allSchemas.tableColumns,...CustomerreturnRecordDetail.allSchemas.tableMainColumns])
const CustomerreturnRecordMainAllSchema = ref(cloneDeep(CustomerreturnRecordMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
CustomerreturnRecordMain.allSchemas = CustomerreturnRecordMainAllSchema.value.allSchemas
} else {
CustomerreturnRecordMain.allSchemas.formSchema = CustomerreturnRecordMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number')
CustomerreturnRecordMain.allSchemas.tableColumns = CustomerreturnRecordMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number')
CustomerreturnRecordMain.allSchemas.tableFormColumns = CustomerreturnRecordMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number')
CustomerreturnRecordMain.allSchemas.tableMainColumns = CustomerreturnRecordMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number')
CustomerreturnRecordMain.allSchemas.detailSchema = CustomerreturnRecordMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number')
CustomerreturnRecordMain.allSchemas.searchSchema = CustomerreturnRecordMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {

42
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

@ -60,6 +60,7 @@
@onEnter="onEnter"
@inputNumberChange="inputNumberChange"
@clearSearchInput="clearSearchInput"
:key="updateKey"
/>
<!-- 添加明细采购收货记录单号 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
@ -119,6 +120,8 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'CustomerreturnRequestMain' })
@ -131,8 +134,30 @@ const routeName = ref()
const customerCode = ref()
const genLabelId = ref(); //ID
routeName.value = route.name
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns])
const CustomerreturnRequestMainAllSchema = ref(cloneDeep(CustomerreturnRequestMain))
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns, ...CustomerreturnRequestDetail.allSchemas.tableMainColumns])
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
CustomerreturnRequestMain.allSchemas = CustomerreturnRequestMainAllSchema.value.allSchemas
} else {
CustomerreturnRequestMain.allSchemas.formSchema = CustomerreturnRequestMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number')
CustomerreturnRequestMain.allSchemas.tableColumns = CustomerreturnRequestMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number')
CustomerreturnRequestMain.allSchemas.tableFormColumns = CustomerreturnRequestMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number')
CustomerreturnRequestMain.allSchemas.tableMainColumns = CustomerreturnRequestMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number')
CustomerreturnRequestMain.allSchemas.detailSchema = CustomerreturnRequestMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number')
CustomerreturnRequestMain.allSchemas.searchSchema = CustomerreturnRequestMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number')
console.log(344,CustomerreturnRequestMain.allSchemas)
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
@ -224,10 +249,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
obj.packingNumber = '' //
CustomerreturnRequestDetail.allSchemas.tableFormColumns.map(item =>{
if(item.field == 'packingNumber') {
item.isInpuFocusShow = false
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
}
item.isInpuFocusShow = false
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
}
})
})
if (res) {
@ -561,6 +586,7 @@ const showLabelSuccess = async (formField, searchField, val, formRef, type, row)
const formRef = ref()
const openForm =async (type: string, row?: number) => {
originTableData.value = []
if(type == "update"){
CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'deliverRecordNumber'){
@ -577,6 +603,7 @@ const openForm =async (type: string, row?: number) => {
// }
})
}else {
CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'deliverRecordNumber'){
item.componentProps.isSearchList = true
@ -831,8 +858,11 @@ const searchFormClick = (searchData) => {
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CustomerreturnRequestMainApi.importTemplate()
})
</script>

10
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts

@ -628,16 +628,6 @@ export const DeliverRequestMain = useCrudSchemas(
},
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',

50
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -283,25 +283,25 @@ export const CustomerStatementReconciliation = useCrudSchemas(reactive<CrudSchem
},
{
label: '验收日期',
field: 'checkTime',
field: 'acceptCheckTime',
sort: 'custom',
isForm: false,
},
{
label: '订单号',
field: 'qty',
field: 'releaseNumber',
sort: 'custom',
isForm: false,
},
{
label: '数量-INTEX',
field: 'price',
field: 'tftmQuantity',
sort: 'custom',
isForm: false,
},
{
label: '数量-TFTM',
field: 'amount',
field: 'qty',
sort: 'custom',
},
{
@ -311,22 +311,22 @@ export const CustomerStatementReconciliation = useCrudSchemas(reactive<CrudSchem
},
{
label: '单价-INTEX',
field: 'amount',
field: 'intexPrice',
sort: 'custom',
},
{
label: '单价-TFTM',
field: 'amount',
field: 'price',
sort: 'custom',
},
{
label: '单价差异',
field: 'amount',
field: 'priceVariance',
sort: 'priceVariance',
},
{
label: '金额-INTEX',
field: 'amount',
field: 'intexAmount',
sort: 'custom',
},
{
@ -355,72 +355,62 @@ export const CustomerStatementShareReconciliation = useCrudSchemas(reactive<Crud
{
label: '厂家编号',
field: 'itemCode',
field: 'factoryCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '厂家名称',
field: 'articleName',
field: 'factoryName',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '帐票号',
field: 'checkTime',
field: 'invoiceNumber',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '品号',
field: 'uom',
field: 'articleNumber',
sort: 'custom',
isForm: false,
},
{
label: '车型',
field: 'qty',
field: 'vehicleType',
sort: 'custom',
isForm: false,
},
{
label: '数量',
field: 'price',
field: 'qty',
sort: 'custom',
isForm: false,
},
{
label: '模具分摊金额',
field: 'amount',
field: 'allocationPrice',
sort: 'custom',
isForm: false,
},
{
label: '模具分摊单价',
field: 'amount',
field: 'allocationPrice',
sort: 'custom',
isForm: false,
},
{
label: '调整金额',
field: 'amount',
field: 'adjustmentAmount',
sort: 'custom',
},

449
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

@ -1,57 +1,85 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CustomerStatementMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
<Search
:schema="CustomerStatementMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="CustomerStatementMain.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CustomerStatementMain.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">
<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 #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="CustomerStatementMainRules"
:formAllSchemas="CustomerStatementMain.allSchemas" :apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain"
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="CustomerStatementMainRules"
:formAllSchemas="CustomerStatementMain.allSchemas"
:apiUpdate="CustomerStatementMainApi.updateCustomerStatementMain"
:apiCreate="CustomerStatementMainApi.createCustomerStatementMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
ref="detailRef"
:isBasic="false"
:allSchemas="CustomerStatementMain.allSchemas"
:detailAllSchemas="DetailAllSchemas"
:detailAllSchemasRules="CustomerStatementDetailRules"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{
label: '明细',
prop: 'Detail'
},{
label: '对账差异',
prop: 'Reconciliation'
},{
label: '模具分摊对账单',
prop: 'ShareReconciliation'
}]"
:tabs="[
{
label: '明细',
prop: 'Detail'
},
{
label: '对账差异',
prop: 'Reconciliation'
},
{
label: '模具分摊对账单',
prop: 'ShareReconciliation'
}
]"
:otherHeadButttonData="otherHeadButttonData"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
@ -59,25 +87,62 @@
@changeTabs="changeTabs"
:tableObjectExtend="tableObjectExtend"
@buttonBaseClick="detailButtonBaseClick"
@handleSubmitForm="handleDetailSubmitForm"
>
<template #qty="{row}" v-if="tabCurrent.prop == 'ShareReconciliation'">
<span :style="{color:row.qty>0?'red':row.qty<0?'#409eff':'#000'}">{{ row.qty }}</span>
<template #quantityVariance="{ row }" v-if="tabCurrent.prop == 'Reconciliation'">
<span
:style="{
color: row.quantityVariance > 0 ? '#409eff' : row.quantityVariance < 0 ? 'red' : '#000'
}"
>{{ row.quantityVariance }}</span
>
</template>
<template #amountVariance="{ row }" v-if="tabCurrent.prop == 'Reconciliation'">
<span
:style="{
color: row.amountVariance > 0 ? '#409eff' : row.amountVariance < 0 ? 'red' : '#000'
}"
>{{ row.amountVariance }}</span
>
</template>
<template #amount="{row}" v-if="tabCurrent.prop == 'ShareReconciliation'">
<div style="display: flex;align-items: center;">
<span style="margin-right:6px">{{ row.amount }}</span>
<Icon icon="ep:edit" color="#409eff" @click="openDetailForm(row)"/>
<template #adjustmentAmount="{ row }" v-if="tabCurrent.prop == 'ShareReconciliation'">
<div style="position: relative">
<span>{{ row.adjustmentAmount }}</span>
<Icon
icon="ep:edit"
color="#409eff"
@click="openDetailForm(row)"
style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%)"
/>
</div>
</template>
</Detail>
<!-- 导入 -->
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportCustomerStatementShareForm ref="importShareFormRef" url="/wms/customer-tool-apport-statement-detail/import" :importTemplateData="importShareTemplateData" @success="importSuccess" />
<ImportCustomerStatementForm
ref="importFormRef"
url="/wms/customer-statement-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<ImportCustomerStatementShareForm
ref="importShareFormRef"
url="/wms/customer-tool-apport-statement-detail/import"
:importTemplateData="importShareTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerStatementMain, CustomerStatementMainRules,CustomerStatementDetail,CustomerStatementDetailRules,CustomerStatementReconciliation,CustomerStatementShareReconciliation} from './customerStatementMain.data'
import {
CustomerStatementMain,
CustomerStatementMainRules,
CustomerStatementDetail,
CustomerStatementDetailRules,
CustomerStatementReconciliation,
CustomerStatementShareReconciliation
} from './customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -98,7 +163,7 @@ routeName.value = route.name
const tableColumns = ref(CustomerStatementMain.allSchemas.tableColumns)
const apiPage = ref(CustomerStatementDetailApi.getCustomerStatementDetailPage)
const DetailAllSchemas = ref(CustomerStatementDetail.allSchemas)
const DetailAllSchemas = ref(CustomerStatementShareReconciliation.allSchemas)
const tabsExtend = ref(false)
const tableObjectExtend = ref()
@ -128,11 +193,11 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//defaultButtons.defaultAddBtn({hasPermi:'wms:customerStatementMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:customer-statement-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:customer-statement-main:export'}), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:customer-statement-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:customer-statement-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -145,30 +210,38 @@ 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)
}
}
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId'] ? tableObject.tableList.findIndex(item => item['masterId'] == row['masterId']) : -1
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:customerStatementMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerStatementMain:delete'}), //
{
{
label: t('ts.重新对比'),
name: 'rematch',
hide: isShowMainButton(row, ['2']),
@ -189,9 +262,9 @@ const butttondata = (row, $index) => {
link: true //
},
{
label: t('ts.导入模具分摊对账单'),
label: t('ts.导入模具分摊对账单'),
name: 'importShareReconciliation',
hide: isShowMainButton(row, ['3','4']),
hide: isShowMainButton(row, ['3', '4']),
type: 'primary',
color: '',
hasPermi: 'wms:customer-statement-main:import',
@ -215,28 +288,39 @@ const butttondata = (row, $index) => {
hasPermi: '',
link: true //
},
defaultButtons.mainSendBackBtn({hasPermi: 'wms:customer-statement-main:sendBack', hide: isShowMainButton(row, ['3','4','5']) }), // 退
defaultButtons.mainListCancelBtn({ hasPermi: 'wms:customer-statement-main:publish',hide: isShowMainButton(row, ['2','3','4','5'])}), //
defaultButtons.mainSendBackBtn({
hasPermi: 'wms:customer-statement-main:sendBack',
hide: isShowMainButton(row, ['3', '4', '5'])
}), // 退
defaultButtons.mainListCancelBtn({
hasPermi: 'wms:customer-statement-main:publish',
hide: isShowMainButton(row, ['2', '3', '4', '5'])
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'rematch') { //
tapRematch(row.id);
} else if (val == 'confirmationContrast') { //
if (val == 'rematch') {
//
tapRematch(row.id)
} else if (val == 'confirmationContrast') {
//
tapConfirmationContrast(row.id)
} else if (val == 'importShareReconciliation') { //
} else if (val == 'importShareReconciliation') {
//
handleShareImport(row.id)
} else if (val == 'confirmShareMoney') { //
} else if (val == 'confirmShareMoney') {
//
handleConfirmShareMoney(row.id)
} else if (val == 'createTicketApply') { //
} else if (val == 'createTicketApply') {
//
// handleConfirmShareMoney(row.id)
}else if (val == 'sendBack') { // 退
} else if (val == 'sendBack') {
// 退
tapSendBack(row.id)
}else if (val == 'cancel') { //
} else if (val == 'cancel') {
//
tapCancel(row.id)
}
}
@ -250,16 +334,16 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = CustomerStatementMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
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 CustomerStatementMainApi.createCustomerStatementMain(data)
message.success(t('common.createSuccess'))
@ -276,7 +360,7 @@ const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerStatementMain')
detailRef.value.openDetail(chooseRow.value, titleName, titleValue, 'basicCustomerStatementMain')
}
/** 删除按钮操作 */
@ -289,7 +373,7 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
} catch {}
}
/** 导出按钮操作 */
@ -316,7 +400,7 @@ const importShareFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
const handleShareImport = (id:number) => {
const handleShareImport = (id: number) => {
importShareTemplateData.customerId = id
importShareFormRef.value.open()
}
@ -351,15 +435,15 @@ onMounted(async () => {
importTemplateData.templateUrl = await CustomerStatementMainApi.importTemplate()
})
//
const tapRematch = async (id:number) => {
const tapRematch = async (id: number) => {
try {
//
await message.confirm( t('ts.是否重新比对'))
await CustomerStatementMainApi.recontrast(id);
await message.confirm(t('ts.是否重新对比'))
await CustomerStatementMainApi.recontrast(id)
await message.success(t('ts.重新对比成功'))
//
//exportLoading.value = true
} catch {
} finally {
//
await getList()
@ -367,14 +451,14 @@ const tapRematch = async (id:number) => {
}
//
const tapConfirmationContrast = async (id:number) => {
const tapConfirmationContrast = async (id: number) => {
try {
await message.confirm( t('ts.是否确认对比结果'))
await CustomerStatementMainApi.confirmationContrast(id);
await message.confirm(t('ts.是否确认对比结果'))
await CustomerStatementMainApi.confirmationContrast(id)
await message.success(t('ts.确认成功'))
//
//exportLoading.value = true
} catch {
} finally {
//
await getList()
@ -382,14 +466,14 @@ const tapConfirmationContrast = async (id:number) => {
}
//退
const tapSendBack = async (id:number) => {
const tapSendBack = async (id: number) => {
try {
await message.confirm(t('ts.是否退回'))
await CustomerStatementMainApi.sendBack(id);
await message.confirm(t('ts.是否退回所选中数据?'))
await CustomerStatementMainApi.sendBack(id)
await message.success(t('ts.退回成功'))
//
//exportLoading.value = true
} catch {
} finally {
//
await getList()
@ -397,24 +481,25 @@ const tapSendBack = async (id:number) => {
}
//
const tapCancel = async (id:number) => {
const tapCancel = async (id: number) => {
try {
await message.confirm(t('ts.是否作废'))
await CustomerStatementMainApi.nodeAbrogate(id);
await message.confirm(t('ts.是否作废所选中数据?'))
await CustomerStatementMainApi.nodeAbrogate(id)
await message.success(t('ts.作废成功'))
//
//exportLoading.value = true
} catch {
} finally {
//
await getList()
}
}
//
const handleConfirmShareMoney = async (id:number) => {
try {
const handleConfirmShareMoney = async (id: number) => {
try {
await message.confirm(t('ts.是否确认分摊金额'))
await CustomerStatementMainApi.confirmationShare(id);
await CustomerStatementMainApi.confirmationShare(id)
await message.success(t('ts.确认成功'))
} finally {
//
await getList()
@ -435,13 +520,16 @@ const changeTabs = async (item) => {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
tableObjectExtend.value = [
{
key: 'masterId',
value: chooseRow.value.id
}
]
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
DetailAllSchemas.value = CustomerStatementDetail.allSchemas
otherHeadButttonData.value = [{
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'export',
hide: false,
@ -449,21 +537,24 @@ const changeTabs = async (item) => {
icon: 'ep:download',
color: '',
hasPermi: 'wms:customer-statement-main:export'
}]
} else if (item.prop == 'Reconciliation') {
}
]
} else if (item.prop == 'Reconciliation') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
tableObjectExtend.value = [
{
key: 'masterId',
value: chooseRow.value.id
}
]
DetailAllSchemas.value = CustomerStatementReconciliation.allSchemas
apiPage.value = CustomerStatementDetailApi.getCustomerStatementReconciliationPage
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportReconciliation',
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
@ -473,34 +564,38 @@ const changeTabs = async (item) => {
{
label: t('ts.重新对比'),
name: 'againContrast',
hide: isShowMainButton( chooseRow.value, ['2']),
hide: isShowMainButton(chooseRow.value, ['2']),
type: 'primary',
color: '',
float:'left',
float: 'left',
hasPermi: 'wms:customer-statement-main:recontrast'
},{
},
{
label: t('ts.确认对比结果'),
name: 'confirmResults',
hide: isShowMainButton( chooseRow.value, ['2']),
hide: isShowMainButton(chooseRow.value, ['2']),
type: 'primary',
color: '',
float:'left',
float: 'left',
hasPermi: 'wms:customer-statement-main:confirmationContrast'
}]
}
]
} else if (item.prop == 'ShareReconciliation') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
tableObjectExtend.value = [
{
key: 'masterId',
value: chooseRow.value.id
}
]
apiPage.value = CustomerStatementDetailApi.getCustomerToolApportStatementPage
DetailAllSchemas.value = CustomerStatementShareReconciliation.allSchemas
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportConfirmShareMoney',
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
@ -513,10 +608,11 @@ const changeTabs = async (item) => {
hide: isShowMainButton(chooseRow.value, ['4']),
type: 'primary',
color: '',
float:'left',
float: 'left',
hasPermi: 'wms:customer-statement-main:confirmationShare'
}]
} else{
}
]
} else {
tableObjectExtend.value = []
tabsExtend.value = false
apiPage.value = ''
@ -524,49 +620,86 @@ const changeTabs = async (item) => {
}
}
//
const detailButtonBaseClick = (val, item,detailTableObject) => {
const detailButtonBaseClick = async (val, item, detailTableObject) => {
console.log(val, item, detailTableObject)
if (val == 'export') {
//
if (tabCurrent.value.prop == 'Detail') {
handleExportDetail(detailTableObject)
} else if (tabCurrent.value.prop == 'Reconciliation') {
//
//
handleExportReconciliation(detailTableObject)
} {
} else if (tabCurrent.value.prop == 'ShareReconciliation') {
//
}
}else if (val == 'againContrast') {
} else if (val == 'againContrast') {
//
}else if (val == 'confirmResults') {
try {
await tapRematch(chooseRow.value.id)
detailRef.value.submitUpdateList()
} catch {}
} else if (val == 'confirmResults') {
//
}else if (val == 'exportConfirmShareMoney') {
//
}else if (val == 'confirmShareMoney') {
try {
await tapConfirmationContrast(chooseRow.value.id)
detailRef.value.submitUpdateList()
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: 'wms:customer-statement-main:export'
}
]
} catch {}
} else if (val == 'confirmShareMoney') {
//
try {
await handleConfirmShareMoney(chooseRow.value.id)
detailRef.value.submitUpdateList()
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: 'wms:customer-statement-main:export'
}
]
} catch {}
}
}
//
//
const handleExportDetail = async (detailTableObject) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerStatementDetailApi.exportCustomerStatementDetail(detailTableObject.params)
const data = await CustomerStatementDetailApi.exportCustomerStatementDetail(
detailTableObject.params
)
download.excel(data, `对账差异【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
//
//
const handleExportReconciliation = async (detailTableObject) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerStatementDetailApi.exportCustomerStatementCompareDetail(detailTableObject.params)
const data = await CustomerStatementDetailApi.exportCustomerStatementCompareDetail(
detailTableObject.params
)
download.excel(data, `对账差异【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -577,4 +710,62 @@ const handleExportReconciliation = async (detailTableObject) => {
const openDetailForm = (row) => {
detailRef.value.openForm('update', row)
}
//
const handleDetailSubmitForm = async (formType, data) => {
console.log(detailRef.value.tableObjectRef.tableList)
await CustomerStatementDetailApi.updateAdjustmentAmount(data.id,data.masterId,data.adjustmentAmount)
message.success(t('common.updateSuccess'))
detailRef.value.submitUpdateList()
const amount = ref(0)
detailRef.value.tableObjectRef.tableList.forEach(item => {
amount.value = amount.value + item.adjustmentAmount
})
//
if (amount.value == 0) {
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: 'wms:customer-statement-main:export'
},
{
label: t('ts.确认分摊金额'),
name: 'confirmShareMoney',
hide: isShowMainButton(chooseRow.value, ['4']),
type: 'primary',
color: '',
disabled:true,
float: 'left',
hasPermi: 'wms:customer-statement-main:confirmationShare'
}
]
} else {
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'export',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: 'wms:customer-statement-main:export'
},
{
label: t('ts.确认分摊金额'),
name: 'confirmShareMoney',
hide: isShowMainButton(chooseRow.value, ['4']),
type: 'primary',
color: '',
disabled:false,
float: 'left',
hasPermi: 'wms:customer-statement-main:confirmationShare'
}
]
}
}
</script>

287
src/views/wms/inventoryManage/balance/index.vue

@ -6,17 +6,19 @@
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:route-name="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Balance.allSchemas"
/>
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:route-name="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Balance.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table ref="tableRef" v-clientTable
<Table
ref="tableRef"
v-clientTable
:selection="true"
:columns="tableColumns"
:data="tableObject.tableList"
@ -29,22 +31,26 @@
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>
<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 }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="BalanceRules"
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="BalanceRules"
:formAllSchemas="Balance.allSchemas"
:apiUpdate="BalanceApi.updateBalance"
:apiCreate="BalanceApi.createBalance"
@ -53,22 +59,32 @@
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="true"
ref="detailRef"
:isBasic="true"
:allSchemas="TransactionTab.allSchemas"
:detailAllSchemas="TransactionTab.allSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{
label: '库存事务',
prop: 'Transaction'
}]"
:tabs="[
{
label: '库存事务',
prop: 'Transaction'
}
]"
@changeTabs="changeTabs"
:tableObjectExtend="tableObjectExtend"
/>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/balance/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/wms/balance/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
@ -77,15 +93,18 @@ import download from '@/utils/download'
import * as BalanceApi from '@/api/wms/balance'
import * as PackageApi from '@/api/wms/package'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import { Balance,TransactionTab, BalanceRules } from './balance.data'
import { Balance, TransactionTab, BalanceRules } from './balance.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
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 {
SupplierdeliverRequestPackage
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'Balance' })
@ -117,11 +136,11 @@ 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.defaultExportBtn({ hasPermi: 'wms:balance:export' }), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null),//
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -132,42 +151,51 @@ 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') {
//
selectionRows.value = []
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
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'){//
} else if (val == 'filtrate') {
//
} else if (val == 'selection_point') {
//
handleSelectionPoint()
} else { //
} else {
//
console.log('其他按钮', item)
}
}
const searchList = (model)=>{
const searchList = (model) => {
selectionRows.value = []
setSearchParams(model)
}
watch(
() => tableObject.tableList,
() => {
const currentRows = selectionRows.value.find(item=>item.currentPage==tableObject.currentPage)
if(currentRows){
const currentRows = selectionRows.value.find(
(item) => item.currentPage == tableObject.currentPage
)
if (currentRows) {
nextTick(() => {
currentRows.selectionRows.forEach(item=>{
tableRef.value.toggleRowSelection(item,true)
currentRows.selectionRows.forEach((item) => {
tableRef.value.toggleRowSelection(item, true)
})
})
}
@ -175,48 +203,49 @@ watch(
)
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){
const getSelectionRows = (currentPage, currentPageSelectionRows) => {
console.log('getSelectionRows', currentPage, currentPageSelectionRows)
const currentRows = selectionRows.value.find((item) => item.currentPage == currentPage)
if (currentRows) {
currentRows.selectionRows = currentPageSelectionRows
}else{
} else {
selectionRows.value.push({
currentPage,
selectionRows:currentPageSelectionRows
selectionRows: currentPageSelectionRows
})
}
}
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.packingNumber)]
const handleSelectionPoint = async () => {
let rows: any = []
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.packingNumber)]
})
console.log('批量打印',rows.join(','))
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);
getLoading?.close()
if(res.zzLabel){
//
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.zzLabel)
}
if (res.cgLabel) {
//
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.cgLabel)
}
}).catch(err => {
console.log(err)
getLoading?.close()
})
PackageApi.getBalanceToPackageSelection(rows)
.then((res) => {
console.log('res', res)
getLoading?.close()
if (res.zzLabel) {
//
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value + '&asn_number=' + res.zzLabel)
}
if (res.cgLabel) {
//
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value + '&asn_number=' + res.cgLabel)
}
})
.catch((err) => {
console.log(err)
getLoading?.close()
})
// window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
// -
@ -229,20 +258,31 @@ const butttondata = [
icon: '',
color: '',
link: true,
float:'right',
float: 'right',
hasPermi: ''
},
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListPointBtn(null) //
// defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), //
]
// -
// -
const buttonTableClick = async (val, row) => {
if (val == 'bqxx') {
let aaa = 'HPQ;V1.0;I'+row.itemCode+';P'+row.packingNumber+';B'+row.batch+';Q'+row.qty+';U'+row.uom
let aaa =
'HPQ;V1.0;I' +
row.itemCode +
';P' +
row.packingNumber +
';B' +
row.batch +
';Q' +
row.qty +
';U' +
row.uom
alert(aaa)
}else if (val == 'point') { //
} else if (val == 'point') {
//
handlePoint(row)
}
// if (val == 'edit') { //
@ -264,35 +304,68 @@ const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue,'transactionBalance')
detailRef.value.openDetail(row, titleName, titleValue, 'transactionBalance')
}
const BASE_URL = getJmreportBaseUrl()
const labelType = ref('') //
//
const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555);
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/922729953438072832?token=' + getAccessToken())
console.log(159,resLable )
window.open(src.value+'&asn_number='+resLable)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+resLable)
console.log(2333)
tableObject.loading = true
//
// await getLabelType(row,false)
await getLabelDetailPage(row, false)
}
const searchTableRef = ref()
const getLabelDetailPage = async (row, useToPackingNumber) => {
////
let defaultParams = {
moduleName: 'move',
recordNumber: '',
itemCode: row.itemCode,
batch: row.batch
}
})
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList: getListPrint } = tableMethods
await getListPrint()
console.log('tableObjectPrint', tableObjectPrint)
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
}
// --
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
// if (labelType.value == 'cg') {
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+res)
// } else {
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+res)
// }
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
@ -305,7 +378,7 @@ const handleDelete = async (id: number) => {
await BalanceApi.deleteBalance(id)
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} catch {}
}
@ -352,21 +425,23 @@ const changeTabs = (item) => {
if (item.prop == 'Transaction') {
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
tableObjectExtend.value = [
{
key: 'masterId',
value: chooseRow.value.id
}
]
apiPage.value = BalanceApi.getTransactionBalancePage
console.log(988,tableObjectExtend.value)
console.log(988, tableObjectExtend.value)
} else {
tableObjectExtend.value = []
tableObjectExtend.value = []
tabsExtend.value = false
apiPage.value = ''
}
}
/** 初始化 **/
onMounted(async() => {
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await BalanceApi.importTemplate()
})

24
src/views/wms/inventoryjobManage/scrap/scrapJobMain/index.vue

@ -75,6 +75,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ScrapJobMain' })
@ -86,7 +88,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ScrapJobMain.allSchemas.tableColumns,...ScrapJobDetail.allSchemas.tableMainColumns])
const ScrapJobMainAllSchema = ref(cloneDeep(ScrapJobMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ScrapJobMain.allSchemas = ScrapJobMainAllSchema.value.allSchemas
} else {
ScrapJobMain.allSchemas.formSchema = ScrapJobMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapJobMain.allSchemas.tableColumns = ScrapJobMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapJobMain.allSchemas.tableFormColumns = ScrapJobMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapJobMain.allSchemas.tableMainColumns = ScrapJobMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapJobMain.allSchemas.detailSchema = ScrapJobMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapJobMain.allSchemas.searchSchema = ScrapJobMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

24
src/views/wms/inventoryjobManage/scrap/scrapRecordMain/index.vue

@ -70,6 +70,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ScrapRecordMain' })
@ -81,7 +83,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ScrapRecordMain.allSchemas.tableColumns,...ScrapRecordDetail.allSchemas.tableMainColumns])
const ScrapRecordMainAllSchema = ref(cloneDeep(ScrapRecordMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ScrapRecordMain.allSchemas = ScrapRecordMainAllSchema .value.allSchemas
} else {
ScrapRecordMain.allSchemas.formSchema = ScrapRecordMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRecordMain.allSchemas.tableColumns = ScrapRecordMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRecordMain.allSchemas.tableFormColumns = ScrapRecordMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRecordMain.allSchemas.tableMainColumns = ScrapRecordMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRecordMain.allSchemas.detailSchema = ScrapRecordMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRecordMain.allSchemas.searchSchema = ScrapRecordMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

25
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue

@ -73,6 +73,7 @@
@submitForm="submitForm"
@tableFormSelectOnBlur="tableFormSelectOnBlur"
@clearSearchInput="clearSearchInput"
:key="updateKey"
/>
<!-- 详情 -->
@ -118,8 +119,10 @@ import * as ScrapRequestMainApi from '@/api/wms/scrapRequestMain'
import * as ScrapRequestDetailApi from '@/api/wms/scrapRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as StdcostpriceApi from '@/api/wms/stdcostprice'
import { getSwitchByCode } from '@/api/wms/switch'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ScrapRequestMain' })
@ -134,7 +137,27 @@ const tableColumns = ref([
...ScrapRequestMain.allSchemas.tableColumns,
...ScrapRequestDetail.allSchemas.tableMainColumns
])
const ScrapRequestMainAllSchema = ref(cloneDeep(ScrapRequestMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ScrapRequestMain.allSchemas = ScrapRequestMainAllSchema.value.allSchemas
} else {
ScrapRequestMain.allSchemas.formSchema = ScrapRequestMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRequestMain.allSchemas.tableColumns = ScrapRequestMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRequestMain.allSchemas.tableFormColumns = ScrapRequestMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRequestMain.allSchemas.tableMainColumns = ScrapRequestMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRequestMain.allSchemas.detailSchema = ScrapRequestMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
ScrapRequestMain.allSchemas.searchSchema = ScrapRequestMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q1Number'&&item.field != 'q2Number'&&item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

37
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue

@ -93,6 +93,7 @@ import * as UnplannedissueRequestDetailApi from '@/api/wms/unplannedissueRequest
import * as defaultButtons from '@/utils/disposition/defaultButtons'
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: 'UnplannedissueRequestMain' })
@ -109,21 +110,43 @@ const tableColumns = ref([...UnplannedissueRequestMain.allSchemas.tableColumns,.
const updataTableColumns = (val) => {
tableColumns.value = val
}
const fromManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
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(item=>{
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']
@ -586,4 +609,12 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await UnplannedissueRequestMainApi.importTemplate()
})
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}`;
}
</script>

12
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

@ -801,13 +801,17 @@ export const UnplannedissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm: {
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: {
componentProps: {
disabled: true
disabled: true,
valueFormat: 'YYYYMMDD',
}
},
tableForm: {
disabled:true
}
},
{

1
src/views/wms/issueManage/issue/issueRequestMain/index.vue

@ -108,6 +108,7 @@ import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'IssueRequestMain' })
console.log(88,IssueRequestDetail.allSchemas)
const message = useMessage() //
const { t } = useI18n() //

16
src/views/wms/issueManage/productionreturn/productionreturnRecordMain/productionreturnRecordMain.data.ts

@ -414,14 +414,14 @@ export const ProductionreturnRecordMainRules = reactive({
* @returns {Array} 退
*/
export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
},
// {
// label: '生产线代码',
// field: 'productionLineCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '工位代码',
field: 'workStationCode',

41
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -113,6 +113,7 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
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: 'ProductionreturnRequestMain' })
@ -202,7 +203,7 @@ const clearSearchInput = (formField) => {
tableData.value = []
}
}
let fromManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row)
@ -214,6 +215,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// message.warning(`${val[0]['itemCode']}`)
// return
// }
val[0]['batche']
let enableBuy = val[0]['enableBuy']
if(tableData.value.length>0){
enableBuy = tableData.value[0]['enableBuy']
@ -228,7 +230,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
val = val.filter(item=>item['enableBuy']==enableBuy)
let messageItemCodes = []
val.forEach(item=>{
val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['itemCode'] = item['itemCode']
newRow['enableBuy'] = item['enableBuy']
@ -236,13 +238,34 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['inventoryStatus'] = item['inventoryStatus']
newRow['qty'] = item['qty']
// 000000
if (item['batch'] !== '') {
if (item['batch'] != '') {
newRow['batch'] = item['batch']
} else {
newRow['batch'] = '000000'
}else{
newRow['batch'] = getFormattedDate(); // YYYYMMDD
}
// else {
// newRow['batch'] = '000000'
// }
newRow['packUnit'] = item['packUnit']
newRow['packQty'] = item['packQty']
//
row[formField] = val[0][searchField]
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode:val[0]['locationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {
newRow['batchFormItemType'] = 'FormDate'
newRow['disabled_batch'] = false
} else {
newRow['batchFormItemType'] = ''
newRow['disabled_batch'] = true
}
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){
messageItemCodes.push(item['itemCode'])
}else{
@ -889,4 +912,12 @@ onMounted(async () => {
getList()
importTemplateData.templateUrl = await ProductionreturnRequestMainApi.importTemplate()
})
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}`;
}
</script>

14
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts

@ -1041,11 +1041,15 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[
width: 150
},
tableForm: {
disabled: true
disabled: true,
placeholder: '请选择批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: {
componentProps: {
disabled: true
disabled: true,
valueFormat: 'YYYYMMDD',
}
}
},
@ -1473,12 +1477,14 @@ export const ProductionreturnRequestDetailLabel = useCrudSchemas(reactive<CrudSc
},
tableForm: {
disabled: true,
valueFormat: 'YYYYMMDD',
},
form: {
component: 'Input',
componentProps: {
disabled: true
disabled:true
}
}
},
},
{
label: '数量',

24
src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue

@ -77,6 +77,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'ProductionscrapRecordMain' })
@ -88,7 +90,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductionscrapRecordMain.allSchemas.tableColumns,...ProductionscrapRecordDetail.allSchemas.tableMainColumns])
const ProductionscrapRecordMainAllSchema = ref(cloneDeep(ProductionscrapRecordMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ProductionscrapRecordMain.allSchemas = ProductionscrapRecordMainAllSchema.value.allSchemas
} else {
ProductionscrapRecordMain.allSchemas.formSchema = ProductionscrapRecordMainAllSchema.value.allSchemas.formSchema.filter(item =>item.field != 'q3Number')
ProductionscrapRecordMain.allSchemas.tableColumns = ProductionscrapRecordMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q3Number')
ProductionscrapRecordMain.allSchemas.tableFormColumns = ProductionscrapRecordMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q3Number')
ProductionscrapRecordMain.allSchemas.tableMainColumns = ProductionscrapRecordMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q3Number')
ProductionscrapRecordMain.allSchemas.detailSchema = ProductionscrapRecordMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q3Number')
ProductionscrapRecordMain.allSchemas.searchSchema = ProductionscrapRecordMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

30
src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue

@ -64,6 +64,7 @@
@submitForm="submitForm"
@inputNumberChange="inputNumberChange"
@clearSearchInput="clearSearchInput"
:key="updateKey"
/>
<!-- 详情 -->
@ -125,6 +126,8 @@ import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 线
defineOptions({ name: 'ProductionscrapRequestMain' })
@ -136,6 +139,28 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductionscrapRequestMain.allSchemas.tableColumns,...ProductionscrapRequestDetail.allSchemas.tableMainColumns])
const ProductionscrapRequestMainAllSchema = ref(cloneDeep(ProductionscrapRequestMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ProductionscrapRequestMain.allSchemas = ProductionscrapRequestMainAllSchema.value.allSchemas
} else {
ProductionscrapRequestMain.allSchemas.formSchema = ProductionscrapRequestMainAllSchema.value.allSchemas.formSchema.filter(item =>item.field != 'q3Number')
ProductionscrapRequestMain.allSchemas.tableColumns = ProductionscrapRequestMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q3Number')
ProductionscrapRequestMain.allSchemas.tableFormColumns = ProductionscrapRequestMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q3Number')
ProductionscrapRequestMain.allSchemas.tableMainColumns = ProductionscrapRequestMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q3Number')
ProductionscrapRequestMain.allSchemas.detailSchema = ProductionscrapRequestMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q3Number')
ProductionscrapRequestMain.allSchemas.searchSchema = ProductionscrapRequestMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const detailListTableColumns = ProductionscrapRequestDetailLabel.allSchemas
@ -243,11 +268,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// 000000
// 000000线
if (val[0]['batch'] !== '') {
row['batch'] = val[0]['batch']
} else {
row['batch'] = '000000'
// row['batch'] = '000000'
row['batch'] = ''
}
// tableform
// TODO: tableFormColumns 10 20 20

100
src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts

@ -1095,56 +1095,56 @@ export const ProductionscrapRequestMainRules = reactive({
* @returns {Array} 退
*/
export const ProductionscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
isTableForm: false,
isForm:false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}]
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}]
},
},
// {
// label: '生产线代码',
// field: 'productionLineCode',
// sort: 'custom',
// table: {
// width: 150
// },
// hiddenInMain: true,
// isTableForm: false,
// isForm:false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '生产线信息', // 查询弹窗标题
// searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
// searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
// searchCondition:[{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'workshopCode',
// value: 'workshopCode',
// message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
// isMainValue: true
// }]
// }
// },
// tableForm:{
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '生产线信息', // 查询弹窗标题
// searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
// searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
// searchCondition:[{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'workshopCode',
// value: 'workshopCode',
// message: '请选择车间信息!', // 当前置条件为空时 弹出信息提示
// isMainValue: true
// }]
// },
// },
{
label: '工位代码',
field: 'workStationCode',

56
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

@ -99,6 +99,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading()
// ()InventorymoveRecordMainNew
defineOptions({ name: 'InventorymoveRecordMainNew' })
@ -180,7 +181,6 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row)
}
// -
// -
const butttondata = (row,$index) => {
// const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
@ -223,7 +223,9 @@ const getLabelType = async (row,useToPackingNumber)=>{
const getLabelDetailPage = async (row,useToPackingNumber)=>{
let defaultParams = {'moduleName':'move','recordNumber':row.number}
if(useToPackingNumber){
defaultParams = {'moduleName':'move','recordNumber':row.toPackingNumber}
// defaultParams = {'moduleName':'move','recordNumber':row.toPackingNumber}
////
defaultParams = {'moduleName':'move','recordNumber':'','itemCode': row.itemCode}
}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
@ -373,21 +375,59 @@ const submitForm = async (formType, submitData) => {
formRef.value.formLoading = false
}
}
const fromManagementPrecision = ref('')
const toManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row)
nextTick(() => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode'){
const fromLocationCode =formRef.formModel.fromLocationCode//
const toLocationCode =formRef.formModel.toLocationCode//
if(toLocationCode==''){
message.warning('到库位代码不能为空');
return
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['origin_fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
if(val.length==0) return
val.forEach(item=>{
val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['fromPackingNumber'] = item['packingNumber']
newRow['toPackingNumber'] = item['packingNumber']
newRow['fromContainerNumber'] = item['containerNumber']
newRow['itemCode'] = item['itemCode']
newRow['fromBatch'] = item['batch']
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:fromLocationCode
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {//+
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:toLocationCode
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (toManagementPrecision.value != 'BY_QUANTITY') {//+
if(newRow['fromBatch']==''){
newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD
}
newRow['fromBatchFormItemType'] = 'FormDate'
newRow['disabled_fromBatch'] = false
}else{
newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true
newRow['fromBatch'] = '';//
}
}
newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['origin_fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom']
@ -465,5 +505,13 @@ onMounted(async () => {
// ()InventorymoveRecordMainNew
importTemplateData.templateUrl = await InventorymoveRecordMainApi.importTemplateExceptMove()
})
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}`;
}
</script>
./inventorymoveRecordRequestMain.data

8
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts

@ -431,10 +431,16 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
},
tableForm: {
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
clearable:false
},
form: {
componentProps: {
disabled: true
disabled: true,
valueFormat: 'YYYYMMDD',
clearable: false
}
}
},

33
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

@ -91,6 +91,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {importTemplateHoldOk} from "@/api/wms/inventorymoveRequestMain";
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'InventorymoveRequestMain' })
@ -348,20 +349,37 @@ console.log('tableFormColumns',InventorymoveRequestDetail.allSchemas.tableFormCo
const updataTableColumns = (val) => {
tableColumns.value = val
}
const fromManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
nextTick(async() => {
if (type == 'tableForm') {
if(formField == 'fromPackingNumber'){
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
if(val.length==0) return
val.forEach(item=>{
val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['fromPackingNumber'] = item['packingNumber']
newRow['fromContainerNumber'] = item['containerNumber']
newRow['itemCode'] = item['itemCode']
newRow['fromBatch'] = item['batch']
if (item['batch'] != '') {
newRow['fromBatch'] = item['batch']
}else{
newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD
}
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:val[0]['locationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {
newRow['fromBatchFormItemType'] = 'FormDate'
newRow['disabled_fromBatch'] = false
} else {
newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true
}
newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom']
@ -824,4 +842,11 @@ onMounted(async () => {
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove()
}
})
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}`;
}
</script>

8
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts

@ -558,11 +558,15 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
width: 150
},
tableForm: {
disabled: true
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: {
componentProps: {
disabled: true
disabled: true,
valueFormat: 'YYYYMMDD',
}
}
},

134
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainMOVE/index.vue

@ -106,7 +106,6 @@ routeName.value = route.name
const tableColumns = ref([...InventorymoveRequestMain.allSchemas.tableColumns,...InventorymoveRequestDetail.allSchemas.tableMainColumns])
const businessType = ref()
console.log(99 , routeName.value)
const fromInventoryStatus = ref()
const toInventoryStatus = ref()
const importFileName = ref()
@ -123,7 +122,6 @@ if ( routeName.value == 'InventorymoveRequestMain') {
businessType.value = 'Move'
importFileName.value = '库存移动申请'
}
console.log(99 , businessType.value)
@ -299,7 +297,6 @@ const getDefaultToLocationCode = async ()=>{
}
})
let res = await LocationApi.selectBusinessTypeToLocation(params)
console.log('res',res)
if(res&&res.list.length>0){
tableData.value.forEach(item=>{
if(!item['toLocationCode']){
@ -308,9 +305,11 @@ const getDefaultToLocationCode = async ()=>{
})
}
}
let fromManagementPrecision = ref('')
let toManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
nextTick(async() => {
if (type == 'tableForm') {
if(formField == 'fromPackingNumber'){
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
@ -328,6 +327,27 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['toInventoryStatus'] = item['inventoryStatus']//
tableData.value.push(newRow)
})
}else if (formField == 'toLocationCode') {
row[formField] = val[0][searchField]
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode:row['fromLocationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode: val[0][searchField]
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') {
row['fromBatchFormItemType'] = 'FormDate'
row['disabled_fromBatch'] = false
} else {
row['fromBatchFormItemType'] = ''
row['disabled_fromBatch'] = true
}
} else {
row[formField] = val[0][searchField]
}
@ -354,8 +374,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async() => {
const setV = {}
if(formField == 'fromPackingNumber') {
setV['fromPackingNumber'] = val[0]['packingNumber']
@ -366,7 +386,37 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['fromLocationCode'] = val[0]['locationCode']
setV['uom'] = val[0]['uom']
setV['toInventoryStatus'] = val[0]['inventoryStatus'] //InventorymoveRequestMain
} else if (formField == 'toLocationCode') {
setV[formField] = val[0][searchField]
await ruleApi.getManagementPrecision({
itemCodes: [formRef.formModel.itemCode],
locationCode:formRef.formModel.fromLocationCode
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
await ruleApi.getManagementPrecision({
itemCodes: [formRef.formModel.itemCode],
locationCode: val[0][searchField]
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') {
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch')))
obj.value.component= 'DatePicker'
obj.value.componentProps.disabled= false
obj.value.componentProps.type= 'date'
obj.value.componentProps.valueFormat= 'YYYYMMDD'
obj.value.componentProps.format = 'YYYYMMDD'
InventorymoveRequestDetailRules.fromBatch[0].required = true
} else {
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch')))
obj.value.component= 'Input'
obj.value.componentProps={
disabled : true
}
setV['fromBatch'] =''
InventorymoveRequestDetailRules.fromBatch[0].required = false
}
} else {
setV[formField] = val[0][searchField]
}
@ -457,7 +507,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainReAdd') { //
await message.confirm('确认要重新添加吗?')
@ -468,7 +517,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainSubmit') { //
await message.confirm('确认要提交审批吗?')
@ -479,7 +527,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainTurnDown') { //
await message.confirm('确认要驳回吗?')
@ -490,7 +537,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainApprove') { //
await message.confirm('确认要审批通过吗?')
@ -501,7 +547,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?')
@ -512,7 +557,6 @@ const buttonTableClick = async (val, row) => {
buttonBaseClick('refresh',null)
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
@ -531,20 +575,50 @@ const openForm =async (type: string, row?: number) => {
/**
* 详情 新增/编辑事件
*/
const detailOpenForm = (type, row) => {
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.push({
key: 'warehouseCode',
value: fromWarehouseCodeMain.value,
isMainValue: false
})
} else {
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => {
if (item.key == 'warehouseCode') {
item.value = fromWarehouseCodeMain.value
}
})
const detailOpenForm =async (type, row) => {
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.push({
key: 'warehouseCode',
value: fromWarehouseCodeMain.value,
isMainValue: false
})
} else {
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => {
if (item.key == 'warehouseCode') {
item.value = fromWarehouseCodeMain.value
}
})
}
if (type == 'update') {
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode:row['fromLocationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
await ruleApi.getManagementPrecision({
itemCodes: [row['itemCode']],
locationCode: row['toLocationCode']
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY' && toManagementPrecision.value == 'BY_BATCH') {
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch')))
obj.value.component= 'DatePicker'
obj.value.componentProps.disabled= false
obj.value.componentProps.type= 'date'
obj.value.componentProps.valueFormat= 'YYYYMMDD'
obj.value.componentProps.format= 'YYYYMMDD'
InventorymoveRequestDetailRules.fromBatch[0].required = true
} else {
const obj =ref(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromBatch')))
obj.value.component= 'Input'
obj.value.componentProps={
disabled : true
}
InventorymoveRequestDetailRules.fromBatch[0].required = false
}
}
}
const fromWarehouseCodeMain = ref()
@ -629,11 +703,16 @@ const submitForm = async (formType, submitData) => {
message.warning('从库位和到库位不能相同')
return
}
let batchList = tableData.value.filter(item=>item.fromBatchFormItemType&&item.fromBatchFormItemType == 'FormDate')
let noBatch = batchList.some(item => !item.fromBatch)
if(noBatch){
message.warning('请选择从批次')
return
}
data.subList = tableData.value //
let isExist = false
tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) )
console.log(rs,5666);
if(rs.length > 1) isExist = true
})
if (isExist) {
@ -643,7 +722,6 @@ const submitForm = async (formType, submitData) => {
}
flag.value = false
data.subList.forEach(item => {
console.log(556565,item);
if(fromInventoryStatus.value){
//item.fromInventoryStatus = fromInventoryStatus.value
item.toInventoryStatus = toInventoryStatus.value

21
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainMOVE/inventorymoveRequestMain.data.ts

@ -566,7 +566,7 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
@ -583,14 +583,24 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
isTable:false,
tableForm: {
disabled: true
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: {
component: 'Input',
componentProps: {
disabled: true
disabled:true
// style: { width: '100%' },
// type: 'date',
// placeholder: '请选择从批次',
// format: 'YYYYMMDD',
// valueFormat: 'YYYYMMDD',
}
}
},
},
{
label: '到批次',
@ -963,6 +973,9 @@ export const InventorymoveRequestDetailRules = reactive({
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
fromBatch: [
{ required: false, message: '请选择批次码', trigger: 'change' }
],
// fromPackingNumber: [
// { required: true, message: '请选择从包装号', trigger: 'change' }
// ],

50
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue

@ -94,6 +94,7 @@ import * as LocationApi from '@/api/wms/location'
import { formatDate } from '@/utils/formatTime'
import dayjs from 'dayjs'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import * as ruleApi from '@/api/wms/rule/index'
const { loadStart, loadDone } = usePageLoading()
// OktoholdRequestMain
// 使
@ -309,19 +310,57 @@ const clearInput = (field, row, index) => {
row['supplierName'] = ''
}
}
const fromManagementPrecision = ref('')
const toManagementPrecision = ref('')
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
nextTick(async() => {
if (type == 'tableForm') {
if(formField == 'fromPackingNumber'){
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus']))
if(val.length==0) return
val.forEach(item=>{
const toLocationCode =formRef.formModel.toLocationCode//
if(toLocationCode==''){
message.warning('到库位代码不能为空');
return
}
val.forEach(async item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['fromPackingNumber'] = item['packingNumber']
newRow['fromContainerNumber'] = item['containerNumber']
newRow['itemCode'] = item['itemCode']
newRow['fromBatch'] = item['batch']
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:item['locationCode']
}).then((res) => {
fromManagementPrecision.value = res[0].ManagementPrecision
})
if (fromManagementPrecision.value == 'BY_QUANTITY') {//+
//
await ruleApi.getManagementPrecision({
itemCodes: [item['itemCode']],
locationCode:toLocationCode
}).then((res) => {
toManagementPrecision.value = res[0].ManagementPrecision
})
if (toManagementPrecision.value != 'BY_QUANTITY') {//+
if(newRow['fromBatch']==''){
newRow['fromBatch'] = getFormattedDate(); // YYYYMMDD
}
newRow['fromBatchFormItemType'] = 'FormDate'
newRow['disabled_fromBatch'] = false
}else {
newRow['fromBatchFormItemType'] = ''
newRow['disabled_fromBatch'] = true
}
}
newRow['fromInventoryStatus'] = item['inventoryStatus']
newRow['fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom']
@ -765,4 +804,11 @@ onMounted(async () => {
importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove()
}
})
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}`;
}
</script>

11
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

@ -1108,15 +1108,16 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
label: '从批次',
field: 'fromBatch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
disabled: true,
placeholder: '请选择从批次',
valueFormat: 'YYYYMMDD',
format: 'YYYYMMDD',
},
form: {
componentProps: {
disabled: true
disabled: true,
valueFormat: 'YYYYMMDD',
}
}
},

1
src/views/wms/productionManage/productdismantle/productdismantleRecordMain/productdismantleRecordMain.data.ts

@ -744,6 +744,7 @@ export const DismantleRecordDetailb = useCrudSchemas(reactive<CrudSchema[]>([
label: '批次',
field: 'batch',
sort: 'custom',
isTable: false,
table: {
width: 150
},

9
src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue

@ -300,15 +300,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
} else {
const setV = {}
if(formField == 'workshopCode'){
tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
const setV = {}
if (formField == 'shift') {
setV['shift'] = val[0]['code']
setV['shiftName'] = val[0]['name']
}
formRef.setValues(setV)
})
}
//

25
src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts

@ -129,7 +129,7 @@ export const ProductdismantleRequestMain = useCrudSchemas(reactive<CrudSchema[]>
}
},
{
label: '班次代码',
label: '班次',
field: 'shift',
sort: 'custom',
table: {
@ -161,19 +161,6 @@ export const ProductdismantleRequestMain = useCrudSchemas(reactive<CrudSchema[]>
}
}
},
{
label: '班次名称',
field: 'shiftName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
@ -1385,7 +1372,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
isTable: false,
sort: 'custom',
table: {
width: 150
@ -1398,6 +1385,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1409,6 +1397,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '批次',
field: 'batch',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1420,6 +1409,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1431,6 +1421,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '单据号',
field: 'number',
sort: 'custom',
isTable: false,
table: {
width: 180
},
@ -1443,6 +1434,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料名称',
field: 'itemName',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1454,6 +1446,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1465,6 +1458,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
isTable: false,
table: {
width: 150
},
@ -1476,6 +1470,7 @@ export const BomDismantle = useCrudSchemas(reactive<CrudSchema[]>([
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isTable: false,
table: {
width: 150
},

5
src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue

@ -170,11 +170,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}else{
setV[formField] = val[0][searchField]
}
// const setV = {}
if (formField == 'shift') {
setV['shift'] = val[0]['code']
setV['shiftName'] = val[0]['name']
}
formRef.setValues(setV)
}
})

15
src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts

@ -199,7 +199,7 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '班次代码',
label: '班次',
field: 'shift',
sort: 'custom',
table: {
@ -231,19 +231,6 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '班次名称',
field: 'shiftName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
},
},
// {
// label: '物料代码',
// field: 'detailItemCode',

4
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue

@ -162,10 +162,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}else{
setV[formField] = val[0][searchField]
}
if (formField == 'shift') {
setV['shift'] = val[0]['code']
setV['shiftName'] = val[0]['name']
}
formRef.setValues(setV)
}
})

15
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts

@ -203,7 +203,7 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '班次代码',
label: '班次',
field: 'shift',
sort: 'custom',
table: {
@ -235,19 +235,6 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '班次名称',
field: 'shiftName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
table: {
width: 150
},
},
// {
// label: '物料代码',
// field: 'detailItemCode',

3
src/views/wms/productionManage/productputawayAssemble/productputawayAssembleJobMain/index.vue

@ -78,6 +78,7 @@ import {getAccessToken} from "@/utils/auth";
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {exportProductputawayJobMainAssemble} from "@/api/wms/productputawayJobMain";
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ProductputawayJobMain' })
@ -251,7 +252,7 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await ProductputawayJobMainApi.exportProductputawayJobMain(tableObject.params)
const data = await ProductputawayJobMainApi.exportProductputawayJobMainAssemble(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {

3
src/views/wms/productionManage/productreceipt/productreceiptJobMain/index.vue

@ -106,6 +106,7 @@ import {
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {exportProductreceiptJobMainPredict} from "@/api/wms/productreceiptJobMain";
const { loadStart, loadDone } = usePageLoading()
//
//
@ -352,7 +353,7 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await ProductreceiptJobMainApi.exportProductreceiptJobMain(tableObject.params)
const data = await ProductreceiptJobMainApi.exportProductreceiptJobMainPredict(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {

275
src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue

@ -1,23 +1,31 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...ProductreceiptRecordMain.allSchemas.searchSchema,...ProductreceiptRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="[
...ProductreceiptRecordMain.allSchemas.searchSchema,
...ProductreceiptRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductreceiptRecordMain.allSchemas"
:detailAllSchemas="ProductreceiptRecordDetail.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductreceiptRecordMain.allSchemas"
:detailAllSchemas="ProductreceiptRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -28,16 +36,19 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #recoveryRequestFlag="{row}">
<el-tag>{{ row.recoveryRequestFlag=='TRUE'?'是':'否' }}</el-tag>
<template #recoveryRequestFlag="{ row }">
<el-tag>{{ row.recoveryRequestFlag == 'TRUE' ? '是' : '否' }}</el-tag>
</template>
<template #number="{row}">
<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 #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -67,40 +78,48 @@
<!-- bom列表 -->
<Dialog
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushRecordDetailb.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushRecordDetailb.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable
style="width: 905px"
ref="searchTableRef"
@searchTableSuccess="searchTableSuccessLabel"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductreceiptRecordMain,ProductreceiptRecordMainRules,ProductreceiptRecordDetail,ProductreceiptRecordDetailRules, BackflushRecordDetailb } from './productreceiptRecordMain.data'
import {
ProductreceiptRecordMain,
ProductreceiptRecordMainRules,
ProductreceiptRecordDetail,
ProductreceiptRecordDetailRules,
BackflushRecordDetailb
} from './productreceiptRecordMain.data'
import * as ProductreceiptRecordMainApi from '@/api/wms/productreceiptRecordMain'
import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as PackageApi from '@/api/wms/package'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
@ -118,9 +137,13 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductreceiptRecordMain.allSchemas.tableColumns,...ProductreceiptRecordDetail.allSchemas.tableMainColumns])
const tableColumns = ref([
...ProductreceiptRecordMain.allSchemas.tableColumns,
...ProductreceiptRecordDetail.allSchemas.tableMainColumns
])
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: 'Bom',
name: 'bom',
hide: false,
@ -128,16 +151,17 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
// Bom
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } = useTable({
getListApi: BackflushRecordDetailbApi.getBackflushRecordDetailbPage
})
const { getList:getDetailListBom } = detatableMethodsBom
const { getList: getDetailListBom } = detatableMethodsBom
//
const updataTableColumns = (val) => {
@ -153,10 +177,10 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -169,23 +193,27 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -194,42 +222,52 @@ const isShowMainButton = (row,val) => {
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
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.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainInspectRequestBtn({hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestCpBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({hide:row.recoveryRequestFlag == "TRUE" }), // //recoveryRequestFlag==TRUE
]
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
// defaultButtons.mainInspectRequestBtn({ hide: row.inspectRequestFlag == 'FALSE' }), //
defaultButtons.mainPutawayRequestCpBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE' || row.recoveryRequestFlag == 'TRUE'
}), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({ hide: row.recoveryRequestFlag == 'TRUE' }) // 制品回收 //recoveryRequestFlag==TRUE不展示
]
}
// -
const buttonTableClick = async (val, row) => {
if(val == 'inspectRequest'){//
if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number)
}else if (val == 'putawayRequest') { //
} else if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number)
} else if (val == 'point') { //
} else if (val == 'point') {
//
labelPrint(row)
} else if (val == 'recovery') { //
} else if (val == 'recovery') {
//
labelRecovery(row)
}
}
/** 生成采购上架申请按钮操作 */
const handleCreatePutawayRequest = async (number:string) => {
try{
const handleCreatePutawayRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成上架申请吗?'))
tableObject.loading = true
await ProductreceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
@ -243,27 +281,33 @@ const labelPrint = async (row) => {
let resType = await PackageApi.getPackagePage({
requestNumber: row.requestNumber
})
if(resType.list.length > 0){
if (resType.list.length > 0) {
if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
const defaultParams = {
moduleName: 'productreceipt_predict',
tableName: 'record_productreceipt_main',
recordNumber: row.number,
itemCode: row.itemCode,
batch: row.batch
}
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPageByRecordId //
getListApi: PackageApi.getLabelDetailPageByRecordId //
})
//
const { getList:getListPrint } = tableMethods
const { getList: getListPrint } = tableMethods
getListPrint()
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
}
//
const labelRecovery = async (row) => {
@ -272,15 +316,14 @@ const labelRecovery = async (row) => {
tableObject.loading = true
const params = ref({
number: '',
inventoryStatus: '',
inventoryStatus: ''
})
params.number= row.number;
params.inventoryStatus= row.inventoryStatus;
params.number = row.number
params.inventoryStatus = row.inventoryStatus
let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params);
let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params)
message.success(t('ts.撤销报工成功'))
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
@ -288,45 +331,50 @@ const labelRecovery = async (row) => {
}
// --
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
console.log('批量打印', val)
if(val.length == 0){
message.warning("请先选择要打印的数据!")
if (val.length == 0) {
message.warning('请先选择要打印的数据!')
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(','))
.then((res) => {
console.log(res)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
window.open(src.value + '&asn_number=' + res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
window.open(src.value + '&asn_number=' + res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
}
//
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
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,'recordProductreceiptMain')
detailRef.value.openDetail(row, titleName, titleValue, 'recordProductreceiptMain')
}
/** 生成到货检验申请按钮操作 */
const handleCreateInspectRequest = async (number:string) => {
try{
const handleCreateInspectRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成到货检验申请吗?'))
tableObject.loading = true
await ProductreceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
@ -340,18 +388,20 @@ const handleExport = async () => {
loadStart()
const excelTitle = ref(route.meta.title)
tableObject.params.type = 'predict'
if (tableObject.params.isSearch){
if (tableObject.params.isSearch) {
const cmd = {
'column':'type',
'action':'==',
'value':'predict'
column: 'type',
action: '==',
value: 'predict'
}
if (!Array.isArray(tableObject.params.filters)) {
tableObject.params.filters = [];
tableObject.params.filters = []
}
tableObject.params.filters.push(cmd)
}
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params)
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -362,12 +412,12 @@ const handleExport = async () => {
//
const searchFormClick = (searchData) => {
const cmd = {
'column':'type',
'action':'==',
'value':'predict'
column: 'type',
action: '==',
value: 'predict'
}
if (!Array.isArray(searchData.filters)) {
searchData.filters = [];
searchData.filters = []
}
searchData.filters.push(cmd)
tableObject.params = {
@ -378,8 +428,9 @@ const searchFormClick = (searchData) => {
}
// Bom
const tableFormButton = async (val , row) => {
if (val == 'bom') { // bom
const tableFormButton = async (val, row) => {
if (val == 'bom') {
// bom
bomModelVisible.value = true
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {

11
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

@ -189,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ConfigApi from '@/api/infra/config'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {exportProductreceiptRequestMainPredict} from "@/api/wms/productreceiptRequestMain";
const { loadStart, loadDone } = usePageLoading()
//
//
@ -687,7 +688,7 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await ProductreceiptRequestMainApi.exportProductreceiptRequestMain(
const data = await ProductreceiptRequestMainApi.exportProductreceiptRequestMainPredict(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
@ -740,6 +741,14 @@ const submitForm = async (formType, submitData) => {
formRef.value.formLoading = false
return
}
const itemCodeCodes = data.subList.map(item => item.itemCode); // code
const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//itemCode
if (hasDuplicates) {
message.warning('物料不能重复')
formRef.value.formLoading = false
return
}
formRef.value.formLoading = true
try {
if (formType === 'create') {

11
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

@ -238,7 +238,7 @@ const butttondata = (row,$index) => {
}
return [
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestCpBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestCpBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" || row.recoveryRequestFlag == "TRUE"}),//
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({hide:row.recoveryRequestFlag == "TRUE" }), // //recoveryRequestFlag==TRUE
]
@ -317,7 +317,14 @@ const labelPrint = async (row) => {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_assemble','tableName':'record_productreceipt_main','recordNumber':row.number,'number':row.number==null?row.number:row.packingNumber }
const defaultParams = {
    moduleName: 'productreceipt_assemble',
    tableName: 'record_productreceipt_main',
    recordNumber: row.number,
    number: row.number == null ? row.number : row.packingNumber,
    itemCode: row.itemCode,
    batch: row.batch
  }
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
// getListApi: PackageApi.getProductreceiptLabelDetailPage //

6
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue

@ -638,6 +638,12 @@ const submitForm = async (formType, submitData) => {
message.warning('数量必须大于0')
return
}
const itemCodeCodes = data.subList.map(item => item.itemCode); // code
const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//itemCode
if (hasDuplicates) {
message.warning('物料不能重复')
return
}
formRef.value.formLoading = true
try {
if (formType === 'create') {

136
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/productreceiptscrapRequestMain.data.ts

@ -625,74 +625,74 @@ export const ProductreceiptRequestMainRules = reactive({
* @returns {Array}
*/
export const ProductreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
tableForm:{
disabled:true,
multiple: true,
// isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
verificationPage: ProductionlineApi.getProductionlineByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
// {
// label: '生产线代码',
// field: 'productionLineCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// tableForm:{
// disabled:true,
// multiple: true,
// // isInpuFocusShow: true,
// searchListPlaceholder: '请选择生产线代码',
// searchField: 'code',
// searchTitle: '生产线信息',
// searchAllSchemas: Productionline.allSchemas,
// searchPage: ProductionlineApi.getProductionlinePage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'workshopCode',
// value: 'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// }],
// verificationPage: ProductionlineApi.getProductionlineByCodes, // 校验数去焦点输入是否正确的方法
// isShowTableFormSearch: true,
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择生产线代码',
// searchField: 'code',
// searchTitle: '生产线信息',
// searchAllSchemas: Productionline.allSchemas,
// searchPage: ProductionlineApi.getProductionlinePage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'workshopCode',
// value: 'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// }
// },
{
label: '工位代码',
field: 'workStationCode',

6
src/views/wms/productionManage/productredress/productredressRequestMain/index.vue

@ -455,6 +455,12 @@ const submitForm = async (formType, submitData) => {
formRef.value.formLoading = false
return
}
const itemCodeCodes = data.subList.map(item => item.itemCode); // code
const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//itemCode
if (hasDuplicates) {
message.warning('物料不能重复')
return
}
formRef.value.formLoading = true
try {
if (formType === 'create') {

7
src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue

@ -284,6 +284,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
} else {
const setV = {}
if(formField == 'workshopCode'){
setV['productionLineCode'] = ''
tableData.value = []
}
if(formField == 'productionLineCode'){
tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}

24
src/views/wms/productionManage/productscrap/productscrapRecordMain/index.vue

@ -97,6 +97,8 @@ import {getProductscrapBomDismantleRecordPage} from "@/api/wms/bomDismantle";
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ProductscrapRecordMain' })
@ -108,6 +110,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductscrapRecordMain.allSchemas.tableColumns,...ProductscrapRecordDetail.allSchemas.tableMainColumns])
const ProductscrapRecordMainAllSchema = ref(cloneDeep(ProductscrapRecordMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ProductscrapRecordMain.allSchemas = ProductscrapRecordMainAllSchema.value.allSchemas
} else {
ProductscrapRecordMain.allSchemas.formSchema = ProductscrapRecordMainAllSchema.value.allSchemas.formSchema.filter(item =>item.field != 'q3Number')
ProductscrapRecordMain.allSchemas.tableColumns = ProductscrapRecordMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q3Number')
ProductscrapRecordMain.allSchemas.tableFormColumns = ProductscrapRecordMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q3Number')
ProductscrapRecordMain.allSchemas.tableMainColumns = ProductscrapRecordMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q3Number')
ProductscrapRecordMain.allSchemas.detailSchema = ProductscrapRecordMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q3Number')
ProductscrapRecordMain.allSchemas.searchSchema = ProductscrapRecordMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
// table
const buttondataTable = ref([{
@ -170,7 +193,6 @@ const buttonBaseClickBom = (val) => {
item.childList = tableListBom.value
}
})
console.log(157, tableData.value)
bomModelVisible.value = false
}
//

16
src/views/wms/productionManage/productscrap/productscrapRecordMain/productscrapRecordMain.data.ts

@ -128,6 +128,22 @@ export const ProductscrapRecordMain = useCrudSchemas(
width: 150
},
},
{
label: '成本中心代码',
field: 'costCenterCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '原因代码',
field: 'reasonCodeRequisition',
sort: 'custom',
table: {
width: 150
}
},
{
label: '任务单号',
field: 'jobNumber',

27
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -63,6 +63,7 @@
@submitForm="submitForm"
@buttonOperationClick="buttonOperationClick"
@clearSearchInput="clearSearchInput"
:key='updateKey'
/>
<!-- 详情 -->
@ -143,6 +144,8 @@ import * as BomApi from "@/api/wms/bom";
import * as BalanceApi from "@/api/wms/balance";
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'ProductscrapRequestMain' })
@ -154,6 +157,27 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductscrapRequestMain.allSchemas.tableColumns,...ProductscrapRequestDetail.allSchemas.tableMainColumns])
const ProductscrapRequestMainAllSchema = ref(cloneDeep(ProductscrapRequestMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
ProductscrapRequestMain.allSchemas = ProductscrapRequestMainAllSchema.value.allSchemas
} else {
ProductscrapRequestMain.allSchemas.formSchema = ProductscrapRequestMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q3Number')
ProductscrapRequestMain.allSchemas.tableColumns = ProductscrapRequestMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q3Number')
ProductscrapRequestMain.allSchemas.tableFormColumns = ProductscrapRequestMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q3Number')
ProductscrapRequestMain.allSchemas.tableMainColumns = ProductscrapRequestMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q3Number')
ProductscrapRequestMain.allSchemas.detailSchema = ProductscrapRequestMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q3Number')
ProductscrapRequestMain.allSchemas.searchSchema = ProductscrapRequestMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q3Number')
}
updateKey.value++
})
}
getSwitchByCode1()
// table
const buttondataTable = ref([{
@ -310,7 +334,6 @@ const buttonOperationClick = async (row, label, index,isSave = false)=> {
bomTableList.value = detatableDataBom.tableList
console.log(row.fromLocationCode);
detatableDataBom.tableList.forEach(async (item) => {
console.log(333,item)
ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => {
if (bomItem.field == 'batch') {
let condition = [{
@ -518,6 +541,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['costCenterType'] = val[0]['costcentreType']
}else if(formField == 'productionLineCode'){
tableData.value = []
} else if(formField == 'workshopCode'){
tableData.value = []
}
formRef.setValues(setV)
}

26
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/index.vue

@ -28,6 +28,14 @@
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>
@ -66,6 +74,7 @@ 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()
//
@ -100,7 +109,9 @@ const HeadButttondata = [
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
const buttonTableClick = async (val, row) => {
}
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
@ -119,10 +130,23 @@ const buttonBaseClick = (val, item) => {
}
}
// -
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 formRef = ref()
const detailRef = ref()
const { wsCache } = useCache()
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,'recordPurchaseBarter')
}
/** 导出按钮操作 */
const handleExport = async () => {

2
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts

@ -14,7 +14,7 @@ export const PurchaseBarterRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '申请单号',
field: 'number',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm: false,

1
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue

@ -154,6 +154,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField === 'supplierCode'){
setV['supplierCode'] = val[0]['code']
setV['supplierName'] = val[0]['name']
tableData.value = []
}
formRef.setValues(setV)
})

2
src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts

@ -194,6 +194,8 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
field: 'uom',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.UOM,
dictClass: 'string',
tableForm: {
disabled: true
},

261
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/index.vue

@ -1,23 +1,31 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptJobMain.allSchemas.searchSchema,...PurchasereceiptJobDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="[
...PurchasereceiptJobMain.allSchemas.searchSchema,
...PurchasereceiptJobDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptJobMain.allSchemas"
:detailAllSchemas="PurchasereceiptJobDetail.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptJobMain.allSchemas"
:detailAllSchemas="PurchasereceiptJobDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -28,13 +36,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<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 #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -82,26 +93,29 @@
:isShowFooterButtton="false"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchasereceiptJobMain,
import {
PurchasereceiptJobMain,
PurchasereceiptJobMainRules,
PurchasereceiptJobDetail,
PurchasereceiptJobDetailRules,
PurchasereceiptJobDetailPackingNumber } from './purchasereceiptJobMain.data'
PurchasereceiptJobDetailPackingNumber
} from './purchasereceiptJobMain.data'
import * as PurchasereceiptJobMainApi from '@/api/wms/purchasereceiptJobMain'
import * as PurchasereceiptJobDetailApi from '@/api/wms/purchasereceiptJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getSwitchByCode } from '@/api/wms/switch'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
@ -116,30 +130,33 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchasereceiptJobMain.allSchemas.tableColumns,...PurchasereceiptJobDetail.allSchemas.tableMainColumns])
if(routeName.value.includes('SCP')){
tableColumns.value = tableColumns.value.filter(item=>item.label!='操作')
const tableColumns = ref([
...PurchasereceiptJobMain.allSchemas.tableColumns,
...PurchasereceiptJobDetail.allSchemas.tableMainColumns
])
if (routeName.value.includes('SCP')) {
tableColumns.value = tableColumns.value.filter((item) => item.label != '操作')
}
//
const updataTableColumns = (val) => {
if(routeName.value.includes('SCP')){
val = val.filter(item=>item.label!='操作')
if (routeName.value.includes('SCP')) {
val = val.filter((item) => item.label != '操作')
}
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
@ -165,10 +182,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPageSCP:PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPage //
getListApi: routeName.value.includes('SCP')
? PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPageSCP
: PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPage //
})
//
@ -176,32 +195,36 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-job-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-job-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -209,25 +232,35 @@ const isShowMainButton = (row,val) => {
}
}
//
// ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
} else {
return false
}
} else {
return false
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
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.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobAccBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-job-main:close'
}), //
defaultButtons.mainListJobAbaBtn({ hide: isShowMainButton(row, ['2']) }), //
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
{
label: '拒收',
@ -239,29 +272,35 @@ const butttondata = (row,$index) => {
hasPermi: 'wms:purchasereceipt-job-main:refusal',
link: true //
},
defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), //
defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowSourceTypeButton(row) }) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainJobExe') { //
if (val == 'mainJobExe') {
//
console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { //
} else if (val == 'mainJobAba') {
//
console.log('列表-操作按钮事件-放弃')
await PurchasereceiptJobMainApi.abandonPurchasereceiptJobMainSpare(row.masterId)
buttonBaseClick('refresh',null)
} else if (val == 'mainJobClo') { //
buttonBaseClick('refresh', null)
} else if (val == 'mainJobClo') {
//
handleClose(row.masterId)
buttonBaseClick('refresh',null)
} else if (val == 'mainJobAcc') { //
buttonBaseClick('refresh', null)
} else if (val == 'mainJobAcc') {
//
console.log('列表-操作按钮事件-承接')
await PurchasereceiptJobMainApi.acceptPurchasereceiptJobMain(row.masterId)
buttonBaseClick('refresh',null)
} else if(val == 'mainPlanCheckQualityReport'){
//
checkQualityReport(row)
} else if(val == 'mainJobRefusal'){
buttonBaseClick('refresh', null)
}
// else if(val == 'mainPlanCheckQualityReport'){
// //
// checkQualityReport(row)
// }
else if (val == 'mainJobRefusal') {
// handleRefusal(row.masterId)
resonSubmit(row)
}
@ -270,7 +309,7 @@ const buttonTableClick = async (val, row) => {
const showQualityReport = ref(false)
const reportHeight = ref(window.innerHeight - 120)
const qualityReport = ref('')
const checkQualityReport = async (row)=>{
const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}`
}
@ -281,38 +320,37 @@ const handleClose = async (id: number) => {
await message.confirm(t('common.confirmColse'))
await PurchasereceiptJobMainApi.closePurchasereceiptJobMain(id)
message.success(t('common.closeSuccess'))
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} catch {}
}
const resonSubmit = async (row)=>{
ElMessageBox.prompt(t('ts.请输入拒收原因'), t('ts.提示'), {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, //
inputErrorMessage: t(`ts.${'驳回原因不能为空,且不超过256字'}`),
inputType:'textarea',
inputValidator:(value)=>{
if(value.length>60||value.length==0){
return false
}else{
return true
}
const resonSubmit = async (row) => {
ElMessageBox.prompt(t('ts.请输入拒收原因'), t('ts.提示'), {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, //
inputErrorMessage: t(`ts.${'驳回原因不能为空,且不超过256字'}`),
inputType: 'textarea',
inputValidator: (value) => {
if (value.length > 60 || value.length == 0) {
return false
} else {
return true
}
}).then(({ value }) => {
}
})
.then(({ value }) => {
// 
handleRefusal(row.masterId,value)
})
.catch(() => {
handleRefusal(row.masterId, value)
})
}
.catch(() => {})
}
/** 拒收按钮操作 */
const handleRefusal = async (id: number,refuseReason:string) => {
const handleRefusal = async (id: number, refuseReason: string) => {
// refuseReason
try {
await PurchasereceiptJobMainApi.refusalPurchasereceiptJobMain({id,refuseReason})
await PurchasereceiptJobMainApi.refusalPurchasereceiptJobMain({ id, refuseReason })
message.success(t('common.refusalSuccess'))
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} catch {}
}
@ -321,20 +359,22 @@ const detailParenPackingRef = ref()
const { tableObject: packingDetatableData, tableMethods: packDetatableMethods } = useTable({
getListApi: PurchasereceiptJobDetailApi.queryPurchaseceiptChildPackingNumber
})
const { getList:queryDetailList } = packDetatableMethods
const { getList: queryDetailList } = packDetatableMethods
//
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
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,'jobPurchasereceiptMain')
detailRef.value.openDetail(row, titleName, titleValue, 'jobPurchasereceiptMain')
}
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: '查看子包装',
name: 'viewParentPickingNumber',
hide: false,
@ -342,18 +382,20 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
//
const tableFormButton = async (val , row) => {
if (val == 'viewParentPickingNumber') { //
packingDetatableData.params = {
masterId:row.masterId,
parentPackingNumber:row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null,'viewDetail')//
const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber') {
//
packingDetatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
}
@ -366,7 +408,7 @@ const handleExport = async () => {
loadStart()
const excelTitle = ref(route.meta.title)
const data = await PurchasereceiptJobMainApi.exportPurchasereceiptJobMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
@ -385,5 +427,8 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getList()
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
})
</script>

33
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMTypeMain/index.vue

@ -115,7 +115,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {getJmreportBaseUrl, getReportUrl} from '@/utils/systemParam'
import { getSwitchByCode } from '@/api/wms/switch'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons";
@ -170,12 +170,30 @@ const buttonBaseClick = (val, item) => {
}
}
//
// ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
} else {
return false
}
} else {
return true
}
}
// QMS()
const isShowSCPAndQMSButton = () => {
if (EnableQms.value) {
if (routeName.value.includes('SCP')) {
return true
} else {
return false
}
} else {
return false
return true
}
}
@ -183,14 +201,14 @@ const isShowSourceTypeButton = (row) => {
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return [defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})]
return [defaultButtons.mainListPrintInspectionBtn({hide:isShowSCPAndQMSButton()})]
}
return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
//defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), //
defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), //
defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})
defaultButtons.mainListPrintInspectionBtn({hide:isShowSCPAndQMSButton()})
]
}
@ -384,6 +402,9 @@ onMounted(async () => {
tableObject.params = {
orderTypeM : '2'
}
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList()
})
onActivated(() => {

341
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue

@ -1,23 +1,31 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptRecordMain.allSchemas.searchSchema,...PurchasereceiptRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" />
<Search
:schema="[
...PurchasereceiptRecordMain.allSchemas.searchSchema,
...PurchasereceiptRecordDetail.allSchemas.searchSchema
]"
@search="searchList"
@reset="searchList"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
:detailAllSchemas="PurchasereceiptRecordDetail.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
:detailAllSchemas="PurchasereceiptRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -28,13 +36,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<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 #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -77,8 +88,8 @@
:isShowFooterButtton="false"
/>
<!-- 缺货子包装弹窗 -->
<BasicForm
<!-- 缺货子包装弹窗 -->
<BasicForm
ref="outStockDetailParenPackingRef"
@success="getList"
:tableAllSchemas="PurchasereceiptRecordDetailPackingNumber.allSchemas"
@ -90,36 +101,36 @@
:isShowFooterButtton="false"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchasereceiptRecordMain,
import {
PurchasereceiptRecordMain,
PurchasereceiptRecordMainRules,
PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules,
PurchasereceiptRecordDetailPackingNumber } from './purchasereceiptRecordMain.data'
PurchasereceiptRecordDetailPackingNumber
} from './purchasereceiptRecordMain.data'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getSwitchByCode } from '@/api/wms/switch'
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {getJmreportBaseUrl, getReportUrl} from '@/utils/systemParam'
import { getJmreportBaseUrl, getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons";
import {getAccessToken} from "@/utils/auth";
import { mainListPointBtn, mainListPrintInspectionBtn } from '@/utils/disposition/defaultButtons'
import { getAccessToken } from '@/utils/auth'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'PurchasereceiptRecordMain' })
@ -128,8 +139,15 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const apiPage = ref(routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage)
const tableColumns = ref([...PurchasereceiptRecordMain.allSchemas.tableColumns,...PurchasereceiptRecordDetail.allSchemas.tableMainColumns])
const apiPage = ref(
routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage
)
const tableColumns = ref([
...PurchasereceiptRecordMain.allSchemas.tableColumns,
...PurchasereceiptRecordDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas)
//
@ -138,7 +156,9 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage //
getListApi: routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage //
})
//
@ -146,76 +166,125 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-record-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
// ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
} else {
return false
}
} else {
return true
}
}
// QMS()
const isShowSCPAndQMSButton = () => {
if (EnableQms.value) {
if (routeName.value.includes('SCP')) {
return true
} else {
return false
}
} else {
return false
return true
}
}
// QMS()
const isShowputawayRequestFlagButton = (row) => {
if (EnableQms.value) {
if (row.inspectRequestFlag == 'FALSE') {
return true
} else {
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 [defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})]
const butttondata = (row, $index) => {
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return [defaultButtons.mainListPrintInspectionBtn({ hide: isShowSCPAndQMSButton() })]
}
return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
defaultButtons.mainPurchasereturnRecordBtn({hasPermi:'wms:purchasereceipt-record-main:createPurchasereturnRecord',hide:row.purchasereturnRecordFlag == "FALSE" }),// 退
//defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), //
defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), //
defaultButtons.mainListPrintInspectionBtn({hide:routeName.value.includes('SCP')})
defaultButtons.mainInspectRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createInspectRequest',
hide: isShowputawayRequestFlagButton(row)
}), //
defaultButtons.mainPutawayRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE'
}), //
defaultButtons.mainPurchasereturnRecordBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPurchasereturnRecord',
hide: row.purchasereturnRecordFlag == 'FALSE'
}), // 退
//defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), //
defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowSourceTypeButton(row) }), //
defaultButtons.mainListPrintInspectionBtn({ hide: isShowSCPAndQMSButton() })
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'putawayRequest') { //
if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number)
}else if(val == 'inspectRequest'){//
} else if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number)
}else if(val == 'purchasereturnRecord'){//退
} else if (val == 'purchasereturnRecord') {
//退
handleCreatePurchasereturnRecord(row.number)
}else if(val == 'mainPlanCheckQualityReport'){
} else if (val == 'mainPlanCheckQualityReport') {
//
checkQualityReport(row)
}else if (val == 'printInspection'){
} else if (val == 'printInspection') {
handlePrint(row)
}
}
const searchList = (model)=>{
let params = {...model}
if(Array.isArray(params.itemType)&&params.itemType.length>0){
const searchList = (model) => {
let params = { ...model }
if (Array.isArray(params.itemType) && params.itemType.length > 0) {
params.itemTypes = params.itemType.join(',')
params.itemType = ''
}else{
} else {
params.itemTypes = ''
params.itemType = ''
}
@ -227,7 +296,7 @@ const searchList = (model)=>{
const reportHeight = ref(window.innerHeight - 120)
const showQualityReport = ref(false)
const qualityReport = ref('')
const checkQualityReport = async (row)=>{
const checkQualityReport = async (row) => {
showQualityReport.value = true
// qualityReport.value = "http://localhost/purchasereceiptReport?asnNumber=ASNS20240720-0002"
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}`
@ -236,44 +305,47 @@ const checkQualityReport = async (row)=>{
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/986481894320525312?token=' + getAccessToken())
const handlePrint = async (row) => {
window.open(src.value+'&jobNumber='+row.jobNumber)
window.open(src.value + '&jobNumber=' + row.jobNumber)
}
/** 生成采购上架申请按钮操作 */
const handleCreatePutawayRequest = async (number:string) => {
try{
const handleCreatePutawayRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成上架申请吗?'))
tableObject.loading = true
await PurchasereceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
/** 生成到货检验申请按钮操作 */
const handleCreateInspectRequest = async (number:string) => {
try{
const handleCreateInspectRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成到货检验申请吗?'))
tableObject.loading = true
await PurchasereceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
/** 生成采购退货记录按钮操作 */
const handleCreatePurchasereturnRecord = async (number:string) => {
try{
const handleCreatePurchasereturnRecord = async (number: string) => {
try {
await message.confirm(t('ts.确认生成采购退货记录吗?'))
tableObject.loading = true
await PurchasereceiptRecordMainApi.createPurchasereturnRecord(number)
message.success(t('ts.采购退货记录生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
@ -283,27 +355,30 @@ const detailParenPackingRef = ref()
const { tableObject: packingDetatableData, tableMethods: packDetatableMethods } = useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseceiptChildPackingNumber
})
const { getList:queryDetailList } = packDetatableMethods
const { getList: queryDetailList } = packDetatableMethods
//
const outStockDetailParenPackingRef = ref()
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } = useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
})
const { getList:queryOutStockDetailList } = outStockPackDetatableMethods
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } =
useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
})
const { getList: queryOutStockDetailList } = outStockPackDetatableMethods
//
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
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,'recordPurchasereceiptMain')
detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain')
}
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: t('ts.查看子包装'),
name: 'viewParentPickingNumber',
hide: false,
@ -311,28 +386,30 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
const tabeKey = ref("receiptDetail");
const tabeKey = ref('receiptDetail')
//
const tableFormButton = async (val , row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') { //
packingDetatableData.params = {
masterId:row.masterId,
parentPackingNumber:row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null,'viewDetail')//
const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') {
//
packingDetatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') { //
outStockPackingDetatableData.params = {
masterId:row.masterId,
parentPackingNumber:row.packingNumber
}
await queryOutStockDetailList()
outStockDetailParenPackingRef.value.open('create', row, null,'viewDetail')//
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') {
//
outStockPackingDetatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await queryOutStockDetailList()
outStockDetailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
}
@ -344,11 +421,15 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
if(routeName.value.includes('SCP')){
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(tableObject.params)
if (routeName.value.includes('SCP')) {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else{
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(tableObject.params)
} else {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch {
@ -359,13 +440,11 @@ const handleExport = async () => {
//
const searchFormClick = (searchData) => {
searchData.filters.push(
{
action: '==',
column: 'order_type_m',
value: '1'
}
)
searchData.filters.push({
action: '==',
column: 'order_type_m',
value: '1'
})
tableObject.params = {
isSearch: true,
filters: searchData.filters
@ -373,37 +452,41 @@ const searchFormClick = (searchData) => {
getList() //
}
// tabs
const changeTabs = (data) =>{
if(data.prop == 'receiptDetail'){
console.log(data)
apiPage.value = routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage
const changeTabs = (data) => {
if (data.prop == 'receiptDetail') {
console.log(data)
apiPage.value = routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'receiptDetail'
}else if(data.prop == 'scarceGoodsDetail'){
} else if (data.prop == 'scarceGoodsDetail') {
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'scarceGoodsDetail'
}
detailAllSchemas.value.tableColumns.forEach(item=>{
if(item['field']=='qty'){
item['label'] = data.prop == 'scarceGoodsDetail'?'缺货数量':'收货数量'
detailAllSchemas.value.tableColumns.forEach((item) => {
if (item['field'] == 'qty') {
item['label'] = data.prop == 'scarceGoodsDetail' ? '缺货数量' : '收货数量'
}
})
console.log('detailAllSchemas',detailAllSchemas.value)
console.log('detailAllSchemas', detailAllSchemas.value)
}
/** 初始化 **/
onMounted(async () => {
tableObject.params = {
orderTypeM : '1'
orderTypeM: '1'
}
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList()
})
onActivated(() => {
tableObject.params = {
orderTypeM : '1'
orderTypeM: '1'
}
getList()
})

262
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordRefuseMain/index.vue

@ -1,23 +1,31 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchasereceiptRecordMain.allSchemas.searchSchema,...PurchasereceiptRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="[
...PurchasereceiptRecordMain.allSchemas.searchSchema,
...PurchasereceiptRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
:detailAllSchemas="PurchasereceiptRecordDetail.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasereceiptRecordMain.allSchemas"
:detailAllSchemas="PurchasereceiptRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -28,13 +36,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<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 #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -77,8 +88,8 @@
:isShowFooterButtton="false"
/>
<!-- 缺货子包装弹窗 -->
<BasicForm
<!-- 缺货子包装弹窗 -->
<BasicForm
ref="outStockDetailParenPackingRef"
@success="getList"
:tableAllSchemas="PurchasereceiptRecordDetailPackingNumber.allSchemas"
@ -90,30 +101,31 @@
:isShowFooterButtton="false"
/>
<el-dialog
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
v-model="showQualityReport"
:title="t('质检明细')"
:append-to-body="false"
destroy-on-close
fullscreen
>
<iframe :height="reportHeight" width="100%" :src="qualityReport" frameborder="0"></iframe>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchasereceiptRecordMain,
import {
PurchasereceiptRecordMain,
PurchasereceiptRecordMainRules,
PurchasereceiptRecordDetail,
PurchasereceiptRecordDetailRules,
PurchasereceiptRecordDetailPackingNumber } from './purchasereceiptRecordMain.data'
PurchasereceiptRecordDetailPackingNumber
} from './purchasereceiptRecordMain.data'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { PurchasereceiptRefuseRequestTabsList } from '@/utils/disposition/tabsList'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getSwitchByCode } from '@/api/wms/switch'
import { getReportUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
@ -125,8 +137,15 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const apiPage = ref(routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage)
const tableColumns = ref([...PurchasereceiptRecordMain.allSchemas.tableColumns,...PurchasereceiptRecordDetail.allSchemas.tableMainColumns])
const apiPage = ref(
routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage
)
const tableColumns = ref([
...PurchasereceiptRecordMain.allSchemas.tableColumns,
...PurchasereceiptRecordDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas)
//
@ -135,7 +154,9 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage //
getListApi: routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage //
})
//
@ -143,50 +164,88 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-record-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchasereceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// QMS()
const EnableQms = ref(true)
const isShowputawayRequestFlagButton = (row) => {
if (EnableQms.value) {
if (row.inspectRequestFlag == 'FALSE') {
return true
} else {
return false
}
} else {
return true
}
}
// QMS()
const isShowQMSButton = () => {
if (EnableQms.value) {
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){
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.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
defaultButtons.mainListPlanCheckQualityReportBtn({}), //
defaultButtons.mainInspectRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createInspectRequest',
hide: isShowputawayRequestFlagButton(row)
}), //
defaultButtons.mainPutawayRequestBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE'
}), //
defaultButtons.mainListPlanCheckQualityReportBtn({ hide: isShowQMSButton()}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'putawayRequest') { //
if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number)
}else if(val == 'inspectRequest'){//
} else if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number)
}else if(val == 'mainPlanCheckQualityReport'){
}
else if(val == 'mainPlanCheckQualityReport'){
//
checkQualityReport(row)
}
@ -195,64 +254,68 @@ const buttonTableClick = async (val, row) => {
const showQualityReport = ref(false)
const reportHeight = ref(window.innerHeight - 120)
const qualityReport = ref('')
const checkQualityReport = async (row)=>{
const checkQualityReport = async (row) => {
showQualityReport.value = true
qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}`
}
/** 生成采购上架申请按钮操作 */
const handleCreatePutawayRequest = async (number:string) => {
try{
const handleCreatePutawayRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成上架申请吗?'))
tableObject.loading = true
await PurchasereceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
/** 生成到货检验申请按钮操作 */
const handleCreateInspectRequest = async (number:string) => {
try{
const handleCreateInspectRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成到货检验申请吗?'))
tableObject.loading = true
await PurchasereceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
//
const detailParenPackingRef = ref()
const { tableObject: packingDetatableData, tableMethods: packDetatableMethods } = useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseceiptChildPackingNumber
})
const { getList:queryDetailList } = packDetatableMethods
const { getList: queryDetailList } = packDetatableMethods
//
const outStockDetailParenPackingRef = ref()
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } = useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
})
const { getList:queryOutStockDetailList } = outStockPackDetatableMethods
const { tableObject: outStockPackingDetatableData, tableMethods: outStockPackDetatableMethods } =
useTable({
getListApi: PurchasereceiptRecordDetailApi.queryPurchaseshortageChildPackingNumber
})
const { getList: queryOutStockDetailList } = outStockPackDetatableMethods
//
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
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,'recordPurchasereceiptMain')
detailRef.value.openDetail(row, titleName, titleValue, 'recordPurchasereceiptMain')
}
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: t('ts.查看其他包装规格'),
name: 'viewParentPickingNumber',
hide: false,
@ -260,28 +323,30 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
const tabeKey = ref("receiptDetail");
const tabeKey = ref('receiptDetail')
//
const tableFormButton = async (val , row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') { //
packingDetatableData.params = {
masterId:row.masterId,
parentPackingNumber:row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null,'viewDetail')//
const tableFormButton = async (val, row) => {
if (val == 'viewParentPickingNumber' && tabeKey.value == 'receiptDetail') {
//
packingDetatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await queryDetailList()
detailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') { //
outStockPackingDetatableData.params = {
masterId:row.masterId,
parentPackingNumber:row.packingNumber
}
await queryOutStockDetailList()
outStockDetailParenPackingRef.value.open('create', row, null,'viewDetail')//
if (val == 'viewParentPickingNumber' && tabeKey.value == 'scarceGoodsDetail') {
//
outStockPackingDetatableData.params = {
masterId: row.masterId,
parentPackingNumber: row.packingNumber
}
await queryOutStockDetailList()
outStockDetailParenPackingRef.value.open('create', row, null, 'viewDetail') //
}
}
@ -293,11 +358,15 @@ const handleExport = async () => {
//
loadStart()
const excelTitle = ref(route.meta.title)
if(routeName.value.includes('SCP')){
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(tableObject.params)
if (routeName.value.includes('SCP')) {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMainSCP(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else{
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordRefuseMain(tableObject.params)
} else {
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordRefuseMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch {
@ -315,13 +384,15 @@ const searchFormClick = (searchData) => {
getList() //
}
// tabs
const changeTabs = (data) =>{
if(data.prop == 'receiptDetail'){
console.log(data)
apiPage.value = routeName.value.includes('SCP')?PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP:PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage
const changeTabs = (data) => {
if (data.prop == 'receiptDetail') {
console.log(data)
apiPage.value = routeName.value.includes('SCP')
? PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageSCP
: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailRefusePage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'receiptDetail'
}else if(data.prop == 'scarceGoodsDetail'){
} else if (data.prop == 'scarceGoodsDetail') {
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas
tabeKey.value = 'scarceGoodsDetail'
@ -330,6 +401,9 @@ const changeTabs = (data) =>{
/** 初始化 **/
onMounted(async () => {
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList()
})
</script>

20
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -181,6 +181,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth'
import { getSwitchByCode } from '@/api/wms/switch'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import { getJmreportBaseUrl } from '@/utils/systemParam'
@ -356,12 +357,17 @@ const isShowMainButton = (row,val) => {
}
}
//
// ,QMS()
const EnableQms = ref(true)
const isShowSourceTypeButton = (row) => {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
if (EnableQms.value) {
if (row.sourceType == 'EDI' || row.sourceType == 'ASN_ExternalReceipt') {
return true
} else {
return false
}
} else {
return false
return true
}
}
@ -460,7 +466,8 @@ const buttonTableClick = async (val, row) => {
}else if (val == 'point') {
//
labelPrint(row)
}else if(val == 'mainPlanCheckQualityReport'){
}
else if(val == 'mainPlanCheckQualityReport'){
//
checkQualityReport(row)
}
@ -901,6 +908,9 @@ const formFormDateChange = (field, val,row, index) => {
/** 初始化 **/
onMounted(async () => {
await getSwitchByCode('EnableQms').then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
})
getList()
importTemplateData.templateUrl = await PurchasereceiptRequestMainApi.importTemplate()
})

4
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -863,13 +863,13 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
form: {
component: 'InputNumber',
componentProps: {
min: 1,
min: 0,
precision: 6
},
},
tableForm: {
type: 'InputNumber',
min: 1,
min: 0,
precision: 6
}
},

23
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnJobMain/index.vue

@ -75,6 +75,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'PurchasereturnJobMain' })
@ -86,7 +88,28 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchasereturnJobMain.allSchemas.tableColumns,...PurchasereturnJobDetail.allSchemas.tableColumns])
const PurchasereturnJobMainAllSchema = ref(cloneDeep(PurchasereturnJobMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
PurchasereturnJobMain.allSchemas = PurchasereturnJobMainAllSchema.value.allSchemas
} else {
PurchasereturnJobMain.allSchemas.formSchema = PurchasereturnJobMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q2Number')
PurchasereturnJobMain.allSchemas.tableColumns = PurchasereturnJobMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q2Number')
PurchasereturnJobMain.allSchemas.tableFormColumns = PurchasereturnJobMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q2Number')
PurchasereturnJobMain.allSchemas.tableMainColumns = PurchasereturnJobMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q2Number')
PurchasereturnJobMain.allSchemas.detailSchema = PurchasereturnJobMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q2Number')
PurchasereturnJobMain.allSchemas.searchSchema = PurchasereturnJobMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q2Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

24
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/index.vue

@ -72,6 +72,8 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'PurchasereturnRecordMain' })
@ -83,6 +85,28 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchasereturnRecordMain.allSchemas.tableColumns,...PurchasereturnRecordDetail.allSchemas.tableMainColumns])
const PurchasereturnRecordMainAllSchema = ref(cloneDeep(PurchasereturnRecordMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
PurchasereturnRecordMain.allSchemas = PurchasereturnRecordMainAllSchema.value.allSchemas
} else {
PurchasereturnRecordMain.allSchemas.formSchema = PurchasereturnRecordMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q2Number')
PurchasereturnRecordMain.allSchemas.tableColumns = PurchasereturnRecordMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q2Number')
PurchasereturnRecordMain.allSchemas.tableFormColumns = PurchasereturnRecordMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q2Number')
PurchasereturnRecordMain.allSchemas.tableMainColumns = PurchasereturnRecordMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q2Number')
PurchasereturnRecordMain.allSchemas.detailSchema = PurchasereturnRecordMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q2Number')
PurchasereturnRecordMain.allSchemas.searchSchema = PurchasereturnRecordMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q2Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {

36
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -35,6 +35,7 @@
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
:key="updateKey"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
@ -73,6 +74,7 @@
@submitForm="submitForm"
@onEnter="onEnter"
@onChange="onChangeForm"
:key="updateKey"
>
<template #hahaha>
<el-button style="width:100%" type="primary" @click="chooseReceiptList">选择收货单明细</el-button>
@ -123,6 +125,7 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm"
:detailValidate="detailValidate"
:key="updateKey"
/>
<!-- 创建标签 -->
@ -183,6 +186,8 @@ import { async } from '@antv/x6/lib/registry/marker/async'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { getSwitchByCode } from '@/api/wms/switch'
import { cloneDeep } from 'lodash-es'
const { loadStart, loadDone } = usePageLoading()
// 退
defineOptions({ name: 'PurchasereturnRequestMainNew' })
@ -200,6 +205,37 @@ const tableColumns = ref([
const isShowButton = ref(true)
const PurchasereturnRequestMainNewAllSchema = ref(cloneDeep(PurchasereturnRequestMainNew))
const PurchasereturnRequestMainAllSchema = ref(cloneDeep(PurchasereturnRequestMain))
// QMSq1q2q3
const EnableQms = ref(true)
const updateKey = ref(0)
const getSwitchByCode1 =async () => {
await getSwitchByCode("EnableQms").then((res) => {
EnableQms.value = res == 'TRUE' ? true : false
if (EnableQms.value) {
PurchasereturnRequestMainNew.allSchemas = PurchasereturnRequestMainNewAllSchema.value.allSchemas
PurchasereturnRequestMain.allSchemas = PurchasereturnRequestMainAllSchema.value.allSchemas
} else {
PurchasereturnRequestMainNew.allSchemas.formSchema = PurchasereturnRequestMainNewAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q2Number')
PurchasereturnRequestMainNew.allSchemas.tableColumns = PurchasereturnRequestMainNewAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMainNew.allSchemas.tableFormColumns = PurchasereturnRequestMainNewAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMainNew.allSchemas.tableMainColumns = PurchasereturnRequestMainNewAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMainNew.allSchemas.detailSchema = PurchasereturnRequestMainNewAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q2Number')
PurchasereturnRequestMainNew.allSchemas.searchSchema = PurchasereturnRequestMainNewAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.formSchema = PurchasereturnRequestMainAllSchema.value.allSchemas.formSchema.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.tableColumns = PurchasereturnRequestMainAllSchema.value.allSchemas.tableColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.tableFormColumns = PurchasereturnRequestMainAllSchema.value.allSchemas.tableFormColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.tableMainColumns = PurchasereturnRequestMainAllSchema.value.allSchemas.tableMainColumns.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.detailSchema = PurchasereturnRequestMainAllSchema.value.allSchemas.detailSchema.filter(item => item.field != 'q2Number')
PurchasereturnRequestMain.allSchemas.searchSchema = PurchasereturnRequestMainAllSchema.value.allSchemas.searchSchema.filter(item => item.field != 'q2Number')
}
updateKey.value++
})
}
getSwitchByCode1()
//
const updataTableColumns = (val) => {
tableColumns.value = val

1
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -723,7 +723,6 @@ const getGenerateLabelList = async (row) => {
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
// console.log(3333, item?.boxPackaging[0])
item.boxPackaging = item.boxPackaging ? item.boxPackaging : []
item.packUnitInitOptions = item.boxPackaging
item.secondPackUnitInitOptions = item.palletPackaging || []

287
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts

@ -0,0 +1,287 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {
CustomerStatementMain,
} from '../../../deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
// 表单校验
export const PurchaseClaimRequestMainRules = reactive({
beforeTaxAmount: [required],
taxRate: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm: false,
// 0:新增1:已发布2已作废
},
{
label: '客户对账单',
field: 'customerStatementNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '客户代码',
field: 'customer',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '客户名称',
field: 'customerName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '未税金额',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '税率(%)',
field: 'taxRate',
dictType: DICT_TYPE.TAX_RATE_DICT,
dictClass: 'string',
sortTableDefault: 3,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '价税合计金额',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
sort: 'custom',
},
{
label: '开票日期',
field: 'invoiceTime',
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: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isTable: false,
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')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const PurchaseClaimRequestDetailRules = reactive({
beforeTaxAmount: [required],
taxRate: [required],
taxAmount: [required],
adTaxAmount: [required],
})
export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '品番',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
tableForm: {
disabled: true
}
},
{
label: '品号',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
isForm: false,
// 0:新增1:已发布2已作废
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '销售单价',
field: 'price',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '模具分摊单价',
field: 'allocationPrice',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '合计单价',
field: 'beforeTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '未税金额',
field: 'taxRate',
sort: 'custom',
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '含税金额',
field: 'adTaxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
]))

408
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

@ -0,0 +1,408 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchaseClaimRequestMain.allSchemas.searchSchema,...PurchaseClaimRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestMain.allSchemas"
:tableAllSchemas="PurchaseClaimRequestDetail.allSchemas"
:tableFormRules="PurchaseClaimRequestDetailRules"
:tableData="tableData"
:apiUpdate="PurchaseClaimRequestMainApi.updatePurchaseClaimRequestMain"
:apiCreate="PurchaseClaimRequestMainApi.createPurchaseClaimRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas"
:detailAllSchemasRules="PurchaseClaimRequestDetailRules"
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail"
:apiPage="PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage"
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchaseClaimRequestMain,PurchaseClaimRequestMainRules,PurchaseClaimRequestDetailRules,PurchaseClaimRequestDetail} from './PurchaseClaimRequestMain.data'
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'purchaseClaimRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const tableColumns = ref([...PurchaseClaimRequestMain.allSchemas.tableColumns,...PurchaseClaimRequestDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRequestMainApi.getPurchaseClaimRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
const tableData = ref([])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode') {
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0) return
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
row[formField] = item[searchField]
newRow['uom'] = item['customerUom']
newRow['id'] = item['id']
.push(newRow)
})
}else{
row[formField] = val[0][searchField]
}
// if(formField == 'itemCode') {
// row['uom'] = val[0]['customerUom']
// }
//
} else {
const setV = {}
if(formField == 'customerStatementNumber') {
//
setV['customer'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1,
pageNSize: 100,
masterId:val[0]['id']
}).then((res) => {
console.log(55,res)
tableData.value = res.list && res.list.length > 0 ?res.list : []
})
// tableData.value = []
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
// setV['soLine'] = val[0]['lineNumber']
// setV['lineNumber'] = val[0]['lineNumber']
// setV['itemCode'] = val[0]['itemCode']
setV['remark'] = val[0]['remark']
setV['uom'] = val[0]['customerUom']
formRef.setValues(setV)
})
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:`wms:${routeName.value}:create` }), //
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import` }), //
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,'planDeliverMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await PurchaseClaimRequestMainApi.deletePurchaseClaimRequestMain(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await PurchaseClaimRequestMainApi.exportPurchaseClaimRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
PurchaseClaimRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
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))
}
//true0
const flag = ref(false)
//
const submitForm = async (formType, submitData) => {
let data = {...submitData}
if(data.masterId){
data.id = data.masterId
}
data.subList = tableData.value //
data.subList.forEach(item=>{
item.toWarehouseCode = data.toWarehouseCode
item.toLocationCode = data.toLocationCode
})
data.businessType = businessType.value
//
let isExist = false
tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true
})
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach(obj => {
if(obj.qty == 0){
message.error(`数量不能为0!`)
flag.value = true
return;
}
})
if(flag.value){
return
}
var isHave =PurchaseClaimRequestMain.allSchemas.formSchema.some(function (item) {
return item.field === 'beginTime' || item.field === 'endTime';
});
if(isHave){
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){
message.error('结束时间要大于开始时间')
return;
}
}
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null;
formRef.value.formLoading = true
try {
if (formType === 'create') {
await PurchaseClaimRequestMainApi.createPurchaseClaimRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await PurchaseClaimRequestMainApi.updatePurchaseClaimRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PurchaseClaimRequestMainApi.importTemplate()
})
</script>

182
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/index.vue

@ -1,182 +0,0 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchaseclaimRecordMain.allSchemas.searchSchema,...PurchaseclaimRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseclaimRecordMain.allSchemas"
:detailAllSchemas="PurchaseclaimRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PurchaseclaimRecordMainRules"
:formAllSchemas="PurchaseclaimRecordMain.allSchemas"
:tableAllSchemas="PurchaseclaimRecordDetail.allSchemas"
:tableFormRules="PurchaseclaimRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseclaimRecordMain.allSchemas"
:detailAllSchemas="PurchaseclaimRecordDetail.allSchemas"
:detailAllSchemasRules="PurchaseclaimRecordDetailRules"
:apiPage="PurchaseclaimRecordDetailApi.getPurchaseclaimRecordDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PurchaseclaimRecordMain,PurchaseclaimRecordMainRules,PurchaseclaimRecordDetail,PurchaseclaimRecordDetailRules } from './purchaseclaimRecordMain.data'
import * as PurchaseclaimRecordMainApi from '@/api/wms/purchaseclaimRecordMain'
import * as PurchaseclaimRecordDetailApi from '@/api/wms/purchaseclaimRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'PurchaseclaimRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...PurchaseclaimRecordMain.allSchemas.tableColumns,...PurchaseclaimRecordDetail.allSchemas.tableMainColumns])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseclaimRecordDetailApi.getPurchaseclaimRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:purchaseclaim-record-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const 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) => {
}
//
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,"recordPurchaseclaimMain")
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await PurchaseclaimRecordMainApi.exportPurchaseclaimRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

382
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRecordMain/purchaseclaimRecordMain.data.ts

@ -1,382 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const PurchaseclaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 180
},
},
{
label: '要货计划单号',
field: 'ppNumber',
sort: 'custom',
table: {
width: 180
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
}
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
}
},
{
label: '执行时间',
field: 'executeTime',
isTable: true,
formatter: dateFormatter,
deatil: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}
},
{
label: '生效日期',
field: 'activeDate',
isTable: true,
formatter: dateFormatter2,
deatil: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
}
},
{
label: '申请时间',
field: 'requestTime',
isTable: true,
formatter: dateFormatter,
deatil: {
dateFormatter: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}
},
{
label: '截止时间',
field: 'dueTime',
isTable: true,
formatter: dateFormatter,
deatil: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
}
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '代码',
field: 'code',
sort: 'custom',
table: {
width: 150
}
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
form:{
component:'Switch',
componentProps:{
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// }
// },
// {
// label: '创建时间',
// field: 'createTime',
// isTable: true,
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// }
// },
]))
//表单校验
export const PurchaseclaimRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'blur' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'blur' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const PurchaseclaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
}
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
}
},
{
label: '原因',
field: 'reason',
isTable: true,
dictClass: 'string',
sort: 'custom',
table: {
width: 150
}
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '金额',
field: 'amount',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
}
},
{
label: '代码',
field: 'code',
sort: 'custom',
table: {
width: 150
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
table: {
width: 150
},
form:{
component:'Switch',
componentProps:{
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
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')]
},
},
},
]))
//表单校验
export const PurchaseclaimRecordDetailRules = reactive({
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
poNumber: [
{ required: true, message: '请选择订单号', trigger: 'change' }
],
poLine: [
{ required: true, message: '请输入订单行', trigger: 'blur' }
],
reason: [
{ required: true, message: '请输入原因', trigger: 'blur' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save