|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
|
|
const api_user = require("../../../api/user.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_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: {},
|
|
|
|
renderList: []
|
|
|
|
});
|
|
|
|
common_vendor.onLoad((op) => {
|
|
|
|
common_vendor.index.$on("scancodedate", function(code) {
|
|
|
|
if (code) {
|
|
|
|
details.scancode = code;
|
|
|
|
scandata();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
common_vendor.onPullDownRefresh(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
details.scantype = 1;
|
|
|
|
details.beilist = {};
|
|
|
|
details.newbeilist = {};
|
|
|
|
details.scancode = "";
|
|
|
|
details.renderList = [];
|
|
|
|
details.mergeTray = "";
|
|
|
|
details.newmergeTray = "";
|
|
|
|
common_vendor.index.stopPullDownRefresh();
|
|
|
|
}, 1e3);
|
|
|
|
});
|
|
|
|
function setstate(state) {
|
|
|
|
details.scantype = state;
|
|
|
|
}
|
|
|
|
function goorderdetail(item) {
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/orderDetails/orderDetails?orderCode=" + item.orderCode
|
|
|
|
});
|
|
|
|
}
|
|
|
|
async function scandata() {
|
|
|
|
let res = null;
|
|
|
|
if (details.scantype == 1) {
|
|
|
|
if (details.mergeTray) {
|
|
|
|
details.scancode = details.mergeTray;
|
|
|
|
}
|
|
|
|
let data = {
|
|
|
|
trayCode: details.scancode
|
|
|
|
};
|
|
|
|
res = await api_user.warehouseTrayTypescanSourceTrayCode(data);
|
|
|
|
} else if (details.scantype == 2) {
|
|
|
|
if (details.newmergeTray) {
|
|
|
|
details.scancode = details.newmergeTray;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
details.scantype = 2;
|
|
|
|
} else if (details.scantype == 2) {
|
|
|
|
details.newbeilist = res.data;
|
|
|
|
details.newmergeTray = details.scancode;
|
|
|
|
details.scantype = 1;
|
|
|
|
}
|
|
|
|
details.renderList = details.tabberstate === 1 ? details.beilist.list : details.newbeilist.list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function settabberstate(state) {
|
|
|
|
details.tabberstate = state;
|
|
|
|
if (state === 1 && details.beilist.list)
|
|
|
|
details.renderList = details.beilist.list;
|
|
|
|
else if (state === 2 && details.newbeilist.list)
|
|
|
|
details.renderList = details.newbeilist.list;
|
|
|
|
else
|
|
|
|
details.renderList = [];
|
|
|
|
}
|
|
|
|
function godetails() {
|
|
|
|
if (!details.newmergeTray) {
|
|
|
|
utils_utils.utils.ttsspke("请扫描解绑托盘");
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "请扫描解绑托盘",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!details.mergeTray) {
|
|
|
|
utils_utils.utils.ttsspke("请扫描合并托盘");
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "请扫描合并托盘",
|
|
|
|
icon: "none"
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
tip.value.setdetails({
|
|
|
|
isshow: true,
|
|
|
|
content: "是否确认合并?",
|
|
|
|
confirmTxt: "合并",
|
|
|
|
success: async () => {
|
|
|
|
common_vendor.index.showLoading({
|
|
|
|
mask: true,
|
|
|
|
title: "合并中"
|
|
|
|
});
|
|
|
|
let data = {
|
|
|
|
sourceTrayCode: details.mergeTray,
|
|
|
|
targetTrayCode: details.newmergeTray
|
|
|
|
};
|
|
|
|
let res = await api_user.warehouseTrayTypemergeTray(data);
|
|
|
|
common_vendor.index.hideLoading();
|
|
|
|
if (res.code == 200) {
|
|
|
|
utils_utils.utils.ttsspke("合托成功");
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
url: "/pagesHome/pages/MergeTrayDetails/MergeTrayDetails?tray=" + details.newmergeTray
|
|
|
|
});
|
|
|
|
}
|
|
|
|
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,
|
|
|
|
renderList
|
|
|
|
} = common_vendor.toRefs(details);
|
|
|
|
return (_ctx, _cache) => {
|
|
|
|
var _a, _b;
|
|
|
|
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(scandata),
|
|
|
|
f: common_vendor.o(($event) => setstate(2)),
|
|
|
|
g: common_vendor.unref(newmergeTray),
|
|
|
|
h: common_vendor.o(($event) => common_vendor.isRef(newmergeTray) ? newmergeTray.value = $event.detail.value : null),
|
|
|
|
i: common_vendor.o(scandata),
|
|
|
|
j: common_vendor.o(($event) => settabberstate(1)),
|
|
|
|
k: common_vendor.n(common_vendor.unref(tabberstate) == 1 ? "xz" : ""),
|
|
|
|
l: common_vendor.o(($event) => settabberstate(2)),
|
|
|
|
m: common_vendor.n(common_vendor.unref(tabberstate) == 2 ? "xz" : ""),
|
|
|
|
n: common_vendor.t((common_vendor.unref(tabberstate) == 1 ? ((_a = common_vendor.unref(beilist)) == null ? void 0 : _a.totalNum) || common_vendor.unref(beilist).stockNum : ((_b = common_vendor.unref(newbeilist)) == null ? void 0 : _b.totalNum) || common_vendor.unref(beilist).stockNum) || 0),
|
|
|
|
o: common_vendor.unref(renderList)
|
|
|
|
}, common_vendor.unref(renderList) ? {
|
|
|
|
p: common_vendor.f(common_vendor.unref(renderList), (item, index, i0) => {
|
|
|
|
return common_vendor.e({
|
|
|
|
a: item.goodsType === 1
|
|
|
|
}, item.goodsType === 1 ? {
|
|
|
|
b: common_vendor.t(item.serviceNum),
|
|
|
|
c: common_vendor.t(item.orderCode),
|
|
|
|
d: common_vendor.o(($event) => goorderdetail(item)),
|
|
|
|
e: common_vendor.t(item.totalNum - item.shelfNum)
|
|
|
|
} : {}, {
|
|
|
|
f: item.goodsType === 2
|
|
|
|
}, item.goodsType === 2 ? {
|
|
|
|
g: common_vendor.t(item.waybillNo),
|
|
|
|
h: common_vendor.t(item.orderCode),
|
|
|
|
i: common_vendor.t(item.totalNum - item.shelfNum)
|
|
|
|
} : {}, {
|
|
|
|
j: item.goodsType === 3
|
|
|
|
}, item.goodsType === 3 ? {
|
|
|
|
k: common_vendor.t(item.materialCode),
|
|
|
|
l: common_vendor.t(item.materialName),
|
|
|
|
m: common_vendor.t(item.orderCode),
|
|
|
|
n: common_vendor.t(item.marketName),
|
|
|
|
o: common_vendor.t(item.incomingBatch),
|
|
|
|
p: common_vendor.t(item.totalNum - item.shelfNum)
|
|
|
|
} : {}, {
|
|
|
|
q: common_vendor.t(item.totalNum),
|
|
|
|
r: common_vendor.t(item.shelfNum)
|
|
|
|
});
|
|
|
|
})
|
|
|
|
} : {}, {
|
|
|
|
q: common_vendor.o(godetails),
|
|
|
|
r: common_vendor.sr(tip, "b653fa3c-1", {
|
|
|
|
"k": "tip"
|
|
|
|
})
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/worksp/logpm/pagesHome/pages/MergeTray/MergeTray.vue"]]);
|
|
|
|
wx.createPage(MiniProgramPage);
|