"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"); (_easycom_u_navbar2 + _component_saomiao2 + _component_tips)(); } 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: "ScanUp", setup(__props) { const tip = common_vendor.ref(null); let details = common_vendor.reactive({ checkstate: 1, upshelfScanType: "", scancode: "", allocationId: "", //库位id datalist: [], reqobj: {}, uplistarr: [] }); 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) ; }); common_vendor.onLoad((op) => { details.upshelfScanType = op.type; common_vendor.index.$on("scancodedate", function(code) { if (code) { details.scancode = code; scandata(); } }); }); async function scandata() { var _a; if (!details.allocationId) { 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" }); } } else { if (Number(details.upshelfScanType) == 4 && details.reqobj.trayCode) { 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 data = { upshelfScanType: details.upshelfScanType, code: details.scancode }; let res = await api_user.warehouseUpdownTypeupShelfScanGoods(data); console.log(res); if (res.code == 200) { details.uplistarr = details.uplistarr.concat(res.data); } 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, upShelfOrderList: details.uplistarr }; res = await api_user.warehouseUpdownTypeupShelfOrder(data); } else if (Number(details.upshelfScanType) == 3) { let data = { allocationId: details.allocationId, upShelfPackageList: details.uplistarr }; res = await api_user.warehouseUpdownTypeupShelfPackage(data); } else if (Number(details.upshelfScanType) == 4) { let data = { allocationId: details.allocationId, trayCode: details.uplistarr[0].trayCode }; res = await api_user.warehouseUpdownTypeupShelfTray(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 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; } function setstate(state) { details.checkstate = state; } const { uplistarr, checkstate, upshelfScanType, allocationId, datalist, reqobj } = common_vendor.toRefs(details); return (_ctx, _cache) => { 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).totalNum || 0), f: common_vendor.t(common_vendor.unref(reqobj).trayNum || 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.serviceNum) } : {}, common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? { b: common_vendor.t(item.orderCode) } : {}, common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? { c: common_vendor.t(item.totalNum) } : {}, common_vendor.unref(upshelfScanType) == 3 ? { d: common_vendor.t(item.orderCode) } : {}, common_vendor.unref(upshelfScanType) == 3 ? { e: common_vendor.t(item.orderPackageCode) } : {}, common_vendor.unref(upshelfScanType) == 4 ? { f: common_vendor.t(item.trayCode) } : {}, common_vendor.unref(upshelfScanType) == 4 ? { g: common_vendor.t(item.orderCode) } : {}, common_vendor.unref(upshelfScanType) == 4 ? { h: common_vendor.t(item.shelfNum) } : {}, common_vendor.unref(upshelfScanType) == 1 ? { i: item.completeSet == 1 ? "/pagesHome/static/qitao.png" : "/pagesHome/static/weiqitao.png" } : {}); }), 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) == 1 || common_vendor.unref(upshelfScanType) == 2, t: common_vendor.unref(upshelfScanType) == 3, v: common_vendor.unref(upshelfScanType) == 3, w: common_vendor.unref(upshelfScanType) == 4, x: common_vendor.unref(upshelfScanType) == 4, y: common_vendor.unref(upshelfScanType) == 4, z: common_vendor.unref(upshelfScanType) == 1 } : {}, { A: common_vendor.unref(checkstate) == 2 }, common_vendor.unref(checkstate) == 2 ? { B: 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 == 1 || item.goodsType == 3) && item.trayCode }, (item.goodsType == 1 || item.goodsType == 3) && item.trayCode ? { f: common_vendor.t(item.trayCode) } : {}, { g: item.goodsType == 3 && item.materialCode }, item.goodsType == 3 && item.materialCode ? { h: common_vendor.t(item.materialCode) } : {}, { i: item.goodsType == 3 && item.orderCode }, item.goodsType == 3 && item.orderCode ? { j: common_vendor.t(item.orderCode) } : {}, { k: item.goodsType == 3 && item.marketName }, item.goodsType == 3 && item.marketName ? { l: common_vendor.t(item.marketName) } : {}, { m: item.goodsType == 3 && item.incomingBatch }, item.goodsType == 3 && item.incomingBatch ? { n: common_vendor.t(item.incomingBatch) } : {}, { o: item.goodsType == 1 || item.goodsType == 2 }, item.goodsType == 1 || item.goodsType == 2 ? { p: common_vendor.t(item.totalNum), q: common_vendor.t(item.shelfNum) } : {}); }) } : {}, { C: common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode }, common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode ? { D: common_vendor.f([1], (item, k0, i0) => { return {}; }), E: common_vendor.t(common_vendor.unref(reqobj).trayCode), F: common_vendor.t(common_vendor.unref(reqobj).trayNum) } : {}, { G: common_vendor.o(uplist), H: common_vendor.sr(tip, "ec406a20-2", { "k": "tip" }) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/ScanUp/ScanUp.vue"]]); wx.createPage(MiniProgramPage);