|
@@ -63,77 +63,83 @@
|
|
|
|
|
|
// 扫码
|
|
|
const handleScanCode = () => {
|
|
|
- // 引入原生插件
|
|
|
- const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
- if (mpaasScanModule) {
|
|
|
- // 调用插件的 mpaasScan 方法
|
|
|
- mpaasScanModule.mpaasScan({
|
|
|
- // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
- // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
- scanType: ["qrCode", "barCode"],
|
|
|
- // 是否隐藏相册,默认false不隐藏
|
|
|
- hideAlbum: false,
|
|
|
- },
|
|
|
- (ret) => {
|
|
|
- console.log(ret);
|
|
|
- const result = JSON.parse(ret.resp_result);
|
|
|
- if (!result.carrierId || result.carrierId == "") {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "请扫载具码",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
+ // 引入原生插件
|
|
|
+ const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
+ if (mpaasScanModule) {
|
|
|
+ // 调用插件的 mpaasScan 方法
|
|
|
+ mpaasScanModule.mpaasScan({
|
|
|
+ // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
+ // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
+ scanType: ["qrCode", "barCode"],
|
|
|
+ // 是否隐藏相册,默认false不隐藏
|
|
|
+ hideAlbum: false,
|
|
|
+ },
|
|
|
+ (ret) => {
|
|
|
+ console.log(ret);
|
|
|
+ const result = JSON.parse(ret.resp_result);
|
|
|
+ if (!result.carrierId || result.carrierId == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- /************************ 查询是否一批多箱 ************************/
|
|
|
- getCarrierInfo(result).then(resqust => {
|
|
|
- if (resqust.code == 200) {
|
|
|
- //返回数据大于一条,跳转选择批次弹窗
|
|
|
- if (resqust.data.length > 1) {
|
|
|
- query.value = result;
|
|
|
- console.log("查询箱号信息", resqust)
|
|
|
- selectProcessInspection.value.open(resqust.data)
|
|
|
- } else {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- });
|
|
|
- // 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
|
|
|
- // 需要定义一个请求方法, 从后端获取
|
|
|
- getLotInfo(result).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- lot.value = res.data;
|
|
|
- lot.value.carrierCode = result.carrierCode
|
|
|
- carrierCode.value = result.carrierCode;
|
|
|
- console.log("res", res);
|
|
|
- uni.hideLoading();
|
|
|
- } else {
|
|
|
+ /************************ 查询是否一批多箱 ************************/
|
|
|
+ getCarrierInfo(result).then(resqust => {
|
|
|
+ if (resqust.code == 200) {
|
|
|
+ //返回数据大于一条,跳转选择批次弹窗
|
|
|
+ if (resqust.data.length > 1) {
|
|
|
+ query.value = result;
|
|
|
+ console.log("查询箱号信息", resqust)
|
|
|
+ selectProcessInspection.value.open(resqust.data)
|
|
|
+ } else {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ // 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
|
|
|
+ // 需要定义一个请求方法, 从后端获取
|
|
|
+ getLotInfo(result).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ lot.value = res.data;
|
|
|
+ lot.value.carrierCode = result.carrierCode
|
|
|
+ carrierCode.value = result.carrierCode;
|
|
|
+ console.log("res", res);
|
|
|
+ uni.hideLoading();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: res.msg,
|
|
|
+ title: err.message,
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: err.message,
|
|
|
- duration: 2000
|
|
|
})
|
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
}
|
|
|
- } else {
|
|
|
+ }).catch(err => {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: res.msg,
|
|
|
+ title: err.message,
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
|
|
|
- }
|
|
|
- );
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|