|
@@ -601,35 +601,33 @@
|
|
uni.scanCode({
|
|
uni.scanCode({
|
|
onlyFromCamera: true,
|
|
onlyFromCamera: true,
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- if (res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result
|
|
|
|
- .indexOf("&") != -1) {
|
|
|
|
- let subId = "";
|
|
|
|
- let newList = res.result.split("?")[1].split("&")
|
|
|
|
- let list = newList[0].split("=")[1].split("-")
|
|
|
|
- subId = list[0];
|
|
|
|
- if (subId) {
|
|
|
|
- uni.setStorageSync('saoCodeId', subId);
|
|
|
|
|
|
+ let list = res.result.split("?")[1].split("&");
|
|
|
|
+ let codeData = {};
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
+ codeData[item.split("=")[0]] = item.split("=")[1];
|
|
|
|
+ })
|
|
|
|
+ if(codeData.type){
|
|
|
|
+ if(codeData.type != 5){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请扫描实验室二维码',
|
|
|
|
+ icon: "none",
|
|
|
|
+ mask: true,
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ uni.setStorageSync('saoCodeId', codeData.subId);
|
|
if (self.pageType == 1 || self.pageType == 2) { //管理员和检查者
|
|
if (self.pageType == 1 || self.pageType == 2) { //管理员和检查者
|
|
- self.getCheckPlanBySubId(subId)
|
|
|
|
|
|
+ self.getCheckPlanBySubId(codeData.subId)
|
|
} else if (self.pageType == 3) { //整改者
|
|
} else if (self.pageType == 3) { //整改者
|
|
let obj = {
|
|
let obj = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
- subId: subId,
|
|
|
|
|
|
+ subId: codeData.subId,
|
|
}
|
|
}
|
|
self.checkHazardAppList2(obj);
|
|
self.checkHazardAppList2(obj);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '请扫描正确的二维码',
|
|
|
|
- icon: "none",
|
|
|
|
- mask: true,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ }else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请扫描正确的二维码',
|
|
title: '请扫描正确的二维码',
|
|
icon: "none",
|
|
icon: "none",
|