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

228 lines
8.1 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_user = require("../../../api/user.js");
const store_useSystemSettingsStore = require("../../../store/useSystemSettingsStore.js");
const utils_utils = require("../../../utils/utils.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_tips = common_vendor.resolveComponent("tips");
(_component_BasicContainer + _component_tiplist + _component_tips)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "DeliveryCustomerScan",
setup(__props) {
common_vendor.storeToRefs(store_useSystemSettingsStore.useSystemSettingsStore());
const option = common_vendor.reactive({
title: "配送客户扫描",
haveData: true,
async pullDownRefreshInitPage() {
return await initpage();
}
});
let details = common_vendor.reactive({
id: "",
datalist: [],
items: {},
scancode: "",
authbuts: common_vendor.index.getStorageSync("authbuts"),
/** 装车件数 */
scannedNumber: 0,
loadingId: ""
});
const tip = common_vendor.ref(null);
const tiplists = common_vendor.ref(null);
const basicContainer = common_vendor.ref(null);
common_vendor.onLoad((op) => {
details.loadingId = op.loadingId;
details.id = op.id;
details.items = JSON.parse(op.item);
});
common_vendor.onShow(async () => {
await common_vendor.nextTick$1();
basicContainer.value.startPullDownRefresh();
});
const ordernumber = common_vendor.computed(() => {
let num = 0;
details.datalist.map((item) => {
num += Number(item.ordNub);
});
return num;
});
const deliveryNumber = common_vendor.computed(() => {
let num = 0;
details.datalist.map((item) => {
num += Number(item.reservationNum);
});
return num;
});
common_vendor.computed(() => {
let num = 0;
details.datalist.forEach((item) => {
num += Number(item.loadingNub);
});
return num;
});
const handleDriverInfo = async (content = "请重新提交") => {
let subData = {
deliveryId: details.id
};
let res = await api_user.deliveryvehicle(subData);
const { code, data } = res;
if (code !== 200)
return;
const _driverId = common_vendor.index.getStorageSync("checkvehicle").driverId;
let _flag = false;
for (let item of data) {
if (item.driverId === _driverId) {
_flag = true;
common_vendor.index.setStorageSync("checkvehicle", item);
break;
}
}
if (!_flag) {
common_vendor.index.navigateBack({
delta: 2
});
utils_utils.utils.handleToast("司机信息变更");
return;
}
utils_utils.utils.handleToast(content);
};
async function ckoneloading(item) {
tip.value.setdetails({
title: "提示",
content: "确认一键装车?",
confirmTxt: "确认",
isshow: true,
isshowcancel: true,
success: async () => {
let loadingId = common_vendor.index.getStorageSync("checkvehicle").id;
let data = {
reservationId: item.id,
loadingId,
deliveryId: details.id
};
let response = await api_user.deliveryoneloading(data);
if (response.code === 13e3)
handleDriverInfo();
if (response.code !== 200)
return;
tip.value.setisshow(false);
},
cancel: () => {
tip.value.setisshow(false);
},
close: () => {
tip.value.setisshow(false);
}
});
}
async function initpage() {
try {
let data = {
id: details.id
};
let response = await api_user.deliverycustom(data);
if (response.code !== 200)
return;
console.log("response", response);
details.datalist = response.data || [];
details.scannedNumber = 0;
details.datalist.forEach((item) => {
details.scannedNumber += Number(item.loadingNub);
});
} catch (e) {
} finally {
return null;
}
}
function goCustomerOrdersDetails(item) {
const data = {
isstock: item.isstock,
consignee: item.consignee,
isload: item.isload,
ordNub: item.ordNub,
reservationNum: item.reservationNum,
signNub: item.signNub,
id: item.id
};
common_vendor.index.navigateTo({
url: "/pagesHome/pages/CustomerOrdersDetails/CustomerOrdersDetails?item=" + JSON.stringify(data) + "&id=" + details.id + "&loadingId=" + details.loadingId
});
}
function goCustomerTrayDetails(item) {
const data = {
type_name: item.type_name,
deliStatus_name: item.deliStatus_name,
vehicleName: item.vehicleName,
driverName: item.driverName,
loadingTeamName: item.loadingTeamName,
isstock: item.isstock,
customersNumber: item.customersNumber,
orderNumber: item.orderNumber,
loadCusNub: item.loadCusNub,
loadOrdNub: item.loadOrdNub,
signNub: item.signNub,
signNubSr: item.signNubSr,
id: item.id
};
common_vendor.index.navigateTo({
url: "/pagesHome/pages/CustomerTrayDetails/CustomerTrayDetails?item=" + JSON.stringify(data) + "&id=" + details.id + "&loadingId=" + details.loadingId
});
}
const { authbuts, items, datalist } = common_vendor.toRefs(details);
return (_ctx, _cache) => {
return {
a: common_vendor.t(common_vendor.unref(items).type_name),
b: common_vendor.t(common_vendor.unref(items).vehicleStatus_name),
c: common_vendor.t(common_vendor.unref(items).vehicleName),
d: common_vendor.t(common_vendor.unref(items).driverName),
e: common_vendor.t(common_vendor.unref(items).loadingTeamName),
f: common_vendor.t(common_vendor.unref(items).isstock),
g: common_vendor.t(common_vendor.unref(items).customersNumber),
h: common_vendor.t(ordernumber.value),
i: common_vendor.t(deliveryNumber.value),
j: common_vendor.t(common_vendor.unref(details).scannedNumber),
k: common_vendor.f(common_vendor.unref(datalist), (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.consignee),
b: common_vendor.t(item.isstock),
c: common_vendor.t(item.isload),
d: common_vendor.t(item.stockupArea || "无备货区"),
e: common_vendor.t(item.ordNub),
f: common_vendor.o(($event) => goCustomerOrdersDetails(item)),
g: common_vendor.t(item.reservationNum),
h: common_vendor.t(item.loadingNub),
i: common_vendor.t(item.trayNum),
j: common_vendor.o(($event) => goCustomerTrayDetails(item)),
k: common_vendor.unref(authbuts).indexOf("一键装车") != -1 && item.isload != "是"
}, common_vendor.unref(authbuts).indexOf("一键装车") != -1 && item.isload != "是" ? {
l: common_vendor.o(($event) => ckoneloading(item))
} : {});
}),
l: common_vendor.sr(basicContainer, "df6babb8-0", {
"k": "basicContainer"
}),
m: common_vendor.p({
option
}),
n: common_vendor.sr(tiplists, "df6babb8-1", {
"k": "tiplists"
}),
o: common_vendor.sr(tip, "df6babb8-2", {
"k": "tip"
})
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/worksp/logpm/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan.vue"]]);
wx.createPage(MiniProgramPage);