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.
294 lines
9.9 KiB
294 lines
9.9 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 _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); |
|
const _easycom_l_calendar2 = common_vendor.resolveComponent("l-calendar"); |
|
const _component_tiplist = common_vendor.resolveComponent("tiplist"); |
|
(_easycom_u_navbar2 + _easycom_u_icon2 + _easycom_l_calendar2 + _component_tiplist)(); |
|
} |
|
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 tips = 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(); |
|
} |
|
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); |
|
}); |
|
tips.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; |
|
} |
|
tips.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) => { |
|
tips.value.setdetails({ isshow: false }); |
|
}, |
|
close: (details2) => { |
|
tips.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); |
|
}); |
|
tips.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; |
|
} |
|
tips.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) => { |
|
tips.value.setdetails({ isshow: false }); |
|
}, |
|
close: (details2) => { |
|
tips.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 { |
|
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: common_vendor.t(item.stockupArea || "无备货区"), |
|
j: common_vendor.t(item.trainNumber), |
|
k: common_vendor.o(($event) => goloddeta(item)), |
|
l: common_vendor.t(item.customersNumber), |
|
m: common_vendor.t(item.orderNumber), |
|
n: common_vendor.t(item.deliveryNumber), |
|
o: common_vendor.t(item.scannedNumber), |
|
p: common_vendor.t(item.inventoryNub), |
|
q: common_vendor.o(($event) => goselscan(item)) |
|
}; |
|
}), |
|
p: common_vendor.o(() => { |
|
}), |
|
q: common_vendor.o(jiazai), |
|
r: common_vendor.o(showCalendar), |
|
s: common_vendor.o(onConfirm), |
|
t: common_vendor.o(($event) => common_vendor.isRef(show) ? show.value = $event : null), |
|
v: common_vendor.p({ |
|
initStartDate: date.value[0], |
|
initEndDate: date.value[1], |
|
value: common_vendor.unref(show) |
|
}), |
|
w: common_vendor.sr(tips, "20682624-4", { |
|
"k": "tips" |
|
}) |
|
}); |
|
}; |
|
} |
|
}); |
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/LoadingScan/LoadingScan.vue"]]); |
|
wx.createPage(MiniProgramPage);
|
|
|