2052 lines
60 KiB
Vue
2052 lines
60 KiB
Vue
<template>
|
||
<!-- 新增问题 -->
|
||
<view class="addIssue">
|
||
<view class="fixedheader">
|
||
<headers :showBack="true">
|
||
<view class="headerName">
|
||
{{ pageTitle }}
|
||
</view>
|
||
</headers>
|
||
<view class="tab flex2" style="background-color: #fff">
|
||
<view
|
||
class="tabType"
|
||
@click="radioChange('type1')"
|
||
:class="checkedTab == 'type1' ? 'checkedTab' : 'noCheckTab'"
|
||
>
|
||
质量问题</view
|
||
>
|
||
<view
|
||
class="tabType"
|
||
@click="radioChange('type2')"
|
||
:class="checkedTab == 'type2' ? 'checkedTab' : 'noCheckTab'"
|
||
>
|
||
排查记录</view
|
||
>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- <view class="type flex" v-if="COMPANY != 'zjwj'">
|
||
<view class="name">类型:</view>
|
||
<view>
|
||
<radio-group @change="radioChange" class="radio-wrap">
|
||
<label class="radio">
|
||
<radio value="type1" checked="true" />质量问题
|
||
</label>
|
||
<label class="radio">
|
||
<radio value="type2" />排查记录
|
||
</label>
|
||
</radio-group>
|
||
</view>
|
||
</view> -->
|
||
<view
|
||
class="content"
|
||
:style="{ paddingTop: (mobileTopHeight + 100) * 1.5 + 'rpx' }"
|
||
>
|
||
<view class="type flex">
|
||
<view class="name"><text class="star">*</text>检查部位:</view>
|
||
<picker
|
||
@click="$refs.locationTree._show()"
|
||
:disabled="true"
|
||
class="picker"
|
||
>
|
||
<view class="uni-input uni-select cl" v-if="checkPointName == ''">
|
||
请选择
|
||
<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%" class="ellipsis">{{
|
||
checkPointName
|
||
}}</view>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>问题描述:</view>
|
||
<picker
|
||
:disabled="true"
|
||
@click="$refs.issueTree._show()"
|
||
class="picker"
|
||
>
|
||
<view
|
||
class="uni-input uni-select cl"
|
||
v-if="form.dangerItemContent == ''"
|
||
>
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else
|
||
>{{ form.dangerItemContent }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
|
||
<view class="type flex" v-else>
|
||
<view class="name"><text class="star">*</text>排查分类:</view>
|
||
<picker
|
||
:disabled="true"
|
||
@click="$refs.issueTree._show()"
|
||
class="picker"
|
||
>
|
||
<view class="uni-input uni-select cl" v-if="issueName == ''">
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else
|
||
>{{ issueName }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>问题分类:</view>
|
||
<!-- <picker class="picker" :disabled="true" @click="$refs.issueTree._show()">
|
||
<view class="uni-input uni-select cl" v-if="issueName==''">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{issueName}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker> -->
|
||
<picker class="picker" :disabled="true">
|
||
<view class="uni-input uni-select cl" v-if="issueName == ''">
|
||
请输入
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{ issueName }} </view>
|
||
</picker>
|
||
</view>
|
||
|
||
<view class="type flex3">
|
||
<view class="name">补充说明:</view>
|
||
<textarea
|
||
class="textarea"
|
||
maxlength="-1"
|
||
placeholder-class="cl"
|
||
name="inspectContent"
|
||
@input="supplementTextarea"
|
||
:value="form.dangerDesc"
|
||
placeholder="请输入"
|
||
></textarea>
|
||
</view>
|
||
<view class="type flex3" v-if="typeCheck == 'type1'">
|
||
<view class="name">整改要求:</view>
|
||
<textarea
|
||
class="textarea"
|
||
maxlength="-1"
|
||
placeholder-class="cl"
|
||
name="inspectContent"
|
||
@input="claimTextarea"
|
||
:value="form.remark"
|
||
placeholder="请输入"
|
||
></textarea>
|
||
</view>
|
||
|
||
<!-- 新增四个字段 -->
|
||
<!-- <view class="type flex" v-if="COMPANY != 'zjwj'">
|
||
<view class="name"><text class="star"></text>分部工程:</view>
|
||
<picker @change="(e)=>checkSubListData(e,1)" :value="subsectionIndex" class="picker" :range="listData"
|
||
range-key="subdivisionProjectName">
|
||
<view class="uni-input uni-select cl" v-if="subsectionIndex==-1">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>
|
||
{{listData[subsectionIndex]?listData[subsectionIndex].subdivisionProjectName:''}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
|
||
|
||
<view class="type flex" v-if="COMPANY != 'zjwj'">
|
||
<view class="name"><text class="star"></text>分项工程:</view>
|
||
<picker @change="(e)=>checkSubListData(e,2)" :value="subentryIndex" class="picker" :range="subListData"
|
||
range-key="subdivisionProjectName">
|
||
<view class="uni-input uni-select cl" v-if="subentryIndex==-1 || subListData.length == 0">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>
|
||
{{ subListData[subentryIndex]?subListData[subentryIndex].subdivisionProjectName : '' }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<view class="type flex" v-if="COMPANY != 'zjwj'">
|
||
<view class="name"><text class="star"></text>巡检楼层:</view>
|
||
<input type="number" placeholder-class="cl" class="inpuStyle uni-select cl" :value="form.floor"
|
||
placeholder="请输入" @input='eventfloor' />
|
||
</view> -->
|
||
|
||
<view class="type flex3">
|
||
<view class="name">事件描述:</view>
|
||
<textarea
|
||
class="textarea"
|
||
maxlength="-1"
|
||
placeholder-class="cl"
|
||
name="inspectContent"
|
||
@input="eventDescription"
|
||
:value="form.addedDescription"
|
||
placeholder="请输入"
|
||
></textarea>
|
||
</view>
|
||
|
||
<!-- 新增字段分割线------------ -->
|
||
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>问题等级:</view>
|
||
<picker
|
||
@change="(e) => bindPickerChange(e, 1)"
|
||
:value="issueGradeIndex"
|
||
class="picker"
|
||
:range="issueGradeList"
|
||
range-key="name"
|
||
>
|
||
<view class="uni-input uni-select cl" v-if="form.level == ''">
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>
|
||
{{
|
||
form.level == 1
|
||
? "一级"
|
||
: form.level == 2
|
||
? "二级"
|
||
: form.level == 3
|
||
? "三级"
|
||
: "四级"
|
||
}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>紧急程度:</view>
|
||
<picker
|
||
@change="(e) => bindPickerChange(e, 2)"
|
||
:value="urgencyIndex"
|
||
class="picker"
|
||
:range="urgencyList"
|
||
range-key="name"
|
||
>
|
||
<view class="uni-input uni-select cl" v-if="form.urgentLevel == ''">
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else
|
||
>{{
|
||
form.urgentLevel == 1
|
||
? "一般"
|
||
: form.urgentLevel == 2
|
||
? "严重"
|
||
: "紧要"
|
||
}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<view class="type flex">
|
||
<view class="name"><text class="star">*</text>检查时间:</view>
|
||
<dateTimePiccker
|
||
:placeholder="'请选择'"
|
||
:disabled="true"
|
||
:start="startTime"
|
||
fields="second"
|
||
:default-value="form.inspectTime"
|
||
@change="bindPickerChange($event, 'startTime')"
|
||
class="dateTimePiccker"
|
||
>
|
||
<!-- <view class="uni-input uni-select cl" v-if="form.inspectTime===''">
|
||
请选择 <image class="icon-right" src="/static/icon-right.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{form.inspectTime}}
|
||
<image class="icon-right" src="/static/icon-right.png"></image>
|
||
</view> -->
|
||
</dateTimePiccker>
|
||
<!-- <picker @change="(e)=>bindPickerChange(e,4)" mode="date" :value="form.inspectTime" class="picker">
|
||
<view class="uni-input uni-select cl" v-if="form.inspectTime===''">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{form.inspectTime}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker> -->
|
||
</view>
|
||
|
||
<view class="type flex" v-if="COMPANY != 'zjwj'">
|
||
<view class="name"><text class="star">*</text>分包单位:</view>
|
||
<picker @click="clickUnit" :disabled="true" class="picker">
|
||
<view
|
||
class="uni-input uni-select cl"
|
||
v-if="form.enterpriseName == ''"
|
||
>
|
||
请选择
|
||
<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%" class="ellipsis">{{
|
||
form.enterpriseName
|
||
}}</view>
|
||
<uni-icons2
|
||
@click="deletesBtn(1)"
|
||
type="clear"
|
||
size="22"
|
||
></uni-icons2>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>整改时限:</view>
|
||
<dateTimePiccker
|
||
:placeholder="'请选择'"
|
||
:start="startTime2"
|
||
fields="minute"
|
||
:default-value="form.changeLimitTime"
|
||
@change="bindPickerChange($event, 'startTime2')"
|
||
class="dateTimePiccker"
|
||
>
|
||
<!-- <view class="uni-input uni-select cl" v-if="form.changeLimitTime===''">
|
||
请选择 <image class="icon-right" src="/static/icon-right.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{form.changeLimitTime}}
|
||
<image class="icon-right" src="/static/icon-right.png"></image>
|
||
</view> -->
|
||
</dateTimePiccker>
|
||
<!-- <picker @change="(e)=>bindPickerChange(e,5)" mode="date" :value="form.changeLimitTime" class="picker">
|
||
<view class="uni-input uni-select cl" v-if="form.changeLimitTime===''">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>{{form.changeLimitTime}}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker> -->
|
||
</view>
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>整改人:</view>
|
||
<picker
|
||
@change="(e) => bindPickerChange(e, 6)"
|
||
:value="changePeopleIndex"
|
||
class="picker"
|
||
:range="personUpdateList"
|
||
range-key="realName"
|
||
v-if="isShowPicker"
|
||
>
|
||
<view
|
||
class="uni-input uni-select cl"
|
||
v-if="changePeopleIndex == null"
|
||
>
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else
|
||
>{{ personUpdateList[changePeopleIndex].realName }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>复查人:</view>
|
||
<picker
|
||
@change="(e) => bindPickerChange(e, 7)"
|
||
:value="reviewIndex"
|
||
class="picker"
|
||
:range="reviewList"
|
||
range-key="realName"
|
||
>
|
||
<view class="uni-input uni-select cl" v-if="reviewIndex == null">
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else
|
||
>{{ reviewList[reviewIndex].realName }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name"><text class="star">*</text>核检人:</view>
|
||
<picker
|
||
@change="(e) => bindPickerChange(e, 8)"
|
||
:value="verifyManIndex"
|
||
class="picker"
|
||
:disabled="true"
|
||
:range="personList"
|
||
range-key="realName"
|
||
>
|
||
<view
|
||
class="uni-input uni-select cl"
|
||
v-if="verifyManIndex == null && !defaultAuditPerson"
|
||
>
|
||
请选择
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-input uni-select" v-else>
|
||
{{ defaultAuditPerson || personList[verifyManIndex].realName }}
|
||
<image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<!-- <view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name">通知人:</view>
|
||
<picker @click="$refs.informTree._show()" :disabled="true" class="picker">
|
||
<view class="uni-input uni-select cl" v-if="notifier===''">
|
||
请选择 <image class="icon-down" src="/static/icon-down-black.png"></image>
|
||
</view>
|
||
<view class="uni-select flex2" v-else>
|
||
<view style="line-height:40rpx; width:80%; padding:6px 0;">{{notifier}}</view>
|
||
<image class="icon-down" style="width:26rpx; height:26rpx;" src="/static/icon-down-black.png">
|
||
</image>
|
||
</view>
|
||
</picker>
|
||
</view> -->
|
||
<view class="type flex" v-if="typeCheck == 'type1'">
|
||
<view class="name">现场整改:</view>
|
||
<view class="flex">
|
||
<text :class="form.status == 2 ? 'status' : ''">未完成</text>
|
||
<switch
|
||
:checked="form.status == 5"
|
||
@change="switchChange"
|
||
style="margin: 0 20rpx; transform: scale(0.74, 0.7)"
|
||
/>
|
||
<text :class="form.status == 5 ? 'status' : ''">已完成</text>
|
||
</view>
|
||
</view>
|
||
<view
|
||
v-if="typeCheck == 'type1'"
|
||
style="font-size: 24rpx; margin: 0 0 20rpx 17px; color: gray"
|
||
>注:如果在检查的时候已经整改,请直接选择已完成</view
|
||
>
|
||
<view class="type flex3" v-if="COMPANY == 'zjwj' && typeCheck == 'type1'">
|
||
<view class="name">图纸定位:</view>
|
||
<view
|
||
class="name"
|
||
style="color: #187cff; width: 100px"
|
||
@click="openImgDialog"
|
||
>在图纸中定位</view
|
||
>
|
||
<!-- <view class="uni-form-input imgBox_wrap">
|
||
<view class="imgBox" v-show="mapImgList.length>0" v-for="(item,index) in mapImgList" :key="index">
|
||
<image :src="url_config+'image/'+item.url" class="img"
|
||
@click="previewImage(url_config+'image/'+item.url)"></image>
|
||
<uni-icons2 @click="deleteImg(item,1)" class="deleteImg" type="clear" size="24"></uni-icons2>
|
||
</view>
|
||
<view class="addImgBox" @click="uploadImg(2)" v-if="mapImgList.length<5">
|
||
<image src="/static/icon-add.png" class="icon-add"></image>
|
||
</view>
|
||
</view> -->
|
||
</view>
|
||
<view class="type flex3">
|
||
<view class="name">上传图片:</view>
|
||
<view class="uni-form-input imgBox_wrap">
|
||
<view
|
||
class="imgBox"
|
||
v-show="imgFileList.length > 0"
|
||
v-for="(item, index) in imgFileList"
|
||
:key="index"
|
||
>
|
||
<image
|
||
:src="url_config + 'image/' + item.url"
|
||
class="img"
|
||
@click="previewImage(url_config + 'image/' + item.url)"
|
||
>
|
||
</image>
|
||
<view
|
||
@click="deleteImg(item, 1)"
|
||
style="margin: 10rpx"
|
||
class="deleteImg"
|
||
>×</view
|
||
>
|
||
</view>
|
||
<view
|
||
class="addImgBox"
|
||
@click="uploadImg(1)"
|
||
v-if="imgFileList.length < 5"
|
||
>
|
||
<image src="/static/icon-add.png" class="icon-add"></image>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="type">
|
||
<view>视频(mp4)附件:</view>
|
||
<view
|
||
v-if="videoFileList.length > 0"
|
||
class="imgBox flex2"
|
||
style="width: 100%; height: 28px"
|
||
v-for="(item, index) in videoFileList"
|
||
:key="index"
|
||
>
|
||
<view
|
||
style="
|
||
color: #4181fe;
|
||
width: 28%;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
"
|
||
@click="playVideo(url_config + 'image/' + item.url, 'video')"
|
||
>
|
||
{{ item.name }}
|
||
</view>
|
||
<view
|
||
@click="deleteImg(item, 2)"
|
||
style="margin: 10rpx; color: gray; left: 78px"
|
||
class="deleteImg"
|
||
>×
|
||
</view>
|
||
</view>
|
||
<view
|
||
class="addImgBox"
|
||
@click="uploadVideo"
|
||
v-if="videoFileList.length <= 0"
|
||
style="margin-left: 88px"
|
||
>
|
||
<image src="/static/icon-add.png" class="icon-add"></image>
|
||
</view>
|
||
</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: 40rpx">
|
||
<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: -80rpx;" 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>
|
||
</template>
|
||
|
||
<script>
|
||
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 {
|
||
mobileTopHeight: 0,
|
||
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: {},
|
||
};
|
||
},
|
||
onLoad(option) {
|
||
this.pageTitle = option.type == "add" ? "新增检查" : "编辑检查";
|
||
this.projectSn = JSON.parse(uni.getStorageSync("projectDetail")).projectSn;
|
||
this.userInfo = JSON.parse(uni.getStorageSync("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);
|
||
},
|
||
mounted() {
|
||
var that = this;
|
||
uni.getSystemInfo({
|
||
success(res) {
|
||
that.mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
|
||
uni.setStorageSync("systemInfo", res);
|
||
console.log(res);
|
||
},
|
||
});
|
||
console.log("this.mobileTopHeight", this.mobileTopHeight);
|
||
},
|
||
methods: {
|
||
//获取复查人
|
||
getReviewPeopleList() {
|
||
this.sendRequest({
|
||
url: "xmgl/systemUser/getProjectChilderSystemUserList",
|
||
method: "post",
|
||
data: {
|
||
projectSn: this.projectSn,
|
||
// enterpriseTypeId: 7,
|
||
qualityRegionId: this.form.regionId,
|
||
qualityRegionBindType: 2,
|
||
isSupervisingRoleName: 1,
|
||
},
|
||
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,
|
||
notSupervisingUnit: 1,
|
||
},
|
||
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
|
||
// }
|
||
// });
|
||
this.reviewList = [];
|
||
this.reviewIndex = null;
|
||
this.form.reviewId = "";
|
||
this.getReviewPeopleList();
|
||
} 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) {
|
||
console.log(e);
|
||
//type ==1 问题等级;2紧急情况;3检查人;4 检查时间;5整改时限; 6整改人; 7复查人; 8核验人;
|
||
if (type == 1) {
|
||
if (this.issueGradeList.length == 0) return;
|
||
this.issueGradeIndex = e.detail.value;
|
||
this.form.level = this.issueGradeList[e.detail.value].value;
|
||
} else if (type == 2) {
|
||
if (this.urgencyList.length == 0) return;
|
||
this.urgencyIndex = e.detail.value;
|
||
this.form.urgentLevel = this.urgencyList[e.detail.value].value;
|
||
} else if (type == 3) {
|
||
if (this.personList.length == 0) return;
|
||
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.f1} ${e.f8}`;
|
||
} else if (type == 6) {
|
||
if (this.personUpdateList.length == 0) return;
|
||
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) {
|
||
if (this.reviewList.length == 0) return;
|
||
this.reviewIndex = e.detail.value;
|
||
this.form.reviewId = this.reviewList[e.detail.value].userId;
|
||
} else if (type == 8) {
|
||
if (this.personList.length == 0) return;
|
||
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) {
|
||
var that = this;
|
||
if (type == 1) {
|
||
uni.chooseImage({
|
||
count: 5 - that.imgFileList.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.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) {
|
||
let that = this;
|
||
uni.showModal({
|
||
title: "提示",
|
||
content: "确定删除该附件吗?",
|
||
success: function (res) {
|
||
if (res.confirm) {
|
||
if (type == 1) {
|
||
let fileArr = JSON.parse(JSON.stringify(that.imgFileList));
|
||
fileArr.forEach((item, index) => {
|
||
if (item.url == val.url) {
|
||
fileArr.splice(index, 1);
|
||
}
|
||
});
|
||
that.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;
|
||
}
|
||
} else if (res.cancel) {
|
||
console.log("用户点击取消");
|
||
}
|
||
},
|
||
});
|
||
},
|
||
//上传视频
|
||
uploadVideo() {
|
||
var that = this;
|
||
uni.chooseVideo({
|
||
count: 5 - that.videoFileList.length,
|
||
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: JSON.parse(uploadFileRes.data).data[0].imageUrl,
|
||
};
|
||
that.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],
|
||
});
|
||
},
|
||
|
||
//新增保存
|
||
async addSaveBtn() {
|
||
console.log(this.form.inspectTime);
|
||
console.log(this.form.changeLimitTime);
|
||
let arr = [],
|
||
arr2 = [];
|
||
|
||
this.videoFileList.forEach((item) => {
|
||
arr.push(item.name + "*" + this.url_config + "image/" + item.url);
|
||
});
|
||
this.imgFileList.forEach((item) => {
|
||
arr2.push(item.name + "*" + this.url_config + "image/" + item.url);
|
||
});
|
||
// this.form.fileUrl = this.videoFileList.length>0?JSON.stringify(this.videoFileList):'';
|
||
// this.form.imageUrl = this.imgFileList.length>0?JSON.stringify(this.imgFileList):'';
|
||
this.form.fileUrl = arr.join(",");
|
||
this.form.imageUrl = arr2.join(",");
|
||
let data = JSON.parse(JSON.stringify(this.form));
|
||
if (!data.regionId) {
|
||
uni.showToast({
|
||
title: "请选择检查部位",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.dangerItemContent && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择问题描述",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
} else if (!data.dangerItemContent) {
|
||
uni.showToast({
|
||
title: "请选择排查分类",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.dangerTypeId && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择问题分类",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
// if (data.inspectManId == '') {
|
||
// uni.showToast({
|
||
// title: '请选择检查人',
|
||
// icon: 'none'
|
||
// })
|
||
// return
|
||
// }
|
||
if (!data.inspectTime) {
|
||
uni.showToast({
|
||
title: "请选择检查时间",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.enterpriseName) {
|
||
uni.showToast({
|
||
title: "请选择分包单位",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.changeLimitTime && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择整改时限",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.changeId && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择整改人",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.reviewId && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择复查人",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
if (!data.verifyManId && this.typeCheck == "type1") {
|
||
uni.showToast({
|
||
title: "请选择核查人",
|
||
icon: "none",
|
||
});
|
||
return;
|
||
}
|
||
data.level = data.level == 0 ? Number(data.level) + 1 : data.level;
|
||
data.urgentLevel =
|
||
data.urgentLevel == 0 ? Number(data.urgentLevel) + 1 : data.urgentLevel;
|
||
data.projectSn = this.projectSn;
|
||
data.inspectManId = this.userInfo.userId;
|
||
data.creatorId = this.userInfo.userId;
|
||
data.dangerItemContent = this.issueName;
|
||
let pointArr = [];
|
||
for (let i = 0; i < this.pointList.length; i++) {
|
||
let obj = this.pointList[i].x + "*" + this.pointList[i].y;
|
||
pointArr.push(obj);
|
||
}
|
||
data.measurePoints = pointArr.join(",");
|
||
console.log("data.measurePoints=============", data.measurePoints);
|
||
if (this.typeCheck == "type1") {
|
||
console.log(data);
|
||
// 质量问题
|
||
this.sendRequest({
|
||
url: "xmgl/qualityInspectionRecord/add",
|
||
method: "post",
|
||
data: data,
|
||
success: (res) => {
|
||
console.log(res);
|
||
if (res.code == 200) {
|
||
uni.showToast({
|
||
title: "保存成功",
|
||
});
|
||
setTimeout(() => {
|
||
uni.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1200);
|
||
} else {
|
||
uni.showToast({
|
||
title: res.message,
|
||
icon: "none",
|
||
});
|
||
}
|
||
},
|
||
});
|
||
} else {
|
||
console.log(this.taskId);
|
||
console.log(this.itemId);
|
||
// 排查记录
|
||
let data2 = {
|
||
dangerDesc: data.dangerDesc,
|
||
dangerItemContent: this.issueName,
|
||
dangerItemId: data.dangerItemId,
|
||
dangerTypeId: data.dangerTypeId,
|
||
enterpriseName: data.enterpriseName,
|
||
enterpriseSn: data.enterpriseSn,
|
||
fileUrl: data.fileUrl,
|
||
imageUrl: data.imageUrl,
|
||
inspectManId: data.inspectManId,
|
||
inspectTime: data.inspectTime,
|
||
projectSn: data.projectSn,
|
||
recordType: 2,
|
||
regionId: data.regionId,
|
||
regionName: data.regionName,
|
||
routineInspect: 0,
|
||
subsectionId: data.subsectionId, //分部工程
|
||
subentryId: data.subentryId, //分项工程
|
||
floor: data.floor, //巡检楼层
|
||
addedDescription: data.addedDescription, //事件描述
|
||
taskId: this.taskId || null, // 任务ID
|
||
itemId: this.itemId || null, // 任务子ID
|
||
};
|
||
console.log(data.taskId);
|
||
await this.sendRequest({
|
||
url: "xmgl/qualityInspectionRecord/add",
|
||
method: "post",
|
||
data: data2,
|
||
success: (res) => {
|
||
console.log(res);
|
||
if (res.code == 200) {
|
||
uni.showToast({
|
||
title: "保存成功",
|
||
});
|
||
setTimeout(() => {
|
||
uni.navigateBack({
|
||
delta: 1,
|
||
});
|
||
}, 1200);
|
||
} else {
|
||
uni.showToast({
|
||
title: res.message,
|
||
icon: "none",
|
||
});
|
||
}
|
||
},
|
||
});
|
||
}
|
||
},
|
||
|
||
// 切换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 scoped lang="scss">
|
||
.fixedheader {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 2;
|
||
.headerName {
|
||
z-index: 1;
|
||
}
|
||
}
|
||
.tab {
|
||
width: 100%;
|
||
height: 90rpx;
|
||
text-align: center;
|
||
box-shadow: 0 0 20rpx 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: 4rpx solid #4181fe;
|
||
}
|
||
|
||
.noCheckTab {
|
||
padding-bottom: 4rpx;
|
||
}
|
||
|
||
.lagCss {
|
||
width: 180px;
|
||
height: 61px;
|
||
background: #fff;
|
||
text-align: center;
|
||
line-height: 29px;
|
||
border-radius: 20rpx;
|
||
}
|
||
|
||
.add2 {
|
||
width: 240rpx;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
text-align: center;
|
||
color: #fff;
|
||
background: #4181fe;
|
||
border-radius: 50rpx;
|
||
font-size: 28rpx;
|
||
margin: 0px 24rpx;
|
||
}
|
||
|
||
.point {
|
||
height: 40rpx;
|
||
width: 40rpx;
|
||
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: 40rpx 30rpx;
|
||
}
|
||
|
||
.type {
|
||
font-size: 30rpx;
|
||
line-height: 80rpx;
|
||
margin-bottom: 16rpx;
|
||
/* border-bottom: 1px solid rgba(194, 194, 194, 0.2); */
|
||
}
|
||
|
||
.type .name {
|
||
margin-right: 6px;
|
||
width: 176rpx;
|
||
text-align: right;
|
||
}
|
||
|
||
.radio-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.radio {
|
||
margin-right: 40rpx;
|
||
}
|
||
}
|
||
|
||
.accessory {
|
||
width: 100%;
|
||
height: 70px;
|
||
padding: 0 20rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.accessoryImg {
|
||
width: 110rpx;
|
||
height: 120rpx;
|
||
margin-right: 16rpx;
|
||
}
|
||
|
||
.picker {
|
||
width: 70%;
|
||
border: 1px solid rgba(42, 43, 91, 0.3);
|
||
padding: 0px 30rpx;
|
||
box-sizing: border-box;
|
||
border-radius: 10rpx;
|
||
}
|
||
|
||
.uni-input {
|
||
line-height: 64rpx;
|
||
}
|
||
|
||
.textarea {
|
||
width: calc(79% - 64rpx);
|
||
border-radius: 10rpx;
|
||
border: 1px solid rgba(42, 43, 91, 0.3);
|
||
padding: 8px 30rpx;
|
||
box-sizing: border-box;
|
||
height: 100rpx;
|
||
}
|
||
|
||
.inpuStyle {
|
||
width: calc(80% - 70rpx);
|
||
border-radius: 40rpx;
|
||
border: 1px solid rgba(42, 43, 91, 0.3);
|
||
padding: 8px 30rpx;
|
||
box-sizing: border-box;
|
||
height: 70rpx;
|
||
color: #000;
|
||
}
|
||
|
||
.cl {
|
||
font-size: 30rpx;
|
||
border-radius: 10rpx;
|
||
}
|
||
|
||
.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: 20rpx;
|
||
}
|
||
|
||
.deleteImg {
|
||
position: absolute;
|
||
right: -6rpx;
|
||
top: -36rpx;
|
||
font-size: 30rpx;
|
||
color: #fff;
|
||
}
|
||
}
|
||
|
||
.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;
|
||
|
||
.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: 40rpx 30rpx;
|
||
border-radius: 10rpx;
|
||
box-shadow: 0 0 20rpx 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: 10rpx 10rpx;
|
||
box-sizing: border-box;
|
||
font-size: 30rpx;
|
||
}
|
||
|
||
.checkName {
|
||
border-bottom: 4rpx solid #4181fe;
|
||
color: #4181fe;
|
||
}
|
||
|
||
.noCheckName {
|
||
padding-top: 4px;
|
||
}
|
||
|
||
.unitList {
|
||
margin: 20rpx 0;
|
||
font-size: 30rpx;
|
||
|
||
.title {
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.list_val {
|
||
padding: 8px 20rpx;
|
||
}
|
||
}
|
||
|
||
.bg_999 {
|
||
background-color: rgba(153, 153, 153, 0.1);
|
||
}
|
||
|
||
.ellipsis {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.status {
|
||
color: #007aff;
|
||
}
|
||
|
||
.addSaveBtn {
|
||
margin: 60rpx auto;
|
||
width: 60%;
|
||
padding: 20rpx 0;
|
||
text-align: center;
|
||
background-color: #4181fe;
|
||
color: #fff;
|
||
font-size: 34rpx;
|
||
border-radius: 60rpx;
|
||
letter-spacing: 4rpx;
|
||
box-shadow: 0 3px 20rpx 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: 1px solid #ccc;
|
||
border-radius: 10rpx;
|
||
width: 67%;
|
||
padding-left: 20rpx;
|
||
}
|
||
</style>
|