|
@@ -1,15 +1,15 @@
|
|
|
<template>
|
|
|
- <view class="shade">
|
|
|
+ <view class="shade" v-if="pageType == 1">
|
|
|
<view class="null-box" @click="dialogClose()"></view>
|
|
|
<view class="shade_n">
|
|
|
<view class="title">
|
|
|
- <view>{{dialogTtile}}</view>
|
|
|
+ <view>请选择实验室</view>
|
|
|
</view>
|
|
|
<view class="batch">
|
|
|
<view class="batch-li" @click="batchClick(item)" v-for="(item,index) in batchList">
|
|
|
<view class="batch-li-l">
|
|
|
- <text v-if="dialogStatus==0">{{item.planTitle}}</text>
|
|
|
- <text v-if="dialogStatus==1">{{item.checkName}}</text>
|
|
|
+ <text>{{item.planTitle}}-{{item.checkName}}</text>
|
|
|
+ <text>{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</text>
|
|
|
</view>
|
|
|
<view class="batch-li-r">
|
|
|
<img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
|
|
@@ -22,9 +22,9 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- securityAppCheckPlanAppTitleList,
|
|
|
securityAppCheckManageList,
|
|
|
securityAppCheckSetOptionList,
|
|
|
+ securityAppCheckPlanScanCode,
|
|
|
} from '@/pages_safetyCheck/api/index.js'
|
|
|
import {
|
|
|
config
|
|
@@ -36,24 +36,10 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- baseUrl: config.base_url,
|
|
|
+ pageType:0,
|
|
|
newData:{},
|
|
|
- dialogTtile: '',
|
|
|
- dialogStatus: 0, //0计划 1批次 2实验室
|
|
|
batchList: [],
|
|
|
- queryParams: {
|
|
|
- page: 1,
|
|
|
- pageSize: 100,
|
|
|
- checkCategory: '', //1校院巡查 2学院自查
|
|
|
- subId: '',
|
|
|
- },
|
|
|
- checkPlanSetVoList: null,
|
|
|
- form: {},
|
|
|
- OptionListArr:[],//临时存储检查项
|
|
|
- planId:'',
|
|
|
- planTitle:'',
|
|
|
- checkTypeName:'',
|
|
|
- crossCheck:'',
|
|
|
+ checkCategory: null,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -62,251 +48,66 @@
|
|
|
mounted() {
|
|
|
if(uni.getStorageSync('identityData')){
|
|
|
if(uni.getStorageSync('identityData').type=='collegeAdmin'){
|
|
|
- this.queryParams.checkCategory=2
|
|
|
+ this.checkCategory=2
|
|
|
}else if(uni.getStorageSync('identityData').type=='schoolAdmin'){
|
|
|
- this.queryParams.checkCategory=1
|
|
|
+ this.checkCategory=1
|
|
|
}
|
|
|
}
|
|
|
this.$set(this, 'newData', this.subjectData);
|
|
|
- console.log(this.subjectData)
|
|
|
- this.$set(this.queryParams, 'subId', this.subjectData.subId);
|
|
|
- this.securityAppCheckPlanAppTitleList();
|
|
|
+ this.securityAppCheckPlanScanCode();
|
|
|
},
|
|
|
methods: {
|
|
|
dialogClose() {
|
|
|
- this.dialogStatus = 0;
|
|
|
this.$parent.goPage('securityCheck',false);
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- //十六进制颜色值和RGB格式转换
|
|
|
- hexToRgb(hex, opacity = 1) {
|
|
|
- // 去除#号
|
|
|
- var color = hex.replace("#", "");
|
|
|
- // 分割成红、绿、蓝三部分的16进制字符串
|
|
|
- var red = parseInt(color.substring(0, 2), 16);
|
|
|
- var green = parseInt(color.substring(2, 4), 16);
|
|
|
- var blue = parseInt(color.substring(4, 6), 16);
|
|
|
- return `RGB(${red}, ${green}, ${blue},${opacity})`;
|
|
|
},
|
|
|
batchClick(row) {
|
|
|
- let self = this;
|
|
|
- if (this.dialogStatus == 0) { //计划点击
|
|
|
- this.$set(this, 'planId', row.planId);
|
|
|
- this.$set(this, 'planTitle', row.planTitle);
|
|
|
- this.$set(this, 'checkTypeName', row.checkTypeName);
|
|
|
- this.$set(this, 'crossCheck', row.crossCheck);
|
|
|
- if (row.checkPlanSetVoList.length == 1) {
|
|
|
- //如果只有1个检查批次不弹窗
|
|
|
- let planSetId = row.checkPlanSetVoList[0].planSetId
|
|
|
- self.checkPlanSetVoList = row.checkPlanSetVoList[0];
|
|
|
- self.securityAppCheckManageList(planSetId)
|
|
|
- } else if (row.checkPlanSetVoList.length == 0) {
|
|
|
- this.dialogStatus = 0;
|
|
|
- this.$parent.goPage('securityCheck',false);
|
|
|
- uni.showToast({
|
|
|
- title: '该实验室暂无检查计划!',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return
|
|
|
- } else {
|
|
|
- this.$set(this, 'batchList', row.checkPlanSetVoList);
|
|
|
- this.dialogStatus = 1;
|
|
|
- this.dialogTtile = '批次';
|
|
|
- this.$parent.goPage('securityCheck',true);
|
|
|
-
|
|
|
- }
|
|
|
- } else if (this.dialogStatus == 1) { //批次点击
|
|
|
- /* this.dialogStatus = 2;
|
|
|
- this.dialogTtile = '实验室'; */
|
|
|
- let planSetId = row.planSetId
|
|
|
- self.checkPlanSetVoList = row;
|
|
|
- this.securityAppCheckManageList(planSetId)
|
|
|
- }
|
|
|
+ let infoData = row;
|
|
|
+ infoData.pageType = 0;
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
|
|
|
+ JSON.stringify(infoData))
|
|
|
+ });
|
|
|
},
|
|
|
//查询计划
|
|
|
- async securityAppCheckPlanAppTitleList() {
|
|
|
- this.queryParams.subId = this.newData.subId;
|
|
|
- this.queryParams.checkStatus = 0;
|
|
|
- let self = this;
|
|
|
- const {
|
|
|
- data
|
|
|
- } = await securityAppCheckPlanAppTitleList(this.queryParams);
|
|
|
- if (data.code == 200) {
|
|
|
- //循环过滤掉当前计划中批次中已经检查完成的
|
|
|
- data.data.records.forEach(function(item, index) {
|
|
|
- let list = [];
|
|
|
- item.checkPlanSetVoList.forEach(function(item2) {
|
|
|
- if (item2.checkSetProgress != 100) {
|
|
|
- list.push(item2)
|
|
|
- }
|
|
|
- })
|
|
|
- item.checkPlanSetVoList = list
|
|
|
- })
|
|
|
- let list2 = []
|
|
|
- list2 = data.data.records.filter(function(item) {
|
|
|
- return item.checkPlanSetVoList.length != 0
|
|
|
- });
|
|
|
- data.data.records = list2
|
|
|
-
|
|
|
- if (data.data.records.length == 1) { //一个计划
|
|
|
- this.$set(this, 'planId', data.data.records[0].planId);
|
|
|
- this.$set(this, 'planTitle', data.data.records[0].planTitle);
|
|
|
- this.$set(this, 'checkTypeName', data.data.records[0].checkTypeName);
|
|
|
- this.$set(this, 'crossCheck', data.data.records[0].crossCheck);
|
|
|
- if (data.data.records[0].checkPlanSetVoList.length == 1) { //1个批次
|
|
|
- let planSetId = data.data.records[0]
|
|
|
- if (data.data.records[0].checkPlanSetVoList[0]) { //一个批次
|
|
|
- let planSetId = data.data.records[0].checkPlanSetVoList[0].planSetId
|
|
|
- self.checkPlanSetVoList = data.data.records[0].checkPlanSetVoList[0];
|
|
|
- self.securityAppCheckManageList(planSetId)
|
|
|
- }
|
|
|
- } else if (data.data.records[0].checkPlanSetVoList.length == 0) {
|
|
|
- this.dialogStatus = 0;
|
|
|
- this.$parent.goPage('securityCheck',false);
|
|
|
- uni.showToast({
|
|
|
- title: '该实验室暂无检查计划!',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return
|
|
|
- } else { //多个批次
|
|
|
- this.dialogStatus = 1;
|
|
|
- this.batchList = data.data.records[0].checkPlanSetVoList;
|
|
|
- this.$parent.goPage('securityCheck',true);
|
|
|
- this.dialogTtile = '批次';
|
|
|
- }
|
|
|
-
|
|
|
- } else if (data.data.records.length==0) {
|
|
|
- this.dialogStatus = 0;
|
|
|
- this.$parent.goPage('securityCheck',false);
|
|
|
- uni.showToast({
|
|
|
- title: '该实验室暂无检查计划!',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return
|
|
|
- } else { //多个计划
|
|
|
- this.batchList = data.data.records;
|
|
|
- this.$parent.goPage('securityCheck',true);
|
|
|
- this.dialogTtile = '计划标题';
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- //检查任务-在此结果里对比实验室Id判断是否有实验室
|
|
|
- async securityAppCheckManageList(planSetId) {
|
|
|
- let self = this;
|
|
|
+ async securityAppCheckPlanScanCode() {
|
|
|
+ console.log('planSetId',this.newData)
|
|
|
let obj = {
|
|
|
- page: 1,
|
|
|
- pageSize: 20,
|
|
|
- planSetId: planSetId,
|
|
|
- subId: self.newData.subId,
|
|
|
+ subId:this.newData.subId,
|
|
|
+ checkCategory:this.checkCategory,
|
|
|
+ };
|
|
|
+ if(this.newData.planSetId){
|
|
|
+ obj.planSetId = this.newData.planSetId;
|
|
|
}
|
|
|
const {
|
|
|
data
|
|
|
- } = await securityAppCheckManageList(obj);
|
|
|
+ } = await securityAppCheckPlanScanCode(obj);
|
|
|
if (data.code == 200) {
|
|
|
- //this.shadeList = data.data.records;
|
|
|
- if (data.data.records[0]) {
|
|
|
- let manageId = data.data.records[0].manageId;
|
|
|
- self.securityAppCheckSetOptionList(data.data.records[0],0);
|
|
|
- } else {
|
|
|
- self.dialogStatus = 0;
|
|
|
- this.$parent.goPage('securityCheck',false);
|
|
|
+ if(data.data[0]){
|
|
|
+ if(data.data[1]){
|
|
|
+ //多个
|
|
|
+ this.$set(this,'batchList',data.data);
|
|
|
+ this.$set(this,'pageType',1);
|
|
|
+ }else{
|
|
|
+ //单个
|
|
|
+ let infoData = data.data[0];
|
|
|
+ infoData.pageType = 0;
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' + encodeURIComponent(
|
|
|
+ JSON.stringify(infoData))
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //没有
|
|
|
uni.showToast({
|
|
|
title: '该实验室暂无检查计划!',
|
|
|
icon: "none",
|
|
|
mask: true,
|
|
|
duration: 2000
|
|
|
});
|
|
|
- return
|
|
|
+ this.dialogClose();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
- //查询检查项
|
|
|
- async securityAppCheckSetOptionList(item,checkStatus) {
|
|
|
- let self = this;
|
|
|
- let upData = item;
|
|
|
- let obj = {
|
|
|
- page: 1,
|
|
|
- pageSize: 20,
|
|
|
- checkStatus: checkStatus,
|
|
|
- manageId: upData.manageId,
|
|
|
- }
|
|
|
- const {
|
|
|
- data
|
|
|
- } = await securityAppCheckSetOptionList(obj);
|
|
|
- if (data.code == 200 && checkStatus==0) {//先查询待检查数据
|
|
|
- if (data.data.records[0]) {
|
|
|
- let infoData = {};
|
|
|
- infoData.pageType = 0;
|
|
|
- infoData.itemsStatus = 0;
|
|
|
- infoData.subName = upData.subName;
|
|
|
- infoData.checkPlanSetVoList = self.checkPlanSetVoList;
|
|
|
- infoData.planId = self.planId;
|
|
|
- infoData.planTitle = self.planTitle;
|
|
|
- infoData.checkTypeName = self.checkTypeName;
|
|
|
- infoData.crossCheck = self.crossCheck;
|
|
|
-
|
|
|
- infoData.roomNum = upData.roomNum;
|
|
|
- infoData.subId = data.data.records[0].subId;
|
|
|
- infoData.manageId = data.data.records[0].manageId;
|
|
|
- infoData.setOptionId = data.data.records[0].setOptionId;
|
|
|
- infoData.hazardCheckPro = data.data.records[0].hazardCheckPro;
|
|
|
- infoData.checkCategory = data.data.records[0].checkCategory;
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
|
|
|
- encodeURIComponent(
|
|
|
- JSON
|
|
|
- .stringify(infoData))
|
|
|
- });
|
|
|
- } else {
|
|
|
- self.securityAppCheckSetOptionList(item,2);
|
|
|
-
|
|
|
- }
|
|
|
- }else if (data.code == 200 && checkStatus==2) {//查询检查中数据
|
|
|
- if (data.data.records[0]) {
|
|
|
- let infoData = {};
|
|
|
- infoData.pageType = 0;
|
|
|
- infoData.itemsStatus = 0;
|
|
|
- infoData.subName = upData.subName;
|
|
|
- infoData.checkPlanSetVoList = self.checkPlanSetVoList;
|
|
|
- infoData.planId = self.planId;
|
|
|
- infoData.planTitle = self.planTitle;
|
|
|
- infoData.checkTypeName = self.checkTypeName;
|
|
|
- infoData.crossCheck = self.crossCheck;
|
|
|
- infoData.roomNum = upData.roomNum;
|
|
|
- infoData.subId = data.data.records[0].subId;
|
|
|
- infoData.manageId = data.data.records[0].manageId;
|
|
|
- infoData.setOptionId = data.data.records[0].setOptionId;
|
|
|
- infoData.hazardCheckPro = data.data.records[0].hazardCheckPro;
|
|
|
- infoData.checkCategory = data.data.records[0].checkCategory;
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages_safetyCheck/views/inspectManage/conductInspections?infoData=' +
|
|
|
- encodeURIComponent(
|
|
|
- JSON
|
|
|
- .stringify(infoData))
|
|
|
- });
|
|
|
- } else {
|
|
|
- self.dialogStatus = 0;
|
|
|
- this.$parent.goPage('securityCheck',false);
|
|
|
- uni.showToast({
|
|
|
- title: '该实验室暂无检查工作!',
|
|
|
- icon: "none",
|
|
|
- mask: true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
onHide() {
|
|
|
|