diff --git a/api/index.js b/api/index.js index ab6423f7..e2f0294e 100644 --- a/api/index.js +++ b/api/index.js @@ -140,14 +140,14 @@ export const getBalancesAsync = (params) => promise( }); -//根据零件、箱码、托码、批次、库位类型、库存状态查询库存 +//根据物料、箱码、托码、批次、库位类型、库存状态查询库存 export const getBalancesByFilter = (params) => request( devUrl + "/api/pda/inventory/balances/by-balances-request-many-parameter", { method: 'post', data: params }); -//根据零件、箱码、托码、批次、库位类型、库存状态查询库存 +//根据物料、箱码、托码、批次、库位类型、库存状态查询库存 export const getBalancesByFilterAsync = (params) => promise( devUrl + "/api/pda/inventory/balances/by-balances-request-many-parameter", { method: 'post', @@ -170,7 +170,7 @@ export const getBalancesByStatus = (params) => request( data: params }); -//根据库位和零件号查询库存 +//根据库位和物料号查询库存 export const getBalancesByLocationAndItem = (params) => request( devUrl + "/api/pda/inventory/balances/get-by-location-and-item?locationCode=" + params.locationCode + "&itemCode=" + params.itemCode, { @@ -179,7 +179,7 @@ export const getBalancesByLocationAndItem = (params) => request( }); -//根据库位和零件号查询库存 +//根据库位和物料号查询库存 export const getBalancesByLocationAndItemAsync = (params) => promise( devUrl + "/api/pda/inventory/balances/get-by-location-and-item?locationCode=" + params.locationCode + "&itemCode=" + params.itemCode, { @@ -203,15 +203,15 @@ export const summary = (params) => request( data: params }); -//零件 -//查询零件信息 +//物料 +//查询物料信息 export const getitems = (code) => request( devUrl + "/api/pda/item/" + code, { method: 'get', data: code }); -//根据库位查询零件 +//根据库位查询物料 export const getItemsByLocation = (params) => promise( devUrl + "/api/pda/inventory/balances/get-item-by-location", { method: 'get', @@ -427,7 +427,7 @@ export const locationByType = (type) => request( data: type }); -//根据库位查询零件 +//根据库位查询物料 export const getLocationByItem = (params) => promise( devUrl + "/api/pda/inventory/balances/get-location-by-item", { method: 'get', diff --git a/api/request.js b/api/request.js index 5a6d9e33..764fce4c 100644 --- a/api/request.js +++ b/api/request.js @@ -481,7 +481,7 @@ export function getPurchaseReturnRequestList(params) { /** - * 原料上架 + * 采购上架 * @param {*} * status 任务状态 * CreationTimeStart 开始日期 @@ -500,7 +500,7 @@ export function getPutawayJobList(params) { /** * * @param {*} id 任务id - * 原料上架获取任务明细 + * 采购上架获取任务明细 */ export function putawayGetJobDetail(id) { return request({ @@ -511,7 +511,7 @@ export function putawayGetJobDetail(id) { } -/**原料上架 +/**采购上架 * * @param {*} number 任务编号 * 按任务编号查询任务 diff --git a/api/request2.js b/api/request2.js index e3886e99..4bdd9c61 100644 --- a/api/request2.js +++ b/api/request2.js @@ -96,6 +96,19 @@ export function updateUserPwd(oldPassword, newPassword) { }) } +/** + * 获取仓库代码 + * @param {*} + * + */ +export function getWarehouseCodeList(pageNo,pageSize) { + return request({ + url: baseApi + "/wms/warehouse/page?pageNo="+pageNo+"&pageSize="+pageSize, + method: "get", + data: {}, + }); +} + /** * 获取消息列表 * @param {*} @@ -375,7 +388,7 @@ export function getBasicLocationByCode(code) { /** - * 校验库位零件关系 + * 校验库位物料关系 * @param {*} * */ @@ -968,7 +981,7 @@ export function inspectJobSubmit(params) { /** - * 原料上架 任务 + * 采购上架 任务 * status 任务状态 * 开始日期 * 结束日期 @@ -984,7 +997,7 @@ export function getPutawayJobList(params) { } /** - * 原料上架 获取任务明细 + * 采购上架 获取任务明细 * @param {*} id 任务id * */ @@ -997,7 +1010,7 @@ export function getPutawayJobDetail(id) { } /** - * 原料上架 承接任务 + * 采购上架 承接任务 * @param {*} id * */ @@ -1010,7 +1023,7 @@ export function takePutawayJob(id) { } /** - * 原料上架 放弃承接 + * 采购上架 放弃承接 * @param {*} id * */ @@ -1023,7 +1036,7 @@ export function cancleTakePutawayJob(id) { } /** - * 原料上架 任务提交 + * 采购上架 任务提交 * @param {*} params */ export function putawayJobSubmit(params) { @@ -1035,7 +1048,7 @@ export function putawayJobSubmit(params) { } /** - * 原料上架申请 获取任务列表 + * 采购上架申请 获取任务列表 * 任务状态 * 开始日期 * 结束日期 @@ -1051,7 +1064,7 @@ export function getPutawayRequestList(params) { } /** - * 原料上架申请 获取任务明细 + * 采购上架申请 获取任务明细 * @param {*} id 任务id * */ @@ -1064,7 +1077,7 @@ export function getPutawayRequestDetail(id) { } /** - * 原料上架申请 提交 + * 采购上架申请 提交 * @param {*} params */ export function putawayRequestSubmit(params) { @@ -1076,7 +1089,7 @@ export function putawayRequestSubmit(params) { } /** - * 原料上架申请 关闭任务 + * 采购上架申请 关闭任务 * @param {*} params */ export function putawayRequestClose(id) { @@ -1088,7 +1101,7 @@ export function putawayRequestClose(id) { } /** - * 原料上架申请 提交审批 + * 采购上架申请 提交审批 * @param {*} params */ export function putawayRequestApprove(id) { @@ -1100,7 +1113,7 @@ export function putawayRequestApprove(id) { } /** - * 原料上架申请 提交审批通过 + * 采购上架申请 提交审批通过 * @param {*} params */ export function putawayRequestApproveAgree(id) { @@ -1112,7 +1125,7 @@ export function putawayRequestApproveAgree(id) { } /** - * 原料上架申请 审批驳回 + * 采购上架申请 审批驳回 * @param {*} params */ export function putawayRequestApproveRefused(id) { @@ -1124,7 +1137,7 @@ export function putawayRequestApproveRefused(id) { } /** - * 原料上架申请 处理 + * 采购上架申请 处理 * @param {*} params */ export function putawayRequestHandle(id) { @@ -1136,7 +1149,7 @@ export function putawayRequestHandle(id) { } /** - * 原料上架申请 重新添加 + * 采购上架申请 重新添加 * @param {*} params */ export function putawayRequestAddAgain(id) { @@ -1150,7 +1163,7 @@ export function putawayRequestAddAgain(id) { /** - * 原料上架记录 提交 + * 采购上架记录 提交 * @param {*} params */ export function putawayRecordSubmit(params) { @@ -3509,7 +3522,7 @@ export function getBalanceByFilter(param) { } /** - * 查询管理精度,多个零件,多个库位 + * 查询管理精度,多个物料,多个库位 * @param {*} * */ @@ -3537,6 +3550,19 @@ export function deleteFileById(id) { }); } +/** + * 删除文件(多个文件) + * @param {*} + * + */ +export function deleteFileByTable(tableName, tableId) { + return request({ + url: baseApi + "/infra/file/deleteByTable?tableName=" + tableName + "&tableId=" + tableId, + method: "delete", + data: {}, + }); +} + /** * 获取文件列表 diff --git a/common/balance.js b/common/balance.js index ba464a86..1a53c9f6 100644 --- a/common/balance.js +++ b/common/balance.js @@ -263,6 +263,11 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) { action: "==", value: label.batch }) + filters.push({ + column: "packingNumber", + action: "==", + value: null + }) filters.push({ column: "locationCode", action: "==", @@ -325,6 +330,16 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback) action: "==", value: label.itemCode }) + filters.push({ + column: "packingNumber", + action: "==", + value: null + }) + filters.push({ + column: "batch", + action: "==", + value: null + }) filters.push({ column: "locationCode", action: "==", diff --git a/common/basic.js b/common/basic.js index 4df664c5..b725be39 100644 --- a/common/basic.js +++ b/common/basic.js @@ -476,7 +476,7 @@ export function getInspectReasonList(value) { // else return '其他' // } -// //零件状态 +// //物料状态 // export function getItemStatusStyle(val) { // if (val == "wpztUNK") return 'item_unk' // else if (val == "wpztENABLE") return 'item_active' @@ -498,7 +498,7 @@ export function getInspectReasonList(value) { // } -// //零件状态描述 +// //物料状态描述 // export function getItemStatusDesc(val) { // if (val == "wpztUNK") return '未知' // else if (val == "wpztENABLE") return '可用' @@ -541,7 +541,7 @@ export function getInspectReasonList(value) { // if (val == 0) return '未知' // else if (val == 1) return '库位盘点' // else if (val == 2) return '物品盘点' -// else if (val == 3) return '库位零件盘点' +// else if (val == 3) return '库位物料盘点' // else return '其他' // } diff --git a/common/calc.js b/common/calc.js index 358252ee..2b48e481 100644 --- a/common/calc.js +++ b/common/calc.js @@ -2,16 +2,16 @@ import { Decimal } from 'decimal.js';//引入 class Calc { add(num1,num2) { - return new Decimal(num1).add(new Decimal(num2)) + return new Decimal(num1).add(new Decimal(num2)).toNumber() } sub(num1,num2) { - return new Decimal(num1).sub(new Decimal(num2)) + return new Decimal(num1).sub(new Decimal(num2)).toNumber() } mul(num1,num2) { - return new Decimal(num1).mul(new Decimal(num2)) + return new Decimal(num1).mul(new Decimal(num2)).toNumber() } div(num1,num2) { - return new Decimal(num1).div(new Decimal(num2)) + return new Decimal(num1).div(new Decimal(num2)).toNumber() } } export const calc = new Calc(); \ No newline at end of file diff --git a/common/classify.data.js b/common/classify.data.js index 4870927a..8979aed8 100644 --- a/common/classify.data.js +++ b/common/classify.data.js @@ -1,7 +1,7 @@ export default [{ "name": "库存查询", "children": [{ - "name": "按零件查询库存", + "name": "按物料查询库存", "icon": "/static/menus/menu_search_lj.svg", "url": "pages/query/item", "index": 1, @@ -55,13 +55,13 @@ export default [{ }, { - "name": "原料上架任务", + "name": "采购上架任务", "icon": "/static/menus/menu_search_lj.svg", "url": "/pages/putaway/job/putawayJob", "index": 3, }, { - "name": "原料上架记录", + "name": "采购上架记录", "icon": "/static/menus/menu_search_lj.svg", "url": "/pages/putaway/record/putawayRecord", "index": 3, @@ -309,7 +309,7 @@ export default [{ "index": 8, }, { - "name": "原料上架申请", + "name": "采购上架申请", "icon": "/static/menus/menu_search_lj.svg", "url": "/pages/putaway/request/putawayRequest", "index": 8, diff --git a/common/detail.js b/common/detail.js index 07d28531..d004df04 100644 --- a/common/detail.js +++ b/common/detail.js @@ -1,77 +1,83 @@ - import { calc } from '@/common/calc' -export function getDataSource(subList) { - let items = []; - subList.forEach(detail => { - var item = items.find(r => - r.itemCode == detail.itemCode) - if (item == undefined) { - item = createItemInfo(detail); - let newDetail = createDetailInfo(detail); // - item.subList.push(newDetail); - items.push(item) - } else { - item.qty = calc.add(item.qty,detail.qty) - let newDetail = createDetailInfo(detail); // - item.subList.push(newDetail); - } - }) - return items; -} +import { + calc + } from '@/common/calc' -export function createItemInfo(detail) { - let item = { - itemCode: detail.itemCode, - itemName: detail.itemName, - stdPackQty: Number(detail.stdPackQty)||undefined, - stdPackUnit: detail.stdPackUnit, - qty: Number(detail.qty), - handleQty: 0, - uom: detail.uom, - subList: [] +import { Decimal } from 'decimal.js';//引入 + export function getDataSource(subList) { + let items = []; + subList.forEach(detail => { + var item = items.find(r => + r.itemCode == detail.itemCode) + if (item == undefined) { + item = createItemInfo(detail); + let newDetail = createDetailInfo(detail); // + item.subList.push(newDetail); + items.push(item) + } else { + item.qty = calc.add(item.qty, detail.qty) + let newDetail = createDetailInfo(detail); // + item.subList.push(newDetail); + } + }) + return items; + } + + export function createItemInfo(detail) { + let item = { + itemCode: detail.itemCode, + itemName: detail.itemName, + stdPackQty: Number(detail.stdPackQty) || undefined, + stdPackUnit: detail.stdPackUnit, + qty: Number(detail.qty), + handleQty: 0, + uom: detail.uom, + subList: [] + } + return item; } - return item; -} -export function createDetailInfo(data) { - data.scaned = false; - // data.record = {}; - let detail = data; - return detail; -} + export function createDetailInfo(data) { + data.scaned = false; + // data.record = {}; + let detail = data; + return detail; + } -//根据明细创建记录 -export function createRecordInfo(detail, balance) { - var record = {} - // let record = JSON.parse(JSON.stringify(detail)); - //克隆对象,深度克隆,防止双向绑定同一个变量 - Object.assign(record, detail) - detail.scaned = true; - detail.balance = balance; - detail.recommendInventoryStatus = detail.inventoryStatus; - detail.inventoryStatus = balance.inventoryStatus; - record.qty = Number(balance.qty); - return record; -} + //根据明细创建记录 + export function createRecordInfo(detail, balance) { + var record = {} + // let record = JSON.parse(JSON.stringify(detail)); + //克隆对象,深度克隆,防止双向绑定同一个变量 + Object.assign(record, detail) + detail.scaned = true; + detail.balance = balance; + detail.recommendInventoryStatus = detail.inventoryStatus; + detail.inventoryStatus = balance.inventoryStatus; + record.qty = Number(balance.qty); + return record; + } -//计算实际数量 -export function calcHandleQty(detailSource) { - for (let item of detailSource) { - item.handleQty = 0; - for (let detail of item.subList) { - if (detail != undefined && detail.scaned) { - item.handleQty += Number(detail.handleQty) + //计算实际数量 + export function calcHandleQty(detailSource) { + for (let item of detailSource) { + item.handleQty = new Decimal(0).toNumber(); + item.qty = new Decimal(0).toNumber(); + for (let detail of item.subList) { + if (detail != undefined && detail.scaned) { + item.handleQty = calc.add(item.handleQty,detail.handleQty); + item.qty = calc.add(item.qty,detail.qty); + } } } } -} -export function getScanCount(subList) { - let items = subList.filter(r => { - if (r.scaned) { - return r; - } - }) - let scanCount = items != null ? items.length : 0; - return scanCount; -} + export function getScanCount(subList) { + let items = subList.filter(r => { + if (r.scaned) { + return r; + } + }) + let scanCount = items != null ? items.length : 0; + return scanCount; + } diff --git a/common/directory.js b/common/directory.js index 844cf38a..934b4322 100644 --- a/common/directory.js +++ b/common/directory.js @@ -1,5 +1,6 @@ let jobStatusList = []; let itemStatusList = []; +let itemTypeList =[]; let locationTypeList = []; let uomList = []; let inventoryStatusList = []; @@ -39,6 +40,7 @@ export function getBusinessTypeDesc(type) { export function clearCacheData() { jobStatusList = []; itemStatusList = []; + itemTypeList =[]; locationTypeList = []; uomList = []; inventoryStatusList = []; @@ -143,16 +145,57 @@ export function getJobStateStyle(value) { } } -//获取库位描述 -export function getListLocationTypeDesc(lst) { +//获取库位描述(多个库位) +export function getListLocationTypeDesc(list) { let desc = ''; - lst.forEach(res => { + list.forEach(res => { desc += getLocationTypeInfo(res).label + "," }) desc = desc.slice(0, -1); return desc; } + +//获取物品状态(多个状态) +export function getListItemStateDesc(list) { + let desc = ''; + list.forEach(res => { + desc += getItemStateInfo(res).label + "," + }) + desc = desc.slice(0, -1); + return desc; +} + +//获取物品类型(多个) +export function getListItemTypeDesc(list) { + let desc = ''; + list.forEach(res => { + desc += getItemTypeInfo(res).label + "," + }) + desc = desc.slice(0, -1); + return desc; +} + +//获取物品类型 +export function getItemTypeInfo(value) { + var resultInfo = ""; + if (itemTypeList.length == 0) { + itemTypeList = getDirectoryInfo("item_type") + } + if (itemTypeList.length > 0) { + for (let item of itemTypeList) { + if (item.value == value) { + resultInfo = item + break; + } + } + } + return resultInfo +} + + + + //获取物品状态 export function getItemStateInfo(value) { var resultInfo = ""; diff --git a/common/record.js b/common/record.js index 8980df6c..f4a988c1 100644 --- a/common/record.js +++ b/common/record.js @@ -6,6 +6,10 @@ import { getDirectoryItemArray, } from '@/common/directory.js'; import { calc } from '@/common/calc' +import { Decimal } from 'decimal.js';//引入 + import { + deepCopyData + } from '@/common/basic.js'; export function createItemInfo(balance, pack) { let item = { @@ -13,24 +17,24 @@ export function createItemInfo(balance, pack) { itemName: pack.itemName, stdPackQty: pack.stdPackQty, stdPackUnit: pack.stdPackUnit, - qty: Number(balance.qty), - handleQty: 0, + qty: new Decimal(balance.qty).toNumber(), + handleQty:new Decimal(0).toNumber(), uom: pack.uom, subList: [] } return item; } -export function createDetailInfo(data, pack) { - data.scaned = true; +export function createDetailInfo(balance, pack) { + balance.scaned = true; // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; // data.inventoryStatus = data.inventoryStatus; - let detail = {}; - Object.assign(detail, data) - detail.balanceQty = Number(detail.qty) - detail.stdPackQty = Number(pack.stdPackQty) + let detail = deepCopyData(balance); + detail.balanceQty = new Decimal(detail.qty).toNumber() + detail.qty = new Decimal(detail.qty).toNumber(); + detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber() detail.stdPackUnit = pack.stdPackUnit - detail.handleQty =0; + detail.handleQty = new Decimal(detail.qty).toNumber() ; detail.package = pack; return detail; @@ -39,10 +43,14 @@ export function createDetailInfo(data, pack) { //计算实际数量 export function calcHandleQty(detailSource) { for (let item of detailSource) { - item.qty = 0; + item.handleQty = new Decimal(0).toNumber(); + item.qty = new Decimal(0).toNumber(); for (let detail of item.subList) { - if (detail != undefined && detail.scaned) { - item.qty = calc.add(item.qty,detail.qty); + if(detail!=undefined){ + if(detail.scaned){ + item.handleQty = calc.add(item.handleQty,detail.handleQty); + } + item.qty = calc.add(item.qty,detail.qty); } } } @@ -54,6 +62,8 @@ export function getBusinessType(typeCode, callback) { businessType: '', fromlocationTypeList: '', tolocationTypeList: '', + itemCodeTypeList:"", + useOnTheWay:"FALSE", fromInventoryStatuses: '', toInventoryStatuses: '', message: '' @@ -63,8 +73,10 @@ export function getBusinessType(typeCode, callback) { result.businessType = res.data.list[0]; result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes) result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes) + result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes) result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses; result.toInventoryStatuses = res.data.list[0].inInventoryStatuses; + result.useOnTheWay =res.data.list[0].useOnTheWay callback(result) } else { result.success = false; diff --git a/common/scan.js b/common/scan.js index 73fe2759..f8635d6f 100644 --- a/common/scan.js +++ b/common/scan.js @@ -125,7 +125,7 @@ export function analyseScanInfo(scanMsg) { //解析完工收货标签 //P2250229RAA;L220408;Q100;N62840610;SB0000107;UEA;DU571LS;FA;E2022-4-8 -//P零件号,L批次,Q数量,N生产计划号,S箱码,U计量单位,D生产线,F班次,E日期,M零件名称(待添加) +//P物料号,L批次,Q数量,N生产计划号,S箱码,U计量单位,D生产线,F班次,E日期,M物料名称(待添加) //解析规则 //P:itemCode 物料号 //L:lot批次 @@ -240,7 +240,7 @@ export function analyseProductLabelInfo(scanMsg) { //解析天津mes标签 //1#2546319FL#254FL003#202207110009: -//1.序号1,2.生产号2546311FL,3.零件号254FL004,4.批序号202207110009 +//1.序号1,2.生产号2546311FL,3.物料号254FL004,4.批序号202207110009 export function analyseTJMesQRCode(scanMsg) { let scanResult = { success: false, @@ -269,7 +269,7 @@ export function analyseTJMesQRCode(scanMsg) { seq: datas[0], //序号 produceNo: datas[1], //生产号 // projectNo: datas[2], //项目号 - itemCode: itemCode, //配置码(零件号) + itemCode: itemCode, //配置码(物料号) lot: datas[3], //批次 position: location //上层、下层 } @@ -282,7 +282,7 @@ export function analyseTJMesQRCode(scanMsg) { seq: seq, //序号 produceNo: 'N', //生产号 projectNo: 'N', //项目号 - itemCode: 'N', //配置码(零件号) + itemCode: 'N', //配置码(物料号) lot: 'N', //批次 position: '' } diff --git a/common/style/new_style.css b/common/style/new_style.css index 6d4c4bc7..0ff8e4ab 100644 --- a/common/style/new_style.css +++ b/common/style/new_style.css @@ -115,7 +115,7 @@ uni-page-head .uni-page-head__title { } /* -零件状态 +物料状态 未知,可用,隔离,新增,规划,禁用 */ @@ -2439,7 +2439,7 @@ button[disabled] { font-size: 38rpx; } -.text_stock { +.text_balance { font-size: 36rpx; } diff --git a/common/style/pdabasic.css b/common/style/pdabasic.css index d52e32ec..7b7f368a 100644 --- a/common/style/pdabasic.css +++ b/common/style/pdabasic.css @@ -417,7 +417,7 @@ -/* //零件状态 +/* //物料状态 export function getItemTypeStyle(val) { if (val == 0) return 'active' else if (val == 1) return 'hold' @@ -428,7 +428,7 @@ export function getItemTypeStyle(val) { } */ -/* 零件状态 */ +/* 物料状态 */ .active { background-color: #5FCB94; color: #FFFFFF; @@ -460,7 +460,7 @@ export function getItemTypeStyle(val) { font-weight: bolder; } -/* 零件编号字体 */ +/* 物料编号字体 */ .text-itemcode { /* font-size: 26rpx; */ color: #000; @@ -472,7 +472,7 @@ export function getItemTypeStyle(val) { /* font-size: 22rpx; */ } -/* 零件编号字体 */ +/* 物料编号字体 */ .text-bolder { color: #000; font-weight: bolder; diff --git a/mycomponents/balance/handleBalance.vue b/mycomponents/balance/handleBalance.vue index a35de49c..1707d4ab 100644 --- a/mycomponents/balance/handleBalance.vue +++ b/mycomponents/balance/handleBalance.vue @@ -1,12 +1,12 @@ diff --git a/mycomponents/scan/winScanPackAndLocation.vue b/mycomponents/scan/winScanPackAndLocation.vue index 89f8387c..a9f4baeb 100644 --- a/mycomponents/scan/winScanPackAndLocation.vue +++ b/mycomponents/scan/winScanPackAndLocation.vue @@ -28,14 +28,13 @@ + @confirm="" style='height: 30rpx;border:1px solid #fff ;'> {{fromLocationCode}} - @@ -72,7 +71,7 @@ } from '@/common/directory.js'; export default { name: 'winScanPack', - emits: ["getResult", "close"], + emits: ["getResult", "close", "getCountScanResult"], components: { winComScan, comMessage, @@ -91,6 +90,11 @@ type: Boolean, default: false }, + //不提示库存 + noShowBalanceMessage: { + type: Boolean, + default: false + }, //是否允许修改库位 allowModifyLocation: { type: Boolean, @@ -117,7 +121,8 @@ businessType: {}, inventoryStatus: [], managementPrecision: '', - fromInventoryStatuses: "" + fromInventoryStatuses: "", + isCheck:false } }, created() { @@ -163,20 +168,30 @@ this.$emit("close", ''); }, - scanLocation() { + + scanLocation(scanResult) { + var isCheck = false; if (this.fromLocationCode == '') { - this.showMessage('来源库位不能为空', callback => { + this.showErrorMessage('来源库位不能为空', callback => { this.locationGetFocus(); }) return; } + + if(this.fromLocationList.length>0){ + if(!this.isInLocationList(this.fromLocationCode)){ + this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => { + this.locationGetFocus(); + }) + return; + } + } uni.showLoading({ title: '扫描中...', mask: true }); getBasicLocationByCode(this.fromLocationCode).then(res => { - uni.hideLoading(); if (res.data.total > 0) { let result = res.data.list[0]; var type = result.type; @@ -184,8 +199,10 @@ if (available == "TRUE") { if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) { this.location = result; - this.packGetFocus(); + // this.packGetFocus(); + this.checkPackage(scanResult); } else { + uni.hideLoading(); var hint = getListLocationTypeDesc(this.fromLocationTypeArray); this.showErrorMessage("库位[" + this.fromLocationCode + "]是" + getLocationTypeName(type) + ",
需要的库位类型是[" + hint + "]", callback => { @@ -193,11 +210,13 @@ }) } } else { + uni.hideLoading(); this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { this.locationGetFocus(); }) } } else { + uni.hideLoading(); this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { this.locationGetFocus(); }) @@ -210,35 +229,50 @@ }) }, - getScanResult(result) { - console.log("扫描", result) - if (this.fromLocationCode == '' || this.fromLocationCode == null) { - this.showMessage('请先扫描来源库位', callback => { - this.locationGetFocus(); - }) - return; - } else { - if (result.label != null) { - this.scanResult = result; - getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, - res => { - if (res.success) { - this.managementPrecision = res.managementPrecision - this.afterQueryBalance(res.data.list); - } else { - this.showErrorMessage(res.message, res => { - this.packGetFocus(); - }) - } - - }); - } + getScanResult(result) { + // console.log("扫描", result) + // if (this.fromLocationCode == '' || this.fromLocationCode == null) { + // this.showMessage('请先扫描来源库位', callback => { + // this.locationGetFocus(); + // }) + // return; + // } else + this.scanLocation(result); + // debugger + // if(this.isCheck){ + // this.checkPackage(result); + // } + }, + + checkPackage(result){ + if (result.label != null) { + this.scanResult = result; + // uni.showLoading({ + // title: '查询中...', + // mask: true + // }) + getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, + res => { + uni.hideLoading(); + if (res.success) { + this.managementPrecision = res.managementPrecision + this.afterQueryBalance(res.data.list); + } else { + this.showErrorMessage(res.message, res => { + this.packGetFocus(); + }) + } + // uni.hideLoading(); + }); } }, + afterQueryBalance(datas) { if (this.allowNullBalance) { this.allowNoneBalance(datas); + } else if (this.noShowBalanceMessage) { + this.countCallBack(datas); } else { this.mustHavaBalance(datas); } @@ -267,7 +301,7 @@ this.packCallBack(balance); //因为盘点时有负库存,暂时去掉判断 2023年12月28日 - + // if (balance.qty > 0) { // this.packCallBack(balance); // } else { @@ -298,6 +332,20 @@ // } }, + //盘点回调 + countCallBack(datas) { + this.$refs.comscan.clear(); + //返回标签信息、库存信息和管理模式 + let data = { + label: this.scanResult.label, + package: this.scanResult.package, + balance: datas, + fromLocationCode: this.fromLocationCode, + } + this.packGetFocus(); + this.$emit("getCountScanResult", data); + }, + packCallBack(item) { this.$refs.comscan.clear(); //返回标签信息、库存信息和管理模式 @@ -334,22 +382,22 @@ let status = getInventoryStatusDesc(this.inventoryStatus); switch (this.managementPrecision) { case 'BY_PACKAGING': - condition = condition + '零件号=[' + label.itemCode + ']
箱码=[' + label.packingNumber + + condition = condition + '物料号=[' + label.itemCode + ']
箱码=[' + label.packingNumber + ']
批次=[' + label.batch + ']
库位=[' + this.fromLocationCode + ']' break; case 'BY_BATCH': - condition = condition + '零件号=[' + label.itemCode + ']
批次=[' + + condition = condition + '物料号=[' + label.itemCode + ']
批次=[' + label.batch + ']
库位=[' + this.fromLocationCode + ']' break; case 'BY_QUANTITY': - condition = condition + '零件号=[' + label.itemCode + ']
库位=[' + this.fromLocationCode + ']' + condition = condition + '物料号=[' + label.itemCode + ']
库位=[' + this.fromLocationCode + ']' break; case 'BY_UNIQUEID': - condition = condition + '零件号=[' + label.itemCode + ']' + condition = condition + '物料号=[' + label.itemCode + ']' break; } if (this.inventoryStatus.length > 0) { @@ -376,6 +424,20 @@ change(e) { this.show = e.show }, + isInLocationList(location) { + + var item = this.fromLocationList.find(res => res == location) + + if (item = undefined) { + return false + } + return true + }, + addLocationCode(code) { + if (!this.isInLocationList(code)) { + this.fromLocationList.push(code) + } + } } } diff --git a/mycomponents/scan/winScanPackAndPosition.vue b/mycomponents/scan/winScanPackAndPosition.vue index 5c06e934..dfe09e37 100644 --- a/mycomponents/scan/winScanPackAndPosition.vue +++ b/mycomponents/scan/winScanPackAndPosition.vue @@ -94,7 +94,6 @@ }, methods: { openScanPopup() { - if (this.positionList.length == 0) { uni.showLoading({ title: "数据加载中....", @@ -111,6 +110,21 @@ this.$refs.popup.open('bottom'); }, + + initData(){ + this.positionInfo = "请选择位置"; + this.positionList = []; + this.productionLineCode = ''; + this.rawLocationCode = ""; + this.fgLocationCode = ""; + this.workshopCode = ""; + this.workStationCode =""; + this.workShopName = ""; + this.productionLineName=""; + this.workStationName=""; + this.show = false; + this.isEditPosition = true + }, closeScanPopup() { this.$refs.popup.close(); diff --git a/mycomponents/status/balanceStatus.vue b/mycomponents/status/balanceStatus.vue index 19564c36..786c4ff9 100644 --- a/mycomponents/status/balanceStatus.vue +++ b/mycomponents/status/balanceStatus.vue @@ -3,7 +3,8 @@ {{statusDesc(status) }} - + +
diff --git a/mycomponents/workStation/workStation.vue b/mycomponents/workStation/workStation.vue index 9c99f96a..da284da9 100644 --- a/mycomponents/workStation/workStation.vue +++ b/mycomponents/workStation/workStation.vue @@ -2,6 +2,11 @@ + + 仓库 + {{fromWarehouseCode}} + + 车间 {{workshopCode}} @@ -37,6 +42,11 @@ watch: {}, props: { + fromWarehouseCode:{ + type: String, + default: "" + }, + workshopCode: { type: String, default: "" diff --git a/pages.json b/pages.json index 859ab9f7..1c3e660a 100644 --- a/pages.json +++ b/pages.json @@ -263,7 +263,7 @@ { "path": "pages/putaway/job/putawayJob", "style": { - "navigationBarTitleText": "原料上架", + "navigationBarTitleText": "采购上架", "enablePullDownRefresh": false, "titleNView": { // "autoBackButton": "true", @@ -292,21 +292,21 @@ { "path": "pages/putaway/job/putawayDetail", "style": { - "navigationBarTitleText": "原料上架详情", + "navigationBarTitleText": "采购上架详情", "enablePullDownRefresh": false } }, { "path": "pages/putaway/record/putawayRecord", "style": { - "navigationBarTitleText": "原料上架记录", + "navigationBarTitleText": "采购上架记录", "enablePullDownRefresh": false } }, { "path": "pages/putaway/request/putawayRequest", "style": { - "navigationBarTitleText": "原料上架申请", + "navigationBarTitleText": "采购上架申请", "enablePullDownRefresh": true, "titleNView": { // "autoBackButton": "true", @@ -333,14 +333,14 @@ { "path": "pages/putaway/request/putawayRequestDetail", "style": { - "navigationBarTitleText": "原料上架申请详情", + "navigationBarTitleText": "采购上架申请详情", "enablePullDownRefresh": false } }, { "path": "pages/putaway/request/putawayRequestCreate", "style": { - "navigationBarTitleText": "原料上架申请创建", + "navigationBarTitleText": "采购上架申请创建", "enablePullDownRefresh": false } }, @@ -466,7 +466,7 @@ { "path": "pages/issue/record/issueRecord", "style": { - "navigationBarTitleText": "直接发料", + "navigationBarTitleText": "直接发料记录", "enablePullDownRefresh": true, "titleNView": { "autoBackButton": "true" @@ -561,14 +561,14 @@ { "path": "pages/productionReturn/record/returnToStore", "style": { - "navigationBarTitleText": "合格退料", + "navigationBarTitleText": "合格退料记录", "enablePullDownRefresh": false } }, { "path": "pages/productionReturn/record/returnToHold", "style": { - "navigationBarTitleText": "隔离退料", + "navigationBarTitleText": "隔离退料记录", "enablePullDownRefresh": false } }, @@ -671,7 +671,7 @@ "path": "pages/query/item", "style": { "enablePullDownRefresh": false, // 是否配置下拉刷新的功能 - "navigationBarTitleText": "按零件查询库存", + "navigationBarTitleText": "按物料查询库存", "titleNView": { "autoBackButton": "true", "buttons": [{}] diff --git a/pages/container/coms/comContainerBindCard.vue b/pages/container/coms/comContainerBindCard.vue index 0cf75e8f..9c733fe8 100644 --- a/pages/container/coms/comContainerBindCard.vue +++ b/pages/container/coms/comContainerBindCard.vue @@ -131,7 +131,7 @@ methods: { removeData(e, dataContent) { if (e.content.text == "清空") { - this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?", + this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?", res => { if (res) { this.$emit('removeItem') diff --git a/pages/container/coms/comPalletRecord.vue b/pages/container/coms/comPalletRecord.vue index e9d3b1d3..ad07a2b9 100644 --- a/pages/container/coms/comPalletRecord.vue +++ b/pages/container/coms/comPalletRecord.vue @@ -5,7 +5,7 @@