|
@@ -303,53 +303,83 @@
|
|
|
function handleScanCode() {
|
|
|
// 引入原生插件
|
|
|
const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
- // 调用插件的 mpaasScan 方法
|
|
|
- mpaasScanModule.mpaasScan({
|
|
|
- // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
- // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
- scanType: ["qrCode", "barCode"],
|
|
|
- // 是否隐藏相册,默认false不隐藏
|
|
|
- hideAlbum: false,
|
|
|
- },
|
|
|
- (ret) => {
|
|
|
- console.log(ret);
|
|
|
- let vehicleObj = JSON.parse(ret.resp_result);
|
|
|
- if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
- uni.showToast({
|
|
|
- icon: "none",
|
|
|
- title: "请扫载具码",
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- showDaywork({
|
|
|
- carrierId: vehicleObj.carrierId,
|
|
|
- status: 7
|
|
|
- }).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- console.log(response)
|
|
|
- console.log(response.data[0].productionPlanDetailId)
|
|
|
- console.log(store.planDetails.id)
|
|
|
- if (response.data[0].productionPlanDetailId == store.planDetails.id) {
|
|
|
- console.log(response.data)
|
|
|
- lotDialog.value.open(response.data);
|
|
|
+ if (mpaasScanModule) {
|
|
|
+ // 调用插件的 mpaasScan 方法
|
|
|
+ mpaasScanModule.mpaasScan({
|
|
|
+ // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
+ // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
+ scanType: ["qrCode", "barCode"],
|
|
|
+ // 是否隐藏相册,默认false不隐藏
|
|
|
+ hideAlbum: false,
|
|
|
+ },
|
|
|
+ (ret) => {
|
|
|
+ console.log(ret);
|
|
|
+ let vehicleObj = JSON.parse(ret.resp_result);
|
|
|
+ if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ showDaywork({
|
|
|
+ carrierId: vehicleObj.carrierId,
|
|
|
+ status: 7
|
|
|
+ }).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ console.log(response)
|
|
|
+ console.log(response.data[0].productionPlanDetailId)
|
|
|
+ console.log(store.planDetails.id)
|
|
|
+ if (response.data[0].productionPlanDetailId == store.planDetails.id) {
|
|
|
+ console.log(response.data)
|
|
|
+ lotDialog.value.open(response.data);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '该批次不在此计划单内',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: '该批次不在此计划单内',
|
|
|
+ title: response.msg,
|
|
|
duration: 2000
|
|
|
})
|
|
|
}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ // 测试时用
|
|
|
+ showDaywork({
|
|
|
+ carrierId: '1770342949110988804',
|
|
|
+ status: 7
|
|
|
+ }).then(response => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ console.log(response)
|
|
|
+ console.log(response.data[0].productionPlanDetailId)
|
|
|
+ console.log(store.planDetails.id)
|
|
|
+ if (response.data[0].productionPlanDetailId == store.planDetails.id) {
|
|
|
+ console.log(response.data)
|
|
|
+ lotDialog.value.open(response.data);
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: response.msg,
|
|
|
+ title: '该批次不在此计划单内',
|
|
|
duration: 2000
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
- );
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: response.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function handleAddDaywork(data) {
|