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

211 lines
7.1 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_saomiao2 = common_vendor.resolveComponent("saomiao2");
(_easycom_u_navbar2 + _component_tips + _component_saomiao2)();
}
const _easycom_u_navbar = () => "../../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
if (!Math) {
_easycom_u_navbar();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "MergeTray",
setup(__props) {
const tip = common_vendor.ref(null);
const details = common_vendor.reactive({
scantype: 1,
mergeTray: "",
//来源托盘
newmergeTray: "",
//目标托盘
scancode: "",
tabberstate: 1,
beilist: {},
newbeilist: {}
});
common_vendor.onLoad((op) => {
common_vendor.index.$on("scancodedate", function(code) {
if (code) {
details.scancode = code;
scandata();
}
});
});
function setstate(state) {
details.scantype = state;
}
async function scandata() {
let res = null;
if (details.scantype == 1) {
let data = {
trayCode: details.scancode
};
res = await api_user.warehouseTrayTypescanSourceTrayCode(data);
} else if (details.scantype == 2) {
let data = {
trayCode: details.scancode
};
res = await api_user.warehouseTrayTypescanTargetTrayCode(data);
}
if (res.code == 200) {
if (details.scantype == 1) {
details.beilist = res.data;
details.mergeTray = details.scancode;
} else if (details.scantype == 2) {
details.newbeilist = res.data;
details.newmergeTray = details.scancode;
}
} else {
common_vendor.index.showToast({
title: res.msg,
icon: "none"
});
}
console.log(res);
}
function settabberstate(state) {
details.tabberstate = state;
}
function godetails() {
if (!details.newmergeTray) {
common_vendor.index.showToast({
title: "请扫描目标托盘",
icon: "none"
});
return;
}
if (!details.mergeTray) {
common_vendor.index.showToast({
title: "请扫描来源托盘",
icon: "none"
});
return;
}
tip.value.setdetails({
isshow: true,
content: "是否确认合并?",
confirmTxt: "合并",
success: async () => {
let data = {
sourceTrayCode: details.mergeTray,
targetTrayCode: details.newmergeTray
};
let res = await api_user.warehouseTrayTypemergeTray(data);
if (res.code == 200) {
common_vendor.index.showToast({
title: "合并成功",
icon: "none"
});
common_vendor.index.navigateTo({
url: "/pagesHome/pages/MergeTrayDetails/MergeTrayDetails?tray=" + details.newmergeTray
});
} else {
common_vendor.index.showToast({
title: res.msg,
icon: "none"
});
}
tip.value.setdetails({ isshow: false });
},
cancel: () => {
tip.value.setdetails({ isshow: false });
},
close: () => {
tip.value.setdetails({ isshow: false });
}
});
}
const {
beilist,
newbeilist,
newmergeTray,
mergeTray,
scantype,
scancode,
tabberstate
} = common_vendor.toRefs(details);
return (_ctx, _cache) => {
var _a, _b, _c, _d;
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) => setstate(1)),
c: common_vendor.unref(mergeTray),
d: common_vendor.o(($event) => common_vendor.isRef(mergeTray) ? mergeTray.value = $event.detail.value : null),
e: common_vendor.o(($event) => setstate(2)),
f: common_vendor.unref(newmergeTray),
g: common_vendor.o(($event) => common_vendor.isRef(newmergeTray) ? newmergeTray.value = $event.detail.value : null),
h: common_vendor.o(($event) => settabberstate(1)),
i: common_vendor.n(common_vendor.unref(tabberstate) == 1 ? "xz" : ""),
j: common_vendor.o(($event) => settabberstate(2)),
k: common_vendor.n(common_vendor.unref(tabberstate) == 2 ? "xz" : ""),
l: common_vendor.t((common_vendor.unref(tabberstate) == 1 ? (_a = common_vendor.unref(beilist)) == null ? void 0 : _a.totalNum : (_b = common_vendor.unref(newbeilist)) == null ? void 0 : _b.totalNum) || 0),
m: common_vendor.unref(tabberstate) == 1
}, common_vendor.unref(tabberstate) == 1 ? {
n: common_vendor.f(((_c = common_vendor.unref(beilist)) == null ? void 0 : _c.list) || [], (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(index + 1),
b: common_vendor.n(item.isFleeing == "0" ? "xzc" : ""),
c: common_vendor.n(item.isFleeing == "1" ? "xze" : ""),
d: item.orderCode
}, item.orderCode ? {
e: common_vendor.t(item.orderCode)
} : {}, {
f: item.code
}, item.code ? {
g: common_vendor.t(item.code)
} : {}, {
h: item.num
}, item.num ? {
i: common_vendor.t(item.num)
} : {});
})
} : {}, {
o: common_vendor.unref(tabberstate) == 2
}, common_vendor.unref(tabberstate) == 2 ? {
p: common_vendor.f(((_d = common_vendor.unref(newbeilist)) == null ? void 0 : _d.list) || [], (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(index + 1),
b: common_vendor.n(item.isFleeing == "0" ? "xzc" : ""),
c: common_vendor.n(item.isFleeing == "1" ? "xze" : ""),
d: item.orderCode
}, item.orderCode ? {
e: common_vendor.t(item.orderCode)
} : {}, {
f: item.code
}, item.code ? {
g: common_vendor.t(item.code)
} : {}, {
h: item.num
}, item.num ? {
i: common_vendor.t(item.num)
} : {});
})
} : {}, {
q: common_vendor.o(godetails),
r: common_vendor.sr(tip, "4c3e554e-1", {
"k": "tip"
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "F:/物流/logPm/pagesHome/pages/MergeTray/MergeTray.vue"]]);
wx.createPage(MiniProgramPage);