123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <template>
- <view class="shade">
- <view class="null-box" @click="dialogClose()"></view>
- <view class="shade_n">
- <view class="title">
- <view>{{dialogTtile}}</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>
- </view>
- <view class="batch-li-r">
- <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- securityAppCheckPlanAppTitleList,
- securityAppCheckManageList,
- securityAppCheckSetOptionList,
- } from '@/pages_safetyCheck/api/index.js'
- import {
- config
- } from '@/api/request/config.js'
- export default {
- name: "iotControl",
- props: {
- subjectData: {},
- },
- data() {
- return {
- baseUrl: config.base_url,
- 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:'',
- }
- },
- created() {
-
- },
- mounted() {
- if(uni.getStorageSync('identityData')){
- if(uni.getStorageSync('identityData').type=='collegeAdmin'){
- this.queryParams.checkCategory=2
- }else if(uni.getStorageSync('identityData').type=='schoolAdmin'){
- this.queryParams.checkCategory=1
- }
- }
- this.$set(this, 'newData', this.subjectData);
- console.log(this.subjectData)
- this.$set(this.queryParams, 'subId', this.subjectData.subId);
- this.securityAppCheckPlanAppTitleList();
- },
- 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)
- }
- },
- //查询计划
- 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;
- let obj = {
- page: 1,
- pageSize: 20,
- planSetId: planSetId,
- subId: self.newData.subId,
- }
- const {
- data
- } = await securityAppCheckManageList(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);
- uni.showToast({
- title: '该实验室暂无检查计划!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
-
- }
- },
- //查询检查项
- 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() {
-
- },
- beforeDestroy() {
-
- },
- }
- </script>
- <style lang="stylus" scoped>
- .shade {
- height: 100%;
- width: 100%;
- position: fixed;
- display: flex;
- flex-direction: column;
- z-index: 200;
- background: rgba(0, 0, 0, 0.2);
- top: 0;
-
- .null-box {
- flex: 1;
- }
-
- .shade_n {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 750rpx;
- height: 466rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 0rpx 0rpx;
- overflow-y: auto;
-
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 50rpx 0 284rpx;
- box-sizing: border-box;
- border-bottom: 1rpx solid #E0E0E0;
-
- >view {
- font-size: 30rpx;
- color: #3D3D3D;
- line-height: 90rpx;
- text-align: left;
- }
-
- >img {
- width: 24rpx;
- height: 12rpx;
- }
- }
-
- .batch {
- padding: 0 30rpx;
- box-sizing: border-box;
-
- .batch-li {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #E0E0E0;
- padding: 20rpx 0 16rpx 0rpx;
- box-sizing: border-box;
-
- .batch-li-l {
- >text:nth-of-type(1) {
- display: block;
- font-size: 30rpx;
- color: #333333;
- line-height: 42rpx;
- text-align: left;
- }
-
- >text:nth-of-type(2) {
- display: block;
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- margin-top: 6rpx;
- }
- }
-
- .batch-li-r {
- font-size: 28rpx;
- color: #666666;
- line-height: 39rpx;
- text-align: left;
- display: flex;
- justify-content: flex-start;
- align-items: center;
-
- >img {
- width: 24rpx;
- height: 24rpx;
- margin-left: 9rpx;
- }
- }
- }
- }
- }
- }
- </style>
|