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

371 lines
13 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_user = require("../../../api/user.js");
const store_useSearchInfoStore = require("../../../store/useSearchInfoStore.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 _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
const _easycom_l_calendar2 = common_vendor.resolveComponent("l-calendar");
const _component_BasicContainer = common_vendor.resolveComponent("BasicContainer");
const _component_PopUp = common_vendor.resolveComponent("PopUp");
const _component_tiplist = common_vendor.resolveComponent("tiplist");
(_easycom_u_icon2 + _easycom_l_calendar2 + _component_BasicContainer + _component_PopUp + _component_tiplist)();
}
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_icon + _easycom_l_calendar)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "SelfPickupScan",
setup(__props) {
const option = {
title: "自提扫描",
haveData: true,
async pullDownRefreshInitPage() {
details.recordsList = [];
details.current = 1;
await initpage();
}
};
let details = common_vendor.reactive({
datatime: "",
show: false,
current: 1,
size: 10,
recordsList: [],
imgList: [
{
state: 1,
dictValue: "提货证件",
imgList: []
},
{
state: 2,
dictValue: "文员确认",
imgList: []
},
{
state: 3,
dictValue: "库管签收",
imgList: []
}
],
isChange: false,
changeImageList: [],
/**
* 必填照片 (无用)
*/
ImagesRequiredFields: [],
/** 下拉高度 */
scrollHeight: "",
/**
* 10: 待提货
* 20: 已提货
* 30: 已签收
*/
tabBarCode: 10,
/** 待提货查询 */
searchInfo1: {
date: []
},
/** 已提货查询 */
searchInfo2: {
date: []
},
/** 已签收查询 */
searchInfo3: {
date: []
}
});
const date = common_vendor.ref([]);
const basicContainer = common_vendor.ref(null);
const UpReceivedImage = common_vendor.ref();
const tiplists = common_vendor.ref();
const searchInfoStore = store_useSearchInfoStore.useSearchInfoStore();
const { searchInfo } = common_vendor.storeToRefs(searchInfoStore);
const { HANDLE_EDIT_INFO, HANDLE_DELETE } = searchInfoStore;
function showCalendar() {
details.show = !details.show;
}
function onConfirm(e) {
console.log(e);
date.value[0] = e.startDate;
date.value[1] = e.endDate;
details.datatime = date.value[0] + " 至 " + date.value[1];
}
function handleTabBarCode(code) {
console.log("details :>> ", details);
details.tabBarCode = code;
if (code === 10)
date.value = details.searchInfo1.date;
else if (code === 20)
date.value = details.searchInfo2.date;
basicContainer.value.startPullDownRefresh();
}
common_vendor.watchEffect(() => {
if (date.value.length != 0) {
details.datatime = date.value[0] + " 至 " + date.value[1];
} else
details.datatime = "";
});
common_vendor.onLoad(() => {
});
common_vendor.onShow(async () => {
const pageSearchInfo = searchInfo.value["SelfPickupScan"];
console.log("pageSearchInfo :>> ", pageSearchInfo);
if (pageSearchInfo) {
const code = pageSearchInfo.conditions;
details.searchInfo1 = pageSearchInfo.searchInfo1;
details.searchInfo2 = pageSearchInfo.searchInfo2;
if (code === 10 || pageSearchInfo.searchInfo1)
date.value = pageSearchInfo.searchInfo1.date;
else if (code === 20 || pageSearchInfo.searchInfo2)
date.value = pageSearchInfo.searchInfo2.date;
details.tabBarCode = code;
} else {
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.searchInfo1.date = [...date.value];
details.searchInfo2.date = [...date.value];
}
await common_vendor.nextTick$1();
basicContainer.value.startPullDownRefresh();
details.scrollHeight = await utils_utils.utils.getViewDistanceFormTop(".scvbx");
});
function jiazai() {
details.current++;
initpage();
}
async function initpage() {
if (details.tabBarCode === 10)
details.searchInfo1.date = [...date.value];
else if (details.tabBarCode === 20)
details.searchInfo2.date = [...date.value];
if (date.value.length === 0)
return utils_utils.utils.handleToast("请选择自提时间");
let data = {
current: details.current,
size: details.size,
pickUpTimeStart: date.value[0],
pickUpTimeEnd: date.value[1],
conditions: details.tabBarCode
};
HANDLE_EDIT_INFO("SelfPickupScan", {
searchInfo1: details.searchInfo1,
searchInfo2: details.searchInfo2,
searchInfo3: details.searchInfo3,
conditions: details.tabBarCode
});
let response = await api_user.billLadingpageList(data);
if (response.code !== 200)
return;
if (details.current == 1) {
details.recordsList = response.data.records;
} else {
if (response.data.records.lngth == 0) {
common_vendor.index.showToast({
title: "已经到底了。",
icon: "none"
});
return;
}
details.recordsList = details.recordsList.concat(response.data.records);
}
}
function goselscan(item) {
common_vendor.index.navigateTo({
url: "/pagesHome/pages/SelfPScanList/SelfPScanList?billLadingId=" + item.billLadingId
});
}
function goselscandetails(item) {
common_vendor.index.navigateTo({
url: "/pagesHome/pages/SelfPickupDetails/SelfPickupDetails?billLadingId=" + item.billLadingId
});
}
function cleartime() {
details.datatime = "";
date.value = [];
handlSearch();
}
const showUpImg = async (item) => {
let submitData = {
billLadingId: item.billLadingId
};
let res = await api_user.billLadingGetReceivedImage(submitData);
const { code, data } = res;
let remark = "";
if (code !== 200)
return;
remark = res.data.remark;
if (data.list) {
for (let item2 of data.list) {
details.imgList.find((val) => val.state === Number(item2.state)).imgList.push({ ...item2, urlRoute: item2.url });
}
}
tiplists.value.setdetails({
title: "请上传签收图片(每项最少一张)",
isshow: true,
tipstate: 3,
placeholder: "请填写备注",
confirmTxt: "确认",
inputtext: remark,
imglist: details.imgList,
maximglength: 20,
isChange: details.isChange,
changeImageList: details.changeImageList,
ImagesRequiredFields: details.ImagesRequiredFields,
success: async (detail) => {
console.log("detail :>> ", detail);
let data2 = {
billLadingId: item.billLadingId,
printList: [],
remark: detail.inputtext
};
let res2 = null;
const isSubmit = detail.imglist.every((item2) => {
if (item2.imgList.length < 1)
return false;
else {
data2.printList = [...data2.printList, ...item2.imgList.map((val) => {
val.state = item2.state;
val.url = val.urlRoute;
return val;
})];
return true;
}
});
if (!isSubmit) {
common_vendor.index.showToast({
title: "请根据要求上传照片",
icon: "none"
});
utils_utils.utils.ttsspke("必传照片不足");
return;
}
try {
common_vendor.index.showLoading({
mask: true
});
console.log("data :>> ", data2);
res2 = await api_user.billLadingAddReceivedImage(data2);
if (res2.code !== 200)
return;
for (let item2 of details.imgList) {
item2.imgList = [];
}
initpage();
common_vendor.index.showToast({
title: res2.msg,
icon: "none"
});
tiplists.value.setdetails({ isshow: false });
} catch (err) {
console.log("err :>> ", err);
} finally {
common_vendor.index.hideLoading();
}
},
cancel: () => {
for (let item2 of details.imgList) {
item2.imgList = [];
}
tiplists.value.setdetails({ isshow: false });
},
close: () => {
for (let item2 of details.imgList) {
item2.imgList = [];
}
tiplists.value.setdetails({ isshow: false });
}
});
};
const handlSearch = () => {
basicContainer.value.startPullDownRefresh();
};
const leftClick = () => {
HANDLE_DELETE("SelfPickupScan");
common_vendor.index.navigateBack();
};
const { datatime, dataList, show, recordsList } = common_vendor.toRefs(details);
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(details).tabBarCode === 10 ? 1 : "",
b: common_vendor.o(($event) => handleTabBarCode(10)),
c: common_vendor.unref(details).tabBarCode === 20 ? 1 : "",
d: common_vendor.o(($event) => handleTabBarCode(20)),
e: common_vendor.t(common_vendor.unref(datatime) || "请选择时间"),
f: !common_vendor.unref(datatime)
}, !common_vendor.unref(datatime) ? {
g: common_vendor.o(showCalendar),
h: common_vendor.p({
name: "calendar",
color: "#999999",
size: "50"
})
} : {
i: common_vendor.o(cleartime),
j: common_vendor.p({
name: "close-circle",
color: "#999999",
size: "40"
})
}, {
k: common_vendor.o(() => {
}),
l: common_vendor.o(showCalendar),
m: common_vendor.o(handlSearch),
n: common_vendor.f(common_vendor.unref(recordsList), (item, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(item.pickUpPlate),
b: common_vendor.t(item.consignee),
c: common_vendor.t(item.createTime),
d: common_vendor.t(item.createTime),
e: common_vendor.t(item.orderNum),
f: common_vendor.t(item.planNum),
g: common_vendor.t(item.signedNum),
h: common_vendor.t(item.inventoryNub)
}, Number(common_vendor.unref(details).tabBarCode) === 10 ? {
i: common_vendor.o(($event) => goselscandetails(item)),
j: common_vendor.o(($event) => goselscan(item))
} : {}, {
k: common_vendor.o(($event) => showUpImg(item))
});
}),
o: Number(common_vendor.unref(details).tabBarCode) === 10,
p: common_vendor.unref(details).scrollHeight,
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(basicContainer, "62fd4582-0", {
"k": "basicContainer"
}),
x: common_vendor.p({
option,
leftClick
}),
y: common_vendor.sr(UpReceivedImage, "62fd4582-4", {
"k": "UpReceivedImage"
}),
z: common_vendor.sr(tiplists, "62fd4582-5", {
"k": "tiplists"
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-62fd4582"], ["__file", "D:/worksp/logpm/pagesHome/pages/SelfPickupScan/SelfPickupScan.vue"]]);
wx.createPage(MiniProgramPage);