货无忧
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.

179 lines
5.8 KiB

2 years ago
"use strict";
const common_vendor = require("../../../common/vendor.js");
1 year ago
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");
1 year ago
require("../../../config/host.js");
1 year ago
require("../../../utils/md5.js");
if (!Array) {
1 year ago
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar");
1 year ago
const _component_tiplist = common_vendor.resolveComponent("tiplist");
1 year ago
const _component_saomiao2 = common_vendor.resolveComponent("saomiao2");
1 year ago
(_easycom_u_navbar2 + _component_tiplist + _component_saomiao2)();
1 year ago
}
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
_easycom_u_navbar();
2 years ago
}
1 year ago
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]);
});
1 year ago
tips.value.setdetails({ isshow: false });
},
cancel: (details2) => {
tips.value.setdetails({ isshow: false });
},
close: (details2) => {
tips.value.setdetails({ isshow: false });
}
});
}
function print(item) {
}
1 year ago
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"
});
}
1 year ago
}
const { items, codelist, printlist } = common_vendor.toRefs(details);
return (_ctx, _cache) => {
return common_vendor.e({
1 year ago
a: common_vendor.p({
title: "配置包条码",
bgColor: "#D3832A",
leftIconColor: "#ffffff",
titleStyle: "color:#ffffff",
1 year ago
placeholder: 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
1 year ago
}, common_vendor.unref(items).unpack == 0 ? {} : {}, {
1 year ago
i: common_vendor.o(showmd),
j: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => {
1 year ago
return {
a: common_vendor.t(index),
b: common_vendor.t(item.packageCode)
};
}),
1 year ago
k: common_vendor.sr(tips, "420736b0-1", {
1 year ago
"k": "tips"
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/setbarcode/setbarcode.vue"]]);
2 years ago
wx.createPage(MiniProgramPage);