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

571 lines
22 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_user = require("../../../api/user.js");
const store_useSystemSettingsStore = require("../../../store/useSystemSettingsStore.js");
require("../../../utils/request.js");
require("../../../store/index.js");
require("../../../utils/utils.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 _easycom_uni_th2 = common_vendor.resolveComponent("uni-th");
const _easycom_uni_tr2 = common_vendor.resolveComponent("uni-tr");
const _easycom_uni_td2 = common_vendor.resolveComponent("uni-td");
const _easycom_uni_table2 = common_vendor.resolveComponent("uni-table");
const _component_tips = common_vendor.resolveComponent("tips");
const _component_tiplist = common_vendor.resolveComponent("tiplist");
(_easycom_u_navbar2 + _easycom_uni_th2 + _easycom_uni_tr2 + _easycom_uni_td2 + _easycom_uni_table2 + _component_tips + _component_tiplist)();
}
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
const _easycom_uni_th = () => "../../../uni_modules/uni-table/components/uni-th/uni-th.js";
const _easycom_uni_tr = () => "../../../uni_modules/uni-table/components/uni-tr/uni-tr.js";
const _easycom_uni_td = () => "../../../uni_modules/uni-table/components/uni-td/uni-td.js";
const _easycom_uni_table = () => "../../../uni_modules/uni-table/components/uni-table/uni-table.js";
if (!Math) {
(_easycom_u_navbar + cusSelects + _easycom_uni_th + _easycom_uni_tr + _easycom_uni_td + _easycom_uni_table)();
}
const cusSelects = () => "../../../compoment/cus-selects-fan/cus-selects-fan.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "signOrderScan",
setup(__props) {
common_vendor.storeToRefs(store_useSystemSettingsStore.useSystemSettingsStore());
const utils = common_vendor.inject("utils");
let details = common_vendor.reactive({
schanvalue: "",
typearr: [
{
value: 3,
label: "齐套"
},
{
value: 2,
label: "部分扫"
},
{
value: 1,
label: "未扫"
}
],
items: {},
datalist: [],
orderArr: [],
zeroArr: [],
stockArr: [],
id: "",
orderStatus: 1,
scancode: "",
deliveryId: "",
orderType: "",
inputtxt: "",
listcheckindex: -1,
scrollHeight: "",
/** 计划件数 */
Plannednub: 0,
/** 签收数 */
signNub: 0
});
const tiplists = common_vendor.ref(null);
const tip = common_vendor.ref(null);
const ordNub = common_vendor.computed(() => {
let num = 0;
num += details.orderArr.length;
num += details.zeroArr.length;
return num;
});
common_vendor.onLoad(async (op) => {
details.items = JSON.parse(op.item);
details.id = JSON.parse(op.item).id;
details.deliveryId = op.deliveryId;
});
common_vendor.onShow(async () => {
try {
let data = {
reservationId: details.items.id,
completecode: details.orderType,
orderCode: details.inputtxt
};
details.datalist = [];
const promise1 = api_user.signfororder(data, { isShowLoading: false });
const promise2 = api_user.signforinventory(data, { isShowLoading: false });
common_vendor.index.showLoading();
const [response, response1] = await Promise.all([promise1, promise2]);
if (response.code !== 200)
return;
details.zeroArr = [];
details.orderArr = [];
if (response.data && response.data)
response.data.forEach((val) => {
if (val.isZero === "1")
return details.zeroArr.push(val);
val.abnormalSignature = 0;
val.abnormalLoading = 0;
val.distributionAppParcelListVOS.forEach((value) => {
if (Number(value.isAbnnormalSigning) === 1)
val.abnormalSignature += 1;
if (Number(value.isAbnormalLoading) === 1)
val.abnormalLoading += 1;
});
details.orderArr.push(val);
});
if (response1.code !== 200)
return;
if (response1.data)
details.stockArr = response1.data || [];
computedNum();
if (details.orderStatus === 1)
details.datalist = details.orderArr;
else if (details.orderStatus === 2)
details.datalist = details.zeroArr;
else
details.datalist = details.stockArr;
} catch (err) {
console.log("err :>> ", err);
} finally {
await common_vendor.nextTick$1();
common_vendor.index.hideLoading();
}
});
common_vendor.onMounted(async () => {
await common_vendor.nextTick$1();
utils.getViewDistanceFormTop(".scve").then((res) => {
console.log("res :>> ", res);
details.scrollHeight = res;
});
});
function goorderdetail(item) {
common_vendor.index.navigateTo({
url: "/pagesHome/pages/orderDetails/orderDetails?orderCode=" + item.orderCode
});
}
const handlePackageScan = () => {
common_vendor.index.navigateTo({
url: "/pagesHome/pages/signPackageScan/signPackageScan?item=" + JSON.stringify(details.items) + "&deliveryId=" + details.deliveryId
});
};
function computedNum() {
const _arr = [...details.orderArr, ...details.zeroArr, ...details.stockArr];
details.Plannednub = 0;
details.signNub = 0;
for (let item of _arr) {
details.Plannednub += item.reservationNum;
details.signNub += item.signforNub;
}
}
common_vendor.onPullDownRefresh(async () => {
await initpage();
common_vendor.index.stopPullDownRefresh();
});
async function scandata() {
let data = {
barcode: details.scancode,
deliveryId: details.deliveryId,
reservationId: details.id
};
if (Number(details.orderStatus) == 1) {
let response = await api_user.signforsignfor(data);
console.log(response);
if (response.code === 200)
;
else if (response.code == 3006) {
tip.value.setdetails({
isshow: true,
content: "请确认是否异常签收",
success: async () => {
let data2 = {
barcode: details.scancode,
deliveryId: details.deliveryId,
reservationId: details.id
};
let response2 = await api_user.signforsignforcontinue(data2);
if (response2.code !== 200)
return;
console.log(response2);
common_vendor.index.showToast({
title: response2.msg,
icon: "none"
});
initpage();
tip.value.setdetails({ isshow: false });
},
cancel: () => {
tip.value.setdetails({ isshow: false });
},
close: () => {
tip.value.setdetails({ isshow: false });
}
});
return;
} else {
common_vendor.index.showToast({
title: response.msg,
icon: "none"
});
}
} else if (Number(details.orderStatus) === 3) {
let response = await api_user.signforsignforIn(data);
console.log(response);
if (response.code == 3006) {
tip.value.setdetails({
isshow: true,
content: "请确认是否异常签收",
success: async () => {
let data2 = {
barcode: details.scancode,
deliveryId: details.deliveryId,
reservationId: details.id
};
let response2 = await api_user.signforsignforcontinue(data2);
console.log(response2);
if (response2.code !== 200)
return;
common_vendor.index.showToast({
title: response2.msg,
icon: "none"
});
initpage();
tip.value.setdetails({ isshow: false });
},
cancel: () => {
tip.value.setdetails({ isshow: false });
},
close: () => {
tip.value.setdetails({ isshow: false });
}
});
return;
} else {
common_vendor.index.showToast({
title: response.msg,
icon: "none"
});
}
}
initpage();
}
function showsdqs() {
tiplists.value.setdetails({
isshow: true,
tipstate: 1,
title: "请输入扫描的码",
placeholder: "请输入扫描的码",
inputtext: "",
success: (detail) => {
details.scancode = detail.inputtext;
scandata();
tiplists.value.setdetails({ isshow: false });
},
cancel: () => {
tiplists.value.setdetails({ isshow: false });
},
close: () => {
tiplists.value.setdetails({ isshow: false });
}
});
}
function setorderStatus(state) {
details.orderStatus = state;
if (details.orderStatus === 1) {
details.datalist = details.orderArr;
} else if (details.orderStatus === 2) {
details.datalist = details.zeroArr;
} else {
details.datalist = details.stockArr;
}
}
async function initpage() {
try {
common_vendor.index.showLoading({
mask: true
});
details.listcheckindex = -1;
let data = {
reservationId: details.id,
completecode: details.orderType,
orderCode: details.inputtxt
};
details.datalist = [];
let response = null;
if (details.orderStatus == 1 || details.orderStatus === 2) {
response = await api_user.signfororder(data);
if (response.code !== 200)
return;
details.zeroArr = [];
details.orderArr = [];
response.data.forEach((val) => {
if (val.isZero === "1")
return details.zeroArr.push(val);
val.abnormalSignature = 0;
val.abnormalLoading = 0;
val.distributionAppParcelListVOS.forEach((value) => {
if (value.isAbnnormalSigning === 1)
val.abnormalSignature += 1;
if (value.isAbnormalLoading === 1)
val.abnormalLoading += 1;
});
console.log("val :>> ", val);
details.orderArr.push(val);
});
} else if (details.orderStatus == 3) {
response = await api_user.signforinventory(data);
if (response.code !== 200)
return;
details.stockArr = response.data || [];
}
if (details.orderStatus === 1)
details.datalist = details.orderArr;
else if (details.orderStatus === 2)
details.datalist = details.zeroArr;
else
details.datalist = details.stockArr;
} catch (err) {
console.log("err :>> ", err);
} finally {
computedNum();
common_vendor.index.hideLoading();
return null;
}
}
function setcheckindex(index) {
if (details.listcheckindex == index) {
details.listcheckindex = -1;
} else {
details.listcheckindex = index;
}
}
function checktype(e) {
if (e == "") {
details.schanvalue = "";
details.orderType = "";
return;
}
details.typearr.map((item) => {
if (item.value == e) {
details.schanvalue = item.label;
details.orderType = item.value;
}
});
}
function checkphon(item, index) {
console.log("item :>> ", item);
if (item.isZero === "1") {
const inpList = item.distributionParcelNumberVOS.map((val) => {
return {
id: val.parcelListId,
title: val.firsts,
value: val.signingNum,
maxNum: val.reservationNum,
minNum: 0,
type: "Number",
disabled: val.signingNum === val.reservationNum,
allocationId: val.allocationId,
orderCode: val.orderCode,
stockArticleId: val.stockArticleId
};
});
tiplists.value.setdetails({
title: "设置零担物料数量",
isshow: true,
tipstate: 4,
inpList,
inputtext: "",
confirmTxt: "确认",
isonecheck: true,
success: async (deta) => {
try {
if (deta.inpList.every((val) => val.disabled))
return tiplists.value.setdetails({ isshow: false });
if (deta.inpList.length === 0 || item.completeStact)
return tiplists.value.setdetails({ isshow: false });
common_vendor.index.showLoading({
mask: true,
title: "提交中"
});
let data = {
reservationId: details.items.id,
deliveryId: details.deliveryId,
orderId: deta.inpList[0].stockArticleId,
loadingId: common_vendor.index.getStorageSync("checkvehicle").id,
parcelListDTOS: []
};
data.parcelListDTOS = deta.inpList.map((val) => {
console.log("val :>> ", val);
return {
parcelListId: val.id,
stockArticleId: val.stockArticleId,
signingNum: val.value
};
});
const res = await api_user.signforZeroSignfor(data);
if (res.code !== 200)
return;
if (res.audio) {
}
initpage();
} catch (err) {
console.log("err :>> ", err);
} finally {
common_vendor.index.hideLoading();
tiplists.value.setdetails({ isshow: false });
}
},
cancel: (details2) => {
tiplists.value.setdetails({ isshow: false });
},
close: (details2) => {
tiplists.value.setdetails({ isshow: false });
}
});
return;
}
if (details.listcheckindex == index) {
details.listcheckindex = -1;
} else {
details.listcheckindex = index;
}
}
const { listcheckindex, inputtxt, orderStatus, datalist, items, typearr, schanvalue } = 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).consignee),
c: common_vendor.t(common_vendor.unref(items).deliveryAddress),
d: common_vendor.t(common_vendor.unref(items).deliveryPhone),
e: common_vendor.o(showsdqs),
f: common_vendor.t(ordNub.value),
g: common_vendor.t(common_vendor.unref(details).Plannednub),
h: common_vendor.t(common_vendor.unref(items).reservationNum),
i: common_vendor.t(common_vendor.unref(details).signNub),
j: common_vendor.o(checktype),
k: common_vendor.p({
data: common_vendor.unref(typearr),
value: common_vendor.unref(schanvalue),
placeholder: "全部",
arrLeft: 5,
size: "145",
clearable: true
}),
l: common_vendor.unref(inputtxt),
m: common_vendor.o(($event) => common_vendor.isRef(inputtxt) ? inputtxt.value = $event.detail.value : null),
n: common_vendor.o(initpage),
o: common_vendor.n(common_vendor.unref(orderStatus) == 1 ? "xz" : ""),
p: common_vendor.o(($event) => setorderStatus(1)),
q: common_vendor.n(common_vendor.unref(orderStatus) == 2 ? "xz" : ""),
r: common_vendor.o(($event) => setorderStatus(2)),
s: common_vendor.n(common_vendor.unref(orderStatus) == 3 ? "xz" : ""),
t: common_vendor.o(($event) => setorderStatus(3)),
v: common_vendor.f(common_vendor.unref(datalist), (item, index, i0) => {
return common_vendor.e(common_vendor.unref(orderStatus) === 1 ? common_vendor.e({
a: common_vendor.o(($event) => goorderdetail(item)),
b: common_vendor.t(item.orderCode),
c: common_vendor.o(($event) => goorderdetail(item)),
d: common_vendor.t(item.waybillNumber),
e: common_vendor.t(item.reservationNum),
f: common_vendor.t(item.loadingNub),
g: common_vendor.t(item.signforNub),
h: common_vendor.t(item.abnormalLoading),
i: common_vendor.t(item.abnormalSignature),
j: common_vendor.unref(listcheckindex) == index
}, common_vendor.unref(listcheckindex) == index ? {
k: "fb393026-4-" + i0 + "," + ("fb393026-3-" + i0),
l: common_vendor.p({
align: "left"
}),
m: "fb393026-5-" + i0 + "," + ("fb393026-3-" + i0),
n: common_vendor.p({
align: "left"
}),
o: "fb393026-6-" + i0 + "," + ("fb393026-3-" + i0),
p: common_vendor.p({
align: "left"
}),
q: "fb393026-7-" + i0 + "," + ("fb393026-3-" + i0),
r: common_vendor.p({
align: "center"
}),
s: "fb393026-3-" + i0 + "," + ("fb393026-2-" + i0),
t: common_vendor.f(item.distributionAppParcelListVOS, (ite, k1, i1) => {
return {
a: common_vendor.t(ite.orderPackageCode),
b: ite.orderPackageStatus !== "70" ? 1 : "",
c: "fb393026-9-" + i0 + "-" + i1 + "," + ("fb393026-8-" + i0 + "-" + i1),
d: common_vendor.t(ite.thirdProduct),
e: "fb393026-10-" + i0 + "-" + i1 + "," + ("fb393026-8-" + i0 + "-" + i1),
f: common_vendor.t(ite.orderPackageStatus === "70" ? "已签" : "未签"),
g: "fb393026-11-" + i0 + "-" + i1 + "," + ("fb393026-8-" + i0 + "-" + i1),
h: common_vendor.t(ite.isAbnnormalSigningName || ite.isAbnormalLoadingName || "/"),
i: "fb393026-12-" + i0 + "-" + i1 + "," + ("fb393026-8-" + i0 + "-" + i1),
j: Number(ite.isAbnormalLoading) === 1 || Number(ite.isAbnnormalSigning) === 1 ? 1 : "",
k: "fb393026-8-" + i0 + "-" + i1 + "," + ("fb393026-2-" + i0)
};
}),
v: common_vendor.p({
align: "center"
}),
w: common_vendor.sr("uniTable1", "fb393026-2-" + i0, {
"f": 1
}),
x: common_vendor.o(() => {
}),
y: "fb393026-2-" + i0,
z: common_vendor.p({
border: true,
emptyText: "暂无更多数据"
})
} : {}, {
A: common_vendor.t(item.signforNub == 0 ? "未扫" : item.signforNub == item.reservationNum ? "齐套" : "部分扫"),
B: common_vendor.n(item.signforNub == 0 ? "tip tp2" : item.signforNub == item.reservationNum ? "tip tp1" : "tip tp3"),
C: common_vendor.o(($event) => setcheckindex(index))
}) : {}, common_vendor.unref(orderStatus) === 2 ? common_vendor.e({
D: common_vendor.o(($event) => goorderdetail(item)),
E: common_vendor.t(item.orderCode),
F: common_vendor.o(($event) => goorderdetail(item)),
G: common_vendor.t(item.descriptionGoods),
H: common_vendor.t(item.reservationNum),
I: common_vendor.t(item.distributionParcelNumberVOS.reduce((cur, item2) => cur += item2.signingNum || 0, 0)),
J: item.complete
}, item.complete ? {
K: common_vendor.t(item.complete),
L: common_vendor.n(item.completecode == 3 ? "tip tp1" : item.completecode == 1 ? "tip tp2" : "tip tp3")
} : {}, {
M: common_vendor.o(($event) => checkphon(item, index))
}) : {}, common_vendor.unref(orderStatus) === 3 ? {
N: common_vendor.t(item.sku),
O: common_vendor.t(item.descriptionGoods),
P: common_vendor.t(item.specification),
Q: common_vendor.t(item.logpmUnit),
R: common_vendor.t(item.signforNub == 0 ? "未扫" : item.signforNub == item.reservationNum ? "齐套" : "部分扫"),
S: common_vendor.n(item.signforNub == 0 ? "tip tp2" : item.signforNub == item.reservationNum ? "tip tp1" : "tip tp3"),
T: common_vendor.o(($event) => setcheckindex(index))
} : {});
}),
w: common_vendor.unref(orderStatus) === 1,
x: common_vendor.unref(orderStatus) === 2,
y: common_vendor.unref(orderStatus) === 3,
z: common_vendor.o(() => {
}),
A: common_vendor.unref(details).scrollHeight,
B: common_vendor.o(handlePackageScan),
C: common_vendor.sr(tip, "fb393026-13", {
"k": "tip"
}),
D: common_vendor.sr(tiplists, "fb393026-14", {
"k": "tiplists"
})
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fb393026"], ["__file", "D:/worksp/logpm/pagesHome/pages/signOrderScan/signOrderScan.vue"]]);
wx.createPage(MiniProgramPage);