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

240 lines
8.6 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_user = require("../../../api/user.js");
const store_useBluetoothStore = require("../../../store/useBluetoothStore.js");
const store_useSystemSettingsStore = require("../../../store/useSystemSettingsStore.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 _component_BasicContainer = common_vendor.resolveComponent("BasicContainer");
const _component_tiplist = common_vendor.resolveComponent("tiplist");
const _component_PopUp = common_vendor.resolveComponent("PopUp");
const _component_BluetoothList = common_vendor.resolveComponent("BluetoothList");
(_component_BasicContainer + _component_tiplist + _component_PopUp + _component_BluetoothList)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "setbarcode",
setup(__props) {
common_vendor.storeToRefs(store_useSystemSettingsStore.useSystemSettingsStore());
const bluetoothList = common_vendor.ref(null);
const bluetoothStore = store_useBluetoothStore.useBluetoothStore();
common_vendor.storeToRefs(bluetoothStore);
const utils = common_vendor.inject("utils");
let details = common_vendor.reactive({
items: {},
reservationId: "",
codelist: [],
printlist: [],
goodsAreaName: "",
allocationId: "",
positionCode: "",
stockupId: "",
stockPrint: 1,
customer: "",
deliveryAddress: "",
completeStact: false,
orderpackgedetails: {},
/** 新增包条数量 */
packageNum: 0
});
const tips = common_vendor.ref(null);
const basicContainer = common_vendor.ref(null);
const popUp_AddPrint = common_vendor.ref(null);
const popUp_Edit = common_vendor.ref(null);
const option = {
title: "配置包条码",
haveData: true,
async pullDownRefreshInitPage() {
await initpage();
}
};
common_vendor.onLoad((op) => {
details.stockupId = op.stockupId;
details.items = JSON.parse(op.item);
console.log("op :>> ", details.items);
details.reservationId = op.reservationId;
details.goodsAreaName = op.goodsAreaName;
details.allocationId = op.allocationId;
details.positionCode = op.positionCode;
if (op.completeStact == "true") {
details.completeStact = true;
}
});
common_vendor.onShow(() => {
const timer = setTimeout(() => {
basicContainer.value.startPullDownRefresh();
clearTimeout(timer);
}, 200);
});
function setstockPrint(values) {
if (Number(details.items.planNum) === details.codelist.length) {
common_vendor.index.showToast({
title: "扫描完毕",
icon: "none"
});
return;
}
details.stockPrint = values;
if (values == 1) {
utils.ttsspke("请扫描原有包条码");
} else {
utils.ttsspke("请扫描打印的包条码");
}
}
async function initpage() {
let data = {
orderStatus: 2,
reservationId: details.reservationId,
stockListId: details.items.stockListId,
stockupId: details.stockupId,
allocationId: details.allocationId,
positionCode: details.positionCode,
status: details.completeStact ? 1 : 0,
cargoNumber: details.items.cargoNumber
};
let response = await api_user.stockConfigList(data);
if (response.code !== 200)
return;
details.codelist = response.data.stockConfigOrderPackageListVOS;
details.customer = response.data.customer;
details.deliveryAddress = response.data.deliveryAddress;
details.orderpackgedetails = response.data;
console.log(">>>>111111:", response);
}
function showmd() {
const _maxNum = Number(details.items.planNum) - details.codelist.length;
if (_maxNum === 0) {
common_vendor.index.showToast({
title: "没有可用数量",
icon: "none"
});
utils.ttsspke("没有可用数量");
return;
}
popUp_AddPrint.value.setDetails({
title: "生成包条数量",
showPopUp: true,
success() {
details.packageNum = Number(details.packageNum);
if (details.packageNum > _maxNum) {
common_vendor.index.showToast({
title: "不能大于计划数量,请重新输入",
icon: "none"
});
return;
}
if (details.packageNum <= 0) {
common_vendor.index.showToast({
title: "数量必须大于0,请重新输入",
icon: "none"
});
}
ctokListpackage();
}
});
}
async function ctokListpackage() {
common_vendor.index.showLoading({
mask: true,
title: "数据请求中"
});
let data = {
reservationId: details.reservationId,
stockListId: details.items.stockListId,
packageNum: details.packageNum,
allocationId: details.allocationId,
status: details.completeStact ? 1 : 0,
cargoNumber: details.items.cargoNumber
};
let response = await api_user.distributionStockupstockupStockListPackageCode(data);
common_vendor.index.hideLoading();
if (response.code !== 200)
return;
popUp_AddPrint.value.details.showPopUp = false;
console.log(response);
details.printlist = response.data;
let checklist = [];
response.data.map((item, index) => {
checklist.push(index);
});
console.log("tips :>> ", tips);
tips.value.setdetails({
title: "请选择要打印的包条",
tipstate: 2,
list: response.data,
checklist,
inputtext: "",
confirmTxt: "打印",
isshow: true,
success: (deta) => {
if (deta.checklist.length == 0) {
common_vendor.index.showToast({
title: "请先选择需要打印的包条码",
icon: "none"
});
return;
}
tips.value.setdetails({ isshow: false });
},
cancel: (details2) => {
tips.value.setdetails({ isshow: false });
},
close: (details2) => {
tips.value.setdetails({ isshow: false });
}
});
}
const { orderpackgedetails, items, codelist, printlist } = common_vendor.toRefs(details);
return (_ctx, _cache) => {
return {
a: common_vendor.t(common_vendor.unref(items).materialName),
b: common_vendor.t(common_vendor.unref(details).positionCode),
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).cargoUnit),
f: common_vendor.t(common_vendor.unref(items).planNum),
g: common_vendor.t(common_vendor.unref(codelist).length),
h: common_vendor.o(($event) => setstockPrint(1)),
i: common_vendor.o(($event) => setstockPrint(2)),
j: common_vendor.o(showmd),
k: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => {
return {
a: common_vendor.t(index + 1),
b: common_vendor.t(item.createTime),
c: common_vendor.t(item.code),
d: common_vendor.t(item.incomingBatch)
};
}),
l: common_vendor.sr(basicContainer, "592c6178-0", {
"k": "basicContainer"
}),
m: common_vendor.p({
option
}),
n: common_vendor.sr(tips, "592c6178-1", {
"k": "tips"
}),
o: common_vendor.t(Number(common_vendor.unref(details).items.planNum)),
p: common_vendor.t(Number(common_vendor.unref(details).items.planNum) - common_vendor.unref(details).codelist.length),
q: common_vendor.unref(details).packageNum,
r: common_vendor.o(($event) => common_vendor.unref(details).packageNum = $event.detail.value),
s: common_vendor.sr(popUp_AddPrint, "592c6178-2", {
"k": "popUp_AddPrint"
}),
t: common_vendor.sr(popUp_Edit, "592c6178-3", {
"k": "popUp_Edit"
}),
v: common_vendor.sr(bluetoothList, "592c6178-4", {
"k": "bluetoothList"
})
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/worksp/logpm/pagesHome/pages/setbarcode/setbarcode.vue"]]);
wx.createPage(MiniProgramPage);