"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_saomiao2 = common_vendor.resolveComponent("saomiao2"); const _component_tips = common_vendor.resolveComponent("tips"); (_easycom_u_navbar2 + _component_tiplist + _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: "DeliveryCustomerScan", setup(__props) { let details = common_vendor.reactive({ id: "", datalist: [], items: {}, scancode: "", authbuts: common_vendor.index.getStorageSync("authbuts") }); const tip = common_vendor.ref(null); const tiplists = common_vendor.ref(null); common_vendor.onLoad((op) => { details.id = op.id; details.items = JSON.parse(op.item); }); common_vendor.onHide(() => { common_vendor.index.$off("scancodedate"); }); common_vendor.onShow(() => { initpage(); common_vendor.index.$on("scancodedate", function(code) { if (code) { console.log(code); details.scancode = code; scandata(); } }); }); const ordernumber = common_vendor.computed(() => { let num = 0; details.datalist.map((item) => { num += Number(item.ordNub); }); return num; }); const deliveryNumber = common_vendor.computed(() => { let num = 0; details.datalist.map((item) => { num += Number(item.reservationNum); }); return num; }); const scannedNumber = common_vendor.computed(() => { let num = 0; details.datalist.map((item) => { num += Number(item.loadingNub); }); return num; }); async function ckoneloading(item) { tip.value.setdetails({ title: "提示", content: "确认一键装车?", confirmTxt: "确认", isshow: true, isshowcancel: true, success: async () => { let loadingId = common_vendor.index.getStorageSync("checkvehicle").id; let data = { reservationId: item.id, loadingId, deliveryId: details.id }; let response = await api_user.deliveryoneloading(data); if (response.code == 200) ; else { common_vendor.index.showToast({ title: response.msg, icon: "none" }); } tip.value.setisshow(false); }, cancel: () => { tip.value.setisshow(false); }, close: () => { tip.value.setisshow(false); } }); } async function scandata() { let loadingId = common_vendor.index.getStorageSync("checkvehicle").id; let data = { deliveryId: details.id, loadingId, type: 1, barcode: details.scancode }; let res = await api_user.deliveryloadingscan(data); console.log(res); if (res.code == 200) { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } } async function initpage() { let data = { id: details.id }; let response = await api_user.deliverycustom(data); details.datalist = response.data.records; } function goCustomerOrdersDetails(item) { common_vendor.index.navigateTo({ url: "/pagesHome/pages/CustomerOrdersDetails/CustomerOrdersDetails?item=" + JSON.stringify(item) + "&id=" + details.id }); } const { authbuts, items, datalist } = common_vendor.toRefs(details); return (_ctx, _cache) => { return { 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(items).type_name), c: common_vendor.t(common_vendor.unref(items).vehicleStatus_name), d: common_vendor.t(common_vendor.unref(items).vehicleName), e: common_vendor.t(common_vendor.unref(items).driverName), f: common_vendor.t(common_vendor.unref(items).loadingTeamName), g: common_vendor.t(common_vendor.unref(items).isstock), h: common_vendor.t(common_vendor.unref(items).customersNumber), i: common_vendor.t(common_vendor.unref(ordernumber)), j: common_vendor.t(common_vendor.unref(deliveryNumber)), k: common_vendor.t(common_vendor.unref(scannedNumber)), l: common_vendor.f(common_vendor.unref(datalist), (item, k0, i0) => { return common_vendor.e({ a: common_vendor.t(item.consignee), b: common_vendor.t(item.isstock), c: common_vendor.t(item.isload), d: common_vendor.t(item.stockupArea || "无备货区"), e: common_vendor.t(item.ordNub), f: common_vendor.o(($event) => goCustomerOrdersDetails(item)), g: common_vendor.t(item.reservationNum), h: common_vendor.t(item.loadingNub), i: common_vendor.unref(authbuts).indexOf("一键装车") != -1 && item.isload != "是" }, common_vendor.unref(authbuts).indexOf("一键装车") != -1 && item.isload != "是" ? { j: common_vendor.o(($event) => ckoneloading(item)) } : {}); }), m: common_vendor.sr(tiplists, "69b5a390-1", { "k": "tiplists" }), n: common_vendor.sr(tip, "69b5a390-3", { "k": "tip" }) }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan.vue"]]); wx.createPage(MiniProgramPage);