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.
321 lines
11 KiB
321 lines
11 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("../../../utils/base64.js"); |
|
require("../../../config/host.js"); |
|
require("../../../utils/md5.js"); |
|
if (!Array) { |
|
const _easycom_u_navbar2 = common_vendor.resolveComponent("u-navbar"); |
|
const _component_tips = common_vendor.resolveComponent("tips"); |
|
const _component_tiplist = common_vendor.resolveComponent("tiplist"); |
|
const _component_saomiao2 = common_vendor.resolveComponent("saomiao2"); |
|
(_easycom_u_navbar2 + _component_tips + _component_tiplist + _component_saomiao2)(); |
|
} |
|
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js"; |
|
if (!Math) { |
|
(_easycom_u_navbar + cusSelects)(); |
|
} |
|
const cusSelects = () => "../../../compoment/cus-selects-fan/cus-selects-fan.js"; |
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ |
|
__name: "signOrderScan", |
|
setup(__props) { |
|
const utils = common_vendor.inject("utils"); |
|
let details = common_vendor.reactive({ |
|
schanvalue: "", |
|
typearr: [ |
|
{ |
|
value: 3, |
|
label: "齐套" |
|
}, |
|
{ |
|
value: 2, |
|
label: "部分扫" |
|
}, |
|
{ |
|
value: 1, |
|
label: "未扫" |
|
} |
|
], |
|
items: {}, |
|
datalist: [], |
|
id: "", |
|
orderStatus: 1, |
|
scancode: "", |
|
deliveryId: "", |
|
orderType: "", |
|
inputtxt: "", |
|
listcheckindex: -1 |
|
}); |
|
const tiplists = common_vendor.ref(null); |
|
const tip = common_vendor.ref(null); |
|
const Plannednub = common_vendor.computed(() => { |
|
let num = 0; |
|
details.datalist.map((item) => { |
|
if (item.reservationNum) { |
|
num += item.reservationNum; |
|
} |
|
}); |
|
return num; |
|
}); |
|
const ordNub = common_vendor.computed(() => { |
|
return details.datalist.length; |
|
}); |
|
const signNub = common_vendor.computed(() => { |
|
let num = 0; |
|
details.datalist.map((item) => { |
|
if (item.signforNub) { |
|
num += item.signforNub; |
|
} |
|
}); |
|
return num; |
|
}); |
|
common_vendor.watchEffect(() => { |
|
if (signNub.value != 0) { |
|
console.log(signNub.value + "件"); |
|
utils.ttsspke(signNub.value + "件"); |
|
} |
|
}); |
|
common_vendor.onLoad((op) => { |
|
details.items = JSON.parse(op.item); |
|
details.id = JSON.parse(op.item).id; |
|
details.deliveryId = op.deliveryId; |
|
initpage(); |
|
common_vendor.index.$on("scancodedate", function(code) { |
|
if (code) { |
|
console.log(code); |
|
details.scancode = code; |
|
scandata(); |
|
} |
|
}); |
|
}); |
|
function goorderdetail(item) { |
|
common_vendor.index.navigateTo({ |
|
url: "/pagesHome/pages/orderDetails/orderDetails?orderCode=" + item.orderCode |
|
}); |
|
} |
|
async function scandata() { |
|
let data = { |
|
barcode: details.scancode, |
|
deliveryId: details.deliveryId, |
|
reservationId: details.id |
|
}; |
|
if (details.orderStatus == 1) { |
|
let response = await api_user.signforsignfor(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); |
|
common_vendor.index.showToast({ |
|
title: response2.msg, |
|
icon: "none" |
|
}); |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
cancel: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
close: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
} |
|
}); |
|
} else { |
|
common_vendor.index.showToast({ |
|
title: response.msg, |
|
icon: "none" |
|
}); |
|
} |
|
} else if (details.orderStatus == 2) { |
|
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); |
|
common_vendor.index.showToast({ |
|
title: response2.msg, |
|
icon: "none" |
|
}); |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
cancel: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
}, |
|
close: () => { |
|
tip.value.setdetails({ isshow: false }); |
|
} |
|
}); |
|
} 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; |
|
initpage(); |
|
} |
|
async function initpage() { |
|
let data = { |
|
reservationId: details.id, |
|
completecode: details.orderType, |
|
orderCode: details.inputtxt |
|
}; |
|
details.datalist = []; |
|
let response = null; |
|
if (details.orderStatus == 1) { |
|
response = await api_user.signfororder(data); |
|
} else if (details.orderStatus == 2) { |
|
response = await api_user.signforinventory(data); |
|
} |
|
details.datalist = response.data.records; |
|
} |
|
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; |
|
} |
|
}); |
|
} |
|
const { listcheckindex, inputtxt, orderStatus, datalist, items, typearr, schanvalue } = common_vendor.toRefs(details); |
|
return (_ctx, _cache) => { |
|
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(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(common_vendor.unref(ordNub)), |
|
g: common_vendor.t(common_vendor.unref(Plannednub)), |
|
h: common_vendor.t(common_vendor.unref(items).reservationNum), |
|
i: common_vendor.t(common_vendor.unref(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.unref(orderStatus) == 1 |
|
}, common_vendor.unref(orderStatus) == 1 ? { |
|
t: common_vendor.f(common_vendor.unref(datalist), (item, index, i0) => { |
|
return common_vendor.e({ |
|
a: common_vendor.o(($event) => goorderdetail(item)), |
|
b: common_vendor.t(item.orderCode), |
|
c: common_vendor.t(item.reservationNum), |
|
d: common_vendor.t(item.reservationNum), |
|
e: common_vendor.t(item.loadingNub), |
|
f: common_vendor.t(item.signforNub), |
|
g: common_vendor.unref(listcheckindex) == index |
|
}, common_vendor.unref(listcheckindex) == index ? { |
|
h: common_vendor.f(item.distributionAppParcelListVOS, (ite, k1, i1) => { |
|
return { |
|
a: common_vendor.t(ite.packetBarCode), |
|
b: common_vendor.t(ite.thirdProduct), |
|
c: common_vendor.t(ite.isScan ? ite.isScan : "未扫") |
|
}; |
|
}) |
|
} : {}, { |
|
i: common_vendor.t(item.signforNub == 0 ? "未扫" : item.signforNub == item.reservationNum ? "齐套" : "部分扫"), |
|
j: common_vendor.n(item.signforNub == 0 ? "tip tp2" : item.signforNub == item.reservationNum ? "tip tp1" : "tip tp3"), |
|
k: common_vendor.o(($event) => setcheckindex(index)) |
|
}); |
|
}) |
|
} : {}, { |
|
v: common_vendor.unref(orderStatus) == 2 |
|
}, common_vendor.unref(orderStatus) == 2 ? { |
|
w: common_vendor.f(common_vendor.unref(datalist), (item, index, i0) => { |
|
return { |
|
a: common_vendor.t(item.sku), |
|
b: common_vendor.t(item.descriptionGoods), |
|
c: common_vendor.t(item.specification), |
|
d: common_vendor.t(item.logpmUnit), |
|
e: common_vendor.o(($event) => setcheckindex(index)) |
|
}; |
|
}) |
|
} : {}, { |
|
x: common_vendor.sr(tip, "7bc9dba3-2", { |
|
"k": "tip" |
|
}), |
|
y: common_vendor.sr(tiplists, "7bc9dba3-3", { |
|
"k": "tiplists" |
|
}) |
|
}); |
|
}; |
|
} |
|
}); |
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/workspace/logpm/pagesHome/pages/signOrderScan/signOrderScan.vue"]]); |
|
wx.createPage(MiniProgramPage);
|
|
|