2024-05-22 01:32:19 +08:00

1578 lines
40 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="emergencyDisposal">
<headers class="fixedheader" :showBack="true">
<view class="headerName">
立即救援
</view>
</headers>
<!-- 新增问题 -->
<view class="immediate-rescue" :style="{ 'margin-top': (statusBarHeight+52) + 'px' }">
<view class="content">
<!-- <view class="type flex">
<view class="name"><text class="star">*</text>是否处理完毕</view>
<radio-group class="radio-group" @change="radioChange">
<label class="radio" v-for="(item, index) in items" :key="item.value">
<view>
<radio :value="item.value" :checked="index === current" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view> -->
<view class="rescue-item" v-for="(item,eIndex) in rescueList" :key="eIndex">
<view class="type flex">
<view class="name">
<!-- <text class="star">*</text> -->
处置人:
</view>
<!-- <picker class="picker">
<view class="uni-input uni-select cl" v-if="issueName==''">
请输入
</view>
<view class="uni-input uni-select" v-else>{{issueName}}
</view>
</picker> -->
<view>
{{item.disposalPersonName}}
</view>
</view>
<view class="type flex">
<view class="name">
<!-- <text class="star">*</text> -->
处理完成时间:
</view>
<dateTimePiccker :placeholder="'请选择'" :start="startTime2" fields="minute"
:default-value="item.changeLimitTime" @change="bindPickerChange($event,'startTime2',eIndex)"
class="dateTimePiccker">
</dateTimePiccker>
</view>
<view class="type flex3">
<view class="name">现场照片:</view>
<view class="uni-form-input imgBox_wrap"
v-show="item.videoFileList && item.imgFileList.length>0">
<view class="imgBox" v-for="(item,index) in item.imgFileList" :key="index">
<image :src="item.url" class="img" @click="previewImage(item.url)">
</image>
<view @click="deleteImg(item,1,eIndex,index)" style="margin: 5px;" class="deleteImg">×
</view>
</view>
</view>
<view class="addImgBox" @click="uploadImg(1,eIndex)" v-if="item.imgFileList.length<1">
<image src="/static/icon-add.png" class="icon-add"></image>
</view>
</view>
<view class="type flex3">
<view class="name">现场视频:</view>
<view v-if="item.videoFileList && item.videoFileList.length>0">
<view class="imgBox flex2" v-for="(item,index) in item.videoFileList" :key="index">
<view
style="color: #4181FE;width: 50%;white-space: nowrap; overflow: hidden;text-overflow: ellipsis;"
@click="playVideo(item.url,'video')">
{{item.name}}
<!-- url_config+'image/'+ -->
</view>
<view @click="deleteImg(item,2,eIndex,index)"
style="margin: 5px;color: gray;left: 78px;" class="deleteImg">×
</view>
</view>
</view>
<view class="addImgBox" @click="uploadVideo(eIndex)" v-if="item.videoFileList.length<=0">
<image src="/static/icon-add.png" class="icon-add"></image>
</view>
</view>
<view class="type flex3">
<view class="name">处置说明:</view>
<textarea class="textarea" maxlength="-1" placeholder-class="cl" name="inspectContent"
@input='eventDescription' v-model="item.addedDescription" placeholder="请输入"></textarea>
</view>
<view class="rescue-item_delete" @click="deleteRescue(eIndex)">
X
</view>
</view>
<view class="rescue-item_add" @click="addRescue()">
<image src="/static/icon-add.png" class="icon-add"></image> 新增救援记录
</view>
<view class="addSaveBtn" @click="addSaveBtn">提交保存</view>
</view>
<!-- 图纸定位弹窗 -->
<view class="unitDialog" v-if="imgDialog">
<view class="unitContent" style="height: 65%;width: 89%;">
<view class="name" style="text-align: center;">图纸定位</view>
<view style="display: flex;margin-top: 20px;">
<view class="add2" v-if="imgDialogUrl!=''" @click.stop="pointText()">
{{imgDialogUrlText}}
</view>
<view class="add2" v-if="imgDialogUrl!=''" @click.stop="uploadImg(2)">更换图片</view>
</view>
<view class="uni-form-input imgBox_wrap" style="width: 100%;">
<view class="imgBox" style="width: 100%; height: 100%;" v-show="imgDialogUrl.length>0"
v-for="(item,index) in imgDialogUrl" :key="index">
<image data-index='111' :src="url_config+'image/'+item.url"
@click.stop="pointImage($event)">
<view>
<image src="/static//monitorPoint.png" class="point"
:style="{top: item.y - 200 + 'px',left:item.x - 40 + 'px'}"
v-for="(item,index) in pointList" :key="index" @click.stop="pointShow(index)">
</image>
</view>
<view :style="{top: item.y - 200 + 'px',left:item.x - 40 + 'px'}"
v-for="(item,index) in pointList" :key="index" v-if="imgIndex === index"
class="point">
<view class="lagCss">
坐标 x : {{item.x}}
y : {{item.y}}
<view style="color: red;" @click.stop="removePoint(index)">删除</view>
</view>
</view>
</view>
<view class="addImgBox" style="width: 178px;
height: 163px;margin: 20%;" @click="uploadImg(2)" v-if="imgDialogUrl.length==0">
<image src="/static/icon-add.png" class="icon-add"></image>
</view>
</view>
<view class="butA">
<view class='addSaveBtn' style=" margin-left: 105px;width: 40%;margin-top: 8%;"
v-if="imgDialogUrl!=''" @click="imgDialogBtn">保存</view>
<view class='addSaveBtn' style=" margin-left: 105px;width: 40%;margin-top: -5%;" v-else
@click="imgDialog = false">
取消</view>
</view>
<!-- <view class="text" style="text-align: center;
color: orange;margin-top: -40px;" v-else>
暂无图纸,请上传
</view> -->
</view> -->
</view>
<!-- 分包单位弹窗 -->
<view class="unitDialog" v-if="unitDialog" @click="unitDialog=false">
<view class="unitContent">
<!-- <view class="tabs flex2">
<view @click.stop="checkTypeBtn(1)" :class="checkType==1?'checkName tabs_name':'noCheckName tabs_name'">
专业分包商</view>
<view @click.stop="checkTypeBtn(6)" :class="checkType==6?'checkName tabs_name':'noCheckName tabs_name'">
劳务分包商</view>
</view> -->
<view class="unitList" v-if="subpackageLsit.length>0">
<view class="title">公司名称</view>
<view class="list_val" v-for="(item,index) in subpackageLsit" @click="checkSubpackage(item)"
:class="index%2==0?'bg_999':''">{{item.enterpriseName}}</view>
</view>
<view class="placeholderBox" v-if="subpackageLsit.length==0">
<image src="/static/noData.png" mode="" class="noDataImg"></image>
<view class="text">
暂无数据
</view>
</view>
</view>
</view>
<!-- 标记点 -->
<!-- 检查部位 -->
<tki-tree ref="locationTree" @confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="checkPointList"
rangeKey="regionName" confirmColor="#4e8af7" :selectParent="true" />
<!-- 问题分类 -->
<tki-tree ref="issueTree" @confirm="(val)=>checkPointBtn(val,2)" idKey='id' :range="issueList"
rangeKey="dangerName" confirmColor="#4e8af7" />
<!-- 通知人 -->
<tki-tree ref="informTree" :multiple="true" @confirm="(val)=>checkPointBtn(val,3)" idKey='id'
:range="personList" rangeKey="workerName" confirmColor="#4e8af7" />
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
</view>
</view>
</template>
<script>
import headers from "../../../components/headers/headers.vue"
import tkiTree from "@/components/tki-tree/tki-tree.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import dateTimePiccker from '@/components/dateTimePicker/index.vue'
import {
dateformat
} from "@/utils/tool.js"
export default {
components: {
tkiTree,
canversCom,
dateTimePiccker
},
data() {
return {
rescueList: [{
changeLimitTime: "",
imgFileList: [],
videoFileList: [],
addedDescription: "",
}],
isShowPicker: true,
startTime: this.getDate({
format: true,
}),
startTime2: this.getDate({
format: true,
}),
checkedTab: 'type1',
imgList: {},
openImg: false,
base64Image: '',
imgIndex: -1,
pointList: [],
location: {
left: '0',
top: '0'
},
x: 0,
y: 0,
imgDialogUrlSu: false,
imgDialogUrlText: "编辑隐患点",
imgDialog: false,
imgDialogUrl: [],
pageTitle: '新增检查',
projectSn: '',
checkType: 1, //分包商类型 1专业分包 6劳务分包
form: {
regionId: "", // 检查部位
regionName: "",
dangerItemContent: "",
dangerItemId: "",
dangerTypeId: "",
dangerDesc: "",
remark: "",
routineId: 0,
level: "",
urgentLevel: "",
inspectManId: "",
inspectTime: dateformat(new Date()),
enterpriseSn: "",
enterpriseName: "",
changeLimitTime: "",
changeId: "",
reviewId: "",
verifyManId: "",
notifyPerson: [],
status: 2, // 现场整改状态 2未完成 5已完成
measurePoints: [],
imageUrl: "",
fileUrl: "",
recordType: 1,
dangerName: '',
subsectionId: '', //分部工程
subentryId: '', //分项工程
floor: '', //巡检楼层
addedDescription: '', //事件描述
taskId: '', //任务ID
itemId: '' // 任务子ID
},
checkPointList: [], //获取检查部位数据
checkPointName: '',
issueList: [], //问题分类 || 问题描述
issueName: '',
issueGradeList: [{
name: '一级',
value: 1
},
{
name: '二级',
value: 2
},
{
name: '三级',
value: 3
},
{
name: '四级',
value: 4
},
], //问题等级
issueGradeIndex: 0,
urgencyList: [{
name: '一般',
value: 1
},
{
name: '严重',
value: 2
},
{
name: '紧要',
value: 3
},
], //紧急程度
urgencyIndex: 0,
personUpdateList: [], // 人员列表-整改人
personList: [], //人员列表 -- 检查人、整改人、复查人、核验人、通知人
inspectManIndex: null, //检查人
changePeopleIndex: null, //整改人
verifyManIndex: null, //核验人
reviewIndex: null, //复查人
notifier: '', //通知人
unitDialog: false, //分包商弹窗
subpackageLsit: [], //分包商数据列表
videoFileList: [],
imgFileList: [],
mapImgList: [],
basicInfo: {},
selectIndex: null,
userInfo: '',
typeCheck: 'type1', // 类型 type1为质量问题 type2为排查记录
listData: [], //分部工程
subListData: [], //分项工程
subsectionIndex: -1, //分部工程
subentryIndex: -1, ////分项工程
unitEnterpriseId: "",
taskId: '', //任务ID
itemId: '', // 任务子ID
defaultAuditPerson: "",
reviewList: [],
areaData: {},
items: [{
value: 'USA',
name: '是',
checked: 'true'
}, {
value: 'USA',
name: '否',
}],
current: 0,
id: "",
emergencyDetail: {},
}
},
onLoad(option) {
this.id = option.id;
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.pageTitle = option.type == 'add' ? '新增检查' : '编辑检查';
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
console.log('111111', this.userInfo);
// this.getCheckPointList();
// this.getIssueList();
// this.getPersonList();
// this.getReviewPeopleList();
// // this.getPersonUpdateList();
// this.getProgressListData()
// console.log('lll', option.taskId, option.itemId)
// this.taskId = option.taskId
// this.itemId = option.itemId
// this.form.taskId = option.taskId
// this.form.itemId = option.itemId
console.log(dateformat(new Date()), 777888)
this.getEmergencyRecordQueryById();
},
onShow() {
},
methods: {
//获取记录
getEmergencyRecordQueryById() {
let that = this;
//获取我整改的巡查记录数量
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/queryById',
method: 'get',
data: {
projectSn: this.projectSn,
id: this.id,
},
success: res => {
console.log(res);
that.emergencyDetail = res.result;
this.rescueList = res.result.situations.map(item => {
return {
disposalPersonId: item.disposalPersonId,
disposalPersonName: item.disposalPersonName,
changeLimitTime: item.disposalCompletionTime,
imgFileList: item.livePicture ? JSON.parse(item.livePicture) : [],
videoFileList: item.liveVideoSituation ? JSON.parse(item
.liveVideoSituation) : [],
addedDescription: item.disposalSpecification,
}
});
}
})
},
// 添加
addRescue() {
this.rescueList.push({
disposalPersonId: this.userInfo.userId,
disposalPersonName: this.userInfo.realName,
changeLimitTime: "",
imgFileList: [],
videoFileList: [],
addedDescription: "",
});
console.log(this.rescueList,888999)
},
// 删除
deleteRescue(index) {
this.rescueList.splice(index, 1);
},
radioChange: function(evt) {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].value === evt.detail.value) {
this.current = i;
break;
}
}
},
//获取复查人
getReviewPeopleList() {
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: this.projectSn,
enterpriseTypeId: 7,
},
success: res => {
console.log(res.result)
if (res.result.length > 0) {
this.reviewList = res.result;
} else {
this.reviewList = [];
}
}
})
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year;
} else if (type === 'end') {
// year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
imgUrl(val) {
this.openImg = false
this.imgUpload(val)
this.openImg = true
},
//图片上传请求的接口
imgUpload(baseImg) {
console.log('进入----------图片上传请求的接口');
let that = this
let cuDate = new Date().getTime();
let arr = []
that.base64Image = baseImg
let parmars = {
base64Image: that.base64Image
}
this.sendRequest({
url: 'xmgl/upload/uploadBase64',
method: 'post',
header: {
'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
},
data: parmars,
success: (res) => {
console.log('转换后的地址----------', res.data.imageUrl);
console.log('阶段代码 imgUpload 耗时2 ' + (new Date().getTime() - cuDate))
that.imgFileList[that.imgFileList.length - 1].url = res.data.imageUrl
}
})
},
imgDialogBtn() {
this.imgDialog = false
// this.pointList=[]
},
//点击点位展示的内容
pointShow(index) {
console.log("当前index : " + index + "- this.imgIndex: " + this.imgIndex)
if (index === this.imgIndex) {
this.imgIndex = -1
} else {
this.imgIndex = index
}
},
//删除点位
removePoint(index) {
console.log('点击的内容', index);
this.pointList.splice(index, 1);
this.imgIndex = -1
},
//布点
pointImage(event) {
if (this.imgDialogUrlSu) {
console.log("开始布点 ", event);
console.log("x", event.detail.x);
console.log("y ", event.detail.y);
let obj = {
x: event.detail.x,
y: event.detail.y
}
this.pointList.push(obj)
}
},
//开始布点或者结束布点
pointText() {
this.imgDialogUrlText = this.imgDialogUrlSu ? "编辑隐患点" : "保存隐患点"
this.imgDialogUrlSu = !this.imgDialogUrlSu
},
//打开图纸上传弹框
openImgDialog() {
this.imgDialog = true
},
toggle() {},
//分部工程改动事件
checkSubListData(e, type) {
console.log(e, type)
if (type === 1) {
if (this.listData[e.detail.value] == "暂无数据") return;
// 选择一级菜单
this.subsectionIndex = e.detail.value;
this.form.subsectionId = this.listData[this.subsectionIndex]?.id || -1; // 赋值给subsectionId字段
this.subListData = this.listData[this.subsectionIndex].children || [];
if (this.subListData.length) {
this.subentryIndex = 0; // 如果存在子级菜单则将分项索引初始化为0
this.subentryId = this.subListData[0]?.id || -1; // 赋值给subentryId字段
} else {
this.subentryIndex = -1; // 如果不存在子级菜单,则将分项索引初始化为-1
this.subentryId = -1; // 初始化为-1
}
} else {
if (this.subListData[e.detail.value] == "暂无数据") return;
// 选择二级菜单
this.subentryIndex = e.detail.value;
this.form.subentryId = this.subListData[this.subentryIndex]?.id || -1; // 赋值给subentryId字段
}
},
//获取分部分项工程, 以父子节点形式呈现
getProgressListData() {
this.sendRequest({
url: 'xmgl/subdivisionProject/getParentChildList',
method: 'get',
data: {
projectSn: this.projectSn
},
success: res => {
if (res.code == 200) {
this.listData = res.result;
console.log('获取分部分项工程, 以父子节点形式呈现', this.listData)
if (this.listData.length >= 1) {
this.form.subsectionId = this.listData[0].id
if (this.listData[0].children.length >= 1) {
this.subListData = this.listData[0].children;
this.form.subentryId = this.listData[0].children[0].id;
} else {
this.subListData = ['暂无数据']
}
} else {
this.listData = ['暂无数据']
}
}
}
})
},
//获取检查部位 列表
getCheckPointList() {
this.sendRequest({
url: 'xmgl/qualityRegion/list',
method: 'post',
data: {
projectSn: this.projectSn
},
success: res => {
if (res.code == 200) {
this.checkPointList = res.result;
console.log('-----------', this.checkPointList)
}
}
})
},
dealFalseCheck(arr) {
arr.map(item => {
if (item.children) {
item.checked = false;
item.orChecked = false;
this.dealFalseCheck(item.children)
} else {
item.checked = false;
item.orChecked = false;
}
})
},
//确定选中--回显
checkPointBtn(val, type) {
this.form.level = ''
// type==1 检查部位 2 问题分类 3,通知人
if (type == 1) {
this.form.enterpriseSn = "";
this.form.enterpriseName = "";
this.form.changeId = "";
console.log(val, type)
this.changePeopleIndex = null
// console.log(this.checkPointList, val, this.personList)
this.areaData = val[0];
this.form.regionId = val[0].id;
let arr = JSON.parse(JSON.stringify(val[0].parents));
let obj = {
id: val[0].id,
regionName: val[0].regionName
};
arr.push(obj);
//获取选中的字符串 名称
var regionName = arr.map(function(item, index) {
return item.regionName;
}).join("/");
this.checkPointName = regionName;
this.form.regionName = regionName;
this.form.changeId = val[0].dutyId;
this.notifier = val[0].intendanceNames;
this.form.notifyPerson = val[0].intendanceIds;
// 分包单位数据拿取
this.subpackageLsit = val[0].enterpriseInfos
this.personUpdateList = []
// 整改人数据拿取
// this.personUpdateList = val[0].systemUsers
// this.personUpdateList.forEach((item, index) => {
// if (item.userId == val[0].dutyId) {
// this.changePeopleIndex = index
// }
// });
} else if (type == 2) {
console.log('选择问题描述的数据', val);
//设置问题描述
this.form.dangerItemContent = val[0].dangerName;
this.form.dangerItemId = val[0].id;
this.form.level = val[0].level
this.form.remark = val[0].remark //整改要求
//设置问题类型
if (val[0].parents.length == 0) {
this.form.dangerTypeId = val[0].id;
this.issueName = val[0].dangerName;
} else {
this.form.dangerTypeId = val[0].parents[0].id;
this.issueName = val[0].parents[0].dangerName + '/' + val[0].parents[1].dangerName + '/' + val[0]
.dangerName;
this.form.dangerName = val[0].dangerName
}
} else if (type == 3) {
console.log(val)
this.notifier = val.map((item, index) => {
return item.workerName
}).join(',');
this.form.notifyPerson = val.map((item, index) => {
return item.workerName
}).join(',')
}
},
//获取问题分类
getIssueList() {
this.sendRequest({
url: 'xmgl/dangerTypeRecord/selectDangerTypeAndItemList',
method: 'post',
data: {
projectSn: this.projectSn,
recordStatus: 0,
},
success: (res) => {
if (res.result.length > 0) {
res.result.forEach(item => {
if (item.children && item.children.length > 0) {
item.children.forEach(itm => {
if (itm.itemList && itm.itemList.length > 0) {
itm.itemList.forEach(item2 => {
item2.dangerName = item2.content
})
itm.children = itm.itemList
}
})
}
})
console.log(res.result)
this.issueList = res.result
}
}
})
},
//补充说明
supplementTextarea(e) {
this.form.dangerDesc = e.detail.value
},
//整改要求
claimTextarea(e) {
this.form.remark = e.detail.value
},
//事件描述
eventDescription(e) {
this.form.addedDescription = e.detail.value
},
//巡检楼层
eventfloor(e) {
console.log('巡检楼层---', e);
let input = e.detail.value;
this.form.floor = parseInt(input); // 或者 this.form.floor = parseInt(input);
},
//获取分包公司
getSubpackageLsit() {
let data = {
// enterpriseTypeId: this.checkType,
pageNo: 1,
pageSize: 999,
projectSn: this.projectSn,
};
this.sendRequest({
url: 'xmgl/projectEnterprise/list',
method: 'post',
data: data,
success: (res) => {
if (res.result.records.length > 0) {
this.subpackageLsit = res.result.records;
} else {
this.subpackageLsit = [];
}
}
})
},
//下拉选择回显
bindPickerChange(e, type, eIndex) {
console.log(e)
//type ==1 问题等级;2紧急情况;3检查人;4 检查时间;5整改时限; 6整改人; 7复查人; 8核验人;
if (type == 1) {
this.issueGradeIndex = e.detail.value;
this.form.level = this.issueGradeList[e.detail.value].value;
} else if (type == 2) {
this.urgencyIndex = e.detail.value;
this.form.urgentLevel = this.urgencyList[e.detail.value].value;
} else if (type == 3) {
this.inspectManIndex = e.detail.value;
this.form.inspectManId = this.personList[e.detail.value].userId
} else if (type == 'startTime') {
this.form.inspectTime = e.f3;
} else if (type == 'startTime2') {
// this.form.changeLimitTime = e.f3;
this.rescueList[eIndex].changeLimitTime = e.f3;
} else if (type == 6) {
this.changePeopleIndex = e.detail.value;
this.form.changeId = this.personUpdateList[e.detail.value].userId;
console.log(this.changePeopleIndex, this.form.changeId)
} else if (type == 7) {
this.reviewIndex = e.detail.value;
this.form.reviewId = this.reviewList[e.detail.value].userId;
} else if (type == 8) {
this.verifyManIndex = e.detail.value;
this.form.verifyManId = this.personList[e.detail.value].userId;
}
},
//获取人员列表--- 检查人、整改人、复查人、核验人、通知人
getPersonList() {
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: this.projectSn
},
success: res => {
console.log(res.result)
if (res.result.length > 0) {
console.log('检查人员列表', this.personList);
this.personList = res.result;
let index = this.personList.findIndex(item => {
return item.userId == this.userInfo.userId;
})
if (index != -1) {
this.verifyManIndex = index;
this.form.verifyManId = this.personList[index].userId;
} else {
this.defaultAuditPerson = this.userInfo.realName;
this.form.verifyManId = this.userInfo.userId;
}
} else {
this.personList = [];
}
}
})
},
//获取人员列表--- 整改人
getPersonUpdateList() {
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: this.projectSn,
enterpriseId: this.unitEnterpriseId
},
success: res => {
console.log(res.result)
if (res.result.length > 0) {
console.log('检查人员列表', this.personList);
this.personUpdateList = res.result;
} else {
this.personUpdateList = [];
}
}
})
},
//选择的分包公司
checkSubpackage(val) {
// if (this.checkType == 1) {
this.form.enterpriseSn = val.enterpriseSn;
this.form.enterpriseName = val.enterpriseName;
this.unitEnterpriseId = val.id;
this.form.changeId = "";
this.changePeopleIndex = null;
this.isShowPicker = false;
this.$nextTick(() => {
this.isShowPicker = true;
});
let newArr = [];
if (this.areaData.systemUsers) {
this.areaData.systemUsers.filter((item) => {
if (item.userId && item.enterpriseId == this.unitEnterpriseId) {
newArr.push(item);
}
});
this.personUpdateList = newArr;
}
// this.getPersonUpdateList();
// } else {
// this.form.enterpriseSn = val.enterpriseSn;
// this.form.enterpriseName = val.enterpriseName;
// }
this.unitDialog = false;
},
//删除---公用
deletesBtn(type) {
window.event.stopPropagation();
//type==1 分包单位
if (type == 1) {
this.form.enterpriseSn = '';
this.form.enterpriseName = '';
}
},
//现场整改是否完成
switchChange(e) {
if (e.detail.value) {
this.form.status = 5;
} else {
this.form.status = 2;
}
},
//选择分包单位
clickUnit() {
this.unitDialog = true;
// this.getSubpackageLsit();
},
//切换分包商
checkTypeBtn(type) {
this.checkType = type;
this.getSubpackageLsit();
},
//上传附件
uploadImg(type, rowIndex) {
var that = this
if (type == 1) {
uni.chooseImage({
count: 1,
success(res) {
const tempFilePaths = res.tempFilePaths;
console.log(res.tempFilePaths);
uni.uploadFile({
url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: that.url_config + 'image/' + JSON.parse(uploadFileRes
.data).data[0].imageUrl
};
console.log(rowIndex,777888)
console.log(that.rescueList,777888)
that.rescueList[rowIndex].imgFileList.push(data)
uni.getImageInfo({
src: tempFilePaths[0],
success: (resInfo) => {
console.log('传过去啦 resInfo', resInfo)
that.imgList = {
imgUrl: tempFilePaths[0],
imgWidth: resInfo.width,
imgHeight: resInfo.height,
// team:'班组人员',
// name: '张三'
}
that.openImg = true
}
})
that.openImg = false
}
});
}
})
} else if (type == 2) {
uni.chooseImage({
count: 1,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
if (that.imgDialogUrl.length >= 1) {
that.imgDialogUrl[0].url = data.url
that.imgDialogUrl[0].name = data.name
} else {
that.imgDialogUrl.push(data)
}
console.log("上传图片的信息:", that.imgDialogUrl)
}
});
}
})
} else {
uni.chooseImage({
count: 1 - that.mapImgList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.mapImgList.push(data)
}
});
}
})
}
},
//删除附件
deleteImg(val, type, rowIndex, eIndex) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
if (type == 1) {
let fileArr = JSON.parse(JSON.stringify(that.rescueList[rowIndex]
.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.rescueList[rowIndex].imgFileList = fileArr;
} else if (type == 2) {
let fileArr = JSON.parse(JSON.stringify(that.rescueList[rowIndex]
.videoFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.rescueList[rowIndex].videoFileList = fileArr;
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//上传视频
uploadVideo(eIndex) {
var that = this;
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
compressed: false,
success: function(res) {
let url = res.tempFilePath;
uni.uploadFile({
url: that.url_config + 'upload/image', //仅为示例,非真实的接口地址
filePath: url,
name: 'files',
success: (uploadFileRes) => {
let obj = {
name: JSON.parse(uploadFileRes.data).data[0].fileInfo
.originalFilename,
url: that.url_config + 'image/' + JSON.parse(uploadFileRes
.data).data[0].imageUrl
}
that.rescueList[eIndex].videoFileList.push(obj);
console.log('上传视频后的数据', that.videoFileList);
}
})
}
})
},
//查看视频
playVideo(url, type) {
uni.navigateTo({
url: '../carWashManage/mediaPlay?url=' + url + '&type=' + type
})
},
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
//新增保存
addSaveBtn() {
const everyTime = this.rescueList.every(item => item.changeLimitTime);
if (!everyTime && this.rescueList.length != 0) {
uni.showToast({
title: '处置完成时间有未填项',
icon: 'none'
})
return
}
console.log(this.rescueList);
this.sendRequest({
url: 'xmgl/xzEmergencyRecord/edit',
method: 'post',
data: {
projectSn: this.projectSn,
id: this.emergencyDetail.id,
dispositionStatus: 2,
situations: this.rescueList.map(item => {
return {
disposalPersonId: item.disposalPersonId,
disposalPersonName: item.disposalPersonName,
disposalCompletionTime: item.changeLimitTime,
livePicture: JSON.stringify(item.imgFileList),
liveVideoSituation: JSON.stringify(item.videoFileList),
disposalSpecification: item.addedDescription,
}
}),
},
success: res => {
console.log(res.result)
if (res.code == 200) {
uni.showToast({
title: '提交成功',
})
uni.navigateBack()
}
}
})
},
// 切换tab
radioChange(value) {
this.typeCheck = value
this.checkedTab = value
console.log('切换tab', this.form);
// 重制内容
this.form = {
regionId: "", // 检查部位
regionName: "",
dangerItemContent: "",
dangerItemId: "",
dangerTypeId: "",
dangerDesc: "",
remark: "",
routineId: 0,
level: 0,
urgentLevel: 0,
inspectManId: "",
inspectTime: dateformat(new Date()),
enterpriseSn: "",
enterpriseName: "",
changeLimitTime: "",
changeId: "",
reviewId: "",
verifyManId: "",
notifyPerson: [],
status: 2, // 现场整改状态 2未完成 5已完成
measurePoints: [],
imageUrl: "",
fileUrl: "",
recordType: 1,
// taskId:'',
// itemId:''
};
this.issueName = ''
this.checkPointName = ""
this.videoFileList = [];
this.imgFileList = [];
this.subsectionIndex = -1
this.subentryIndex = -1
this.changePeopleIndex = null
// 重置检查部位
this.dealFalseCheck(this.checkPointList);
this.$refs.locationTree._reTreeList();
// 分包单位数据拿取
this.subpackageLsit = []
// 整改人数据拿取
this.personUpdateList = []
let index = this.personList.findIndex(item => {
return item.userId == this.userInfo.userId;
})
if (index != -1) {
this.verifyManIndex = index;
this.form.verifyManId = this.personList[index].userId;
} else {
this.defaultAuditPerson = this.userInfo.realName;
this.form.verifyManId = this.userInfo.userId;
}
}
}
}
</script>
<style lang="scss" scoped>
.emergencyDisposal {
height: 100%;
}
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
/deep/.headerBox {
background: #2b8df3;
color: #fff;
}
}
.rescue-item:not(:first-child) {
margin-top: 22rpx;
}
.rescue-item {
background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(198, 220, 255, 0.2) 100%);
box-shadow: 0px 8rpx 32rpx -8rpx rgba(42, 60, 106, 0.24);
border-radius: 34rpx;
padding: 24rpx 24rpx;
position: relative;
}
.rescue-item_delete {
color: #D81E06;
font-size: 38rpx;
font-weight: bold;
position: absolute;
top: 8rpx;
right: 32rpx;
}
.rescue-item_add {
width: 580rpx;
height: 74rpx;
background: #FFFFFF;
border-radius: 8rpx;
border: 2rpx dashed #D8DBE8;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 34rpx;
.icon-add {
width: 10px;
height: 10px;
margin-right: 10rpx;
}
}
.radio-group {
display: flex;
.uni-label-pointer {
display: flex;
}
.uni-label-pointer:not(:first-child) {
margin-left: 40rpx;
}
/deep/ .uni-radio-input {
width: 32rpx;
height: 32rpx;
}
}
.immediate-rescue {
margin: 0 4%;
position: relative;
}
.tab {
width: 100%;
height: 45px;
text-align: center;
box-shadow: 0 0 10px rgba(194, 194, 194, 0.5);
}
.tabType {
width: 50%;
line-height: 43px;
border-bottom: 1px solid rgba(194, 194, 194, 0.2);
}
.checkedTab {
color: #4181FE;
border-bottom: 2px solid #4181FE;
}
.noCheckTab {
padding-bottom: 2px;
}
.lagCss {
width: 180px;
height: 61px;
background: #fff;
text-align: center;
line-height: 29px;
border-radius: 10px;
}
.add2 {
width: 120px;
height: 30px;
line-height: 30px;
text-align: center;
color: #fff;
background: #4181fe;
border-radius: 25px;
font-size: 14px;
margin: 0px 22px;
}
.point {
height: 20px;
width: 20px;
position: absolute;
}
.flex {
display: flex;
align-items: center;
}
.flex2 {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex3 {
display: flex;
}
.content {
width: 100%;
box-sizing: border-box;
// padding: 20px 30rpx;
}
.type {
font-size: 30rpx;
line-height: 40px;
margin-bottom: 8px;
/* border-bottom: 1px solid rgba(194, 194, 194, 0.2); */
}
.type .name {
width: 220rpx;
margin-right: 6px;
// width: 176rpx;
text-align: right;
}
.radio-wrap {
display: flex;
align-items: center;
.radio {
margin-right: 20px;
}
}
.accessory {
width: 100%;
height: 70px;
padding: 0 10px;
box-sizing: border-box;
}
.accessoryImg {
width: 110rpx;
height: 60px;
margin-right: 8px;
}
.picker {
width: 70%;
border: 1px solid rgba(42, 43, 91, 0.3);
padding: 0px 30rpx;
box-sizing: border-box;
border-radius: 5px;
}
.uni-input {
line-height: 32px;
}
.textarea {
width: calc(79% - 32px);
border-radius: 5px;
border: 1px solid rgba(42, 43, 91, 0.3);
padding: 8px 15px;
box-sizing: border-box;
height: 50px;
}
.inpuStyle {
width: calc(80% - 35px);
border-radius: 20px;
border: 1px solid rgba(42, 43, 91, 0.3);
padding: 8px 15px;
box-sizing: border-box;
height: 35px;
color: #000;
}
.cl {
font-size: 30rpx;
border-radius: 5px;
}
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
// width: 75%;
}
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 100%;
height: 100%;
border-radius: 10px;
}
.deleteImg {
position: absolute;
right: -6rpx;
top: -36rpx;
font-size: 36rpx;
color: #fff;
}
}
.addImgBox {
border: 2rpx solid rgba(42, 43, 91, 0.1);
background-color: rgba(236, 240, 255, 0.83);
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
.icon-add {
width: 36rpx;
height: 36rpx;
}
}
.unitDialog {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 111;
background-color: rgba(0, 0, 0, 0.5);
}
.unitContent {
width: 85%;
height: 70%;
margin: 25% auto 0;
background-color: #fff;
box-sizing: border-box;
padding: 20px 30rpx;
border-radius: 5px;
box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
.tabs {
border-bottom: 1px solid rgba(153, 153, 153, 0.5);
}
.tabs_name {
width: 40%;
text-align: center;
padding: 5px 10rpx;
box-sizing: border-box;
font-size: 30rpx;
}
.checkName {
border-bottom: 2px solid #4181FE;
color: #4181FE;
}
.noCheckName {
padding-top: 4px;
}
.unitList {
margin: 10px 0;
font-size: 30rpx;
.title {
margin-bottom: 10px;
}
.list_val {
padding: 8px 10px;
}
}
.bg_999 {
background-color: rgba(153, 153, 153, 0.1);
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.status {
color: #007AFF;
}
.addSaveBtn {
margin: 30px auto;
width: 60%;
padding: 10px 0;
text-align: center;
background-color: #4181FE;
color: #fff;
font-size: 34rpx;
border-radius: 30px;
letter-spacing: 2px;
box-shadow: 0 3px 10px rgba(65, 129, 254, 0.8);
}
.addSaveBtn:active {
background-color: rgba(65, 129, 254, 0.8);
}
.radio-box {
display: flex;
}
.radio-item {
display: flex;
margin-right: 20rpx;
align-items: center;
font-size: 28rpx;
/deep/ .uni-radio-input {
width: 32rpx;
height: 32rpx;
}
}
.radio-text {
height: 72rpx;
}
.butA {
display: flex;
// position: absolute;
top: 60%;
width: 70%;
}
.icon-right {
margin-left: 16rpx;
width: 16rpx;
height: 32rpx;
}
.dateTimePiccker {
border: 2rpx solid #ccc;
border-radius: 10rpx;
// width: 67%;
flex: 1;
padding-left: 20rpx;
}
</style>