1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333 |
- <template>
- <view class="uni-container uni-container-bg">
- <view class="example container" :style="'height: ' + (screenHeight - 75) + 'px'">
- <!-- 下拉框 -->
- <view class="u-page__tag-item" style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;">
- <u-form>
- <u-form-item prop="orgName" @click="
- showOrg = true;
- hideKeyboard();
- " label="单位选择:" labelWidth="120px">
- <u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
- <u-icon slot="right" name="arrow-down" class="danwei"></u-icon>
- </u-form-item>
- </u-form>
- </view>
- <view class="tops" v-if="!getqrcode">
- <view style="display: flex;flex-direction: column;">
- <image :src="scan" class="tupian" @click="erWeiMa"></image>
- <view style="margin-top: 20rpx;">设施扫码</view>
- </view>
- <!-- #ifdef H5 -->
- <u-popup :show="qrScanShow" mode="center" @close="qrScanClose" @open="qrScanOpen" closeable
- :safeAreaInsetTop="true" zoom>
- <view class="qr-scan-containner">
- <view class="qr-scan-middle">
- <view class="qr-scan-title">
- 扫码
- </view>
- <qrcode-stream class="qr-scan-view" @decode="onDecode" />
- </view>
- </view>
- </u-popup>
- <!-- <view class="qrcode" v-if="qrcodeShow">
- <qrcode-stream @decode="onDecode" />
- </view> -->
- <!-- #endif -->
- <view>
- <image :src="Group" @click="
- showMCheck = true;
- hideKeyboard();
- " class="tiantupian"></image>
- <view style="margin-top: 20rpx;">手动添加</view>
- </view>
- </view>
- <view class="cont" v-if="!getqrcode">
- 主动检查记录
- </view>
- <view v-if="!getqrcode" class="main-content">
- <uni-card v-for="(item, index) in tableData" :key="index">
- <view class="titles"><text class="name-align-task">检查项:</text>{{item.inspName}}
- <u-icon v-if="item.isdenger==1" name="warning-fill" color="#ff5647" size="28"
- :customStyle="{marginTop:'20px',backgroundColor:'#fff'}"></u-icon>
- </view>
- <view><text class="name-align-task">检查结果:</text>{{item.handleResult}}</view>
- <view class="an-niu">
- <text><text class="name-align-task">检查时间:</text>{{item.inspectTime}}</text>
- <text @click="addClickDetail(item.id)" class="detail">查看详情</text>
- </view>
- </uni-card>
- </view>
- </view>
- <!-- 扫码弹出层 -->
- <u-popup :show="maShow" :round="10" @close="maShow=false">
- <view v-if="insTypeData!=''">
- <view class="springFarm" v-for="(item,index) in insTypeData" :key="index">
- <view class="show-title">设备名称:{{item.fpdName}}</view>
- <view class="show-title">设备序列号:{{item.fpdCode}}</view>
- <view>
- <view class="show-title">设备检查项:</view>
- </view>
- <view style="display: flex;flex-direction: column;">
- <view class="" v-if="item.inspectResultList!=''">
- <uni-grid :column="3" :showBorder="false">
- <uni-grid-item v-for="(items,indexs) in item.inspectResultList" :key="indexs">
- <view class="grid-item-box">
- <image :src="items.subValue==1?zhengchang:moren" class="tupians"
- @click="normalPopup(items,indexs,index)">
- </image>
- <text class="text">{{items.subLable}}</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- </view>
- <!-- <view class="slot-contents" v-if="show2">
- <textarea v-model="dangerDescribe" placeholder="请输入隐患描述内容"></textarea>
- </view> -->
- </view>
- <!-- ----扫码选择隐患 -->
- <view class="slot-contents" v-if="show2">
- <textarea v-model="dangerDescribe" placeholder="请输入隐患描述内容"
- @click="popupChoiceDangerFpd('show2')"></textarea>
- <u-popup :show="showPopupDanger" :round="10" @close="showPopupDanger=false">
- <view style="width: 90vw;overflow-y: auto;margin-bottom: 80rpx;padding:10px">
- <text class="text-xl">选择隐患类型:</text>
- <view class="" class="person-forward">
- <u-checkbox-group v-for="(items, indexs) in choiceDanger" :key="indexs"
- placement="column" v-model="items.checkedListDanger"
- @change="checkboxChange3(items.name,$event)" activeColor="#4CB2B6"
- iconSize="red">
- <u-checkbox :customStyle="{marginBottom: '60rpx'}" :label="items.name"
- :name="items.name">
- </u-checkbox>
- </u-checkbox-group>
- </view>
- <view class="flex flex-direction-row "
- style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="确定"
- @click="checkboxConfirm3()" customStyle="margin-right:20px;padding:0 30px">
- </u-button>
- <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
- @click="checkboxCancel3()" customStyle="padding:0 30px">
- </u-button>
- </view>
- </view>
- </u-popup>
- </view>
- <!-- ----扫码选择隐患 -->
- <view class="show-title">
- <view class="">巡检拍照:<text style="color:#822e2e;"></text></view>
- <view class="">
- <image :src="photograph" @click="photoUpload(item)" class="tiantupian"></image>
- </view>
- <uni-load-more v-show="loading" status="loading" :content-text="contentText" />
- </view>
- <view class="uni-grid-wraps">
- <view style="position: relative;width: 180rpx;float: left;margin: 10rpx 15rpx 0 0rpx;"
- v-for="(items,indexs) in item.attUrl" :key="indexs">
- <image :src="items" style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
- <u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)"
- class="icon-style">
- </u-icon>
- </view>
- </view>
- <view style="width: 60%;position: absolute;left:150rpx;;bottom:60rpx;z-index: 9999;">
- <div class="btnList" v-if="show2">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="立即处理"
- customStyle="margin-right:20%" @click="checkPopupConfirmNow">
- </u-button>
- <u-button v-if="show2" shape="circle" type="primary" color="#4CB2B6" text="生成隐患"
- @click="checkPopupYinHuan">
- </u-button>
- </div>
- <div class="btnList" v-if="!show2">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="保存"
- customStyle="margin-right:20%" @click="checkPopupConfirm()">
- </u-button>
- <u-button shape="circle" type="primary" color="#4CB2B6" text="取消" @click="checkPopupCancel">
- </u-button>
- </div>
- </view>
- </view>
- </view>
- <view v-else>
- 暂无数据
- </view>
- </u-popup>
- <!-- 手动添加弹出层-->
- <u-popup :show="manualPopup" :round="10" @close="manualPopup=false">
- <view v-if="checkManualData!=[]">
- <view class="springFarm" v-for="(item,index) in checkManualData" :key="index">
- <view class="show-title">检查项名称:{{item.inspName}}</view>
- <view>
- <view class="show-title">设备检查项:</view>
- </view>
- <view style="display: flex;flex-direction: column;">
- <view class="" v-if="item.inspectSubDOList!=''">
- <uni-grid :column="3" :showBorder="false">
- <uni-grid-item v-for="(items,indexs) in item.inspectSubDOList" :key="indexs">
- <view class="grid-item-box">
- <image :src="items.isdenger==1?zhengchang:moren" class="tupians"
- @click="checkPopupManual(items,indexs,index)">
- </image>
- <text class="text">{{items.subLable}}</text>
- </view>
- </uni-grid-item>
- </uni-grid>
- </view>
- <!-- <view class="slot-contents" v-if="showManual">
- <textarea v-model="dangerDescribe" placeholder="请输入隐患描述内容"></textarea>
- </view> -->
- <!-- <view class="slot-contents" @click="descript(index)">
- <textarea class="slot-contents" v-model="remark" placeholder="请输入描述内容"></textarea>
- </view> -->
- </view>
- <!-- ----扫码选择隐患 -->
- <view class="slot-contents" v-if="showManual">
- <textarea v-model="dangerDescribe" placeholder="请输入隐患描述内容"
- @click="popupChoiceDangerFpd('Manual')"></textarea>
- <u-popup :show="showPopupDanger" :round="10" @close="showPopupDanger=false">
- <view style="width: 90vw;overflow-y: auto;margin-bottom: 80rpx;padding:10px">
- <text class="text-xl">选择隐患类型:</text>
- <view class="" class="person-forward">
- <u-checkbox-group v-for="(items, indexs) in choiceDanger" :key="indexs"
- placement="column" v-model="items.checkedListDanger"
- @change="checkboxChange3(items.name,$event)" activeColor="#4CB2B6"
- iconSize="red">
- <u-checkbox :customStyle="{marginBottom: '60rpx'}" :label="items.name"
- :name="items.name">
- </u-checkbox>
- </u-checkbox-group>
- </view>
- <view class="flex flex-direction-row "
- style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="确定"
- @click="checkboxConfirm3()" customStyle="margin-right:20px;padding:0 30px">
- </u-button>
- <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
- @click="checkboxCancel3()" customStyle="padding:0 30px">
- </u-button>
- </view>
- </view>
- </u-popup>
- </view>
- <!-- ----扫码选择隐患 -->
- <view class="show-title">
- <view class="">巡检拍照:<text style="color:#822e2e;"></text></view>
- <view class="">
- <image :src="photograph" @click="photoUpload(item)" class="tiantupian"></image> <!-- 加载中 -->
- </view>
- <uni-load-more v-show="loading" status="loading" :content-text="contentText" />
- </view>
- <view class="uni-grid-wraps">
- <view style="position: relative;width: 180rpx;float: left;margin: 10rpx 15rpx 0 0rpx;"
- v-for="(items,indexs) in item.attUrl" :key="indexs">
- <image :src="items" style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
- <u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)"
- class="icon-style">
- </u-icon>
- </view>
- </view>
- <view style="width: 60%;position: fixed;left:150rpx;;bottom:60rpx;z-index: 9999;">
- <div class="btnList" v-if="showManual">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="立即处理"
- customStyle="margin-right:20%" @click="checkPopupConfirmNow">
- </u-button>
- <u-button v-if="showManual" shape="circle" type="primary" color="#4CB2B6" text="生成隐患"
- @click="checkPopupYinHuan">
- </u-button>
- </div>
- <div class="btnList" v-if="!showManual">
- <u-button shape="circle" type="primary" color="#4CB2B6" text="保存"
- customStyle="margin-right:20%" @click="checkPopupConfirm()">
- </u-button>
- <u-button shape="circle" type="primary" color="#4CB2B6" text="取消" @click="checkPopupCancel">
- </u-button>
- </div>
- </view>
- </view>
- </view>
- <view v-else>
- 暂无数据
- </view>
- </u-popup>
- <u-modal :show="show5" title="请输入处理结果" @confirm="descriptFpd" @cancel="show5 = false">
- <view class="slot-content jieguo">
- <textarea v-model="handleResult" placeholder="请输入" />
- </view>
- </u-modal>
- <u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false" @select="sexSelect">
- </u-action-sheet>
- <u-action-sheet :show="showMCheck" :actions="actionsManual" title="请选择检查项" @close="showMCheck = false">
- <view style="margin-bottom: 20rpx;">
- <view class="manual-hand">
- 手动输入设施编码:
- </view>
- <view class="manual-hand-item">
- <u--input placeholder="请输入设施编号" v-model="manualValue" class="manual-hand-input"></u--input>
- <u-button shape="circle" type="primary" color="#4CB2B6" text="确认"
- customStyle="width:120rpx;margin-left:2%" @click="manualHandConfirm()">
- </u-button>
- </view>
- </view>
- <hr>
- <view class="manual-hand">
- 选择检查项大类:
- </view>
- <view v-for="(item,index) in actionsManual" :key="index" @click="SelectMCheck(item)" class="manual">
- {{item.name}}
- </view>
- </u-action-sheet>
- </view>
- </template>
- <script>
- // #ifdef H5
- import {
- QrcodeStream
- } from 'vue-qrcode-reader'
- // #endif
- import {
- getInspect, //获取主动检查列表
- inspTypeList,
- createInspect, //创建主动检查
- getInspectInfo, //手动添加的检查项列表
- getFpd //根据编码获取设施信息
- } from "@/api/check_active";
- import loadImage from 'blueimp-load-image';
- import {
- getAccessToken
- } from '@/utils/auth'
- import config from '@/config'
- import store from "@/store"
- const baseUrl = config.baseUrl
- const baseUrlImg = config.baseUrlImg
- import {
- getOrgId //获取orgId
- } from '@/api/fire_device';
- import {
- shijianc,
- viewImgBig
- } from '@/utils/common.js'
- //隐患弹框--
- import {
- DICT_TYPE,
- getDictDatas
- } from '@/utils/dict';
- //隐患弹框--
- let that = '';
- export default {
- components: {
- // #ifdef H5
- QrcodeStream
- // #endif
- },
- data() {
- return {
- contentText: {
- contentrefresh: '上传照片中',
- },
- screenHeight: this.$screenHeight,
- // ----扫码选择隐患
- showPopupDanger: false,
- dangerDict: getDictDatas(DICT_TYPE.DANGER_RESULT),
- choiceDanger: getDictDatas(DICT_TYPE.DANGER_TYPE),
- checkedPopupDanger: [], //
- // ----扫码选择隐患
- manualValue: '', //手动输入的设施编号
- manualPopup: false,
- scan: `${baseUrlImg}/checkActive/scan.png`,
- // 是否开启扫描
- qrScanShow: false,
- Group: `${baseUrlImg}/checkActive/Group2.png`,
- erWeiMaShu: '', //二维码内容对象
- tableData: [],
- loading: false,
- dengerType: 0,
- saveImplement: {
- dengerType: 0,
- attUrl: [],
- dangerDescribe: "", //隐患描述
- fpdId: "",
- fpdResultCreateReqVOList: [], //传的当前事件
- hisResultCreateReqVOList: [], //手动检查
- handleMethod: "", //处理方式
- handleResult: "", //处理结果描述
- handleTime: '',
- inspectTime: '',
- imgUrl1: "",
- imgUrl2: "",
- imgUrl3: "",
- orgId: 0,
- taskId: 0,
- broadId: 0,
- remark: "", //附加描述
- isdenger: 0,
- },
- maShow: false, //扫码后弹框是否展示
- manualCheck: false, //手动检查弹框是否显示
- actionsManual: [], //手动检查弹框数据
- ManualData: [], //手动检查弹框完整数据
- checkManualData: [], //手动检查选中的一条检查项数据
- showManual: false, //手动检查是否显示描述
- showMCheck: false,
- insTypeData: '', //扫二维码后出现的消防列表数据内容
- moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
- zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
- show5: false,
- remark: '',
- photograph: `${baseUrlImg}/checkActive/photograph.png`,
- show2: false,
- handleResult: '',
- dangerDescribe: '',
- showOrg: false,
- actions: [],
- // 每页数据量
- pageSize: 10,
- // 当前页
- pageNo: 1,
- // 数据总量
- total: 0,
- formData: {
- orgName: '',
- orgId: ''
- },
- getqrcode: false,
- qrcodeShow: false, //h5端扫码是否显示
- }
- },
- watch: {
- loading: {
- handler(newLength, oldLength) {
- this.$modal.isLoadingModel(this.loading)
- },
- immediate: true
- }
- },
- onShow() {
- this.choiceDanger.map(i => {
- i.name = i.label;
- i.id = i.value;
- });
- this.tableData = []
- this.actions = []
- that = this;
- getOrgId({
- pageNo: this.pageNo,
- pageSize: this.pageSize,
- userId: this.$store.state.user.id
- }).then(response => {
- // 取到用户对应的单位名称与id
- response.data.map(v => {
- this.actions.push({
- id: v.dwid,
- name: v.orgName
- });
- });
- this.formData.orgName = response.data.length > 0 ? response.data[0].orgName : '' //默认
- this.formData.orgId = response.data.length > 0 ? response.data[0].dwid : ''
- });
- this.getData(1)
- this.getInspect()
- },
- methods: {
- // ----扫码选择隐患
- popupChoiceDangerFpd(type) {
- this.checkedPopupDanger = this.dangerDescribe.split(',')
- if (this.checkedPopupDanger.includes('其他')) {
- this.showPopupDanger = false
- } else {
- this.showPopupDanger = true
- this.$forceUpdate()
- }
- this.choiceDanger.map((i, indexs) => { //选中的回显
- i.checkedListDanger = []
- this.checkedPopupDanger.map(v => {
- if (i.name == v) {
- this.choiceDanger[indexs].checkedListDanger.push(v)
- }
- })
- })
- },
- checkboxConfirm3(index) {
- this.choiceDanger.map(i => {
- if (i.name == this.checkedPopupDanger[this.checkedPopupDanger.length - 1]) {
- this.dengerType = i.value
- }
- });
- this.dangerDescribe = this.checkedPopupDanger.toString()
- if (this.dangerDescribe.startsWith(',')) {
- this.dangerDescribe = this.dangerDescribe.slice(1);
- }
- this.showPopupDanger = false
- this.$forceUpdate()
- },
- checkboxCancel3(index) {
- this.showPopupDanger = false
- this.checkedPopupDanger = []
- this.$forceUpdate()
- },
- checkboxChange3(i, n) { //勾选的事件
- if (i && n.length != 0) {
- this.checkedPopupDanger.push(i)
- } else if (i && n.length == 0) {
- this.checkedPopupDanger = this.checkedPopupDanger.filter(item => item != i)
- }
- },
- // ----扫码选择隐患
- qrScanOpen() {},
- async getInspect() {
- const res = await getInspectInfo({
- pageNo: 1,
- pageSize: 100
- })
- this.ManualData = res.data.list
- this.actionsManual = res.data.list.filter(obj => obj.inspType !== 'fpd').map(obj => {
- return {
- id: obj.id,
- name: obj.inspName
- };
- })
- },
- closeImage(item, val, k) { //删除图片---5.25新加--未验证
- this.$nextTick(()=>{
- if (this.manualPopup) { //手动检查
- console.log(val, 'vvvvvvvvvvvvvvv');
- this.checkManualData[0].attUrl.splice(val, 1)
-
- } else { //扫码添加
- if (item.fpdType) {
- this.insTypeData[k].attUrl.splice(val, 1)
- }
- // this.tableData[k].attUrl.splice(val, 1)
- }
- this.$forceUpdate();
- })
- },
- sexSelect(e) { //单位
- this.formData.orgId = e.id;
- this.formData.orgName = e.name;
- this.tableData = []
- this.getData(1)
- },
- manualHandConfirm() { //手动输入编号确认
- var that = this
- getFpd({
- fpdCode: this.manualValue
- }).then(res => {
- if (res.data.list.length > 0) {
- inspTypeList({
- id: res.data.list[0].id,
- fpdCode: this.manualValue
- }).then(reponse => {
- that.showMCheck = false
- that.maShow = true
- that.show2 = false
- this.manualValue = ''
- that.insTypeData = reponse.data.records
- that.insTypeData.map(i => i.attUrl = [])
- })
- } else {
- this.$modal.msg('不存在该设备编码,请确认是否输入正确')
- }
- })
- },
- SelectMCheck(e) { //手动选择
- this.reselt()
- this.loading = false
- this.checkManualData = this.ManualData.filter(ManualDataItem => {
- return ManualDataItem.id == e.id
- })
- this.showMCheck = false
- this.manualPopup = true
- this.checkManualData.map(i => {
- i.inspectSubDOList.map(v => {
- v.isdenger = 0
- })
- i.isdenger = i.isdenger
- i.remark = ''
- i.attUrl = []
- i.handleMethod = ''
- i.handleResult = ''
- i.handleTime = ''
- i.inspectTime = ''
- })
- this.remark = ''
- },
- checkPopupManual(items, indexs, index) { //手动选择
- this.checkManualData[0].inspectSubDOList.map(i => {
- if (i.id == items.id) {
- i.isdenger = i.isdenger === 1 ? 0 : 1;
- this.showManual = i.isdenger === 1 ? true : false;
- } else {
- i.isdenger = 0
- this.showManual = false
- }
- })
- this.$forceUpdate()
- },
- descript(index) { //隐患描述点击确认
- // this.show2 = false
- },
- getData(pageNo) {
- this.loading = true
- const id = this.$store.state.user.id
- getInspect({
- pageNo: pageNo,
- pageSize: this.pageSize,
- userId: id,
- orgId: this.formData.orgId
- }).then(response => {
- this.loading = false
- this.tableData = [...this.tableData, ...response.data.list]
- this.dangerDict.map(i => {
- this.tableData.map(k => {
- if (k?.handleResult == i.value) {
- k.handleResult = i.label
- }
- })
- })
- // this.tableData = response.data.list
- this.total = response.data.total
- })
- },
- //小程序端扫码
- erWeiMa() {
- // #ifdef H5
- this.qrScanShow = true
- // #endif
- // #ifdef MP-WEIXIN
- var that = this
- this.remark = ''
- // 只允许从相机扫码
- uni.scanCode({
- onlyFromCamera: true, //只允许从相机扫码
- success: function(res) {
- if (res.errMsg == "scanCode:ok") {
- let result = JSON.parse(res.result)
- inspTypeList(JSON.parse(res.result)).then(reponse => {
- if (reponse.code == 0) {
- that.maShow = true
- that.show2 = false
- that.insTypeData = reponse.data.records
- that.insTypeData.map(i => {
- i.remark = ''
- i.attUrl = []
- i.handleMethod = ''
- i.handleResult = ''
- i.handleTime = ''
- i.inspectTime = ''
- })
- }
- })
- setTimeout(() => {
- that.$modal.msgSuccess('扫码成功')
- }, 200)
- }
- },
- fail: () => {
- that.$modal.msgError('未识别到二维码,请重新尝试!')
- }
- })
- // #endif
- },
- // #ifdef H5
- // 扫码成功后执行函数
- onDecode(qrcodeVal) {
- this.$modal.msgSuccess('扫码成功', qrcodeVal)
- this.qrcodeResault = qrcodeVal
- this.qrScanShow = false
- let result = JSON.parse(qrcodeVal)
- var that = this
- inspTypeList(JSON.parse(qrcodeVal)).then(reponse => {
- if (reponse.code == 0) {
- that.maShow = true
- that.show2 = false
- that.insTypeData = reponse.data.records
- that.insTypeData.map(i => i.attUrl = [])
- }
- })
- setTimeout(() => {
- that.$modal.msgSuccess('扫码成功')
- }, 200)
- },
- // 点击关闭按钮
- qrScanClose() {
- this.qrScanShow = false
- },
- onInit(promise) { //未使用
- promise
- .then(console.log)
- .catch(console.error)
- },
- // #endif
- descriptFpd() { //隐患描述点击确认
- this.show5 = false
- // this.handleResult = this.handleResult
- this.handleMethod = this.handleResult
- if (this.manualPopup) {
- // this.checkManualData[0].handleResult = this.handleResult
- this.checkManualData[0].handleMethod = this.handleResult
- this.checkManualData[0].handleResult = 1
- }
- this.handleResult = 1
- this.checkPopupConfirm()
- // this.maShow=false
- },
- checkPopupConfirmNow() {
- this.show5 = true
- this.handleMethod = "立即处理" //立即整改
- if (this.manualPopup) {
- this.checkManualData[0].handleMethod = "立即处理"
- }
- },
- checkPopupYinHuan() {
- this.handleMethod = "生成隐患" //生成隐患
- // this.handleResult = "不正常"
- this.handleResult = 2
- if (this.manualPopup) { //手动检查
- this.checkManualData[0].handleMethod = "生成隐患"
- // this.checkManualData[0].handleResult = "不正常"
- this.checkManualData[0].handleResult = 2
- }
- this.checkPopupConfirm()
- },
- photoUpload(val) {
- let pictures = [];
- let that = this;
- uni.chooseImage({
- sourceType: ['camera'], //实现拍照
- count: 3,
- sizeType: ['original', 'compressed'],
- // sourceType: ['album','camera'], //打开系统相册
- success(res) {
- that.loading = true
- if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
- res.tempFilePaths.forEach(item => {
- loadImage(
- item,
- function(canvas) {
- canvas.toBlob(function(blob) {
- // 压缩后的 Blob 对象
- const compressedFile = blob;
- // 将压缩后的文件 `compressedFile` 转换为临时URL
- const fileUrl = URL.createObjectURL(
- compressedFile);
- uni.uploadFile({
- url: baseUrl +
- '/admin-api/infra/file/upload', //后端用于处理图片并返回图片地址的接口
- filePath: item,
- name: 'file',
- header: {
- "Authorization": 'Bearer ' +
- getAccessToken(),
- }, //请求token
- success: (res) => {
- let imgUrl = JSON.parse(res
- .data)
- that.loading = false
- //消防设备外(扫一扫下方)展示的图片
- //弹出层的消防设备展示的图片
- if (that.manualPopup) { //手动检查
- that.checkManualData.map(
- i => {
- i.attUrl.push(
- imgUrl
- .data)
- })
- } else { //扫码添加
- that.insTypeData.map((i,
- index) => {
- if (val.id == i
- .id) {
- i.attUrl
- .push(
- imgUrl
- .data
- )
- }
- })
- }
- that.$forceUpdate();
- // // 返回的url
- },
- fail: () => {
- that.loading = false
- }
- })
- // 上传完毕后,释放临时URL
- URL.revokeObjectURL(fileUrl);
- }, 'image/jpeg', 0.6); // 设置压缩后的图片格式为 JPEG,压缩质量为 0.6
- }, {
- canvas: true,
- maxWidth: 800
- } // 设置最大宽度为 800px
- );
- })
- }
- }
- })
- },
- // 消防设备扫码
- normalPopup(items, indexs, index) {
- // this.insTypeData.map(k => {
- // k.attUrl = []
- // })
- this.insTypeData[index].inspectResultList.map(k => {
- if (k.isNormal == 1) this.nnorNormalValue = k.id
- if (this.insTypeData[index].inspectResultList[indexs].isNormal != 1 && this
- .insTypeData[index]
- .inspectResultList[indexs].subValue != 1) {
- // this.show5 = true
- this.show2 = true
- }
- })
- let tableItem = this.insTypeData[index].inspectResultList[indexs]
- let ALLinspectResultList = this.insTypeData[index].inspectResultList
- let YesinspectResultList = []
- let NorinspectResultList = []
- var Y = ALLinspectResultList.filter(i => i.id == this.nnorNormalValue)
- var N = ALLinspectResultList.filter(i => i.id != this.nnorNormalValue)
- N.map(n => {
- NorinspectResultList.push(n.subValue)
- })
- Y.map(y => {
- YesinspectResultList.push(y.subValue)
- })
- // items.isdenger = 0 ? 1 : 0
- if (NorinspectResultList.includes(1)) { //如果互斥的数组存在true normal!=1的数组
- if (tableItem.id == this.nnorNormalValue) {
- this.insTypeData[index].inspectResultList.map((i, kindex) => {
- if (i.id != this.nnorNormalValue) {
- i.subValue = 0
- this.show2 = false
- } else {
- i.subValue = 1
- }
- })
- } else {
- items.subValue = items.subValue == 0 ? 1 : 0
- this.show2 = false
- }
- } else {
- if (tableItem.id == this.nnorNormalValue) {
- items.subValue = items.subValue == 0 ? 1 : 0
- } else {
- // if (YesinspectResultList.includes(true)) { //是否存在第一份
- this.insTypeData[index].inspectResultList.map((i, kindex) => {
- if (i.id == this.nnorNormalValue) {
- i.subValue = 0
- }
- })
- // }
- items.subValue = items.subValue == 0 ? 1 : 0
- }
- }
- },
- checkPopupConfirm() { //弹出得到的那一条数据insTypeData的id 弹出保存
- if (this.manualPopup) { //手动检查
- this.saveImplement = this.checkManualData[0]
- this.saveImplement.dengerType = this.dengerType
- this.saveImplement.hisResultCreateReqVOList = this.checkManualData[0].inspectSubDOList
- this.saveImplement.dangerDescribe = this.dangerDescribe
- this.saveImplement.handleTime = shijianc(new Date().getTime())
- this.saveImplement.inspectTime = shijianc(new Date().getTime())
- this.saveImplement.remark = this.remark
- this.saveImplement.imgUrl1 = this.checkManualData[0].attUrl[0] ? this.checkManualData[0].attUrl[0] :
- "";
- this.saveImplement.imgUrl2 = this.checkManualData[0].attUrl[1] ? this.checkManualData[0].attUrl[1] :
- "";
- this.saveImplement.imgUrl3 = this.checkManualData[0].attUrl[2] ? this.checkManualData[0].attUrl[2] :
- "";
- this.saveImplement.hisResultCreateReqVOList.map(z => {
- z.resLable = z.subLable
- z.resValue = z.isdenger
- })
- this.saveImplement.inspId = this.saveImplement.id
- this.saveImplement.inspectSubDOList.map(i => {
- if (i.isdenger == 1 && i.isNormal == 0) { //必传参数,只有该检查项正常为0,那么isdenger==1
- this.saveImplement.isdenger = 1
- } else {
- this.saveImplement.isdenger = 0
- }
- })
- this.saveImplement.orgId = this.formData.orgId
- if (!this.saveImplement.dangerDescribe && this.saveImplement.isdenger == 1) return that.$modal
- .msgError('请填写隐患描述');
- this.baocun(this.saveImplement)
- } else { //设施扫码
- //this.insTypeData[0]扫二维码后点击出现的一条消防列表数据内容 this.newInsTypeData的多条数据列表
- let arr = []
- let normalArr = 0
- this.insTypeData[0].inspectResultList.map((i, index) => {
- arr.push(i.subValue)
- if (i.isNormal == 1) {
- normalArr = index //找到正常的所在的index
- }
- })
- if (arr.includes(1)) { //包含了证明勾选了
- this.insTypeData.map(i => {
- })
- this.saveImplement = this.insTypeData
- this.saveImplement.map(i => {
- i.dengerType = this.dengerType
- i.handleTime = shijianc(new Date().getTime())
- i.inspectTime = shijianc(new Date().getTime())
- i.orgId = this.formData.orgId
- i.dangerDescribe = this.dangerDescribe
- i.handleMethod = this.handleMethod
- i.remark = this.remark
- i.handleResult = this.handleResult
- i.fpdId = i.id
- i.inspType = "fpd"
- i.imgUrl1 = i.attUrl[0] ? i.attUrl[0] : ""
- i.imgUrl2 = i.attUrl[1] ? i.attUrl[1] : ""
- i.imgUrl3 = i.attUrl[2] ? i.attUrl[2] : ""
- i.inspName = i.fpdName
- i.inspCode = i.fpdCode
- i.inspId = i.id
- i.fpdResultCreateReqVOList = i.inspectResultList
- i.fpdResultCreateReqVOList.map(z => {
- z.broadId = 0
- z.fpdId = z.id
- z.resLable = z.subLable
- z.resValue = z.subValue
- z.status = 0
- if (z.subValue == 1 && z.isNormal ==
- 0) { //必传参数,只有该检查项正常为0,那么isdenger==1
- i.isdenger = 1
- } else {
- i.isdenger = 0
- }
- })
- })
- if (!this.saveImplement[0].dangerDescribe && this.saveImplement[0].isdenger == 1) return that
- .$modal.msgError('请填写隐患描述');
- this.baocun(this.saveImplement[0])
- // ----扫码选择隐患
- this.description2 = ''
- this.show2 = false
- } else {
- that.$modal.alert('请勾选检查结果')
- }
- }
- },
- baocun(val) {
- createInspect(JSON.stringify(val)).then(response => {
- if (response.data) {
- uni.showToast({
- title: '提交成功',
- icon: 'none',
- duration: 2000
- })
- this.tableData = []
- this.getData(1)
- this.reselt()
- this.$forceUpdate()
- } else {
- this.$modal.msgError('提交失败')
- }
- })
- this.maShow = false
- this.manualPopup = false
- },
- reselt() {
- this.dangerDescribe = ''
- this.handleResult = ''
- this.saveImplement = { //重置
- attUrl: [],
- dangerDescribe: "", //隐患描述
- fpdId: "",
- fpdResultCreateReqVOList: [], //传的当前事件
- hisResultCreateReqVOList: [],
- handleMethod: "", //处理方式
- handleResult: "", //处理结果描述
- handleTime: "",
- inspectTime: "",
- imgUrl1: "",
- imgUrl2: "",
- imgUrl3: "",
- orgId: 0,
- taskId: 0,
- broadId: 0,
- remark: "", //附加描述
- isdenger: 0,
- }
- this.checkManualData = [{ //重置
- attUrl: [],
- dangerDescribe: "", //隐患描述
- fpdId: "",
- fpdResultCreateReqVOList: [], //传的当前事件
- hisResultCreateReqVOList: [],
- handleMethod: "", //处理方式
- handleResult: "", //处理结果描述
- handleTime: "",
- inspectTime: "",
- imgUrl1: "",
- imgUrl2: "",
- imgUrl3: "",
- orgId: 0,
- taskId: 0,
- broadId: 0,
- remark: "", //附加描述
- isdenger: 0,
- }]
- },
- checkPopupCancel() {
- this.maShow = false
- this.showManual = false
- this.manualPopup = false
- },
- // 隐藏键盘
- hideKeyboard() {
- uni.hideKeyboard();
- },
- addClick() {
- this.manualCheck = true
- },
- addClickDetail(val) {
- uni.navigateTo({
- url: `/pagesA/fire/check_inspection/inspect_detail/inspect_detail?id=${val}`,
- success: function(res) {
- res.eventChannel.emit('acceptDataFromOpenerPage', val);
- }
- })
- },
- },
- // 触底的事件
- onReachBottom() {
- // 判断是否还有下一页数据
- if (this.pageNo * this.pageSize >= this.total) return uni.showToast({
- title: `数据加载完毕`
- })
- // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- if (this.loading) return
- this.pageNo += 1
- this.getData(this.pageNo)
- },
- }
- </script>
- <style>
- page {
- background-color: #F5F7F9;
- }
- </style>
- <style lang="scss" scoped>
- page {
- background-color: #F5F7F9 !important;
- }
- .tops {
- display: flex;
- justify-content: space-between;
- width: 80%;
- margin: 50rpx 10%;
- // 二维码扫描相关样式
- .qr-scan-containner {
- max-width: 600rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- align-content: center;
- background-color: transparent;
- .qr-scan-middle {
- .qr-scan-title {
- font-size: 30rpx;
- text-align: center;
- padding: 20rpx 0;
- }
- max-width: 100%;
- }
- }
- }
- .tupian {
- width: 95rpx;
- height: 95rpx;
- }
- .tupians {
- width: 45rpx;
- height: 45rpx;
- }
- .tiantupian {
- width: 95rpx;
- height: 95rpx;
- }
- .cont {
- font-size: 16px;
- color: #4CB2B6;
- margin-bottom: 30rpx;
- }
- .text {
- text-align: center;
- color: #000;
- font-size: 26rpx;
- margin-left: 20rpx;
- }
- .text2 {
- text-align: center;
- color: #000;
- font-size: 22rpx;
- margin-top: 10rpx;
- }
- ::v-deep .u-icon__icon {
- margin-right: 0px !important;
- }
- .child {
- margin: 20rpx 0 0 20rpx;
- border-radius: 10rpx;
- .child-new {
- display: flex;
- .child-new-item {
- width: 30%;
- margin-top: 25%;
- transform: translateY(-50px);
- }
- .child-result {
- /deep/.data-v-525ecd67 {
- // width: 130rpx;
- height: 100rpx;
- }
- }
- }
- }
- .titles {
- padding: 20rpx 0;
- color: #383838;
- }
- .grid-item-box {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 15px 0;
- }
- /deep/ .uni-grid-item {
- height: 140rpx !important;
- }
- /deep/.uni-textarea-textarea {
- border: 1px solid #4CB2B6;
- border-radius: 16rpx;
- }
- .btnList {
- display: flex
- }
- .main-content {
- /deep/.u-icon--right[data-v-172979f2],
- /deep/.u-icon--right.data-v-172979f2,
- .u-icon--right {
- // background-color: #f8f8f8;
- border-radius: 5rpx;
- position: absolute;
- top: -14rpx;
- right: 14rpx;
- }
- }
- /deep/.danwei.u-icon--right[data-v-172979f2],
- /deep/.danwei.u-icon--right.data-v-172979f2,
- .danwei.u-icon--right {
- top: 58rpx !important;
- right: 58rpx !important;
- }
- .uni-grid-wraps {
- margin-left: 60rpx;
- margin-bottom: 480rpx !important;
- // margin-bottom: 200rpx;
- }
- /deep/.u-slide-up-enter-active[data-v-39e33bf2],
- /deep/.u-slide-up-enter-active.data-v-39e33bf2,
- .u-slide-up-enter-active {
- height: 90% !important;
- overflow-y: auto;
- }
- .springFarm {
- margin-left: 40rpx;
- }
- .show-title {
- font-size: 32rpx;
- color: #383838;
- margin: 40rpx 0;
- }
- /deep/.u-modal {
- border: 1px solid #4CB2B6 !important;
- }
- .slot-contents {
- // margin-left: 40rpx;
- margin-bottom: 20rpx;
- border-radius: 1px solid #E5E5E5 !important;
- // background-color: #F0F2F3 !important;
- }
- /deep/ .slot-contents .uni-textarea-textarea {
- border: 1px solid #4CB2B6 !important;
- // background-color: #F0F2F3 !important;
- }
- .jieguo {
- /deep/.uni-textarea-textarea {
- border: none !important
- }
- }
- /deep/ .uni-textarea-placeholder {
- color: #a4a8ab;
- margin-top: 20rpx;
- margin-left: 30rpx;
- }
- .detail {
- // width: 72px;
- // height: 60rpx;
- float: right;
- border-radius: 30px;
- background-color: #F7C41E;
- margin-right: 20rpx;
- text-align: center;
- // line-height: 60rpx;
- padding: 3rpx 15rpx;
- }
- .an-niu {
- display: flex;
- justify-content: space-between;
- }
- /deep/.u-input {
- padding: 4px !important;
- }
- /deep/.canvasBox {
- .box {
- width: 600rpx;
- /* 设置扫码容器宽度 */
- height: 600rpx;
- /* 设置扫码容器高度 */
- }
- }
- .manual {
- font-size: 16px;
- padding: 25rpx 0;
- }
- .manual:last-child {
- font-size: 25px;
- padding: 60rpx 0;
- background-color: red;
- }
- .manual-hand {
- margin-left: 30rpx;
- display: flex;
- font-size: 18px;
- color: #30746b;
- margin: 20rpx;
- }
- .manual-hand-item {
- display: flex;
- width: 90%;
- justify-content: space-between;
- margin-left: 3%;
- /deep/.u-input {
- border: 1px solid #726f74 !important;
- }
- }
- //隐患弹框
- /deep/.u-popup__content {
- overflow-y: auto;
- }
- .text-xl {
- font-size: 18px;
- font-weight: 600;
- }
- .person-forward {
- padding-top: 40rpx;
- display: flex;
- flex-direction: column;
- flex-wrap: wrap;
- overflow-y: auto;
- margin-bottom: 100rpx;
- }
- .example {
- overflow-y: auto;
- }
- /deep/.u-action-sheet {
- height: 80vh;
- background-color: #fff;
- overflow-y: auto;
- }
- .icon-style {
- position: absolute;
- top: -8px;
- right: 8px;
- }
- </style>vh
|