|
@@ -3,7 +3,7 @@
|
|
|
<view>
|
|
|
|
|
|
<!-- 数据类型为消防设备 --比如一个灭火器 -->
|
|
|
- <u-list @scrolltolower="scrolltolower" v-if="!getqrcode">
|
|
|
+ <u-list height="87vh" @scrolltolower="scrolltolower" v-if="!getqrcode">
|
|
|
<u-list-item @click="goDetail" v-for="(item, index) in tableData" :key="index">
|
|
|
<view>
|
|
|
<view class="titles">{{item.inspName}}:{{item.inspContent}}</view>
|
|
@@ -66,7 +66,34 @@
|
|
|
</view>
|
|
|
<view class="slot-contents" v-if="item.showDescription&&item.inspType!='fpd'"
|
|
|
@click="descript(index)">
|
|
|
- <textarea v-model="item.description" placeholder="请输入隐患描述内容"></textarea>
|
|
|
+ <textarea v-model="item.description" placeholder="请选择或隐患描述内容"
|
|
|
+ @click="clickChoiceDanger(index)"></textarea>
|
|
|
+ <!-- ----隐患 -->
|
|
|
+ <u-popup :show="item.showDanger" :round="10" @close="item.showDanger=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 item.choiceDanger" :key="indexs"
|
|
|
+ placement="column" v-model="items.checkedListDanger"
|
|
|
+ @change="checkboxChange2(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="checkboxConfirm2(index)" customStyle="margin-right:20px;padding:0 30px">
|
|
|
+ </u-button>
|
|
|
+ <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
|
|
|
+ @click="checkboxCancel2(index)" customStyle="padding:0 30px">
|
|
|
+ </u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <!-- ----隐患 -->
|
|
|
</view>
|
|
|
<!-- <u-modal :show="show2" title="隐患描述" @confirm="descript(index)" @cancel="show2 = false">
|
|
|
<view class="slot-content">
|
|
@@ -118,8 +145,10 @@
|
|
|
</view>
|
|
|
</u-list-item>
|
|
|
</u-list>
|
|
|
+
|
|
|
</view>
|
|
|
- <view style="width: 60%;position: fixed;bottom:60rpx;z-index: 9999;left: 50%;transform: translate(-50%);"
|
|
|
+ <view
|
|
|
+ style="width: 60%;position: fixed;bottom:10rpx;z-index: 9999;left: 50%;transform: translate(-50%);height: 6vh;"
|
|
|
v-if="!getqrcode">
|
|
|
<div class="btnList" v-if="tableData.length!=0">
|
|
|
<u-button shape="circle" type="primary" color="#4CB2B6" text="暂存" customStyle="margin-right:20%"
|
|
@@ -130,9 +159,9 @@
|
|
|
</u-button>
|
|
|
</div>
|
|
|
</view>
|
|
|
- <view style="text-align: center;" v-if="tableData.length==0&&!getqrcode">
|
|
|
+ <!-- <view style="text-align: center;" v-if="tableData.length==0&&!getqrcode">
|
|
|
<view class="text-gray" style="padding-top: 20px;font-size: 40rpx;"> 暂无任务 </view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- //"show巡查未完成判断--可能需要打开 -->
|
|
|
<u-modal :show="show" :title="title" :content='content' @confirm="show = false"></u-modal>
|
|
|
<u-modal :show="show3" :title="title" content='未完成有问题检查项拍照' @confirm="show3= false"></u-modal>
|
|
@@ -158,6 +187,35 @@
|
|
|
</uni-grid-item>
|
|
|
</uni-grid>
|
|
|
</view>
|
|
|
+ <!-- ----扫码选择隐患 -->
|
|
|
+ <view class="slot-contents" v-if="show5">
|
|
|
+ <textarea v-model="description2" placeholder="请输入描述内容" @click="popupChoiceDangerFpd"></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="">
|
|
@@ -188,11 +246,11 @@
|
|
|
暂无数据
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
- <u-modal :show="show5" title="隐患描述" @confirm="descriptFpd" @cancel="show5 = false">
|
|
|
+ <!-- <u-modal :show="show5" title="隐患描述" @confirm="descriptFpd" @cancel="show5 = false">
|
|
|
<view class="slot-content shebeidesrip">
|
|
|
<textarea v-model="description2" placeholder="请输入描述内容" />
|
|
|
</view>
|
|
|
- </u-modal>
|
|
|
+ </u-modal> -->
|
|
|
<!-- 多选closeable closeOnClickOverlay--点击遮罩层不可关闭所属部门的弹出内容选中 ,选择部门-->
|
|
|
</view>
|
|
|
</template>
|
|
@@ -217,6 +275,12 @@
|
|
|
import loadImage from 'blueimp-load-image';
|
|
|
const baseUrl = config.baseUrl
|
|
|
const baseUrlImg = config.baseUrlImg
|
|
|
+ //隐患弹框--
|
|
|
+ import {
|
|
|
+ DICT_TYPE,
|
|
|
+ getDictDatas
|
|
|
+ } from '@/utils/dict';
|
|
|
+ //隐患弹框--
|
|
|
export default {
|
|
|
components: {
|
|
|
// #ifdef H5
|
|
@@ -225,6 +289,16 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ // ----隐患
|
|
|
+ choiceDanger: getDictDatas(DICT_TYPE.DANGER_TYPE),
|
|
|
+ checkedDanger: [],
|
|
|
+ checkedListDanger: [], //选择的隐患数据
|
|
|
+ DangerIndex: "", //隐患描述的位置下标
|
|
|
+ // ----隐患
|
|
|
+ // ----扫码选择隐患
|
|
|
+ showPopupDanger: false,
|
|
|
+ checkedPopupDanger: [], //
|
|
|
+ // ----扫码选择隐患
|
|
|
insType: 1, //1代表检查类型为消防设施,显示扫一扫按钮,其他则显示拍照
|
|
|
// danger: danger, //有隐患图片
|
|
|
moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
|
|
@@ -284,7 +358,8 @@
|
|
|
selectedIndex: '',
|
|
|
qrcodeShow: false,
|
|
|
qrcodeResault: '等待扫码...',
|
|
|
- onDecodeIndex: ''
|
|
|
+ onDecodeIndex: '',
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -297,6 +372,11 @@
|
|
|
},
|
|
|
// 在 vue页面,向起始页通过事件传递数据
|
|
|
onLoad: function(option) {
|
|
|
+ this.choiceDanger.map(i => {
|
|
|
+ i.name = i.label;
|
|
|
+ i.id = i.value;
|
|
|
+ });
|
|
|
+ console.log(this.choiceDanger, 'this.choiceDanger');
|
|
|
this.type = option.type ? option.type : ''
|
|
|
that = this;
|
|
|
const eventChannel = this.getOpenerEventChannel();
|
|
@@ -313,6 +393,8 @@
|
|
|
|
|
|
if (that.newtableDatas && that.newtableDatas[0][option.broadId]) { //获取本地缓存的数据
|
|
|
that.tableData = that.newtableDatas[0][option.broadId]
|
|
|
+ that.tableData.map(i=>i.choiceDanger=that.choiceDanger)
|
|
|
+ console.log(that.tableData,'that.tableData');
|
|
|
that.insTypeData = uni.getStorageSync('insTypeData')
|
|
|
|
|
|
} else {
|
|
@@ -321,25 +403,82 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onShow() {
|
|
|
- // console.log(uni.getStorageSync('tableData'), 'uni.getStorageSync');
|
|
|
- // this.tableData=uni.getStorageSync('tableData')
|
|
|
- // if(uni.getStorageSync('tableData')){
|
|
|
- //
|
|
|
- // console.log(this.tableData,'1111111111');
|
|
|
- // }
|
|
|
-
|
|
|
- },
|
|
|
- // watch: {
|
|
|
- // maShow: {
|
|
|
- // handler(newLength, oldLength) {
|
|
|
- // uni.setStorageSync('tableData', this.tableData)
|
|
|
- // },
|
|
|
- // deep: true,
|
|
|
- // immediate: true
|
|
|
- // }
|
|
|
- // },
|
|
|
+ onShow() {},
|
|
|
methods: {
|
|
|
+ // ----隐患
|
|
|
+ checkboxConfirm2(index) {
|
|
|
+ this.tableData[index].description = this.checkedListDanger.toString()
|
|
|
+ this.tableData[index].showDanger = false
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ checkboxCancel2(index) {
|
|
|
+ this.tableData[index].showDanger = false
|
|
|
+ this.checkedListDanger = []
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ clickChoiceDanger(index) { //描述框点击事件
|
|
|
+ this.checkedListDanger = this.tableData[index].description.split(',')
|
|
|
+ if (this.checkedListDanger.includes('其他')) {
|
|
|
+ this.tableData[index].showDanger = false
|
|
|
+ } else {
|
|
|
+ this.tableData[index].showDanger = true
|
|
|
+ this.DangerIndex = index
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ this.tableData[index].choiceDanger.map((i, indexs) => { //选中的回显
|
|
|
+ i.checkedListDanger = []
|
|
|
+ this.checkedListDanger.map(v => {
|
|
|
+ if (i.name == v) {
|
|
|
+ this.tableData[index].choiceDanger[indexs].checkedListDanger.push(v)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkboxChange2(i, n) { //勾选的事件
|
|
|
+ if (i && n.length != 0) {
|
|
|
+ this.checkedListDanger.push(i)
|
|
|
+ } else if (i && n.length == 0) {
|
|
|
+ this.checkedListDanger = this.checkedListDanger.filter(item => item != i)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // ----隐患
|
|
|
+ // ----扫码选择隐患
|
|
|
+ popupChoiceDangerFpd() {
|
|
|
+ this.checkedPopupDanger = this.description2.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.description2 = this.checkedPopupDanger.toString()
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // ----扫码选择隐患
|
|
|
//扫码
|
|
|
erWeiMa(checkTableDataIds, index) {
|
|
|
// #ifdef H5
|
|
@@ -376,7 +515,7 @@
|
|
|
if (reponse.code == 0) {
|
|
|
that.maShow = true
|
|
|
that.insTypeData = reponse.data.records
|
|
|
- that.insTypeData.map(i => i.attUrl = [])
|
|
|
+ that.insTypeData.map(i => {})
|
|
|
}
|
|
|
})
|
|
|
setTimeout(() => {
|
|
@@ -584,7 +723,6 @@
|
|
|
},
|
|
|
// 获取数据
|
|
|
getData(pageNo, value = '') {
|
|
|
- console.log('999999999')
|
|
|
this.loading = true
|
|
|
this.formData.pageNo = pageNo
|
|
|
CheckActiveImplement(JSON.stringify(this.formData)).then(response => {
|
|
@@ -604,6 +742,9 @@
|
|
|
i.hisFpdCreateReqVOList = []
|
|
|
i.hisResultCreateReqVOList = []
|
|
|
i.qrcodeShow = false
|
|
|
+ // ----隐患
|
|
|
+ i.choiceDanger = this.choiceDanger //隐患描述下拉的数据
|
|
|
+ // ----隐患
|
|
|
})
|
|
|
}
|
|
|
console.log(this.tableData, 'this.tableData');
|
|
@@ -690,10 +831,12 @@
|
|
|
}
|
|
|
if (items.isNormal == 0 && items.subValue == 1) {
|
|
|
item.showDescription = true; // 显示描述框
|
|
|
+ // ----隐患
|
|
|
+ this.tableData[this.descriptIndex].choiceDanger.map(i => i.checkedListDanger = [])
|
|
|
+ // ----隐患
|
|
|
} else {
|
|
|
item.showDescription = false; // 显示描述框
|
|
|
}
|
|
|
- console.log(this.tableData, 'this.tableData不是消防');
|
|
|
|
|
|
},
|
|
|
// 消防设备扫码
|
|
@@ -747,6 +890,15 @@
|
|
|
items.subValue = items.subValue == 0 ? 1 : 0
|
|
|
}
|
|
|
}
|
|
|
+ // ----扫码选择隐患
|
|
|
+ if (items.isNormal == 0 && items.subValue == 1) {
|
|
|
+ this.show5 = true; // 显示描述框
|
|
|
+ console.log();
|
|
|
+ // this.insTypeData.choiceDanger.map(i => i.checkedListDanger = [])
|
|
|
+ } else {
|
|
|
+ this.show5 = false; // 显示描述框
|
|
|
+ }
|
|
|
+ // ----扫码选择隐患
|
|
|
|
|
|
},
|
|
|
checkPopupConfirm(fpdId) { //弹出得到的那一条数据insTypeData的id 弹出保存
|
|
@@ -797,7 +949,9 @@
|
|
|
} else {
|
|
|
that.$modal.msg('请勾选检查结果')
|
|
|
}
|
|
|
-
|
|
|
+ // ----扫码选择隐患
|
|
|
+ this.description2 = ''
|
|
|
+ this.show5=false
|
|
|
// this.tableData.map((i) => { //这一段不用放开,以前是用于消防设备扫多个码统计数据展示的
|
|
|
// if (i.id = fpdId) {
|
|
|
// let isNormalZero=new Array(i.inspectResultList.length) //新建数组用来放isNormal为1和不为1处理后的分别的数组
|
|
@@ -855,7 +1009,7 @@
|
|
|
const compressedFile = blob;
|
|
|
// 将压缩后的文件 `compressedFile` 转换为临时URL
|
|
|
const fileUrl = URL.createObjectURL(
|
|
|
- compressedFile);
|
|
|
+ compressedFile);
|
|
|
|
|
|
uni.uploadFile({
|
|
|
url: baseUrl +
|
|
@@ -882,7 +1036,7 @@
|
|
|
.push(
|
|
|
imgUrl
|
|
|
.data
|
|
|
- )
|
|
|
+ )
|
|
|
}
|
|
|
})
|
|
|
} else { //消防设备外(扫一扫下方)展示的图片
|
|
@@ -895,7 +1049,7 @@
|
|
|
.push(
|
|
|
imgUrl
|
|
|
.data
|
|
|
- )
|
|
|
+ )
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -1039,15 +1193,15 @@
|
|
|
display: flex
|
|
|
}
|
|
|
|
|
|
- /deep/.u-icon--right[data-v-172979f2],
|
|
|
- /deep/.u-icon--right.data-v-172979f2,
|
|
|
- /deep/.u-icon--right {
|
|
|
- background-color: #f8f8f8;
|
|
|
- border-radius: 5rpx;
|
|
|
- position: absolute;
|
|
|
- top: -14rpx;
|
|
|
- right: 20rpx;
|
|
|
- }
|
|
|
+ // /deep/.u-icon--right[data-v-172979f2],
|
|
|
+ // /deep/.u-icon--right.data-v-172979f2,
|
|
|
+ // /deep/.u-icon--right {
|
|
|
+ // background-color: #f8f8f8;
|
|
|
+ // border-radius: 5rpx;
|
|
|
+ // position: absolute;
|
|
|
+ // top: -14rpx;
|
|
|
+ // right: 20rpx;
|
|
|
+ // }
|
|
|
|
|
|
.uni-grid-wraps {
|
|
|
margin-left: 60rpx;
|
|
@@ -1103,4 +1257,25 @@
|
|
|
/* 设置扫码容器高度 */
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //隐患弹框
|
|
|
+ /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;
|
|
|
+
|
|
|
+ }
|
|
|
</style>
|