1280 lines
33 KiB
Vue
Raw Normal View History

2022-06-08 15:48:09 +08:00
<template>
<view class="fullHeight addExamine">
<headers class="fixedheader" :themeType="true" :showBack="true">
<view class="headerName">
{{headerTitle}}
</view>
<!-- <view class="header-btn" @tap="previewRecord" v-if="pageType == 1">
隐患记录
</view> -->
</headers>
2022-08-02 15:11:04 +08:00
<scroll-view class="smallHeight" :class="{'p-0': pageType == 4||pageType == 5}"
:style="{ 'padding-top': statusBarHeight + 45 + 'px' }" scroll-y>
2022-06-08 15:48:09 +08:00
<view class="addExamine-form">
<view class="form-box">
<view class="form-title b-bottom">
上报安全隐患
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status == 1 && addForm.status == 2 || pageType == 1">
<view class="form-item flex">
<view class="form-lable"><text>是否需要整改</text></view>
<radio-group class="flex" @change="radioChange">
2022-08-02 15:11:04 +08:00
<label class="uni-list-cell uni-list-cell-pd flex" v-for="(item, index) in radioOptions"
:key="index">
<radio :disabled="isDisabled" :value="item.id"
:checked="addForm.status === item.id" />
<view>{{item.name}}</view>
</label>
2022-06-08 15:48:09 +08:00
</radio-group>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable">*<text>隐患类别</text></view>
<view class="text" @click="checkDanger">
2023-03-13 10:57:42 +08:00
<text>{{addForm.examineEntry !=''? addForm.examineEntry : "--请选择隐患--"}}</text>
2022-06-08 15:48:09 +08:00
</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>检查项目</text></view>
<view class="text">
<text>{{addForm.examineProject}}</text>
</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>隐患内容</text></view>
<view class="form-textarea">
2022-08-02 15:11:04 +08:00
<textarea :disabled="isDisabled" :value="addForm.examineContent"
@blur="bindTextAreaBlur" />
2022-06-08 15:48:09 +08:00
</view>
</view>
</view>
2023-03-20 18:43:57 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>整改要求</text></view>
<view class="form-textarea">
<textarea :disabled="isDisabled" :value="addForm.requestContent"
@blur="bindTextAreaBlur2" />
</view>
</view>
</view>
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>隐患等级</text></view>
<view class="text">
<text>{{addForm.examineLv}}</text>
</view>
</view>
</view>
2023-03-20 18:43:57 +08:00
<view class="b-bottom">
<view class="form-item flex">
<view class="form-lable">*<text>检查类型</text></view>
<picker class="form-content" :disabled="isDisabled" :value="addForm.type"
range-key="inspectTypeName" :range="typeList" @change="bindExamineType">
<view class="uni-input" :class="{'noCheck': !addForm.type.toString()}">
{{addForm.type.toString() ? typeList[addForm.type].inspectTypeName : "请选择检查类型"}}
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable">*<text>事故隐患等级</text></view>
2022-08-02 15:11:04 +08:00
<picker class="form-content" :disabled="isDisabled" :value="addForm.faultLevel"
range-key="name" :range="faultLevelList" @change="bindfaultLevel">
2022-06-08 15:48:09 +08:00
<view class="uni-input" :class="{'noCheck': !addForm.faultLevel.toString()}">
{{addForm.faultLevel.toString() ? faultLevelList[addForm.faultLevel].name : "请选择事故隐患等级"}}
2022-08-02 15:11:04 +08:00
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
2022-06-08 15:48:09 +08:00
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2023-12-15 09:27:23 +08:00
<view class="b-b ottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable">*<text>责任区域</text></view>
<picker @click="openDutyArea" :disabled="true" class="picker">
<view class="uni-input uni-select cl" v-if="hiddenDangerInspectRegionName == ''">
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
</view>
<view class="uni-input uni-select flex2" v-else>
<view style="width: 98%;white-space: nowrap;" class="ellipsis">
{{hiddenDangerInspectRegionName }}</view>
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom">
<view class="form-item flex">
2022-08-02 15:11:04 +08:00
<view class="form-lable">
<view v-if="addForm.status == 1" style="display: inline;">*</view><text>详细位置</text>
</view>
2022-06-08 15:48:09 +08:00
<view class="form-input">
2022-08-02 15:11:04 +08:00
<input :disabled="isDisabled" :value="addForm.address" @blur="bindAddress" type="text"
placeholder="输入详细位置信息" />
2022-06-08 15:48:09 +08:00
</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable">*<text>整改责任人</text></view>
2022-08-02 15:11:04 +08:00
<picker class="form-content" :disabled="isDisabled" :value="addForm.dutyPeople"
range-key="realName" :range="dutyPeopleList" @change="bindPeopleId">
2022-06-08 15:48:09 +08:00
<view class="uni-input" :class="{'noCheck': !addForm.dutyPeople.toString()}">
{{addForm.dutyPeople.toString() ? dutyPeopleList[addForm.dutyPeople].realName : "请选择整改责任人"}}
2022-08-02 15:11:04 +08:00
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
2022-06-08 15:48:09 +08:00
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>整改单位</text></view>
2022-08-02 15:11:04 +08:00
<picker class="form-content" :disabled="isDisabled" :value="addForm.dutyUnit"
range-key="enterpriseName" :range="dutyUnitList" @change="bindDutyUnit">
2022-06-08 15:48:09 +08:00
<view class="uni-input" :class="{'noCheck': !addForm.dutyUnit.toString()}">
{{addForm.dutyUnit.toString() ? dutyUnitList[addForm.dutyUnit].enterpriseName : "请选择整改单位"}}
2022-08-02 15:11:04 +08:00
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
2022-06-08 15:48:09 +08:00
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom" v-if="addForm.status != 1">
<view class="form-item flex">
<view class="form-lable"><text>要求完成时间</text></view>
2022-08-02 15:11:04 +08:00
<picker class="form-content" :disabled="isDisabled" mode="date" :value="addForm.date"
:start="startDate" @change="bindDateChange">
<view class="uni-input">
{{addForm.date}}
<uni-icons v-if="!isDisabled" type="arrowright" color="#6C7178" />
2022-06-08 15:48:09 +08:00
</view>
</picker>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<view class="b-bottom">
<view class="form-item flex">
<view class="form-lable"><text>补充说明</text></view>
<view class="form-textarea">
2022-08-02 15:11:04 +08:00
<textarea :disabled="isDisabled" :value="addForm.remark" @blur="bindRemarksBlur" />
2022-06-08 15:48:09 +08:00
</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
<view class="form-item flex f-column a-start" style="height: 100px;">
2022-08-02 15:11:04 +08:00
<view class="form-lable">
<view v-if="addForm.status == 1" style="display: inline;">*</view><text>图片</text>
</view>
2022-06-08 15:48:09 +08:00
<view class="uni-form-input imgBox_wrap">
<view class="addImgBox" @click="uploadImg" v-if="!isDisabled">
2022-08-02 15:11:04 +08:00
<image src="/static/safeMange/upload_image.png" class="icon-add" color="#F56C6C">
</image>
2022-06-08 15:48:09 +08:00
</view>
2022-08-02 15:11:04 +08:00
<view class="imgBox" v-show="addForm.imgFileList.length>0"
v-for="(item,index) in addForm.imgFileList" :key="index">
2022-06-08 15:48:09 +08:00
<image :src="url_config+'image/'+item.url" class="img"
@click="previewImage(url_config+'image/'+item.url)"></image>
<view v-if="!isDisabled" @click="deleteImg(item,1)" class="deleteImg">
<image src="/static/safeMange/close_icon.png" color="#F56C6C"></image>
</view>
</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<reply-list :replyData="replyData" v-if="replyData.length > 0"></reply-list>
</scroll-view>
<view class="btn-box" v-if="pageType != 4&&pageType != 5">
<view class="submit-btn" v-if="pageType != 3" @click="submitForm">{{btnTitle}}</view>
<view class="btn-box" v-if="pageType == 3">
<view class="cancle-btn" @click="showDialog(1)">驳回</view>
<view class="pass-btn" @click="showDialog(2)">通过</view>
</view>
</view>
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
<dialogs class="formDialog" ref="dialogs">
<template v-slot:content>
<view class="dialog-title">
复查情况
</view>
<view class="dialog-content">
<view class="form-textarea">
2022-08-02 15:11:04 +08:00
<textarea placeholder="请输入复查情况" @blur="bindContentBlur" />
2022-06-08 15:48:09 +08:00
</view>
</view>
<view class="dialog-btn">
<view class="cancle-btn" @click="cancleReply">取消</view>
<view class="primary-btn" @click="submitReply">提交</view>
</view>
</template>
</dialogs>
2023-12-15 09:27:23 +08:00
<!-- 隐患区域 -->
<tki-tree ref="locationTree" @confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="checkPointList"
rangeKey="regionName" confirmColor="#4e8af7" :selectParent="true" />
<canversCom v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
2022-06-08 15:48:09 +08:00
</view>
</template>
<script>
import canversCom from "@/pages/videoManage/component/canversCom.vue"
2023-12-15 09:27:23 +08:00
import tkiTree from "@/components/tki-tree/tki-tree.vue"
2022-06-08 15:48:09 +08:00
import headers from '../../../components/headers/headers.vue';
import replyList from './replyList.vue';
import dialogs from '../../../components/dialog/dialog.vue'
export default {
2022-08-02 15:11:04 +08:00
data() {
return {
2023-12-15 09:27:23 +08:00
checkPointList: [],
hiddenDangerInspectRegionId: "",
hiddenDangerInspectRegionName: "",
imgList: {},
openImg: false,
2022-06-08 15:48:09 +08:00
headerTitle: "隐患上报",
statusBarHeight: 0,
2022-08-02 15:11:04 +08:00
typeList: [],
dutyPeopleList: [],
dutyUnitList: [],
2022-06-08 15:48:09 +08:00
engineeringId: "",
2022-08-02 15:11:04 +08:00
faultLevelList: [{
2022-06-08 15:48:09 +08:00
id: 1,
name: "一般"
2022-08-02 15:11:04 +08:00
}, {
2022-06-08 15:48:09 +08:00
id: 2,
name: "重大"
}],
2022-08-02 15:11:04 +08:00
radioOptions: [{
2022-06-08 15:48:09 +08:00
id: "1",
name: "无需整改"
2022-08-02 15:11:04 +08:00
}, {
2022-06-08 15:48:09 +08:00
id: "2",
name: "待整改"
}],
2022-08-02 15:11:04 +08:00
addForm: {
2022-06-08 15:48:09 +08:00
type: "",
typeId: "",
examineProject: "",
examineEntry: "",
examineContent: "",
examineLv: "",
requestContent: "",
address: "",
date: this.getDate({
format: true,
}),
imgFileList: [],
dutyPeople: "",
dutyPeopleId: "",
dutyUnit: "",
enterpriseSn: "",
faultLevel: "",
status: "2",
2023-03-20 18:43:57 +08:00
remark: "",
taskId: '',
itemId: '',
2022-06-08 15:48:09 +08:00
},
pageType: 1,
2022-08-02 15:11:04 +08:00
replyData: [],
2022-06-08 15:48:09 +08:00
btnTitle: "保存",
projectSn: "",
userId: "",
isDisabled: false,
datailData: {},
reviewStatus: 1,
reviewContent: "",
taskId: "",
itemId: "",
base64Image: '',
2022-06-08 15:48:09 +08:00
}
},
computed: {
2022-08-02 15:11:04 +08:00
startDate() {
return this.getDate('start');
}
2022-06-08 15:48:09 +08:00
},
2022-08-02 15:11:04 +08:00
components: {
2022-06-08 15:48:09 +08:00
headers,
replyList,
dialogs,
2023-12-15 09:27:23 +08:00
canversCom,
tkiTree
2022-06-08 15:48:09 +08:00
},
2022-08-02 15:11:04 +08:00
onShow() {
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
2022-06-08 15:48:09 +08:00
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
this.userId = JSON.parse(uni.getStorageSync('userInfo')).userId
this.queryTypeList()
this.queryUserData()
this.getSubpackageLsit()
2022-08-02 15:11:04 +08:00
if (uni.getStorageSync('dangerData')) {
2022-06-08 15:48:09 +08:00
let dangerData = uni.getStorageSync('dangerData')
this.addForm.examineContent = dangerData.checkContent
this.addForm.examineLv = dangerData.hiddenDangerLevel
this.addForm.requestContent = dangerData.rectifyRequire
this.addForm.examineProject = dangerData.hiddenDangerName
this.addForm.examineEntry = dangerData.title
2022-06-08 15:48:09 +08:00
console.log(uni.getStorageSync('dangerData'), '-----检查项列表带回数据')
}
2022-08-02 15:11:04 +08:00
if (uni.getStorageSync('detailData')) {
2022-06-08 15:48:09 +08:00
let data = ""
this.datailData = data = uni.getStorageSync('detailData');
console.log('带回的数据', uni.getStorageSync('detailData'));
2022-06-08 15:48:09 +08:00
this.addForm.examineContent = data.checkContent
this.addForm.examineLv = data.hiddenDangerLevel
this.addForm.requestContent = data.rectifyRequire
this.addForm.examineProject = data.checkSubitem
this.addForm.examineEntry = data.checkItem
this.addForm.address = data.dutyRegion
this.addForm.date = data.changeLimitTime
let imgArr = data.imageUrl.split(",")
this.enterpriseSn = data.enterpriseSn
this.addForm.typeId = data.inspectTypeId
this.addForm.status = data.status.toString()
this.addForm.remark = data.dangerDesc
2023-12-15 09:27:23 +08:00
this.hiddenDangerInspectRegionName = data.hiddenDangerInspectRegionName
this.hiddenDangerInspectRegionId = data.hiddenDangerInspectRegionId
2022-06-08 15:48:09 +08:00
// console.log(imgArr)
this.addForm.imgFileList = []
2022-08-02 15:11:04 +08:00
imgArr.forEach(item => {
if (item) {
this.addForm.imgFileList.push({
url: item
})
2022-06-08 15:48:09 +08:00
}
})
2022-08-02 15:11:04 +08:00
this.faultLevelList.forEach((item, index) => {
if (data.faultLevel == item.id) {
2022-06-08 15:48:09 +08:00
this.addForm.faultLevel = index
}
})
this.queryReply(data.id)
console.log(this.addForm)
// this.addForm = {
// type: "",
// typeId: "",
// dutyPeople: "",
// dutyPeopleId: "",
// dutyUnit: "",
// }
}
2023-12-15 09:27:23 +08:00
this.getCheckPointList()
2022-06-08 15:48:09 +08:00
console.log(uni.getStorageSync('detailData'), '-----详情')
},
2022-08-02 15:11:04 +08:00
onLoad(val) {
2023-03-20 18:43:57 +08:00
console.log(val.temId, '-----记载详情')
2022-08-02 15:11:04 +08:00
if (val.engineeringId) {
2022-06-08 15:48:09 +08:00
this.engineeringId = val.engineeringId
2022-08-02 15:11:04 +08:00
if (uni.getStorageSync('engineeringList')) {
2022-06-08 15:48:09 +08:00
let data = uni.getStorageSync('engineeringList')
let arr1 = [],
arr2 = []
2022-08-02 15:11:04 +08:00
data.forEach(item => {
2022-06-08 15:48:09 +08:00
arr1.push(item.id)
arr2.push(item.checkDetailContent)
})
this.addForm.checkItemResultId = arr1.join(',')
this.addForm.remark = arr2.join(" ")
2022-06-08 15:48:09 +08:00
}
}
// 判断页面类型 1.新增 2.整改详细 3.审核详细 4.查看详情
2022-08-02 15:11:04 +08:00
if (val.type) {
2022-06-08 15:48:09 +08:00
this.pageType = val.type
}
2022-08-02 15:11:04 +08:00
if (val.type == 2) {
2022-06-08 15:48:09 +08:00
this.headerTitle = "整改详细"
this.btnTitle = "整改回复"
this.isDisabled = true
2022-08-02 15:11:04 +08:00
} else if (val.type == 3 || val.type == 4) {
2022-06-08 15:48:09 +08:00
this.headerTitle = "隐患上报详细"
this.isDisabled = true
}
2022-08-02 15:11:04 +08:00
if (val.type == 5) {
2022-06-08 15:48:09 +08:00
this.headerTitle = "整改情况"
this.isDisabled = true
}
2022-08-02 15:11:04 +08:00
if (val.taskId && val.itemId) {
2022-06-08 15:48:09 +08:00
this.taskId = val.taskId
this.itemId = val.itemId
}
console.log(val, '----页面类型')
},
2022-08-02 15:11:04 +08:00
methods: {
2023-12-15 09:27:23 +08:00
//确定选中--回显
checkPointBtn(val, type) {
// type==1 责任区域
console.log(val, "下拉树形回显")
if (type == 1) {
// console.log(this.checkPointList, val, this.personList)
for (let i = 0; i < this.dutyPeopleList.length; i++) {
if (this.dutyPeopleList[i].realName === val[0].dutyName) {
this.addForm.dutyPeople = i
this.addForm.dutyPeopleId = this.dutyPeopleList[i].userId
}
}
this.hiddenDangerInspectRegionName = val[0].regionName
this.hiddenDangerInspectRegionId = val[0].id
// console.log(this.addForm.dutyPeople,"下拉",this.hiddenDangerInspectRegionName)
}
},
openDutyArea() {
if (this.isDisabled) {
return
}
this.$refs.locationTree._show()
},
//获取责任区域 列表
getCheckPointList() {
this.sendRequest({
url: 'xmgl/hiddenDangerInspectRegion/tree',
method: 'post',
data: {
projectSn: this.projectSn
},
success: res => {
if (res.code == 200) {
this.checkPointList = res.result;
console.log('责任区域下拉', this.checkPointList)
}
}
})
},
imgUrl(val) {
this.openImg = false
this.imgUpload(val)
this.openImg = true
},
2022-08-02 15:11:04 +08:00
queryReply(val) {
2022-06-08 15:48:09 +08:00
let _this = this
this.sendRequest({
url: 'xmgl/hiddenDangerRectifyRecord/selectHiddenDangerRectifyRecordList',
method: 'post',
data: {
inspectId: val
},
success: res => {
2022-08-02 15:11:04 +08:00
res.result.forEach(item => {
if (item.fileUrl != "") {
2022-06-08 15:48:09 +08:00
let arr = item.fileUrl.split(",")
item.imgFileList = []
2022-08-02 15:11:04 +08:00
arr.forEach(itm => {
item.imgFileList.push({
url: itm
})
2022-06-08 15:48:09 +08:00
})
}
})
this.replyData = res.result
console.log(res.result, '-----整改回复')
}
})
},
2022-08-02 15:11:04 +08:00
queryTypeList() {
2022-06-08 15:48:09 +08:00
let sn = JSON.parse(uni.getStorageSync('userInfo')).headquartersSn
let _this = this
this.sendRequest({
url: 'xmgl/inspectType/list',
method: 'post',
data: {
sn: sn
},
success: res => {
this.typeList = res.result
2022-08-02 15:11:04 +08:00
if (this.datailData) {
this.typeList.forEach((item, index) => {
if (this.datailData.inspectTypeId == item.id) {
2022-06-08 15:48:09 +08:00
this.addForm.type = index
}
})
}
console.log(res.result, '-----检查类型')
}
})
},
2022-08-02 15:11:04 +08:00
queryUserData() {
2022-06-08 15:48:09 +08:00
let _this = this
this.sendRequest({
url: 'xmgl/systemUser/getProjectChilderSystemUserList',
method: 'post',
data: {
projectSn: this.projectSn
},
success: res => {
_this.dutyPeopleList = res.result
2022-08-02 15:11:04 +08:00
if (this.datailData) {
this.dutyPeopleList.forEach((item, index) => {
if (this.datailData.changeUser == item.userId) {
2022-06-08 15:48:09 +08:00
this.addForm.dutyPeople = index
}
})
}
console.log(res.result, '-----检查人')
}
})
},
getSubpackageLsit() {
let data = {
enterpriseTypeId: "",
pageNo: 1,
pageSize: 10000,
projectSn: this.projectSn,
};
this.sendRequest({
url: 'xmgl/projectEnterprise/list',
method: 'post',
data: data,
success: (res) => {
console.log(res.result, '------整改单位')
if (res.result.records.length > 0) {
this.dutyUnitList = res.result.records;
} else {
this.dutyUnitList = [];
}
2022-08-02 15:11:04 +08:00
if (this.datailData) {
this.dutyUnitList.forEach((item, index) => {
if (this.datailData.enterpriseSn == item.enterpriseSn) {
2022-06-08 15:48:09 +08:00
this.addForm.dutyUnit = index
}
})
}
}
})
},
2022-08-02 15:11:04 +08:00
bindExamineType(e) {
2022-06-08 15:48:09 +08:00
this.addForm.type = e.detail.value
this.addForm.typeId = this.typeList[e.detail.value].id
console.log(e)
},
2022-08-02 15:11:04 +08:00
bindContentBlur(e) {
this.reviewContent = e.detail.value
2022-06-08 15:48:09 +08:00
},
2022-08-02 15:11:04 +08:00
bindTextAreaBlur(e) {
2022-06-08 15:48:09 +08:00
this.addForm.examineContent = e.detail.value
console.log(e.detail.value)
},
2022-08-02 15:11:04 +08:00
bindTextAreaBlur2(e) {
2022-06-08 15:48:09 +08:00
this.addForm.requestContent = e.detail.value
},
2022-08-02 15:11:04 +08:00
bindRemarksBlur(e) {
2022-06-08 15:48:09 +08:00
this.addForm.remark = e.detail.value
},
2022-08-02 15:11:04 +08:00
bindDateChange(e) {
2022-06-08 15:48:09 +08:00
this.addForm.date = e.detail.value
console.log(e.detail.value)
},
2022-08-02 15:11:04 +08:00
bindPeopleId(e) {
2022-06-08 15:48:09 +08:00
this.addForm.dutyPeople = e.detail.value
this.addForm.dutyPeopleId = this.dutyPeopleList[e.detail.value].userId
console.log(e.detail.value)
},
2022-08-02 15:11:04 +08:00
bindfaultLevel(e) {
2022-06-08 15:48:09 +08:00
this.addForm.faultLevel = e.detail.value
},
2022-08-02 15:11:04 +08:00
bindDutyUnit(e) {
2022-06-08 15:48:09 +08:00
this.addForm.dutyUnit = e.detail.value
this.addForm.enterpriseSn = this.dutyUnitList[e.detail.value].enterpriseSn
console.log(e.detail.value)
},
2022-08-02 15:11:04 +08:00
bindAddress(e) {
2022-06-08 15:48:09 +08:00
this.addForm.address = e.detail.value
console.log(e.detail.value)
},
getDate(type) {
2022-08-02 15:11:04 +08:00
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}`;
2022-06-08 15:48:09 +08:00
},
2023-03-13 10:57:42 +08:00
checkDanger(val) {
2023-03-13 10:57:42 +08:00
console.log('点击触发了吗=========');
2022-08-02 15:11:04 +08:00
if (!this.isDisabled) {
2023-03-13 10:57:42 +08:00
// if (uni.getStorageSync('dangerData')) {
// uni.removeStorageSync('dangerData');
// }
2022-06-08 15:48:09 +08:00
uni.navigateTo({
2023-03-20 18:43:57 +08:00
url: './dangerLibrary?type=1&taskId=' + this.taskId + '&itemId=' + this.itemId
2022-06-08 15:48:09 +08:00
})
}
},
2022-08-02 15:11:04 +08:00
radioChange(e) {
2022-06-08 15:48:09 +08:00
// this.restForm()
console.log(this.addForm)
this.addForm.status = e.detail.value
console.log(this.addForm.status)
},
//上传附件
uploadImg() {
var that = this
uni.chooseImage({
count: 5 - that.addForm.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
console.log('传过去啦 - tempFilePaths', tempFilePaths)
2022-06-08 15:48:09 +08:00
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
};
console.log('传过去啦', res)
2022-06-08 15:48:09 +08:00
that.addForm.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
2022-06-08 15:48:09 +08:00
}
});
}
})
},
//删除附件
deleteImg(val, type) {
let that = this;
uni.showModal({
title: '提示',
content: '确定删除该附件吗?',
success: function(res) {
if (res.confirm) {
if (type == 1) {
let fileArr = JSON.parse(JSON.stringify(that.addForm.imgFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.addForm.imgFileList = fileArr;
} else if (type == 2) {
let fileArr = JSON.parse(JSON.stringify(that.videoFileList));
fileArr.forEach((item, index) => {
if (item.url == val.url) {
fileArr.splice(index, 1)
}
})
that.videoFileList = fileArr;
}
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
},
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
2022-08-02 15:11:04 +08:00
restForm() {
2022-06-08 15:48:09 +08:00
this.addForm = {
type: "",
typeId: "",
examineProject: "",
examineEntry: "",
examineContent: "",
examineLv: "",
requestContent: "",
address: "",
date: this.getDate({
format: true,
}),
imgFileList: [],
dutyPeople: "",
dutyPeopleId: "",
dutyUnit: "",
enterpriseSn: "",
status: "1",
remark: ""
}
2022-08-02 15:11:04 +08:00
if (uni.getStorageSync('dangerData')) {
2022-06-08 15:48:09 +08:00
uni.removeStorageSync('dangerData');
}
},
//图片上传请求的接口
imgUpload(baseImg) {
let that = this
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) => {
2023-12-15 09:27:23 +08:00
console.log('图片接口返回的结果', res.data);
that.addForm.imgFileList[that.addForm.imgFileList.length - 1].url = res.data.imageUrl
}
})
},
2022-08-02 15:11:04 +08:00
submitForm() {
let that = this
console.log('this.addForm1------------', this.addForm)
2022-08-02 15:11:04 +08:00
if (this.pageType == 1) {
2022-06-08 15:48:09 +08:00
let data = {
2022-08-02 15:11:04 +08:00
projectSn: this.projectSn, //项目编号
reviewId: this.userId, //核查人ID--
createUser: this.userId, //创建人
dangerDesc: this.addForm.remark, //报警信息
status: this.addForm.status, //整改状态 1无需整改2待整改3待复查4合格5不合格
dutyRegion: this.addForm.address, //地址
engineeringId: this.engineeringId, //工程id
taskId: this.taskId,
itemId: this.itemId,
2023-12-15 09:27:23 +08:00
hiddenDangerInspectRegionName: this.hiddenDangerInspectRegionName,
hiddenDangerInspectRegionId: this.hiddenDangerInspectRegionId
2022-06-08 15:48:09 +08:00
};
2022-08-02 15:11:04 +08:00
data.inspectTypeId = this.addForm.typeId
data.taskId = this.taskId
data.itemId = this.itemId
data.imageUrl = ''
2022-06-08 15:48:09 +08:00
let arr = []
2022-08-02 15:11:04 +08:00
this.addForm.imgFileList.forEach(item => {
arr.push(item.url)
2022-06-08 15:48:09 +08:00
})
data.imageUrl = arr.join(",")
2023-03-20 18:43:57 +08:00
// if (this.addForm.typeId == "") {
// uni.showToast({
// title: '请选择检查类型!',
// icon: "none",
// duration: 2000
// });
// return;
// }
2022-08-02 15:11:04 +08:00
if (this.addForm.status == 2) {
2023-12-15 09:27:23 +08:00
if (this.addForm.hiddenDangerInspectRegionName == "") {
uni.showToast({
title: '请选择责任区域!',
icon: "none",
duration: 2000
});
return;
}
2022-08-02 15:11:04 +08:00
if (this.addForm.dutyPeopleId == "") {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '请选择整改责任人!',
2022-06-08 15:48:09 +08:00
icon: "none",
duration: 2000
});
return;
}
2022-08-02 15:11:04 +08:00
if (this.addForm.faultLevel.toString() == "") {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '请选择事故隐患等级!',
2022-06-08 15:48:09 +08:00
icon: "none",
duration: 2000
});
return;
}
2022-08-02 15:11:04 +08:00
data.checkItem = this.addForm.examineEntry
data.checkSubitem = this.addForm.examineProject
data.checkContent = this.addForm.examineContent
data.hiddenDangerLevel = this.addForm.examineLv
data.rectifyRequire = this.addForm.requestContent
data.changeUser = this.addForm.dutyPeopleId
data.enterpriseSn = this.addForm.enterpriseSn
data.changeLimitTime = this.addForm.date
data.faultLevel = this.faultLevelList[this.addForm.faultLevel].id
2022-06-08 15:48:09 +08:00
data.recordType = 1
2022-08-02 15:11:04 +08:00
if (this.addForm.checkItemResultId) {
data.checkItemResultId = this.addForm.checkItemResultId
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
} else {
if (data.dutyRegion == "") {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '请填写详细位置信息!',
2022-06-08 15:48:09 +08:00
icon: "none",
duration: 2000
});
return;
}
2022-08-02 15:11:04 +08:00
if (data.imageUrl == "") {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '请上传图片!',
2022-06-08 15:48:09 +08:00
icon: "none",
duration: 2000
});
return;
}
data.recordType = 2
}
2023-03-20 18:43:57 +08:00
console.log('this.addForm2--------------', this.addForm)
2022-06-08 15:48:09 +08:00
let _this = this
this.sendRequest({
url: 'xmgl/hiddenDangerInspectRecord/add',
method: 'post',
data: data,
success: (res) => {
2022-08-02 15:11:04 +08:00
if (res.code == 200) {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '保存成功'
2022-06-08 15:48:09 +08:00
})
2023-03-13 10:57:42 +08:00
uni.navigateTo({
url: "./safeIndex"
})
2022-06-08 15:48:09 +08:00
}
console.log(res.result)
}
})
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
if (this.pageType == 2) {
2022-06-08 15:48:09 +08:00
uni.redirectTo({
url: "./rectificationReply"
})
}
},
2022-08-02 15:11:04 +08:00
previewRecord() {
2022-06-08 15:48:09 +08:00
uni.navigateTo({
2022-08-02 15:11:04 +08:00
url: "./dangerRecord"
2022-06-08 15:48:09 +08:00
})
},
// refusalForm(){
// uni.redirectTo({
// url: "./dangerList?type=2"
// })
// },
2022-08-02 15:11:04 +08:00
showDialog(val) {
2022-06-08 15:48:09 +08:00
this.$refs.dialogs.showFn()
this.reviewStatus = val
},
2022-08-02 15:11:04 +08:00
cancleReply() {
2022-06-08 15:48:09 +08:00
this.$refs.dialogs.hideFn2()
},
2022-08-02 15:11:04 +08:00
submitReply() {
if (this.reviewContent == "") {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '请输入复查情况!',
2022-06-08 15:48:09 +08:00
icon: "none",
duration: 2000
});
return;
}
let data = {
createUser: this.userId,
inspectId: "",
additionalRemarks: this.reviewContent,
status: this.reviewStatus,
2023-03-20 18:43:57 +08:00
type: 2,
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
if (uni.getStorageSync('detailData')) {
2022-06-08 15:48:09 +08:00
data.inspectId = uni.getStorageSync('detailData').id
}
console.log(data)
let _this = this
this.sendRequest({
url: 'xmgl/hiddenDangerRectifyRecord/add',
method: 'post',
data: data,
success: (res) => {
2022-08-02 15:11:04 +08:00
if (res.code == 200) {
2022-06-08 15:48:09 +08:00
uni.showToast({
2022-08-02 15:11:04 +08:00
title: '保存成功'
2022-06-08 15:48:09 +08:00
})
2022-08-02 15:11:04 +08:00
2022-06-08 15:48:09 +08:00
uni.navigateBack({})
}
console.log(res.result)
}
})
this.$refs.dialogs.hideFn2()
// uni.redirectTo({
// url: './dangerList?type=2'
// })
}
}
}
</script>
<style lang="scss" scoped>
2022-08-02 15:11:04 +08:00
.addExamine {
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
.headerName {
z-index: 1;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
}
.header-btn {
position: absolute;
top: 0;
right: 20rpx;
font-size: 24rpx;
line-height: 88rpx;
z-index: 2;
}
.smallHeight {
height: 100%;
box-sizing: border-box;
padding-bottom: 90rpx;
background: #eee;
}
.addExamine-form {
width: 100%;
// height: 100%;
background: #eee;
padding: 16rpx 20rpx;
padding-bottom: 50rpx;
box-sizing: border-box;
.form-box {
background: #fff;
border-radius: 12rpx;
.form-title {
padding: 16rpx 0;
padding-left: 30rpx;
position: relative;
font-weight: 600;
font-size: 28rpx;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.form-title::before {
content: "";
width: 6rpx;
height: 36rpx;
background: #409EFF;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.b-bottom {
border-bottom: 2rpx solid #f0f0f0;
}
.form-item {
padding: 36rpx 20rpx;
line-height: 36rpx;
.form-lable {
color: #F56C6C;
white-space: nowrap;
/deep/span {
color: #000;
}
}
.text {
/deep/span {
font-size: 28rpx;
}
}
.form-textarea {
flex: 1;
margin-left: 20rpx;
height: 160rpx;
border: 1px solid #f0f0f0;
overflow: auto;
/deep/uni-textarea {
2022-06-08 15:48:09 +08:00
width: 100%;
height: 100%;
2022-08-02 15:11:04 +08:00
font-size: 28rpx;
.uni-textarea-compute {
width: 100%;
height: 100%;
overflow: auto;
}
2022-06-08 15:48:09 +08:00
}
}
2022-08-02 15:11:04 +08:00
.form-input {
text-align: right;
/deep/input {
font-size: 28rpx;
}
/deep/.uni-input-placeholder {
color: #C0C4CC;
}
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
}
.flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.f-column {
flex-direction: column;
}
.noCheck {
color: #C0C4CC;
}
.form-content {
font-size: 28rpx;
.uni-input {
line-height: 36rpx;
2022-06-08 15:48:09 +08:00
}
}
2022-08-02 15:11:04 +08:00
.a-start {
align-items: flex-start;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.imgBox_wrap {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
width: 100%;
2022-08-02 15:11:04 +08:00
min-height: 120rpx;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.imgBox {
width: 120rpx;
height: 120rpx;
display: inline-flex;
position: relative;
margin-right: 30rpx;
margin-bottom: 16rpx;
.img {
width: 100%;
height: 100%;
border-radius: 12rpx;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.deleteImg {
position: absolute;
right: -12rpx;
top: -18rpx;
uni-image {
width: 20rpx;
height: 20rpx;
}
}
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.addImgBox {
border: 1px solid rgba(42, 43, 91, 0.1);
background-color: #f6f5f8;
width: 120rpx;
height: 120rpx;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 20rpx;
font-size: 24rpx;
margin-right: 12rpx;
uni-image {
width: 100%;
height: 100%;
}
// .icon-add {
// width: 36rpx;
// height: 36rpx;
// }
2022-06-08 15:48:09 +08:00
}
}
}
2022-08-02 15:11:04 +08:00
.submit-btn {
width: 100%;
height: 96rpx;
background: #409EFF;
color: #fff;
position: fixed;
bottom: 0;
left: 0;
text-align: center;
line-height: 96rpx;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.p-0 {
padding-bottom: 0;
2022-06-08 15:48:09 +08:00
}
2022-08-02 15:11:04 +08:00
.btn-box {
position: fixed;
bottom: 0;
left: 0;
line-height: 96rpx;
display: flex;
width: 100%;
height: 96rpx;
color: #fff;
text-align: center;
.cancle-btn {
2022-06-08 15:48:09 +08:00
flex: 1;
2022-08-02 15:11:04 +08:00
height: 100%;
background: #DD4907;
}
.pass-btn {
flex: 1;
height: 100%;
background: #127FEC;
}
}
.formDialog {
/deep/.dialogContent {
width: 90%;
top: auto;
left: 50%;
bottom: 40rpx;
transform: translate(-50%, 0);
}
.dialog-title {
padding: 0 40rpx;
padding-top: 40rpx;
margin-bottom: 16rpx;
}
.dialog-content {
padding: 0 40rpx;
.form-textarea {
flex: 1;
2022-06-08 15:48:09 +08:00
width: 100%;
2022-08-02 15:11:04 +08:00
height: 218rpx;
border: 1px dashed #f0f0f0;
// overflow: auto;
background: #FAFAFA;
border-radius: 10rpx;
margin-bottom: 30rpx;
/deep/uni-textarea {
2022-06-08 15:48:09 +08:00
width: 100%;
height: 100%;
2022-08-02 15:11:04 +08:00
padding: 26rpx 28rpx;
box-sizing: border-box;
font-size: 28rpx;
.uni-textarea-compute {
width: 100%;
height: 100%;
overflow: auto;
}
2022-06-08 15:48:09 +08:00
}
}
}
2022-08-02 15:11:04 +08:00
.dialog-btn {
width: 100%;
2022-06-08 15:48:09 +08:00
height: 94rpx;
2022-08-02 15:11:04 +08:00
display: flex;
border-top: 1px solid #f0f0f0;
align-items: center;
.cancle-btn {
flex: 1;
height: 94rpx;
text-align: center;
line-height: 94rpx;
background: #F3F3F3;
}
.primary-btn {
flex: 1;
height: 94rpx;
text-align: center;
line-height: 94rpx;
color: #127FEC;
background: #E7F2FD;
}
2022-06-08 15:48:09 +08:00
}
}
2022-08-02 15:11:04 +08:00
.uni-list-cell {
font-size: 28rpx;
margin-right: 20rpx;
/deep/uni-radio .uni-radio-input {
width: 36rpx;
height: 36rpx;
}
2022-06-08 15:48:09 +08:00
}
}
.example-body {
padding: 0 0 20rpx 140rpx;
}
</style>