12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526 |
- <!-- 安全检查-开展检查 -->
- <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 {
- laboratoryAppletGetSubDetailInfo
- } from '@/pages/api/index.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: {
- page: 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 list = text.split("?")[1].split("&");
- let codeData = {};
- list.forEach((item) => {
- codeData[item.split("=")[0]] = item.split("=")[1];
- })
- uni.showToast({
- title: codeData.subId,
- icon: "none",
- mask: true,
- duration: 2000
- });
- this.form.subIds = codeData.subId
- this.getCheckPlanBySubId(codeData.subId)
- this.getByIdLaboratoryList(codeData.code);
- }
- 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(option.infoId);
- }
- },
- 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 self = this;
- const {
- data
- } = await getCheckPlanBySubId({
- 'subId': subId
- });
- if (data.code == 200) {
- 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);
- if(list.length>0){
- self.isCustom = true;
- self.form.checkType = null;
- }else{
- self.isCustom = false;
- self.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(infoId) {
- let self = this;
- const {
- data
- } = await laboratoryAppletGetSubDetailInfo({
- infoId: infoId
- });
- if (data.code == 200) {
- if (data.data) {
- self.form.subjectName = data.data.subName;
- self.form.deptId = data.data.deptId;
- self.form.collegeName = data.data.deptName;
- self.form.buildId = data.data.buildId;
- self.form.buildName = data.data.buildName;
- self.form.roomNumber = data.data.roomNum;
- }
- }
- },
- //搜索房间接口
- 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) {
- let list = res.result.split("?")[1].split("&");
- let codeData = {};
- list.forEach((item) => {
- codeData[item.split("=")[0]] = item.split("=")[1];
- })
- console.log('二维码', codeData)
- if (codeData.code) {
-
- self.laboratoryAppletGetSubDetailInfo(codeData.code);
- } else {
- uni.showToast({
- title: '请扫描正确的二维码',
- icon: "none",
- mask: true,
- duration: 2000
- });
- }
- }
- });
- },
- //获取实验室详情
- async laboratoryAppletGetSubDetailInfo(infoId) {
- const {
- data
- } = await laboratoryAppletGetSubDetailInfo({
- infoId: infoId
- });
- if (data.code == 200) {
- this.$set(this.form, "subIds", data.data.subId)
- this.$set(this.form, "subjectName", data.data.subName)
- this.$set(this.form, "deptId", data.data.deptId)
- this.$set(this.form, "deptName", data.data.deptName)
- this.$set(this.form, "collegeName", data.data.deptName)
- this.$set(this.form, "buildId", data.data.buildId)
- this.$set(this.form, "buildName", data.data.buildName)
- this.$set(this.form, "roomNumber", data.data.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: [], //隐患照片
- }]);
- this.getCheckPlanBySubId(data.data.subId)
- }
- },
- //附件查看
- 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>
|