"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: "Relocation", setup(__props) { const tip = common_vendor.ref(null); let details = common_vendor.reactive({ scancode: "", pagetype: "", allocationId: "", dtilobj: {}, trayCode: "", scanlist: [], obldate: {}, codenumer: 0, isshowtot: false }); common_vendor.onLoad((op) => { details.pagetype = op.type; common_vendor.index.$on("scancodedate", function(code) { if (code) { details.scancode = code; scandata(); } }); }); const traynumber = common_vendor.computed(() => { let numbers = 0; details.scanlist.map((item) => { if (item.shelfNum) { numbers += item.shelfNum; } else if (item.num) { numbers += item.num; } }); return numbers; }); common_vendor.watchEffect(() => { details.scanlist.map((item) => { details.codenumer += item.shelfNum; }); console.log(details.codenumer); }); async function scandata() { let res = null; if (!details.allocationId) { let data = { allocationId: details.scancode }; res = await api_user.warehouseUpdownTypemoveAllocationScanTarget(data); if (res.code == 200) { details.dtilobj = res.data; details.allocationId = res.data.allocationId; details.scancode = ""; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } return; } if (details.pagetype == "1") { let data = { trayCode: details.scancode }; res = await api_user.warehouseUpdownTypemoveAllocationScanTrayCode(data); if (res.code == 200) { details.trayCode = details.scancode; details.scanlist = res.data.list; details.obldate = res.data; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } else if (details.pagetype == "2") { let data = { allocationId: details.allocationId, orderPackageCode: details.scancode }; res = await api_user.warehouseUpdownTypemoveAllocationScanPackage(data); if (res.code == 200) { details.scanlist = details.scanlist.concat(res.data); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } } async function uplist() { let res = null; if (details.pagetype == "1") { let data = { allocationId: details.allocationId, trayCode: details.trayCode }; res = await api_user.warehouseUpdownTypemoveAllocationByTrayCode(data); } else if (details.pagetype == "2") { let data = { allocationId: details.allocationId, upShelfPackageList: details.scanlist }; res = await api_user.warehouseUpdownTypemoveAllocationPackageList(data); } if (res.code == 200) { common_vendor.index.showToast({ title: "移库成功", icon: "none" }); details.scancode = ""; details.allocationId = ""; details.dtilobj = {}; details.obldate = {}; details.trayCode = ""; details.scanlist = []; details.isshowtot = false; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } function setstate(flg) { if (flg && !details.trayCode && details.pagetype == "1") { common_vendor.index.showToast({ title: "请扫描正确的托盘码", icon: "none" }); return; } else if (flg && details.scanlist.length == 0 && details.pagetype == "2") { common_vendor.index.showToast({ title: "请扫描正确的包件码", icon: "none" }); return; } details.isshowtot = flg; } const { obldate, isshowtot, scancode, pagetype, dtilobj, scanlist, trayCode } = common_vendor.toRefs(details); return (_ctx, _cache) => { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; return common_vendor.e({ a: common_vendor.p({ title: common_vendor.unref(pagetype) == "1" ? "托盘移库" : "按件移库", bgColor: "#D3832A", leftIconColor: "#ffffff", titleStyle: "color:#ffffff", placeholder: true, autoBack: true, leftIconSize: "35" }), b: common_vendor.t((((_a = common_vendor.unref(dtilobj)) == null ? void 0 : _a.warehouseName) || "") + "-" + (((_b = common_vendor.unref(dtilobj)) == null ? void 0 : _b.areaTitle) || "") + "-" + (((_c = common_vendor.unref(dtilobj)) == null ? void 0 : _c.shelfTitle) || "") + "-" + (((_d = common_vendor.unref(dtilobj)) == null ? void 0 : _d.allocationTitle) || "")), c: common_vendor.t(((_e = common_vendor.unref(dtilobj)) == null ? void 0 : _e.warehouseName) || "暂无数据"), d: common_vendor.unref(pagetype) == 2 }, common_vendor.unref(pagetype) == 2 ? { e: common_vendor.unref(scancode), f: common_vendor.o(($event) => common_vendor.isRef(scancode) ? scancode.value = $event.detail.value : null), g: common_vendor.o(scandata) } : {}, { h: common_vendor.t(((_f = common_vendor.unref(dtilobj)) == null ? void 0 : _f.trayCode) || "暂无数据"), i: common_vendor.t(common_vendor.unref(dtilobj).trayNum || "0"), j: common_vendor.f(common_vendor.unref(scanlist), (item, k0, i0) => { return common_vendor.e({ a: common_vendor.t(item == null ? void 0 : item.orderCode), b: item.orderPackageCode }, item.orderPackageCode ? { c: common_vendor.t(item == null ? void 0 : item.orderPackageCode) } : {}, { d: common_vendor.t(item == null ? void 0 : item.trayCode) }); }), k: common_vendor.o(($event) => setstate(true)), l: common_vendor.unref(isshowtot) }, common_vendor.unref(isshowtot) ? common_vendor.e({ m: common_vendor.unref(pagetype) == "1" }, common_vendor.unref(pagetype) == "1" ? { n: common_vendor.t((((_g = common_vendor.unref(obldate)) == null ? void 0 : _g.areaName) || "") + "-" + (((_h = common_vendor.unref(obldate)) == null ? void 0 : _h.shelfName) || "") + "-" + (((_i = common_vendor.unref(obldate)) == null ? void 0 : _i.allocationName) || "")), o: common_vendor.t(common_vendor.unref(trayCode)), p: common_vendor.t(common_vendor.unref(traynumber)), q: common_vendor.t((((_j = common_vendor.unref(dtilobj)) == null ? void 0 : _j.areaTitle) || "") + "-" + (((_k = common_vendor.unref(dtilobj)) == null ? void 0 : _k.shelfTitle) || "") + "-" + (((_l = common_vendor.unref(dtilobj)) == null ? void 0 : _l.allocationTitle) || "")), r: common_vendor.o(($event) => setstate(false)), s: common_vendor.o(uplist) } : {}, { t: common_vendor.unref(pagetype) == "2" }, common_vendor.unref(pagetype) == "2" ? common_vendor.e({ v: common_vendor.t(common_vendor.unref(traynumber)), w: common_vendor.t((((_m = common_vendor.unref(dtilobj)) == null ? void 0 : _m.areaTitle) || "") + "-" + (((_n = common_vendor.unref(dtilobj)) == null ? void 0 : _n.shelfTitle) || "") + "-" + (((_o = common_vendor.unref(dtilobj)) == null ? void 0 : _o.allocationTitle) || "")), x: common_vendor.unref(dtilobj).trayCode }, common_vendor.unref(dtilobj).trayCode ? { y: common_vendor.t((_p = common_vendor.unref(dtilobj)) == null ? void 0 : _p.trayCode) } : {}, { z: common_vendor.o(($event) => setstate(false)), A: common_vendor.o(uplist) }) : {}) : {}, { B: common_vendor.sr(tip, "35b94f20-2", { "k": "tip" }) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/Relocation/Relocation.vue"]]); wx.createPage(MiniProgramPage);