|
|
|
"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 _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
|
|
|
|
const _easycom_l_calendar2 = common_vendor.resolveComponent("l-calendar");
|
|
|
|
const _component_tiplist = common_vendor.resolveComponent("tiplist");
|
|
|
|
const _component_tips = common_vendor.resolveComponent("tips");
|
|
|
|
(_easycom_u_navbar2 + _easycom_u_icon2 + _easycom_l_calendar2 + _component_tiplist + _component_tips)();
|
|
|
|
}
|
|
|
|
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
|
|
|
|
const _easycom_u_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
|
|
|
|
const _easycom_l_calendar = () => "../../../uni_modules/l-calendar/components/l-calendar/l-calendar.js";
|
|
|
|
if (!Math) {
|
|
|
|
(_easycom_u_navbar + _easycom_u_icon + _easycom_l_calendar)();
|
|
|
|
}
|
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
__name: "LoadingScan",
|
|
|
|
setup(__props) {
|
|
|
|
let details = common_vendor.reactive({
|
|
|
|
datatime: "",
|
|
|
|
show: false,
|
|
|
|
recordsList: [],
|
|
|
|
current: 1,
|
|
|
|
size: 10,
|
|
|
|
checkstate: 1
|
|
|
|
});
|
|
|
|
const tip = common_vendor.ref(null);
|
|
|
|
const tiplists = common_vendor.ref(null);
|
|
|
|
const date = common_vendor.ref([]);
|
|
|
|
common_vendor.onShow(() => {
|
|
|
|
initpage();
|
|
|
|
});
|
|
|
|
function showCalendar() {
|
|
|
|
details.show = !details.show;
|
|
|
|
}
|
|
|
|
function setstates(state) {
|
|
|
|
if (details.checkstate == state) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
details.checkstate = state;
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
async function startld(item) {
|
|
|
|
tip.value.setdetails({
|
|
|
|
title: "提示",
|
|
|
|
content: "确认发车?",
|
|
|
|
confirmTxt: "发车",
|
|
|
|
isshow: true,
|
|
|
|
isshowcancel: true,
|
|
|
|
success: async () => {
|
|
|
|
Departure(item);
|
|
|
|
},
|
|
|
|
cancel: () => {
|
|
|
|
tip.value.setisshow(false);
|
|
|
|
},
|
|
|
|
close: () => {
|
|
|
|
tip.value.setisshow(false);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
async function Departure(item) {
|
|
|
|
tip.value.setisshow(false);
|
|
|
|
let data = {
|
|
|
|
deliveryId: item.id
|
|
|
|
};
|
|
|
|
let res = await api_user.deliveryvehicle(data);
|
|
|
|
if (res.data.length == 1) {
|
|
|
|
let data2 = {
|
|
|
|
deliveryId: item.id,
|
|
|
|
loadingId: res.data[0].id
|
|
|
|
};
|
|
|
|
let response = await api_user.deliverystart(data2);
|
|
|
|
if (response.code == 200) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "发车成功",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (res.data.length == 0) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "没有司机数据",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let list = [];
|
|
|
|
res.data.map((item2) => {
|
|
|
|
list.push(item2.driverName + "---" + item2.vehicleNub);
|
|
|
|
});
|
|
|
|
tiplists.value.setdetails({
|
|
|
|
title: "请选择车辆",
|
|
|
|
isshow: true,
|
|
|
|
tipstate: 2,
|
|
|
|
list,
|
|
|
|
checklist: [],
|
|
|
|
inputtext: "",
|
|
|
|
confirmTxt: "确认选择",
|
|
|
|
isonecheck: true,
|
|
|
|
success: async (deta) => {
|
|
|
|
if (deta.checklist.length == 0) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "请选择车辆",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
let data2 = {
|
|
|
|
deliveryId: item.id,
|
|
|
|
loadingId: res.data[deta.checklist[0]].id
|
|
|
|
};
|
|
|
|
let response = await api_user.deliverystart(data2);
|
|
|
|
if (response.code == 200) {
|
|
|
|
init();
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "发车成功",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
cancel: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
},
|
|
|
|
close: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function init() {
|
|
|
|
details.current = 1;
|
|
|
|
details.recordsList = [];
|
|
|
|
initpage();
|
|
|
|
}
|
|
|
|
function jiazai() {
|
|
|
|
details.current++;
|
|
|
|
initpage();
|
|
|
|
}
|
|
|
|
common_vendor.watchEffect(() => {
|
|
|
|
if (date.value.length != 0) {
|
|
|
|
details.datatime = date.value[0] + " 至 " + date.value[1];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
function onConfirm(e) {
|
|
|
|
console.log(e);
|
|
|
|
date.value[0] = e.startDate;
|
|
|
|
date.value[1] = e.endDate;
|
|
|
|
details.datatime = date.value[0] + " 至 " + date.value[1];
|
|
|
|
}
|
|
|
|
common_vendor.onLoad(() => {
|
|
|
|
date.value[0] = common_vendor.index.$u.timeFormat((/* @__PURE__ */ new Date()).valueOf() - 1e3 * 60 * 60 * 24 * 3, "yyyy-mm-dd");
|
|
|
|
date.value[1] = common_vendor.index.$u.timeFormat((/* @__PURE__ */ new Date()).valueOf(), "yyyy-mm-dd");
|
|
|
|
details.current = 1;
|
|
|
|
});
|
|
|
|
function showtime(value) {
|
|
|
|
console.log(value);
|
|
|
|
details.show = value;
|
|
|
|
}
|
|
|
|
async function initpage() {
|
|
|
|
let data = {
|
|
|
|
current: details.current,
|
|
|
|
size: details.size,
|
|
|
|
taskTime_start: date.value[0] || "",
|
|
|
|
taskTime_end: date.value[1] || "",
|
|
|
|
type: details.checkstate
|
|
|
|
};
|
|
|
|
let response = await api_user.deliverypage(data);
|
|
|
|
console.log(response);
|
|
|
|
if (details.current == 1) {
|
|
|
|
details.recordsList = response.data.records;
|
|
|
|
} else {
|
|
|
|
if (response.data.records.lngth == 0) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "已经到底了。",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
details.current--;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
details.recordsList = details.recordsList.concat(response.data.records);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async function goselscan(item) {
|
|
|
|
let data = {
|
|
|
|
deliveryId: item.id
|
|
|
|
};
|
|
|
|
let res = await api_user.deliveryvehicle(data);
|
|
|
|
if (res.data.length == 1) {
|
|
|
|
common_vendor.index.setStorageSync("checkvehicle", res.data[0]);
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan?id=" + item.id + "&item=" + JSON.stringify(item)
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (res.data.length == 0) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "没有司机数据",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let list = [];
|
|
|
|
res.data.map((item2) => {
|
|
|
|
list.push(item2.driverName + "---" + item2.vehicleNub);
|
|
|
|
});
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
common_vendor.index.setStorageSync("checkvehicle", res.data[deta.checklist[0]]);
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/DeliveryCustomerScan/DeliveryCustomerScan?id=" + item.id + "&item=" + JSON.stringify(item)
|
|
|
|
});
|
|
|
|
},
|
|
|
|
cancel: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
},
|
|
|
|
close: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
async function goloddeta(item) {
|
|
|
|
let data = {
|
|
|
|
deliveryId: item.id
|
|
|
|
};
|
|
|
|
let res = await api_user.deliveryvehicle(data);
|
|
|
|
console.log(res);
|
|
|
|
if (res.data.length == 1) {
|
|
|
|
common_vendor.index.setStorageSync("checkvehicle", res.data[0]);
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/LoadingDetails/LoadingDetails?item=" + JSON.stringify(item)
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (res.data.length == 0) {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "没有司机数据",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let list = [];
|
|
|
|
res.data.map((item2) => {
|
|
|
|
list.push(item2.driverName + "---" + item2.vehicleNub);
|
|
|
|
});
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
common_vendor.index.setStorageSync("checkvehicle", res.data[deta.checklist[0]]);
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/LoadingDetails/LoadingDetails?item=" + JSON.stringify(item)
|
|
|
|
});
|
|
|
|
},
|
|
|
|
cancel: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
},
|
|
|
|
close: (details2) => {
|
|
|
|
tiplists.value.setdetails({ isshow: false });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function cleartime() {
|
|
|
|
details.datatime = "";
|
|
|
|
date.value = [];
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
const { checkstate, datatime, recordsList, show } = 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.o(($event) => setstates(1)),
|
|
|
|
c: common_vendor.n(common_vendor.unref(checkstate) == 1 ? "xz" : ""),
|
|
|
|
d: common_vendor.o(($event) => setstates(2)),
|
|
|
|
e: common_vendor.n(common_vendor.unref(checkstate) == 2 ? "xz" : ""),
|
|
|
|
f: common_vendor.unref(datatime),
|
|
|
|
g: !common_vendor.unref(datatime)
|
|
|
|
}, !common_vendor.unref(datatime) ? {
|
|
|
|
h: common_vendor.o(($event) => showtime(true)),
|
|
|
|
i: common_vendor.p({
|
|
|
|
name: "calendar",
|
|
|
|
color: "#999999",
|
|
|
|
size: "50"
|
|
|
|
})
|
|
|
|
} : {
|
|
|
|
j: common_vendor.o(cleartime),
|
|
|
|
k: common_vendor.p({
|
|
|
|
name: "close-circle",
|
|
|
|
color: "#999999",
|
|
|
|
size: "40"
|
|
|
|
})
|
|
|
|
}, {
|
|
|
|
l: common_vendor.o(() => {
|
|
|
|
}),
|
|
|
|
m: common_vendor.o(($event) => showtime(true)),
|
|
|
|
n: common_vendor.o(init),
|
|
|
|
o: common_vendor.f(common_vendor.unref(recordsList), (item, k0, i0) => {
|
|
|
|
return common_vendor.e({
|
|
|
|
a: common_vendor.t(item.type_name),
|
|
|
|
b: common_vendor.t(item.vehicleStatus_name),
|
|
|
|
c: common_vendor.t(item.vehicleName),
|
|
|
|
d: common_vendor.t(item.driverName),
|
|
|
|
e: common_vendor.t(item.loadingTeamName),
|
|
|
|
f: common_vendor.t(item.isstock),
|
|
|
|
g: common_vendor.t(item.consignee),
|
|
|
|
h: common_vendor.t(item.createTime),
|
|
|
|
i: item.departureTime
|
|
|
|
}, item.departureTime ? {
|
|
|
|
j: common_vendor.t(item.departureTime)
|
|
|
|
} : {}, {
|
|
|
|
k: common_vendor.t(item.stockupArea || "无备货区"),
|
|
|
|
l: common_vendor.t(item.trainNumber),
|
|
|
|
m: common_vendor.o(($event) => goloddeta(item)),
|
|
|
|
n: common_vendor.t(item.customersNumber),
|
|
|
|
o: common_vendor.t(item.orderNumber),
|
|
|
|
p: common_vendor.t(item.deliveryNumber),
|
|
|
|
q: common_vendor.t(item.scannedNumber),
|
|
|
|
r: common_vendor.t(item.inventoryNub),
|
|
|
|
s: !item.departureTime
|
|
|
|
}, !item.departureTime ? {
|
|
|
|
t: common_vendor.o(($event) => startld(item))
|
|
|
|
} : {}, {
|
|
|
|
v: common_vendor.o(($event) => goselscan(item))
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
p: common_vendor.o(jiazai),
|
|
|
|
q: common_vendor.o(showCalendar),
|
|
|
|
r: common_vendor.o(onConfirm),
|
|
|
|
s: common_vendor.o(($event) => common_vendor.isRef(show) ? show.value = $event : null),
|
|
|
|
t: common_vendor.p({
|
|
|
|
initStartDate: date.value[0],
|
|
|
|
initEndDate: date.value[1],
|
|
|
|
value: common_vendor.unref(show)
|
|
|
|
}),
|
|
|
|
v: common_vendor.sr(tiplists, "38f22c90-4", {
|
|
|
|
"k": "tiplists"
|
|
|
|
}),
|
|
|
|
w: common_vendor.sr(tip, "38f22c90-5", {
|
|
|
|
"k": "tip"
|
|
|
|
})
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/worksp/logpm/pagesHome/pages/LoadingScan/LoadingScan.vue"]]);
|
|
|
|
wx.createPage(MiniProgramPage);
|