"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_tiplist = common_vendor.resolveComponent("tiplist"); const _component_saomiao = common_vendor.resolveComponent("saomiao"); const _component_saomiao1 = common_vendor.resolveComponent("saomiao1"); const _component_saomiao2 = common_vendor.resolveComponent("saomiao2"); const _component_saomiao3 = common_vendor.resolveComponent("saomiao3"); const _component_saomiao4 = common_vendor.resolveComponent("saomiao4"); (_easycom_u_navbar2 + _component_tiplist + _component_saomiao + _component_saomiao1 + _component_saomiao2 + _component_saomiao3 + _component_saomiao4)(); } 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: "setbarcode", setup(__props) { let details = common_vendor.reactive({ items: {}, reservationId: "", codelist: [], printlist: [], packageNum: 0, goodsAreaName: "" }); const tips = common_vendor.ref(null); common_vendor.onLoad((op) => { details.items = JSON.parse(op.item); details.reservationId = op.reservationId; details.goodsAreaName = op.goodsAreaName; common_vendor.index.$on("scancodedate", function(code) { if (code) { console.log(code); scandata(code); } }); initpage(); }); async function initpage() { let data = { orderStatus: 2, reservationId: details.reservationId, stockListId: details.items.stockListId }; let response = await api_user.distributionStockuporderInfo(data); details.codelist = response.data.packageList; } function showmd() { tips.value.setdetails({ list: details.printlist, isshow: true, tipstate: 1, placeholder: "请输入需要生成的包条码数量", success: (deta) => { console.log(deta); details.packageNum = deta.inputtext; if (Number(details.packageNum) > Number(details.items.planNum)) { common_vendor.index.showToast({ title: "不能大于计划数量,请重新输入", icon: "none" }); tips.value.setdetails({ inputtext: "" }); return; } ctokListpackage(); }, cancel: (details2) => { tips.value.setdetails({ isshow: false }); }, close: (details2) => { tips.value.setdetails({ isshow: false }); } }); } async function ctokListpackage() { let data = { reservationId: details.reservationId, stockListId: details.items.stockListId, packageNum: details.packageNum }; let response = await api_user.distributionStockupstockupStockListPackageCode(data); console.log(response); details.printlist = response.data; tips.value.setdetails({ title: "请选择要打印的包条", tipstate: 2, list: response.data, checklist: [], inputtext: "", confirmTxt: "打印", success: (deta) => { if (deta.checklist.length == 0) { common_vendor.index.showToast({ title: "请先选择需要打印的包条码", icon: "none" }); return; } deta.checklist.map((item) => { print(details.printlist[item]); }); tips.value.setdetails({ isshow: false }); }, cancel: (details2) => { tips.value.setdetails({ isshow: false }); }, close: (details2) => { tips.value.setdetails({ isshow: false }); } }); } function print(item) { } async function scandata(code) { let data = { scanType: 2, stockListId: details.items.stockListId, packetBarCode: code, stockupArea: details.goodsAreaName, reservationId: details.reservationId }; let res = await api_user.distributionStockupstockupScan(data); console.log(res); if (res.code == 200) { common_vendor.index.showToast({ title: res.msg, icon: "none" }); initpage(); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } const { items, codelist, printlist } = common_vendor.toRefs(details); return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.p({ title: "配置包条码", placeholder: true, border: "true", autoBack: true, leftIconSize: "35" }), b: common_vendor.t(common_vendor.unref(items).allocation), c: common_vendor.t(common_vendor.unref(items).materialName), d: common_vendor.t(common_vendor.unref(items).sku), e: common_vendor.t(common_vendor.unref(items).cargoNorms), f: common_vendor.t(common_vendor.unref(items).planNum), g: common_vendor.t(common_vendor.unref(items).cargoUnit), h: common_vendor.unref(items).unpack == 0 }, common_vendor.unref(items).unpack == 0 ? {} : {}, { i: common_vendor.o(showmd), j: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => { return { a: common_vendor.t(index), b: common_vendor.t(item.packageCode) }; }), k: common_vendor.sr(tips, "420736b0-1", { "k": "tips" }) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/setbarcode/setbarcode.vue"]]); wx.createPage(MiniProgramPage);