1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492 |
- <!-- 安全检查-开展检查 -->
- <template>
- <view class="examine">
- <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
- <view class="basics">
- <view class="basics_li">
- <view class="basics_li_l">实验室</view>
- <view class="basics_li_r lab_r" :class="addDisabledType?'addDisabled':''">
- <input class="picker-text" @click="popupClick(1)" type="text" disabled
- v-model="form.subjectName" placeholder="请选择实验室"
- placeholder-style="font-size: 30rpx;color:#333;">
- <view class="img-box" @click.stop="saoCode" v-if="!addDisabledType">
- <img src="@/pages_safetyExamine/images/icon_aqjc_sm.png">
- </view>
- </view>
- </view>
- <view class="basics_li">
- <view class="basics_li_l">学院</view>
- <picker disabled @change="collegeChange" :value="collegeIndex" :range="collegeArray"
- class="scope_r">
- <view class="basics_li_r college_r" style="background-color: #F5F5F5 ;">
- <view>{{form.collegeName?form.collegeName:'未选择实验室'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- </view>
- <view class="basics_li">
- <view class="basics_li_l">楼栋</view>
- <picker @change="buildingChange" disabled="" :value="collegeIndex" :range="buildingArray"
- class="scope_r">
- <view class="basics_li_r college_r" style="background-color: #F5F5F5 ;">
- <view>{{form.buildName?form.buildName:'未选择实验室'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- </view>
- <view class="basics_li">
- <view class="basics_li_l">计划标题</view>
- <picker v-if="isCustom" @change="planChange" :disabled='addDisabledType' :value="planIndex"
- :range="planArray" class="scope_r">
- <view class="basics_li_r college_r" :class="addDisabledType?'addDisabled':''">
- <view>{{form.title?form.title:'选择计划标题'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- <view v-if="!isCustom" class="basics_li_r college_r">
- <input type="text" v-model="form.title" maxlength="30" placeholder="输入计划标题">
- </view>
- </view>
- <view class="basics_li" style="justify-content: flex-end;" v-if='planArray[0]&&!addDisabledType'>
- <view class="custom" @click="customFun">{{isCustom?'自定义输入':'选择计划'}}</view>
- </view>
- <view class="basics_li">
- <view class="basics_li_l">检查组织</view>
- <picker @change="categoryChange" :value="categoryIndex" disabled :range="categoryArray"
- class="scope_r">
- <view class="basics_li_r college_r" style="background-color: #F5F5F5 ;">
- <view>{{form.checkType?(form.checkType==1?'校院巡查':'实验室自查'):'选择检查组织'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- </view>
- <view class="basics_li">
- <view class="basics_li_l">检查类型</view>
- <picker @change="specialChange" :value="specialIndex" :range="specialArray" :disabled="isCustom"
- class="scope_r">
- <view class="basics_li_r college_r" :class="isCustom?'addDisabled':''">
- <view>{{form.checkCategory?(form.checkCategory==1?'综合检查':'专项检查'):'选择检查类型'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- </view>
- <view class="period">
- <view class="period_l">计划周期</view>
- <view class="period_r" :class="isCustom?'addDisabled':''">
- <picker mode="date" @change="startChange(form,$event)" :disabled="isCustom">
- <input class="picker-text" disabled type="text" v-model="form.cycleStartTime"
- placeholder="开始时间">
- </picker>
- <view>至</view>
- <picker mode="date" @change="endChange(form,$event)" :disabled="isCustom">
- <input class="picker-text2" disabled type="text" v-model="form.cycleEndTime"
- placeholder="结束时间">
- </picker>
- </view>
- </view>
- </view>
- <view class="attachment" v-if="form.isAttachment==1">
- <view class="attachment_t">
- <text>材料附件</text>
- <text>点击文件标题查看</text>
- </view>
- <view class="attachment_li" v-for="(item,index) in attachmentList" :key="index">
- <img src="@/pages_safetyExamine/images/icon_djc_wj.png" />
- <text @click="attachmentPreview(item)">{{item.fileName}}</text>
- </view>
- </view>
- <view class="inspect" v-if='form.checkCategory==1 || (form.checkResult==0 || form.checkCategory==2)'>
- <view class="inspect_li" v-if='form.checkCategory==1'>
- <view class="inspect_li_l">检查结果</view>
- <picker @change="resultChange" :value="resultIndex" :range="resultArray" class="scope_r">
- <view class="inspect_li_r college_r">
- <view>{{form.checkResult==1?'符合':'不符合'}}</view>
- <img src="@/pages_safetyExamine/images/icon_06.png">
- </view>
- </picker>
- </view>
- <view class="inspect_li" v-if="form.checkResult==0 || form.checkCategory==2">
- <view class="inspect_li_l">整改日期</view>
- <picker mode="date" @change="rectifyDeadline(form,$event)" :start="currentDate">
- <view class="inspect_li_r date_r">
- <input disabled class="picker-text" type="text" v-model="form.rectifyDeadline"
- placeholder="请选择日期" placeholder-style="font-size: 30rpx;color:#333;">
- <img src="@/pages_safetyExamine/images/icon_rl.png">
- </view>
- </picker>
- </view>
- <view class="inspect_li" v-if="form.checkResult==0 || form.checkCategory==2">
- <view class="inspect_li_l">整改通知</view>
- <view class="inform_r">
- <view v-for="(item,index) in informArray" :key="index" @click="tabClick(index)"><text
- :class="informIndex==index?'checked':'inform_r_l' "></text><text
- class="inform_r_r">{{item}}</text></view>
- </view>
- </view>
- </view>
- </scroll-view>
- <!-- 房间选择弹出层 -->
- <view class="popup-max-box" v-if="popupType">
- <view class="popup-null" @click="popupClick(2)"></view>
- <view class="popup-big-box">
- <view class="popup-input-box">
- <input type="text" maxlength="10" v-model="room" placeholder="请输入关键字">
- <view @click="buildBySub">搜索</view>
- </view>
- <view class="popup-for-max-box">
- <view class="popup-for-null" v-if="!roomList[0]">暂无数据</view>
- <view class="popup-for-box" v-for="(item,index) in roomList" :key="index">
- <view class="name-p">{{item.subName}}</view>
- <view class="button-p" @click="popupClickItem(item)">确定</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 检查名称弹窗 -->
- <uni-popup ref="popup" class="inspect_name" type="bottom">
- <view class="popup-content">
- <view class="inspect_name_t">
- <input type="text" v-model="customTitle" maxlength="30" placeholder="请输入计划标题" />
- </view>
- <view class="inspect_name_b">
- <text @click="titleCancel()">取消</text>
- <text @click="titleConfirm()">确定</text>
- </view>
- </view>
- </uni-popup>
- <view class="bottom_btn" @click="handleClick('nextStep')" v-if="form.checkResult==0 || form.checkCategory==2">
- 下一步</view>
- <view class="bottom_btn" @click="handleClick('submitForm')" v-if="form.checkResult==1 && form.checkCategory==1">
- 提交</view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {
- getCheckPlanBySubId,
- checkManageUpdate,
- checkManageAdd,
- findCheckManage,
- findByPlanIdAttachment,
- subjectFindSubjectInfo,
- systemDeptDropList,
- laboratoryBigViewGetBuildByBigView,
- laboratorySubRelInfoGetListByFloor,
- laboratorySubRelInfoGetRelList
- } from '@/pages_safetyExamine/api/index.js'
- export default {
- name: "rectifyList",
- components: {
- },
- data() {
- return {
- pageType: 0,
- //列表请求参数
- getData: {
- pageNum: 1,
- pageSize: 20,
- },
- customTitle: '',
- attachmentList: [], //材料附件
- form: {
- id: '',
- checkPlanId: '',
- manageStatus: '', //保存1 提交2
- subIds: '', //实验室
- subjectName: '',
- title: '', //计划标题
- deptId: '', //学院
- collegeName: '',
- buildId: '', //楼栋
- buildName: '',
- roomNumber: '', //房间号
- checkType: 2, // 检查组织(1校院巡查 2实验室自查)
- checkResult: 1, // 检查结果 0不符合 1符合
- rectifyDeadline: '', //整改期限
- rectifyNotice: '1', //整改通知(1整改告知书 2整改通知书)
- cycleStartTime: '',
- cycleEndTime: '',
- checkCategory: '', //检查类型 1综合检查 2专项检查
- checkHazardDtoList: [{
- voiceRemark: [], //语音备忘存储
- hazardLevel: 2, //隐患等级
- hazardLevelName: '一般隐患', //隐患等级
- hazardCheckCode: '', //检查项目code序号
- hazardCheckName: '', //检查项目名称
- hazardCheckPro: '', //最后一级的id
- hazardCheckPoint: '', // 检查要点
- hazardDescribe: '', //隐患描述
- uploadDtoList: [], //隐患照片
- }],
- checkHazardInfoVoList: [],
- },
- collegeIndex: 0,
- collegeArray: [],
- categoryIndex: 0,
- categoryArray: ['校院巡查', '实验室自查'],
- planIndex: 0,
- specialIndex: 0,
- specialArray: ['综合检查', '专项检查'],
- planArray: [],
- planList: [],
- resultIndex: 0,
- resultArray: ['符合', '不符合'],
- informIndex: 0,
- informArray: ['整改告知书', '整改通知书'],
- //房间弹层 状态
- popupType: false,
- //房间搜索字段
- room: "",
- roomList: [],
- item: {},
- isCustom: false,
- buildingArray: [],
- buildingList: [],
- //扫一扫进入
- laboratoryList: [],
- currentDate: '', //当前日期
- //
- addDisabledType: false
- }
- },
- onLoad(option) {
- //通过微信扫一扫进入
- if (option.q) {
- console.log('外部扫一扫')
- let text = decodeURIComponent(option.q)
- let codeId = "";
- let newList = text.split("?")[1].split("&")
- let list = newList[0].split("=")[1].split("-")
- codeId = list[0];
- uni.showToast({
- title: codeId,
- icon: "none",
- mask: true,
- duration: 2000
- });
- this.form.subIds = codeId
- this.getCheckPlanBySubId(codeId)
- this.getByIdLaboratoryList();
- }
- if (option.id) {
- console.log('开始/编辑')
- this.findCheckManage('add', option.id)
- }
- if (option.form) {
- console.log('子页面返回')
- this.form = JSON.parse(decodeURIComponent(option.form));
- this.isCustom = this.form.isCustom;
- if (this.form.isAttachment == 1) { //0没有附件 1有附件
- this.findByPlanIdAttachment()
- }
- }
- //通过实验室id查询计划
- if (option.subId) {
- console.log('内部扫一扫')
- this.form.subIds = option.subId
- this.getCheckPlanBySubId(option.subId)
- this.getByIdLaboratoryList();
- }
- },
- onShow() {
- this.buildFloorGetlist()
- },
- mounted() {
- //获取当前日期
- this.currentDate = this.getNowFormatDate()
- this.listDepartments();
- },
- methods: {
- //滚动事件
- scrollGet() {},
- handleClick(doType) {
- let self = this;
- if (!this.form.subIds) {
- uni.showToast({
- title: '请选择实验室!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- if (!this.form.deptId) {
- uni.showToast({
- title: '请选择学院!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- if (!this.form.buildId) {
- uni.showToast({
- title: '请选择楼栋!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- if (!this.form.title) {
- if (!this.isCustom) {
- uni.showToast({
- title: '请输入计划标题!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- } else {
- uni.showToast({
- title: '请选择计划标题!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- return
- }
- if (!this.form.cycleStartTime || !this.form.cycleEndTime) {
- uni.showToast({
- title: '请选择计划周期!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- if (this.currentDate < this.form.cycleStartTime) {
- uni.showToast({
- title: '当前时间不在计划周期内',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- if (doType == 'nextStep') { //下一步
- // 打开扫描页面
- if (!this.form.rectifyDeadline) {
- uni.showToast({
- title: '整改日期不能为空!',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- this.form.isCustom = this.isCustom;
- if (this.form.checkCategory == 1) { //综合检查
- uni.navigateTo({
- url: '/pages_safetyExamine/views/examineManage/examineAddTow?form=' +
- encodeURIComponent(JSON.stringify(this.form))
- });
- } else if (this.form.checkCategory == 2) { //专项检查
- if (this.form.checkHazardInfoVoList[0]) {
- uni.navigateTo({
- url: '/pages_safetyExamine/views/examineManage/examineAddTow?form=' +
- encodeURIComponent(JSON.stringify(this.form))
- });
- } else {
- uni.redirectTo({
- url: '/pages/views/saoCode/scan?form=' + encodeURIComponent(JSON.stringify(this
- .form))
- });
- }
- }
- } else if (doType == 'submitForm') {
- self.submitForm()
- }
- },
- customFun() {
- let self = this;
- if (!self.isCustom) { //自定义
- self.form.title = '';
- self.form.id = '';
- self.form.checkType = '';
- self.form.cycleStartTime = '';
- self.form.cycleEndTime = '';
- self.isCustom = !self.isCustom
- } else { //选择计划
- this.$set(this.form, 'isAttachment', 0);
- this.$set(this, 'customTitle', '');
- self.form.checkHazardInfoVoList = [];
- self.$refs.popup.open()
- }
- },
- titleCancel() {
- let self = this;
- self.$refs.popup.close()
- },
- titleConfirm() {
- let self = this;
- self.isCustom = !self.isCustom
- this.$set(this.form, 'title', this.customTitle);
- this.$set(this.form, 'id', '');
- this.$set(this.form, 'checkType', 2);
- this.$set(this.form, 'checkResult', 1);
- this.$set(this.form, 'rectifyDeadline', '');
- this.$set(this, 'informIndex', 0);
- this.$set(this.form, 'cycleStartTime', '');
- this.$set(this.form, 'cycleEndTime', '');
- this.$set(this.form, 'checkHazardDtoList', [{
- voiceRemark: [], //语音备忘存储
- hazardLevel: 2, //隐患等级
- hazardLevelName: '一般隐患', //隐患等级
- hazardCheckCode: '', //检查项目code序号
- hazardCheckName: '', //检查项目名称
- hazardCheckPro: '', //最后一级的id
- hazardCheckPoint: '', // 检查要点
- hazardDescribe: '', //隐患描述
- uploadDtoList: [], //隐患照片
- }]);
- self.$refs.popup.close()
- },
- //开始时间选中事件
- startChange(form, e) {
- if (new Date(e.target.value).getTime() > new Date(form.cycleEndTime).getTime()) {
- uni.showToast({
- title: '结束时间不能小于开始时间',
- icon: "none",
- mask: true,
- duration: 2000
- });
- } else {
- form.cycleStartTime = e.target.value
- }
- },
- //结束时间选中事件
- endChange(form, e) {
- if (new Date(form.cycleStartTime).getTime() > new Date(e.target.value).getTime()) {
- uni.showToast({
- title: '结束时间不能小于开始时间',
- icon: "none",
- mask: true,
- duration: 2000
- });
- } else {
- form.cycleEndTime = e.target.value
- }
- },
- //获取当前日期函数
- getNowFormatDate() {
- let date = new Date(),
- year = date.getFullYear(), //获取完整的年份(4位)
- month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
- strDate = date.getDate() // 获取当前日(1-31)
- if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
- if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
- return `${year}-${month}-${strDate}`
- },
- //根据计划id查询附件列表
- async findByPlanIdAttachment() {
- let _this = this;
- const {
- data
- } = await findByPlanIdAttachment({
- checkPlanId: this.form.checkPlanId
- });
- if (data.code == 200) {
- _this.attachmentList = data.data;
- }
- },
- //详情
- async findCheckManage(type, id) {
- let _this = this;
- const {
- data
- } = await findCheckManage({
- id: id
- });
- if (data.code == 200) {
- if (type == 'add') {
- if (data.data.checkPlanId) {
- this.$set(this, 'isCustom', true);
- }
- this.$set(this, 'addDisabledType', true);
- }
- this.$set(this, 'form', data.data);
- this.$set(this.form, 'subIds', data.data.subId);
- this.form.rectifyNotice = data.data.rectifyNotice == null ? '1' : data.data.rectifyNotice;
- this.informIndex = this.form.rectifyNotice == 1 ? 0 : 1;
- if (data.data.checkCategory == 1) { //综合检查
- this.form.checkResult = data.data.checkResult == null ? '1' : data.data.checkResult;
- if (data.data.checkHazardDtoList[0]) { //隐患项
- this.form.checkHazardDtoList = data.data.checkHazardDtoList;
- //语音备注
- for (let i = 0; i < this.form.checkHazardDtoList.length; i++) {
- if (this.form.checkHazardDtoList[i].voiceRemark) {
- this.form.checkHazardDtoList[i].voiceRemark = JSON.parse(this.form
- .checkHazardDtoList[i].voiceRemark)
- } else {
- this.form.checkHazardDtoList[i].voiceRemark = [];
- }
- }
- }
- } else if (data.data.checkCategory == 2) { //专项检查
- if (_this.form.checkHazardInfoVoList[0]) {
- _this.form.checkHazardInfoVoList.forEach(function(item) {
- item.switch = true;
- // item.checkHazardDtoList.forEach(function(item2) {
- // item2.hazardCheckCode=item2.code
- // })
- })
- }
- if (_this.form.checkHazardInfoVoList[0]) { //隐患项
- //语音备注
- for (let k = 0; k < _this.form.checkHazardInfoVoList.length; k++) {
- for (let i = 0; i < _this.form.checkHazardInfoVoList[k].checkHazardDtoList
- .length; i++) {
- if (_this.form.checkHazardInfoVoList[k].checkHazardDtoList[i].voiceRemark) {
- _this.form.checkHazardInfoVoList[k].checkHazardDtoList[i].voiceRemark = JSON
- .parse(_this.form.checkHazardInfoVoList[k].checkHazardDtoList[i]
- .voiceRemark)
- } else {
- _this.form.checkHazardInfoVoList[k].checkHazardDtoList[i].voiceRemark = [];
- }
- }
- }
- }
- }
- //根据实验室id查询实验室计划
- if (data.data.subId) {
- this.form.cycleStartTime = data.data.cycleStartTime;
- this.form.cycleEndTime = data.data.cycleEndTime;
- }
- if (data.data.isAttachment == 1) { //0没有附件 1有附件
- this.findByPlanIdAttachment()
- }
- }
- },
- //查询学院列表
- async listDepartments() {
- let self = this;
- const {
- data
- } = await systemDeptDropList({
- deptName: '',
- level: 2,
- deptType: 1
- });
- if (data.code == 200) {
- for (let i = 0; i < data.data.length; i++) {
- self.collegeArray.push(data.data[i].deptName)
- }
- self.collegeList = data.data;
- }
- },
- //根据实验室id查询该实验室有关计划
- async getCheckPlanBySubId(subId) {
- let _this = this;
- const {
- data
- } = await getCheckPlanBySubId({
- 'subId': subId
- });
- if (data.code == 200) {
- if (data.data.length > 0) {
- let titleList = [];
- let list = [];
- for (let i = 0; i < data.data.length; i++) {
- if (data.data[i].isSelfData == 1) {
- titleList.push(data.data[i].title)
- list.push(data.data[i]);
- }
- }
- this.$set(this.form, 'id', '');
- this.$set(this.form, 'title', '');
- this.$set(this, 'planArray', titleList);
- this.$set(this, 'planList', list);
- _this.isCustom = true;
- _this.form.checkType = null;
- } else {
- _this.isCustom = false;
- _this.form.checkType = 2;
- }
- }
- },
- //查询楼栋
- async buildFloorGetlist() {
- let _this = this;
- const {
- data
- } = await laboratoryBigViewGetBuildByBigView({
- type: 2
- })
- if (data.code == 200) {
- let idList = [];
- let nameList = [];
- for (let i = 0; i < data.data.length; i++) {
- idList.push(data.rows[i].id)
- nameList.push(data.rows[i].name)
- }
- this.$set(this, "buildingList", idList)
- this.$set(this, "buildingArray", nameList)
- }
- },
- //楼栋选中
- buildingChange(e) {
- this.form.buildId = this.buildingList[e.target.value]
- this.form.buildName = this.buildingArray[e.target.value]
- this.buildBySubList(this.buildingList[e.target.value]);
- },
- //根据楼栋ID查询实验室列表
- async buildBySubList(buildId) {
- let self = this;
- const {
- data
- } = await laboratorySubRelInfoGetListByFloor({
- buildId: buildId
- });
- if (data.code == 200) {
- this.$set(this.form, 'subIds', '')
- this.$set(this.form, 'subjectName', '')
- this.$set(this, 'room', '')
- this.$set(this, 'roomList', data.data);
- }
- },
- //学院选中
- collegeChange(e) {
- this.collegeIndex = e.target.value;
- this.form.deptId = this.collegeList[e.target.value].deptId
- this.form.collegeName = this.collegeList[e.target.value].deptName
- this.buildFloorGetlist(this.form.deptId)
- },
- //检查组织
- categoryChange(e) {
- this.categoryIndex = e.target.value;
- if (e.target.value == 0) {
- this.form.checkType = 1
- } else if (e.target.value == 1) {
- this.form.checkType = 2
- }
- },
- //检查类型
- specialChange(e) {
- this.specialIndex = e.target.value;
- if (e.target.value == 0) {
- this.form.checkCategory = 1
- } else if (e.target.value == 1) {
- this.form.checkCategory = 2
- }
- },
- //计划
- planChange(e) {
- this.planIndex = e.target.value;
- this.form.id = this.planList[e.target.value].id
- this.findCheckManage('check', this.planList[e.target.value].id);
- },
- resultChange(e) {
- this.resultIndex = e.target.value;
- if (e.target.value == 0) {
- this.form.checkResult = 1;
- } else if (e.target.value == 1) {
- this.form.checkResult = 0;
- }
- },
- //开始时间选中事件
- rectifyDeadline(form, e) {
- form.rectifyDeadline = e.target.value
- },
- //整改通知
- tabClick(index) {
- this.informIndex = index;
- if (index == 0) {
- this.form.rectifyNotice = '1';
- } else if (index == 1) {
- this.form.rectifyNotice = '2';
- }
- },
- //搜索房间弹层开关
- popupClick(type) {
- if (type == 1) {
- if (this.addDisabledType) {
- return
- }
- this.popupType = true;
- } else if (type == 2) {
- this.popupType = false;
- }
- },
- //扫一扫进入通过id查询实验室列表
- async getByIdLaboratoryList() {
- let self = this;
- const {
- data
- } = await subjectFindSubjectInfo({
- subIds: this.form.subIds
- });
- if (data.code == 200) {
- if (data.data) {
- self.form.subjectName = data.data.subjectName;
- self.form.deptId = data.data.deptId;
- self.form.collegeName = data.data.collegeName;
- self.form.buildId = data.data.buildId;
- self.form.buildName = data.data.buildName;
- self.form.roomNumber = data.data.roomNumber;
- }
- }
- },
- //搜索房间接口
- async buildBySub() {
- let self = this;
- if (!this.room) {
- uni.showToast({
- title: '请输入要搜索关键词',
- icon: "none",
- mask: true,
- duration: 2000
- });
- return
- }
- const {
- data
- } = await laboratorySubRelInfoGetRelList({
- 'searchValue': this.room
- });
- if (data.code == 200) {
- if (data.data[0]) {
- this.roomList = data.data;
- } else {
- uni.showToast({
- title: '未找到相关实验室',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- }
- },
- //确认搜索房间
- popupClickItem(item) {
- this.$set(this.form, "subIds", item.subId)
- this.$set(this.form, "subjectName", item.subName)
- this.$set(this.form, "deptId", item.deptId)
- this.$set(this.form, "buildId", item.buildId)
- this.$set(this.form, "roomNumber", item.roomNum)
- this.$set(this.form, 'title', '');
- this.$set(this.form, 'id', '');
- this.$set(this.form, 'checkType', 2);
- this.$set(this.form, 'checkResult', 1);
- this.$set(this.form, 'rectifyDeadline', '');
- this.$set(this, 'informIndex', 0);
- this.$set(this.form, 'cycleStartTime', '');
- this.$set(this.form, 'cycleEndTime', '');
- this.$set(this.form, 'checkHazardDtoList', [{
- voiceRemark: [], //语音备忘存储
- hazardLevel: 2, //隐患等级
- hazardLevelName: '一般隐患', //隐患等级
- hazardCheckCode: '', //检查项目code序号
- hazardCheckName: '', //检查项目名称
- hazardCheckPro: '', //最后一级的id
- hazardCheckPoint: '', // 检查要点
- hazardDescribe: '', //隐患描述
- uploadDtoList: [], //隐患照片
- }]);
- //匹配学院名称
- for (let i = 0; i < this.collegeList.length; i++) {
- if (this.collegeList[i].deptId == item.deptId) {
- this.$set(this.form, "collegeName", this.collegeList[i].deptName)
- }
- }
- //匹配楼栋名称
- for (let i = 0; i < this.buildingList.length; i++) {
- if (this.buildingList[i] == item.buildId) {
- this.$set(this.form, "buildName", this.buildingArray[i])
- }
- }
- this.popupType = false;
- this.getCheckPlanBySubId(item.subId)
- },
- //调用摄像头
- saoCode() {
- let self = this;
- uni.scanCode({
- onlyFromCamera: true,
- success: function(res) {
- if (res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result
- .indexOf("&") != -1) {
- let codeRoom = "";
- let newList = res.result.split("?")[1].split("&")
- let list = newList[0].split("=")[1].split("-")
- codeRoom = list[1];
- if (codeRoom) {
- self.roomList = [];
- self.room = codeRoom;
- self.buildBySub();
- self.popupType = true;
- } else {
- uni.showToast({
- title: '请扫描正确的二维码',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- } else {
- uni.showToast({
- title: '请扫描正确的二维码',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- }
- });
- },
- //附件查看
- attachmentPreview(item) {
- uni.showLoading({
- title: '下载中'
- });
- wx.downloadFile({
- url: config.base_url + item.fileUrl,
- header: {
- Authorization: uni.getStorageSync('token')
- },
- success: function(res) {
- uni.hideLoading();
- const filePath = res.tempFilePath
- wx.openDocument({
- filePath: filePath,
- success: function(res) {
- console.log('打开文档成功')
- }
- })
- },
- fail: function(res) {
- uni.hideLoading();
- uni.showToast({
- title: '下载失败',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- })
- },
- //提交
- async submitForm() {
- let self = this;
- this.form.manageStatus = 2;
- let obj = self.form;
- //复合的情况下,删除隐患项
- obj.checkHazardDtoList = [];
- if (self.form.id) {
- const {
- data
- } = await checkManageUpdate(obj);
- if (data.code == 200) {
- uni.showToast({
- title: '提交成功',
- icon: "none",
- mask: true,
- duration: 2000
- });
- uni.redirectTo({
- url: '/pages_safetyExamine/views/examineManage/examineList?pageType=' + this.form
- .checkType
- });
- }
- } else {
- const {
- data
- } = await checkManageAdd(obj);
- if (data.code == 200) {
- uni.showToast({
- title: '提交成功',
- icon: "none",
- mask: true,
- duration: 2000
- });
- uni.redirectTo({
- url: '/pages_safetyExamine/views/examineManage/examineList?pageType=' + this.form
- .checkType
- });
- }
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .examine {
- height: 100%;
- display flex;
- box-sizing: border-box;
- .info-max-box {
- flex: 1;
- overflow: scroll;
- padding: 20rpx 0rpx 128rpx;
- box-sizing: border-box;
- }
- .addDisabled {
- background-color: #f5f5f5;
- }
- .basics {
- margin: 0 30rpx;
- width: 690rpx;
- height: auto;
- background: #FFFFFF;
- border-radius: 20rpx;
- padding: 30rpx 28rpx 30rpx;
- box-sizing: border-box;
- .basics_li {
- display: flex;
- justify-content: flex-start;
- margin-bottom: 24rpx;
- .basics_li_l {
- width: 146rpx;
- text-align: left;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- }
- .basics_li_r {
- width: 486rpx;
- height: 80rpx;
- border-radius: 10rpx;
- opacity: 1;
- border: 1rpx solid #E0E0E0;
- padding-left: 20rpx;
- box-sizing: border-box;
- }
- /* 学院 */
- .college_r {
- width: 486rpx;
- height: 80rpx;
- border-radius: 10rpx;
- border: 1rpx solid #E0E0E0;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >view {
- flex: 1;
- line-height: 80rpx;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- >img {
- width: 14rpx;
- height: 8rpx;
- margin-right: 30rpx;
- }
- }
- /* 实验室 */
- .lab_r {
- width: 486rpx;
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- .picker-text {
- width: 438rpx;
- height: 80rpx;
- }
- .img-box {
- width: 48rpx;
- >img {
- width: 30rpx;
- height: 28rpx;
- margin: 26rpx 18rpx 0 0;
- }
- }
- }
- /* 楼栋 */
- .building_r {
- width: 486rpx;
- height: 80rpx;
- >input {
- height: 80rpx;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- }
- }
- }
- .period {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- margin-bottom: 24rpx;
- .period_l {
- width: 146rpx;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 42rpx;
- text-align: left;
- }
- .period_r {
- width: 490rpx;
- height: 80rpx;
- border-radius: 10rpx;
- border: 1rpx solid #E0E0E0;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .picker-text {
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333;
- line-height: 80rpx;
- width: 230rpx;
- text-align: center;
- }
- .picker-text2 {
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333;
- line-height: 80rpx;
- width: 230rpx;
- text-align: center;
- }
- }
- }
- .custom {
- width: 150rpx;
- height: 60rpx;
- border-radius: 10rpx 10rpx 10rpx 10rpx;
- opacity: 1;
- border: 1rpx solid #0183FA;
- font-size: 26rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #0183FA;
- line-height: 60rpx;
- text-align: center;
- float: right;
- }
- }
- .attachment {
- width: 690rpx;
- background: #FFFFFF;
- border-radius: 20rpx;
- margin: 20rpx 30rpx 0;
- padding-bottom: 32rpx;
- box-sizing: border-box;
- .attachment_t {
- border-bottom: 1rpx solid #D8D8D8;
- >text:nth-of-type(1) {
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 110rpx;
- margin-left: 28rpx;
- }
- >text:nth-of-type(2) {
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #999999;
- line-height: 110rpx;
- margin-left: 24rpx;
- }
- }
- .attachment_li {
- height: 40rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- margin-top: 32rpx;
- >img {
- width: 30rpx;
- height: 26rpx;
- margin-right: 20rpx;
- margin-left: 50rpx;
- }
- >text {
- flex: 1;
- font-size: 28rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #0183FA;
- line-height: 40rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .attachment_li_del {
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- .inspect {
- margin: 20rpx 30rpx 0;
- width: 690rpx;
- height: auto;
- background: #FFFFFF;
- border-radius: 20rpx;
- padding: 40rpx 28rpx 20rpx;
- box-sizing: border-box;
- .inspect_li {
- display: flex;
- justify-content: flex-start;
- margin-bottom: 24rpx;
- .inspect_li_l {
- width: 146rpx;
- text-align: left;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- }
- .inspect_li_r {
- width: 486rpx;
- height: 80rpx;
- border-radius: 10rpx;
- opacity: 1;
- border: 1rpx solid #E0E0E0;
- padding-left: 20rpx;
- box-sizing: border-box;
- }
- .college_r {
- width: 486rpx;
- height: 80rpx;
- border-radius: 10rpx;
- border: 1rpx solid #E0E0E0;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >view {
- flex: 1;
- line-height: 80rpx;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- }
- >img {
- width: 14rpx;
- height: 8rpx;
- margin-right: 30rpx;
- }
- }
- /* 整改日期 */
- .date_r {
- width: 486rpx;
- height: 80rpx;
- display: flex;
- justify-content: flex-start;
- .picker-text {
- width: 438rpx;
- height: 80rpx;
- }
- >img {
- width: 30rpx;
- height: 28rpx;
- margin: 16rpx 18rpx 0 0;
- }
- }
- /* 整改通知 */
- .inform_r {
- width: 486rpx;
- height: 80rpx;
- padding-left: 20rpx;
- box-sizing: border-box;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >view {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- margin-right: 24rpx;
- .inform_r_l {
- display: inline-block;
- width: 30rpx;
- height: 30rpx;
- border-radius: 50%;
- border: 1rpx solid #E0E0E0;
- margin-right: 14rpx;
- }
- .inform_r_r {
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 80rpx;
- }
- .checked {
- display: inline-block;
- width: 30rpx;
- height: 30rpx;
- border-radius: 50%;
- border: 1rpx solid #0183FA;
- margin-right: 14rpx;
- position: relative;
- }
- .checked::after {
- content: '';
- position: absolute;
- top: 5rpx;
- left: 5rpx;
- width: 20rpx;
- height: 20rpx;
- border-radius: 50%;
- background: #0183FA;
- }
- }
- }
- }
- }
- .popup-max-box {
- z-index: 10;
- height: 100%;
- width: 100%;
- position fixed;
- background rgba(0, 0, 0, 0.2);
- display flex;
- flex-direction column;
- .popup-null {
- flex: 1;
- }
- .popup-big-box {
- border-top-left-radius: 20rpx;
- border-top-right-radius: 20rpx;
- background #fff;
- .popup-input-box {
- padding: 30rpx 20rpx;
- display: flex;
- input {
- flex: 1;
- height: 70rpx;
- border: 1rpx solid #e0e0e0;
- border-radius: 10rpx;
- margin-right: 20rpx;
- padding: 0 20rpx;
- }
- view {
- background #0183FA;
- color: #fff;
- border-radius: 10rpx;
- width: 140rpx;
- line-height: 70rpx;
- text-align center;
- font-size: 28rpx;
- }
- }
- .popup-for-max-box {
- margin: 0 20rpx 30rpx;
- height: 600rpx;
- overflow-y scroll;
- .popup-for-null {
- line-height: 100rpx;
- text-align center;
- color: #999;
- }
- .popup-for-box {
- display: flex;
- padding: 10px 0;
- .name-p {
- flex: 1;
- line-height: 60rpx;
- }
- .button-p {
- background #0183FA;
- color: #fff;
- text-align center;
- width: 100rpx;
- line-height: 60rpx;
- height: 60rpx;
- border-radius: 10rpx;
- }
- }
- }
- }
- }
- /* 计划标题 */
- .inspect_name {
- .popup-content {
- width: 750rpx;
- height: 350rpx;
- background: #FFFFFF;
- border-radius: 10rpx 10rpx 0px 0px;
- padding: 0 50rpx;
- box-sizing: border-box;
- overflow: hidden;
- .inspect_name_t {
- margin-top: 66rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- >input {
- width: 100%;
- height: 80rpx;
- border: 2rpx solid #E0E0E0;
- color: #A2A2A2;
- font-size: 28rpx;
- line-height 80rpx;
- border-radius: 10rpx;
- padding: 0 20rpx;
- box-sizing: border-box;
- }
- }
- .inspect_name_b {
- margin-top: 64rpx;
- display: flex;
- justify-content: center;
- >text:nth-of-type(1) {
- width: 160rpx;
- height: 60rpx;
- border-radius: 40rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 60rpx;
- text-align: center;
- margin-right: 120rpx;
- border: 2rpx solid #e0e0e0;
- }
- >text:nth-of-type(2) {
- width: 160rpx;
- height: 60rpx;
- background: linear-gradient(-35deg, #309CFF, #0183FA);
- border-radius: 40rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 60rpx;
- text-align: center;
- }
- }
- }
- }
- .bottom_btn {
- position: fixed;
- bottom: 26rpx;
- left: 30rpx;
- font-size: 30rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 90rpx;
- width: 690rpx;
- height: 90rpx;
- background: #0183FA;
- border-radius: 20rpx;
- text-align: center;
- }
- }
- </style>
|