"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; details.scancode = "1687644634707099650"; scandata(); setTimeout(() => { details.scancode = "HT20230800001"; scandata(); }, 2500); 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); details.dtilobj = res.data; details.allocationId = res.data.allocationId; details.scancode = ""; console.log(details.dtilobj); return; } if (details.pagetype == "1") { let data = { trayCode: details.scancode }; res = await api_user.warehouseUpdownTypemoveAllocationScanTrayCode(data); details.trayCode = details.scancode; details.scanlist = res.data.list; details.obldate = res.data; } 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) { details.isshowtot = flg; } const { obldate, isshowtot, scancode, pagetype, dtilobj, scanlist, trayCode } = common_vendor.toRefs(details); return (_ctx, _cache) => { var _a; 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) || "") + "-" + (common_vendor.unref(dtilobj).areaTitle || "") + "-" + (common_vendor.unref(dtilobj).shelfTitle || "") + "-" + (common_vendor.unref(dtilobj).allocationTitle || "")), c: common_vendor.t(common_vendor.unref(dtilobj).trayCode || "暂无数据"), d: common_vendor.t(common_vendor.unref(dtilobj).warehouseName || "暂无数据"), e: common_vendor.unref(pagetype) == 2 }, common_vendor.unref(pagetype) == 2 ? { f: common_vendor.unref(scancode), g: common_vendor.o(($event) => common_vendor.isRef(scancode) ? scancode.value = $event.detail.value : null), h: common_vendor.o(scandata) } : {}, { i: common_vendor.f(common_vendor.unref(scanlist), (item, k0, i0) => { return common_vendor.e({ a: common_vendor.t(item.orderCode), b: item.orderPackageCode }, item.orderPackageCode ? { c: common_vendor.t(item.orderPackageCode) } : {}, { d: common_vendor.t(item.trayCode) }); }), j: common_vendor.o(($event) => setstate(true)), k: common_vendor.unref(isshowtot) }, common_vendor.unref(isshowtot) ? common_vendor.e({ l: common_vendor.unref(pagetype) == "1" }, common_vendor.unref(pagetype) == "1" ? { m: common_vendor.t(common_vendor.unref(obldate).areaName + "-" + common_vendor.unref(obldate).shelfName + "-" + common_vendor.unref(obldate).allocationName), n: common_vendor.t(common_vendor.unref(trayCode)), o: common_vendor.t(common_vendor.unref(traynumber)), p: common_vendor.t(common_vendor.unref(dtilobj).areaTitle + "-" + common_vendor.unref(dtilobj).shelfTitle + "-" + common_vendor.unref(dtilobj).allocationTitle), q: common_vendor.o(($event) => setstate(false)), r: common_vendor.o(uplist) } : {}, { s: common_vendor.unref(pagetype) == "2" }, common_vendor.unref(pagetype) == "2" ? common_vendor.e({ t: common_vendor.t(common_vendor.unref(traynumber)), v: common_vendor.t(common_vendor.unref(dtilobj).areaTitle + "-" + common_vendor.unref(dtilobj).shelfTitle + "-" + common_vendor.unref(dtilobj).allocationTitle), w: common_vendor.unref(dtilobj).trayCode }, common_vendor.unref(dtilobj).trayCode ? { x: common_vendor.t(common_vendor.unref(dtilobj).trayCode) } : {}, { y: common_vendor.o(($event) => setstate(false)), z: common_vendor.o(uplist) }) : {}) : {}, { A: 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);