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

468 lines
0 B

1 year ago
"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_saomiao2 = common_vendor.resolveComponent("saomiao2");
const _component_tips = common_vendor.resolveComponent("tips");
const _component_tiplist = common_vendor.resolveComponent("tiplist");
(_easycom_u_navbar2 + _component_saomiao2 + _component_tips + _component_tiplist)();
}
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: "PeopleScanUp",
setup(__props) {
const tip = common_vendor.ref(null);
const tiplists = common_vendor.ref(null);
let details = common_vendor.reactive({
checkstate: 1,
upshelfScanType: "",
scancode: "",
allocationId: "",
//库位id
datalist: [],
reqobj: {},
uplistarr: [],
showstate: 0,
waybillCode: "",
codelist: [],
Marketlist: [],
1 year ago
checkmakindex: 0,
checkinarr: []
1 year ago
});
common_vendor.onLoad((op) => {
details.upshelfScanType = op.type;
initmarke();
common_vendor.index.$on("scancodedate", function(code) {
if (code) {
details.scancode = code;
scandata();
}
});
});
1 year ago
common_vendor.onPullDownRefresh(() => {
setTimeout(() => {
details.scancode = "";
details.allocationId = "";
details.datalist = [];
details.reqobj = {};
details.uplistarr = [];
details.waybillCode = "";
details.codelist = [];
details.Marketlist = [];
details.checkmakindex = 0;
details.checkinarr = [];
common_vendor.index.stopPullDownRefresh();
}, 1e3);
});
common_vendor.watchEffect(() => {
if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) {
details.uplistarr = fn2(details.uplistarr, "orderCode");
} else if (Number(details.upshelfScanType) == 3) {
details.uplistarr = fn2(details.uplistarr, "orderPackageCode");
} else if (Number(details.upshelfScanType) == 4) {
details.uplistarr = fn2(details.uplistarr, "trayCode");
}
});
function goorderdetail(item) {
common_vendor.index.navigateTo({
url: "/pagesHome/pages/orderDetails/orderDetails?orderCode=" + item.orderCode
});
}
1 year ago
function checkmake() {
let list = [];
details.Marketlist.map((item) => {
list.push(item == null ? void 0 : item.marketName);
});
tiplists.value.setdetails({
title: "请选择商场",
isshow: true,
tipstate: 2,
list,
checklist: [],
inputtext: "",
confirmTxt: "确认选择",
isonecheck: true,
success: (deta) => {
if (deta.checklist.length == 0) {
common_vendor.index.showToast({
title: "请选择商场",
icon: "none"
});
return;
}
details.checkmakindex = deta.checklist[0];
tiplists.value.setdetails({ isshow: false });
details.codelist = [];
},
cancel: (details2) => {
tiplists.value.setdetails({ isshow: false });
},
close: (details2) => {
tiplists.value.setdetails({ isshow: false });
}
});
}
async function initmarke() {
let data = {
warehouseCode: "LQ"
};
let res = await api_user.warehouseTrayTypefindAllMarket(data);
console.log(res.data);
details.Marketlist = res.data;
}
async function scanlist() {
details.codelist = [];
1 year ago
let response = null;
if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) {
let data = {
zeroType: Number(details.upshelfScanType) == 1 ? 2 : 1,
code: details.waybillCode
};
response = await api_user.warehouseUpdownTypegetZeroOrderByCode(data);
} else if (Number(details.upshelfScanType) == 3 || Number(details.upshelfScanType) == 4) {
let data = {
stockType: Number(details.upshelfScanType) == 3 ? 1 : 2,
value: details.waybillCode,
marketId: details.Marketlist[details.checkmakindex].marketId
};
response = await api_user.warehouseUpdownTypegetStockByParam(data);
}
console.log(response);
details.codelist = response.data;
details.codelist.map((item) => {
item["enterNum"] = 0;
return item;
});
}
function confirmlist() {
details.codelist.map((item) => {
if (item.enterNum > 0 && item.enterNum <= item.residueNumber) {
item.marketId = details.Marketlist[details.checkmakindex].marketId;
details.uplistarr.push(item);
}
});
details.uplistarr = fn2(details.uplistarr, "orderCode");
1 year ago
details.showstate = 0;
details.codelist = [];
details.waybillCode = "";
}
function setshowstate(state) {
details.showstate = state;
}
async function scandata() {
var _a;
let data = {
allocationId: details.scancode
};
let res = await api_user.warehouseUpdownTypeupShelfScanAllocation(data);
console.log(res);
if (res.code == 200) {
details.reqobj = res.data;
details.allocationId = res.data.allocationId;
details.datalist = ((_a = res.data) == null ? void 0 : _a.list) || [];
} else {
common_vendor.index.showToast({
title: res.msg,
icon: "none"
});
}
}
function uplist() {
tip.value.setdetails({
title: "提示",
content: "确认上架?",
confirmTxt: "确认",
isshow: true,
isshowcancel: true,
success: async () => {
if (details.uplistarr.length == 0) {
let content = "";
if (Number(details.upshelfScanType) == 4) {
content = "请先扫描托盘码";
} else {
content = "请先扫描包件数据";
}
tip.value.setdetails({
title: "警告",
content,
confirmTxt: "确认",
isshow: true,
isshowcancel: true,
success: () => {
tip.value.setisshow(false);
},
cancel: () => {
tip.value.setisshow(false);
},
close: () => {
tip.value.setisshow(false);
}
});
return;
}
common_vendor.index.showLoading({
mask: true,
title: "上架中"
});
1 year ago
let res;
details.uplistarr.map((item) => {
if (item.enterNum > item.totalNumber) {
item.enterNum = item.totalNumber;
}
});
1 year ago
if (Number(details.upshelfScanType) == 1 || Number(details.upshelfScanType) == 2) {
let data = {
allocationId: details.allocationId,
upShelfZeroOrderList: details.uplistarr
};
res = await api_user.warehouseUpdownTypeupShelfZeroOrder(data);
} else if (Number(details.upshelfScanType) == 3 || Number(details.upshelfScanType) == 4) {
let data = {
allocationId: details.allocationId,
upShelfStockList: details.uplistarr
};
res = await api_user.warehouseUpdownTypeupShelfStockList(data);
}
common_vendor.index.hideLoading();
1 year ago
if (res.code == 200) {
common_vendor.index.showToast({
title: "上架成功",
icon: "none"
});
details.uplistarr = [];
details.scancode = details.allocationId;
details.allocationId = "";
scandata();
} else {
common_vendor.index.showToast({
title: "上架失败",
icon: "error"
});
1 year ago
}
tip.value.setisshow(false);
},
cancel: () => {
tip.value.setisshow(false);
},
close: () => {
tip.value.setisshow(false);
}
});
}
1 year ago
function setchecl(index) {
if (details.checkinarr.indexOf(index) == -1) {
details.checkinarr.push(index);
} else {
details.checkinarr.splice(details.checkinarr.indexOf(index), 1);
}
}
1 year ago
function setstate(state) {
details.checkstate = state;
}
function fn2(tempArr, fnname) {
let result = [];
tempArr.map((item) => {
if (result.length == 0) {
item.enterNum = Number(item.enterNum);
result.push(item);
} else {
let ckindex = -1;
result.map((ite, index) => {
if (ite[fnname] == item[fnname]) {
ckindex = index;
}
});
if (ckindex != -1) {
result[ckindex].enterNum += Number(item.enterNum);
} else {
item.enterNum = Number(item.enterNum);
result.push(item);
}
}
});
return result;
}
1 year ago
const {
1 year ago
checkinarr,
1 year ago
checkmakindex,
Marketlist,
codelist,
waybillCode,
showstate,
uplistarr,
checkstate,
upshelfScanType,
allocationId,
datalist,
reqobj
} = common_vendor.toRefs(details);
return (_ctx, _cache) => {
var _a;
1 year ago
return common_vendor.e({
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(reqobj).warehouseName || "") + "-" + (common_vendor.unref(reqobj).areaTitle || "") + "-" + (common_vendor.unref(reqobj).shelfTitle || "") + "-" + (common_vendor.unref(reqobj).allocationTitle || "")),
c: common_vendor.t(common_vendor.unref(reqobj).warehouseName),
d: common_vendor.t(common_vendor.unref(reqobj).areaTitle),
e: common_vendor.t(common_vendor.unref(reqobj).orderTotalnum || 0),
f: common_vendor.t(common_vendor.unref(reqobj).totalNum || 0),
g: common_vendor.t(common_vendor.unref(reqobj).stockTotalNum || 0),
h: common_vendor.t(common_vendor.unref(reqobj).stockNum || 0),
i: common_vendor.o(($event) => setstate(1)),
j: common_vendor.n(common_vendor.unref(checkstate) == 1 ? "xz" : ""),
k: common_vendor.o(($event) => setstate(2)),
l: common_vendor.n(common_vendor.unref(checkstate) == 2 ? "xz" : ""),
m: common_vendor.o(($event) => setstate(3)),
n: common_vendor.n(common_vendor.unref(checkstate) == 3 ? "xz" : ""),
o: common_vendor.unref(checkstate) == 1
}, common_vendor.unref(checkstate) == 1 ? {
p: common_vendor.f(common_vendor.unref(uplistarr), (item, k0, i0) => {
return common_vendor.e(common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? {
a: common_vendor.t(item.orderCode),
b: common_vendor.o(item)
} : {}, {
c: item.goodsType == 1
}, item.goodsType == 1 ? {
d: common_vendor.t(item.waybillNo)
1 year ago
} : {}, common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2 ? {
e: common_vendor.t(item.enterNum)
1 year ago
} : {}, common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4 ? {
f: common_vendor.t(item.orderCode),
g: common_vendor.o(($event) => goorderdetail(item))
1 year ago
} : {}, common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4 ? {
h: common_vendor.t(item.enterNum)
1 year ago
} : {});
}),
q: common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2,
r: common_vendor.unref(upshelfScanType) == 1 || common_vendor.unref(upshelfScanType) == 2,
s: common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4,
t: common_vendor.unref(upshelfScanType) == 3 || common_vendor.unref(upshelfScanType) == 4
} : {}, {
v: common_vendor.unref(checkstate) == 2
}, common_vendor.unref(checkstate) == 2 ? {
w: common_vendor.f(common_vendor.unref(datalist), (item, k0, i0) => {
return common_vendor.e({
a: item.goodsType == 0
}, item.goodsType == 0 ? {
b: common_vendor.t(item.orderPackageCode)
1 year ago
} : {}, {
c: item.goodsType == 0
}, item.goodsType == 0 ? {
d: common_vendor.t(item.orderCode),
e: common_vendor.o(($event) => goorderdetail(item))
1 year ago
} : {}, {
f: item.goodsType === 1
}, item.goodsType === 1 ? {
g: common_vendor.t(item.serviceNum),
h: common_vendor.t(item.orderCode),
i: common_vendor.o(($event) => goorderdetail(item))
1 year ago
} : {}, {
j: item.goodsType === 2
}, item.goodsType === 2 ? {
k: common_vendor.t(item.waybillNo),
l: common_vendor.t(item.orderCode)
1 year ago
} : {}, {
m: item.goodsType === 3
}, item.goodsType === 3 ? {
n: common_vendor.t(item.materialCode),
o: common_vendor.t(item.materialName),
p: common_vendor.t(item.orderCode),
q: common_vendor.t(item.marketName),
r: common_vendor.t(item.incomingBatch)
} : {}, {
s: common_vendor.t(item.totalNum)
}, Number(common_vendor.unref(details).upshelfScanType) != 3 ? {
t: item.totalNum == item.shelfNum ? "/pagesHome/static/qitao.png" : "/pagesHome/static/weiqitao.png"
} : {});
}),
x: Number(common_vendor.unref(details).upshelfScanType) != 3
1 year ago
} : {}, {
y: common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode
1 year ago
}, common_vendor.unref(checkstate) == 3 && common_vendor.unref(reqobj).trayCode ? {
1 year ago
z: common_vendor.t(common_vendor.unref(reqobj).trayCode),
A: common_vendor.t(common_vendor.unref(reqobj).trayNum)
1 year ago
} : {}, {
1 year ago
B: common_vendor.t(common_vendor.unref(upshelfScanType) == "1" ? "添加运单" : common_vendor.unref(upshelfScanType) == "2" ? "添加订单" : common_vendor.unref(upshelfScanType) == "3" ? "添加物料" : "添加物料"),
C: common_vendor.o(($event) => setshowstate(2)),
D: common_vendor.o(uplist),
E: common_vendor.unref(showstate)
1 year ago
}, common_vendor.unref(showstate) ? common_vendor.e({
1 year ago
F: common_vendor.unref(showstate) == 2
1 year ago
}, common_vendor.unref(showstate) == 2 ? common_vendor.e({
1 year ago
G: common_vendor.unref(details).upshelfScanType == "3" || common_vendor.unref(details).upshelfScanType == "4"
1 year ago
}, common_vendor.unref(details).upshelfScanType == "3" || common_vendor.unref(details).upshelfScanType == "4" ? {
1 year ago
H: common_vendor.t(((_a = common_vendor.unref(Marketlist)[common_vendor.unref(checkmakindex)]) == null ? void 0 : _a.marketName) || "没有商场"),
I: common_vendor.o(checkmake)
1 year ago
} : {}, {
1 year ago
J: "输入" + (common_vendor.unref(details).upshelfScanType == "1" ? "运单号" : common_vendor.unref(details).upshelfScanType == "2" ? "订单自编号" : common_vendor.unref(details).upshelfScanType == "3" ? "物料编号" : "物料名称"),
K: common_vendor.unref(waybillCode),
L: common_vendor.o(($event) => common_vendor.isRef(waybillCode) ? waybillCode.value = $event.detail.value : null),
M: common_vendor.o(scanlist),
N: common_vendor.f(common_vendor.unref(codelist), (item, index, i0) => {
1 year ago
return common_vendor.e({
a: common_vendor.t(item.materialCode || "暂无数据"),
b: common_vendor.t(item.materialName || "暂无数据"),
c: common_vendor.t(item.orderCode),
d: common_vendor.t(item.residueNumber || 0),
e: common_vendor.t(item.totalNumber || 0),
f: common_vendor.t(item.waybillCode || "暂无数据"),
g: item.enterNum,
h: common_vendor.o(($event) => item.enterNum = $event.detail.value),
i: common_vendor.unref(checkinarr).indexOf(index) != -1
1 year ago
}, common_vendor.unref(checkinarr).indexOf(index) != -1 ? {
j: common_vendor.f(item.list, (ite, k1, i1) => {
1 year ago
return common_vendor.e({
a: ite.areaName
}, ite.areaName ? {
b: common_vendor.t(ite.areaName)
} : {}, {
c: ite.allocationName
}, ite.allocationName ? {
d: common_vendor.t("-" + ite.allocationName)
1 year ago
} : {}, {
e: common_vendor.t(ite.trayCode),
f: common_vendor.t(ite.num)
});
1 year ago
})
} : {}, {
k: common_vendor.o(($event) => setchecl(index))
1 year ago
});
1 year ago
}),
1 year ago
O: common_vendor.o(() => {
}),
1 year ago
P: common_vendor.o(($event) => setshowstate(0)),
Q: common_vendor.o(confirmlist),
R: common_vendor.o(() => {
1 year ago
})
}) : {}) : {}, {
1 year ago
S: common_vendor.sr(tip, "d7bdb9b8-2", {
1 year ago
"k": "tip"
}),
1 year ago
T: common_vendor.sr(tiplists, "d7bdb9b8-3", {
1 year ago
"k": "tiplists"
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/worksp/logpm/pagesHome/pages/PeopleScanUp/PeopleScanUp.vue"]]);
1 year ago
wx.createPage(MiniProgramPage);