From a263602debf7bb4b3d0ff0356931fed5340bec35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Mon, 11 Nov 2024 15:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=E8=BF=81=E7=A7=BBVue2=E5=8D=87=E7=BA=A7Vu?= =?UTF-8?q?e3=2010/25-11/8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 263 ++++++++- src/common/balance.js | 14 +- src/common/detail.js | 40 ++ src/common/label.js | 45 +- src/common/record.js | 33 +- .../detail/comDetailCardBatch.vue | 95 ++-- .../detail/comJobDetailCardBatch.vue | 49 +- .../detail/comRecommendDetailCard.vue | 6 +- src/mycomponents/item/itemCompareQty.vue | 2 +- src/mycomponents/package/packageCard.vue | 2 +- src/mycomponents/qty/balanceQtyEdit.vue | 2 +- src/mycomponents/qty/packUnit.vue | 2 +- src/mycomponents/qty/qtyEdit.vue | 8 +- src/mycomponents/qty/recommendHandleQty.vue | 86 +++ src/mycomponents/qty/recommendQtyEdit.vue | 19 +- src/mycomponents/query/fifoQuery.vue | 293 ++++++++++ .../record/recordComDetailCard.vue | 16 +- .../record/recordComDetailCardBatch.vue | 207 ++++++++ src/mycomponents/scan/winComScan.vue | 12 +- src/mycomponents/scan/winScanLocation.vue | 8 +- src/mycomponents/scan/winScanPack.vue | 10 +- .../scan/winScanPackAndLocation.vue | 11 +- src/mycomponents/scan/winScanPackJob.vue | 2 +- src/pages.json | 98 ++++ src/pages/issue/record/directIssueByBatch.vue | 502 ++++++++++++++++++ .../job/semiProductReceiptJob.vue | 2 +- .../record/productReceiptRecordByBatch.vue | 447 ++++++++++++++++ .../job/purchaseReceiptDevelop.vue | 41 ++ .../job/purchaseReceiptTool.vue | 42 ++ src/pages/putaway/job/putawayJob.vue | 7 +- src/pages/putaway/record/putawayRecord.vue | 1 - src/pages/scrap/record/scrapRecord.vue | 2 +- .../unPlanned/record/receiptRecordByBatch.vue | 346 ++++++++++++ 33 files changed, 2567 insertions(+), 146 deletions(-) create mode 100644 src/mycomponents/qty/recommendHandleQty.vue create mode 100644 src/mycomponents/query/fifoQuery.vue create mode 100644 src/mycomponents/record/recordComDetailCardBatch.vue create mode 100644 src/pages/issue/record/directIssueByBatch.vue create mode 100644 src/pages/productReceipt/record/productReceiptRecordByBatch.vue create mode 100644 src/pages/purchaseReceipt/job/purchaseReceiptDevelop.vue create mode 100644 src/pages/purchaseReceipt/job/purchaseReceiptTool.vue create mode 100644 src/pages/unPlanned/record/receiptRecordByBatch.vue diff --git a/src/api/request2.js b/src/api/request2.js index 6aff7531..f0937b0f 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -170,6 +170,14 @@ export function getExpectinByItemcode(params) { export function getExpectoutByItemcode(params) { return http.post("/wms/expectout/senior",params) } +/** + * 查询库存事务 + * @param {*} + * + */ +export function getTransaction(params) { + return http.post("/wms/transaction/senior",params); +} /** * 按库位查询库存汇总 * @param {*} @@ -369,6 +377,24 @@ export function getBasicItemByCode(itemCode) { } return http.get("/wms/itembasic/page",{params}) } +/** + * 查询物品信息接口 + * @param {*} code 物品代码 + * + */ +export function getBasicItemByCodeSenior(itemCode) { + + var params = { + filters: [{ + column: "code", + action: "like", + value: itemCode + }], + pageNo: 1, + pageSize: 1000 + } + return http.post('/wms/itembasic/senior',params); +} /** * 按物品查询库存汇总 * @param {*} itemCode @@ -795,6 +821,31 @@ export function cancleTakePutawayJob(id) { export function putawayJobSubmit(params) { return http.put("/wms/putaway-job-main/execute", params) } +/** + * 采购上架 全部承接任务 + * @param {*} id + * + */ +export function takeAllPutawayJob(data) { + return http.put("/wms/putaway-job-main/acceptBatch", data) +} + +/** + * 采购上架 全部放弃承接任务 + * @param {*} id + * + */ +export function cancleAllTakePutawayJob(data) { + return http.put("/wms/putaway-job-main/abandonBatch", data) +} +/** + * 采购上架 任务全部提交 + * @param {*} data + */ +export function putawayJobAllExecute(data) { + return http.put("/wms/putaway-job-main/executeBatch", data) +} + /** * 采购上架申请 获取任务列表 * 任务状态 @@ -887,7 +938,7 @@ export function getIssueJobList(params) { * 发料生产线查询 */ export function getIssueJobByProductionline() { - return http.get("/issue-job-mwmsain/getIssueJobByProductionline") + return http.get("/wms/issue-job-main/getIssueJobByProductionline") } /** * 发料接收生产线查询 @@ -1075,6 +1126,18 @@ export function getFuzzyCountJobList(data) { export function getCountJobDetail(id) { return http.get("/wms/count-job-main/getCountJobById?id=" + id) } +/** + * 盘点 获取任务明细 + * @param {*} id 任务id + * + */ +export function getFuuzyCountJobDetail(id) { + return request({ + url: baseApi + "/wms/count-job-main/getCountJobById-pda?id=" + id, + method: "get", + data: {}, + }); +} /** * 盘点任务 任务承接 * @param {*} id @@ -1604,6 +1667,13 @@ export function deliverRequestSubmit(params) { export function deliverRequestClose(id) { return http.put("/wms/deliver-request-main/close?id=" + id) } +/** + * 翻包任务 关闭任务 + * @param {*} params + */ +export function packageoverRequestClose(id) { + return http.put("/wms/packageover-job-main/close?id=" + id) +} /** * 制品发货申请 提交审批 * @param {*} params @@ -1830,6 +1900,41 @@ export function customerReturnRequestAddAgain(id) { export function customerReturnRecordSubmit(params) { return http.put("/wms/customerreturn-record-main/create",params) } +/** + * 客户退货 记录列表 + * @param {*} params + */ +export function getCustomerReturnRecordList(params) { + return http.post("/wms/customerreturn-record-detail/senior",params) +} + +/** + * 客户退货 记录详情 + * @param {*} params + */ + +export function getCustomerReturnRecordDetail(id) { + return http.get("/wms/customerreturn-record-detail/page?masterId=" + id) +} + +/** + * 客户退货 拒收 + * @param {*} params + */ + +export function customerReturnRecordRefuse(id) { + return http.put("/wms/customerreturn-record-main/refuse?id=" + id) +} + +/** + * 客户退货 接收 + * @param {*} params + */ + +export function customerReturnRecordReceive(id) { + return http.put("/wms/customerreturn-record-main/receive?id=" + id) +} + /** * 调拨入库 任务 * status 任务状态 @@ -2093,6 +2198,29 @@ export function issueRecordSubmit(params) { export function getProductionreturnJobList(params) { return http.post("/wms/productionreturn-job-detail/senior",params) } +/** + * 生产隔离退料 任务获取任务列表 + * 任务状态 + * 开始日期 + * 结束日期 + * 获取日期任务列表 + * @param {*} + */ +export function getProductionHoldReturnJobList(params) { + return http.post("/wms/productionreturn-job-detail-hold/senior",params) +} + +/** + * 生产合格退料 任务获取任务列表 + * 任务状态 + * 开始日期 + * 结束日期 + * 获取日期任务列表 + * @param {*} + */ +export function getProductionOkReturnJobList(params) { + return http.post("/wms/productionreturn-job-detail-store/senior",params) +} /** * 生产退料任务 获取任务明细 * @param {*} id 任务id @@ -2213,6 +2341,40 @@ export function productionReturnRecordSubmit(params) { return http.post("/wms/productionreturn-record-main/create",params) } +/** + * 生产隔离退料 记录列表 + * @param {*} params + */ +export function getProductionReturnRecordList(params) { + return http.post("/wms/productionreturn-record-detail-hold/senior",params) +} + +/** + * 生产隔离退料 记录详情 + * @param {*} params + */ + +export function getProductionReturnRecordDetail(id) { + return http.get("/wms/productionreturn-record-detail/page?masterId=" + id) +} + +/** + * 生产隔离退料 拒收 + * @param {*} params + */ + +export function productionReturnRecordRefuse(id) { + return http.put("/wms/productionreturn-record-main/refuse?id=" + id) +} + +/** + * 生产隔离退料 接收 + * @param {*} params + */ + +export function productionReturnRecordReceive(id) { + return http.put("/wms/productionreturn-record-main/receive?id=" + id) +} /** * 计划外出库申请 * 任务状态 @@ -2386,7 +2548,40 @@ export function scrapRequestAddAgain(id) { export function scrapRecordSubmit(params) { return http.post("/wms/scrap-record-main/create",params) } +/** + * 隔离收货 记录列表 + * @param {*} params + */ +export function getProductreceiptRecordList(params) { + return http.post("/wms/productreceipt-record-detail/senior",params) +} + +/** + * 隔离收货 记录详情 + * @param {*} params + */ + +export function getProductreceiptRecordDetail(id) { + return http.get("/wms/productreceipt-record-detail/page?masterId=" + id) +} + +/** + * 隔离收货 拒收 + * @param {*} params + */ + +export function productreceiptRecordRefuse(id) { + return http.put("/wms/productreceipt-record-main/refuse?id=" + id) +} + +/** + * 隔离收货 接收 + * @param {*} params + */ +export function productreceiptRecordReceive(id) { + return http.put("/wms/productreceipt-record-main/receive?id=" + id) +} /** * 补料任务 列表 @@ -2531,6 +2726,14 @@ export function batchPrintingLable(params) { export function getBalanceByFilter(params) { return http.post("/wms/balance/senior" ,params) } +/** + * 查询库存事务 + * @param {*} + * + */ +export function getTransactionByFilter(param) { + return http.post("/wms/transaction/senior" ,param) +} /** * 查询管理精度,多个物料,多个库位 * @param {*} @@ -2724,7 +2927,14 @@ export function getPlaneInfoByproductLine(productionLine,planDate) { export function planReceiptSubmit(data) { return http.post( "/wms/productreceipt-record-main/createByPlan",data) } +/** + * 按计划完工提交 李达明 + * @param {*} + */ +export function createByPlanSubmit(params) { + return http.post("/wms/productreceipt-record-main/createByPlanToSenior",params); +} /** * @param {Object} params 创建计划完工后调用上架申请 number */ @@ -2779,5 +2989,54 @@ export function getProductreceiptDetailbByPackingNumber(packingNumber ) { * 物料变更 */ export function fgChangeCommit(data) { - return http.post("/wms/relegate-request-main/bind",data) + return http.post("/wms/relegate-request-main/bind",data) +} + +/** + * 查询物料与库位关系 + */ +export function checkItemCodeAndLocation(params) { + return http.post("/wms/location/checkRecommendLocation",params) +} + +/** + * 库存余额根据业务类型汇总接口 + */ +export function getBalanceByBusinessType(params) { + return http.get("/wms/balance/summaryByBusinessType",params) +} + +/** + * 物料隔离 记录列表 + * @param {*} params + */ +export function getInventoryMoveRecordList(params) { + return http.post("/wms/inventorymove-record-detail/senior",params) +} + +/** + * 物料隔离 记录详情 + * @param {*} params + */ + +export function getInventoryMoveRecordDetail(id) { + return http.get("/wms/inventorymove-record-detail/page?masterId=" + id) +} + +/** + * 物料隔离 拒收 + * @param {*} params + */ + +export function inventoryMoveRecordRefuse(id) { + return http.put("/wms/inventorymove-record-main/refuse?id=" + id) +} + +/** + * 物料隔离 接收 + * @param {*} params + */ + +export function inventoryMoveRecordReceive(id) { + return http.put("/wms/inventorymove-record-main/receive?id=" + id) } \ No newline at end of file diff --git a/src/common/balance.js b/src/common/balance.js index 47f725ae..3abf5ed7 100644 --- a/src/common/balance.js +++ b/src/common/balance.js @@ -108,7 +108,7 @@ export function getPrecisionStrategyList(itemList, callback) { * @param {*} * */ -export function getManagementPrecisions(itemCodes, locationCode, callback) { +export async function getManagementPrecisions(itemCodes, locationCode, callback) { // let jsonParem = JSON.stringify(param) let result = { list: [], @@ -116,11 +116,11 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) { message: '' }; - var params = { + const params = { itemCodes: itemCodes, locationCode: locationCode } - getManagementPrecision(params).then(res => { + await getManagementPrecision(params).then(res => { if (res.data == null) { result.success = false result.message = '未查询到管理精度信息' @@ -404,13 +404,13 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback) }) filters.push({ column: "packingNumber", - action: "==", - value: null + action: "isStr", + value: '' }) filters.push({ column: "batch", - action: "==", - value: null + action: "isStr", + value: '' }) filters.push({ column: "locationCode", diff --git a/src/common/detail.js b/src/common/detail.js index ad30369d..ddd2c345 100644 --- a/src/common/detail.js +++ b/src/common/detail.js @@ -44,7 +44,47 @@ export function getTreeDataSource(dataList) { return items; } +export function getThreeDataSource(data) { + let items = [] + // let obj ={ + // ...data.subList[0] + // } + // console.log(12) + // data.subList.forEach((item)=>{ + // item.threeList = [{ + // fromLocationCode:item.fromLocationCode, + // batch:item.batch, + // handleQty:0, + // qty:item.qty, + // inventoryStatus:item.inventoryStatus, + // toLocationCode:item.toLocationCode, + // }] + // item.packList=[{ + // scaned : false, + // scanDate: new Date() + // }] + // }) + // obj.subList = data.subList + // items.push(obj) + // return items; + data.subList.forEach((item)=>{ + item.subList = [{ + fromLocationCode:item.fromLocationCode, + batch:item.batch, + handleQty:0, + qty:item.qty, + inventoryStatus:item.inventoryStatus, + toLocationCode:item.toLocationCode, + // packList:[{ + // scaned : false, + // scanDate: new Date() + // }] + }] + }) + items = data.subList + return items; +} export function getDataSource(subList) { let items = []; subList.forEach(detail => { diff --git a/src/common/label.js b/src/common/label.js index c535e877..b14e1ac7 100644 --- a/src/common/label.js +++ b/src/common/label.js @@ -3,17 +3,18 @@ let labelDic = []; import { getLabelByHeader, getPackageListByNumber -} from '../api/request2.js'; +} from '@/api/request2.js'; import { checkDirectoryItemExist, getDirectoryItemArray -} from '../common/directory.js'; - +} from '@/common/directory.js'; +import { + getManagementPrecisions +} from '@/common/balance.js'; -export function getLabelInfo(scanMsg,headerType, callBack) { - console.log('扫描信息:', scanMsg); +export function getLabelInfo(scanMsg,headerType, callBack,locationCode) { if (scanMsg.length == 0) { return null } @@ -41,17 +42,17 @@ export function getLabelInfo(scanMsg,headerType, callBack) { let type = header.substring(header.length - 1, header.length); if (type == 'Q') //qrcode { - getQRCodeInfo(header, version, scanMsg, callBack); + getQRCodeInfo(header, version, scanMsg, callBack,locationCode); } // else if (type == 'B') //barcode // { // getBarCodeInfo(header, version, items[2], callBack); // } else { //直接输入文本 - getBarCodeInfo('text', 'V1.0', scanMsg, callBack); + getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode); } }else { - getBarCodeInfo('text', 'V1.0', scanMsg, callBack); + getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode); // let labelResult = { // label: { // labelType: "", @@ -66,7 +67,7 @@ export function getLabelInfo(scanMsg,headerType, callBack) { } } -export function getQRCodeInfo(header, version, scanMsg, callBack) { +export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) { //获取包装信息 let labelItem = labelDic.find(r => r.header == header && r.version == version); if (labelItem == undefined) { @@ -91,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) { }; labelDic.push(newItem); - getLabelItems(newItem, scanMsg, callBack); + getLabelItems(newItem, scanMsg, callBack,locationCode); } }).catch(err => { labelResult.success = false; @@ -99,22 +100,33 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) { callBack(err); }) } else { - getLabelItems(labelItem, scanMsg, callBack); + getLabelItems(labelItem, scanMsg, callBack,locationCode); } } -export function getLabelItems(labelItem, scanMsg, callBack) { +export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) { + let managementType = "" let labelResult = analysisQRCodeLabel(labelItem, scanMsg); if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { //查询包装信息 let packingNumber = labelResult.label.packingNumber + let packingNumber1 = labelResult.label.packingNumber//记录单号 + if(locationCode){ + await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => { + if (res.success) { + const managementList = res.list; + managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING' + if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){ + packingNumber = '' + } + } + }) + } if (packingNumber != undefined && packingNumber != '') { - getPackageListByNumber(packingNumber).then(pack => { + await getPackageListByNumber(packingNumber).then(pack => { if (pack.data.reqPackage) { labelResult.package = pack.data.reqPackage; labelResult.package.subList = pack.data.subList; - console.log('包装信息', JSON.stringify(labelResult.package)) - } else { labelResult.success = false; labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; @@ -127,6 +139,9 @@ export function getLabelItems(labelItem, scanMsg, callBack) { }) } else { labelResult.package = labelResult.label; + labelResult.package.number = packingNumber1 ? packingNumber1 : '' + labelResult.package.packingNumber='' + labelResult.managementType = managementType callBack(labelResult); // labelResult.success = false; // labelResult.message = '在条码中未解析到箱码'; diff --git a/src/common/record.js b/src/common/record.js index 45cf9d5e..92c870ac 100644 --- a/src/common/record.js +++ b/src/common/record.js @@ -42,7 +42,23 @@ export function createDetailInfo(balance, pack) { return detail; } +export function createDetailInfoForLabel(balance, pack,label) { + balance.scaned = true; + // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; + // data.inventoryStatus = data.inventoryStatus; + let detail = deepCopyData(balance); + detail.balanceQty = new Decimal(detail.qty).toNumber() + detail.qty = new Decimal(detail.qty).toNumber(); + detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0 + detail.packUnit = pack.packUnit + console.log(988,label.qty) + detail.handleQty = new Decimal(label.qty).toNumber(); + detail.package = pack; + detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的 + detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的 + return detail; +} export function createDetailByPackInfo(pack) { // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; @@ -75,7 +91,22 @@ export function calcHandleQty(detailSource) { } } } - +//添加数量 +export function calcHandleQtyAdd(detailSource,label) { + for (let item of detailSource) { + item.handleQty = item.handleQty || new Decimal(0).toNumber(); + item.qty = item.qty|| new Decimal(0).toNumber(); + item.handleQty = calc.add(item.handleQty, label.qty); + for (let detail of item.subList) { + if (detail != undefined) { + if (detail.scaned) { + detail.handleQty = calc.add(detail.handleQty, label.qty); + } + // item.qty = calc.add(item.qty, detail.qty); + } + } + } +} export function calcTreeHandleQty(detailSource) { for (let item of detailSource) { item.handleQty = new Decimal(0).toNumber(); diff --git a/src/mycomponents/detail/comDetailCardBatch.vue b/src/mycomponents/detail/comDetailCardBatch.vue index 4d5547cc..b2cb79fe 100644 --- a/src/mycomponents/detail/comDetailCardBatch.vue +++ b/src/mycomponents/detail/comDetailCardBatch.vue @@ -1,21 +1,26 @@