货无忧
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

147 lines
4.9 KiB

"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("../../../config/host.js");
require("../../../utils/base64.js");
require("../../../utils/md5.js");
if (!Array) {
const _component_tiplist = common_vendor.resolveComponent("tiplist");
_component_tiplist();
}
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;
}
scandata(response.data[0]);
tips.value.setdetails({ isshow: false });
},
cancel: (details2) => {
tips.value.setdetails({ isshow: false });
},
close: (details2) => {
tips.value.setdetails({ isshow: false });
}
});
}
async function scandata(code) {
let data = {
scanType: 2,
stockListId: details.items.stockListId,
packetBarCode: code,
stockupArea: details.goodsAreaName,
reservationId: details.reservationId
};
let response = await api_user.distributionStockupstockupScan(data);
console.log(response);
}
const { items, codelist, printlist } = common_vendor.toRefs(details);
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t(common_vendor.unref(items).allocation),
b: common_vendor.t(common_vendor.unref(items).materialName),
c: common_vendor.t(common_vendor.unref(items).sku),
d: common_vendor.t(common_vendor.unref(items).cargoNorms),
e: common_vendor.t(common_vendor.unref(items).planNum),
f: common_vendor.t(common_vendor.unref(items).cargoUnit),
g: common_vendor.unref(items).unpack == 0
}, common_vendor.unref(items).unpack == 0 ? {} : {}, {
h: common_vendor.o(showmd),
i: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => {
return {
a: common_vendor.t(index),
b: common_vendor.t(item.packageCode)
};
}),
j: common_vendor.sr(tips, "420736b0-0", {
"k": "tips"
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/setbarcode/setbarcode.vue"]]);
wx.createPage(MiniProgramPage);