"use strict"; const common_vendor = require("../../../common/vendor.js"); const api_user = require("../../../api/user.js"); require("../../../utils/request.js"); require("../../../store/index.js"); require("../../../utils/functions.js"); require("../../../utils/IDCardVerification.js"); require("../../../utils/base64.js"); require("../../../config/host.js"); require("../../../utils/md5.js"); if (!Array) { const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar"); const _component_saomiao2 = common_vendor.resolveComponent("saomiao2"); const _component_tips = common_vendor.resolveComponent("tips"); const _component_tiplist = common_vendor.resolveComponent("tiplist"); (_easycom_u_navbar2 + _component_saomiao2 + _component_tips + _component_tiplist)(); } const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js"; if (!Math) { _easycom_u_navbar(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "PeopleScanUp", setup(__props) { const tip = common_vendor.ref(null); const tiplists = common_vendor.ref(null); let details = common_vendor.reactive({ checkstate: 1, upshelfScanType: "", scancode: "", allocationId: "", //库位id datalist: [], reqobj: {}, uplistarr: [], showstate: 0, waybillCode: "", codelist: [], Marketlist: [], checkmakindex: 0, checkinarr: [] }); common_vendor.onLoad((op) => { details.upshelfScanType = op.type; initmarke(); common_vendor.index.$on("scancodedate", function(code) { if (code) { details.scancode = code; scandata(); } }); }); common_vendor.watchEffect(() => { if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) { details.uplistarr = fn2(details.uplistarr, "orderCode"); } else if (Number(details.upshelfScanType) == 3) { details.uplistarr = fn2(details.uplistarr, "orderPackageCode"); } else if (Number(details.upshelfScanType) == 4) { details.uplistarr = fn2(details.uplistarr, "trayCode"); } }); function checkmake() { let list = []; details.Marketlist.map((item) => { list.push(item == null ? void 0 : item.marketName); }); tiplists.value.setdetails({ title: "请选择商场", isshow: true, tipstate: 2, list, checklist: [], inputtext: "", confirmTxt: "确认选择", isonecheck: true, success: (deta) => { if (deta.checklist.length == 0) { common_vendor.index.showToast({ title: "请选择商场", icon: "none" }); return; } details.checkmakindex = deta.checklist[0]; tiplists.value.setdetails({ isshow: false }); details.codelist = []; }, cancel: (details2) => { tiplists.value.setdetails({ isshow: false }); }, close: (details2) => { tiplists.value.setdetails({ isshow: false }); } }); } async function initmarke() { let data = { warehouseCode: "LQ" }; let res = await api_user.warehouseTrayTypefindAllMarket(data); console.log(res.data); details.Marketlist = res.data; } async function scanlist() { details.codelist = []; let response = null; if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) { let data = { zeroType: Number(details.upshelfScanType) == 1 ? 2 : 1, code: details.waybillCode }; response = await api_user.warehouseUpdownTypegetZeroOrderByCode(data); } else if (Number(details.upshelfScanType) == 3 || Number(details.upshelfScanType) == 4) { let data = { stockType: Number(details.upshelfScanType) == 3 ? 1 : 2, value: details.waybillCode, marketId: details.Marketlist[details.checkmakindex].marketId }; response = await api_user.warehouseUpdownTypegetStockByParam(data); } console.log(response); details.codelist = response.data; details.codelist.map((item) => { item["enterNum"] = 0; return item; }); } function confirmlist() { details.codelist.map((item) => { if (item.enterNum > 0 && item.enterNum <= item.residueNumber) { item.marketId = details.Marketlist[details.checkmakindex].marketId; details.uplistarr.push(item); details.uplistarr.map((it, index) => { if (item.orderCode == it.orderCode) { details.uplistarr.splice(index, 1, item); } else if (item.materialCode == it.materialCode) { details.uplistarr.splice(index, 1, item); } }); } }); details.uplistarr = fn2(details.uplistarr, "orderCode"); details.showstate = 0; details.codelist = []; details.waybillCode = ""; } function setshowstate(state) { details.showstate = state; } async function scandata() { var _a; let data = { allocationId: details.scancode }; let res = await api_user.warehouseUpdownTypeupShelfScanAllocation(data); console.log(res); if (res.code == 200) { details.reqobj = res.data; details.allocationId = res.data.allocationId; details.datalist = ((_a = res.data) == null ? void 0 : _a.list) || []; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } function uplist() { tip.value.setdetails({ title: "提示", content: "确认上架?", confirmTxt: "确认", isshow: true, isshowcancel: true, success: async () => { if (details.uplistarr.length == 0) { let content = ""; if (Number(details.upshelfScanType) == 4) { content = "请先扫描托盘码"; } else { content = "请先扫描包件数据"; } tip.value.setdetails({ title: "警告", content, confirmTxt: "确认", isshow: true, isshowcancel: true, success: () => { tip.value.setisshow(false); }, cancel: () => { tip.value.setisshow(false); }, close: () => { tip.value.setisshow(false); } }); return; } let res; if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) { let data = { allocationId: details.allocationId, upShelfZeroOrderList: details.uplistarr }; res = await api_user.warehouseUpdownTypeupShelfZeroOrder(data); } else if (Number(details.upshelfScanType) == 3 || Number(details.upshelfScanType) == 4) { let data = { allocationId: details.allocationId, upShelfStockList: details.uplistarr }; res = await api_user.warehouseUpdownTypeupShelfStockList(data); } if (res.code == 200) { common_vendor.index.showToast({ title: "上架成功", icon: "none" }); details.uplistarr = []; details.scancode = details.allocationId; details.allocationId = ""; scandata(); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } tip.value.setisshow(false); }, cancel: () => { tip.value.setisshow(false); }, close: () => { tip.value.setisshow(false); } }); } function setchecl(index) { if (details.checkinarr.indexOf(index) == -1) { details.checkinarr.push(index); } else { details.checkinarr.splice(details.checkinarr.indexOf(index), 1); } } function setstate(state) { details.checkstate = state; } function fn2(tempArr, fnname) { let result = []; let obj = {}; for (let i = 0; i < tempArr.length; i++) { if (!obj[tempArr[i][fnname]]) { result.push(tempArr[i]); obj[tempArr[i][fnname]] = true; } } return result; } const { checkinarr, checkmakindex, Marketlist, codelist, waybillCode, showstate, uplistarr, checkstate, upshelfScanType, allocationId, datalist, reqobj } = common_vendor.toRefs(details); return (_ctx, _cache) => { var _a; return common_vendor.e({ a: common_vendor.p({ title: "人工上架", bgColor: "#D3832A", leftIconColor: "#ffffff", titleStyle: "color:#ffffff", placeholder: true, autoBack: true, leftIconSize: "35" }), b: common_vendor.t((common_vendor.unref(reqobj).warehouseName || "") + "-" + (common_vendor.unref(reqobj).areaTitle || "") + "-" + (common_vendor.unref(reqobj).shelfTitle || "") + "-" + (common_vendor.unref(reqobj).allocationTitle || "")), c: common_vendor.t(common_vendor.unref(reqobj).warehouseName), d: common_vendor.t(common_vendor.unref(reqobj).areaTitle), e: common_vendor.t(common_vendor.unref(reqobj).orderTotalnum || 0), f: common_vendor.t(common_vendor.unref(reqobj).totalNum || 0), g: common_vendor.t(common_vendor.unref(reqobj).stockTotalNum || 0), h: common_vendor.t(common_vendor.unref(reqobj).stockNum || 0), i: common_vendor.o(($event) => setstate(1)), j: common_vendor.n(common_vendor.unref(checkstate) == 1 ? "xz" : ""), k: common_vendor.o(($event) => setstate(2)), l: common_vendor.n(common_vendor.unref(checkstate) == 2 ? "xz" : ""), m: common_vendor.o(($event) => setstate(3)), n: common_vendor.n(common_vendor.unref(checkstate) == 3 ? "xz" : ""), o: common_vendor.unref(checkstate) == 1 }, common_vendor.unref(checkstate) == 1 ? { p: common_vendor.f(common_vendor.unref(uplistarr), (item, k0, i0) => { return common_vendor.e(common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? { a: common_vendor.t(item.orderCode) } : {}, common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? { b: common_vendor.t(item.enterNum) } : {}, common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4 ? { c: common_vendor.t(item.orderCode) } : {}, common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4 ? { d: common_vendor.t(item.enterNum) } : {}); }), q: common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2, r: common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2, s: common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4, t: common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4 } : {}, { v: common_vendor.unref(checkstate) == 2 }, common_vendor.unref(checkstate) == 2 ? { w: common_vendor.f(common_vendor.unref(datalist), (item, k0, i0) => { return common_vendor.e({ a: item.goodsType == 1 && item.orderCode }, item.goodsType == 1 && item.orderCode ? { b: common_vendor.t(item.orderCode) } : {}, { c: (item.goodsType == 1 || item.goodsType == 3) && item.trayCode }, (item.goodsType == 1 || item.goodsType == 3) && item.trayCode ? { d: common_vendor.t(item.trayCode) } : {}, { e: item.goodsType == 3 && item.materialCode }, item.goodsType == 3 && item.materialCode ? { f: common_vendor.t(item.materialCode) } : {}, { g: item.goodsType == 3 && item.materialName }, item.goodsType == 3 && item.materialName ? { h: common_vendor.t(item.materialName) } : {}, { i: item.goodsType == 3 && item.orderCode }, item.goodsType == 3 && item.orderCode ? { j: common_vendor.t(item.orderCode) } : {}, { k: item.goodsType == 2 && item.orderCode }, item.goodsType == 2 && item.orderCode ? { l: common_vendor.t(item.orderCode) } : {}, { m: item.goodsType == 3 && item.marketName }, item.goodsType == 3 && item.marketName ? { n: common_vendor.t(item.marketName) } : {}, { o: item.goodsType == 3 && item.incomingBatch }, item.goodsType == 3 && item.incomingBatch ? { p: common_vendor.t(item.incomingBatch) } : {}, { q: item.goodsType == 1 || item.goodsType == 2 }, item.goodsType == 1 || item.goodsType == 2 ? { r: common_vendor.t(item.totalNum), s: common_vendor.t(item.shelfNum) } : {}); }) } : {}, { x: common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode }, common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode ? { y: common_vendor.f([1], (item, k0, i0) => { return {}; }), z: common_vendor.t(common_vendor.unref(reqobj).trayCode), A: common_vendor.t(common_vendor.unref(reqobj).trayNum) } : {}, { B: common_vendor.t(common_vendor.unref(upshelfScanType) == "1" ? "添加运单" : common_vendor.unref(upshelfScanType) == "2" ? "添加订单" : common_vendor.unref(upshelfScanType) == "3" ? "添加物料" : "添加物料"), C: common_vendor.o(($event) => setshowstate(2)), D: common_vendor.o(uplist), E: common_vendor.unref(showstate) }, common_vendor.unref(showstate) ? common_vendor.e({ F: common_vendor.unref(showstate) == 2 }, common_vendor.unref(showstate) == 2 ? common_vendor.e({ G: common_vendor.unref(details).upshelfScanType == "3" || common_vendor.unref(details).upshelfScanType == "4" }, common_vendor.unref(details).upshelfScanType == "3" || common_vendor.unref(details).upshelfScanType == "4" ? { H: common_vendor.t(((_a = common_vendor.unref(Marketlist)[common_vendor.unref(checkmakindex)]) == null ? void 0 : _a.marketName) || "没有商场"), I: common_vendor.o(checkmake) } : {}, { J: "输入" + (common_vendor.unref(details).upshelfScanType == "1" ? "运单号" : common_vendor.unref(details).upshelfScanType == "2" ? "订单自编号" : common_vendor.unref(details).upshelfScanType == "3" ? "物料编号" : "物料名称"), K: common_vendor.unref(waybillCode), L: common_vendor.o(($event) => common_vendor.isRef(waybillCode) ? waybillCode.value = $event.detail.value : null), M: common_vendor.o(scanlist), N: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => { return common_vendor.e({ a: common_vendor.t(item.orderCode), b: common_vendor.t(item.residueNumber), c: item.enterNum, d: common_vendor.o(($event) => item.enterNum = $event.detail.value), e: common_vendor.unref(checkinarr).indexOf(index) != -1 }, common_vendor.unref(checkinarr).indexOf(index) != -1 ? { f: common_vendor.f(item.list, (ite, k1, i1) => { return common_vendor.e({ a: ite.allocationName }, ite.allocationName ? { b: common_vendor.t(ite.allocationName) } : {}, { c: ite.trayCode }, ite.trayCode ? { d: common_vendor.t(ite.trayCode) } : {}); }) } : {}, { g: common_vendor.o(($event) => setchecl(index)) }); }), O: common_vendor.o(() => { }), P: common_vendor.o(($event) => setshowstate(0)), Q: common_vendor.o(confirmlist), R: common_vendor.o(() => { }) }) : {}) : {}, { S: common_vendor.sr(tip, "1da4f490-2", { "k": "tip" }), T: common_vendor.sr(tiplists, "1da4f490-3", { "k": "tiplists" }) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/PeopleScanUp/PeopleScanUp.vue"]]); wx.createPage(MiniProgramPage);