<template>
|
<view class="dca" v-if="info">
|
<view class="dca_head">
|
<text>任务{{returnStatus(info.status)}}</text>
|
<text>工单号:{{info.code}}</text>
|
<view class="dca_head_chao" v-if="[...info.sheDealUserQwIds.split(',')].includes(userInfo.qwId) && [1, 2].includes(info.status)" @click="show3 = true">抄送</view>
|
</view>
|
<u-gap height="5" bgColor="#EFEFEF"></u-gap>
|
<view class="dca_list">
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">员工姓名</view>
|
<view class="dca_list_item_value">{{info.memberName}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">部门</view>
|
<view class="dca_list_item_value">{{info.companyName}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">上报时间</view>
|
<view class="dca_list_item_value">{{info.submitDate.substring(0, 16)}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">发现时间</view>
|
<view class="dca_list_item_value">{{info.happenTime.substring(0, 16)}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">风险类型</view>
|
<view class="dca_list_item_value">{{info.typeNamePath}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">发生地点</view>
|
<view class="dca_list_item_value">{{info.locationName}}</view>
|
</view>
|
<view class="dca_list_item">
|
<view class="dca_list_item_label">风险描述</view>
|
<view class="dca_list_item_value">{{info.riskInfo}}</view>
|
</view>
|
<view class="dca_list_item" style="flex-direction: column;">
|
<view class="dca_list_item_label">图片</view>
|
<view class="dca_list_item_tu" v-if="info.multifileList">
|
<view class="dca_list_item_tu_item" v-for="(item, index) in info.multifileList" :key="index" @click="previewImage(item.fileurlFull, info.multifileList.map(item => item.fileurlFull))">
|
<image :src="item.fileurlFull" mode="widthFix"></image>
|
</view>
|
<view class="dca_list_item_tu_zw"></view>
|
<view class="dca_list_item_tu_zw"></view>
|
<view class="dca_list_item_tu_zw"></view>
|
</view>
|
</view>
|
</view>
|
<u-gap height="5" bgColor="#EFEFEF"></u-gap>
|
<view class="dca_process">
|
<view class="dca_process_title">处理流程</view>
|
<view class="dca_process_lc">
|
<view class="lc">
|
<view class="lc_item" v-for="(item, index) in info.logList" :key="index">
|
<view class="lc_item_dian"></view>
|
<view class="lc_item_xian" v-if="info.logList.length === 1 ? false : index !== info.logList.length - 1"></view>
|
<view class="lc_item_title">{{item.title}}</view>
|
<view class="lc_item_info">{{item.companyName}}/{{item.userName}} {{item.createDate}}</view>
|
<view class="lc_item_content" v-if="![0,4].includes(item.objType)">
|
<view class="lc_item_content_item" v-if="[1,2].includes(item.objType)">
|
<view class="lc_item_content_item_label">处理人:</view>
|
<view class="lc_item_content_item_val">
|
<text>{{item.param2}}</text>
|
<view class="lc_item_content_item_val_cui" v-if="item.urgeButton === 1" @click="urge">催促</view>
|
</view>
|
</view>
|
<view class="lc_item_content_item">
|
<view class="lc_item_content_item_label">说明:</view>
|
<view class="lc_item_content_item_val">
|
<text>{{item.content || '暂无'}}</text>
|
</view>
|
</view>
|
<view class="lc_item_content_item">
|
<view class="lc_item_content_item_label">图片:</view>
|
<view class="lc_item_content_item_img" v-if="item.multifileList">
|
<view class="image" v-for="(child, index) in item.multifileList" :key="index" @click="previewImage(child.fileurlFull, item.multifileList.map(item => item.fileurlFull))">
|
<image :src="child.fileurlFull" mode="widthFix"></image>
|
</view>
|
<view class="imagezw"></view>
|
<view class="imagezw"></view>
|
</view>
|
<view class="lc_item_content_item_val" v-else>
|
<text>暂无</text>
|
</view>
|
</view>
|
</view>
|
<view class="lc_item_content" v-else-if="item.objType === 4">
|
<view class="lc_item_content_item">
|
<!-- <view class="lc_item_content_item_label">已催促:</view> -->
|
<view class="lc_item_content_item_val">
|
<text>{{item.content}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<template v-if="info.closeButton === 1 || info.passOnButton === 1">
|
<view style="width: 100%; height: calc(84rpx + env(safe-area-inset-bottom));"></view>
|
<view class="footer">
|
<view class="footer_btn" :style="info.passOnButton === 0 ? 'background-color: #3875C5; color: #ffffff;' : ''" v-if="info.closeButton === 1" @click="openGB">问题关闭</view>
|
<view class="footer_btn" v-if="info.passOnButton === 1" style="background-color: #3875C5; color: #ffffff;" @click="openFP">任务分配</view>
|
</view>
|
</template>
|
<!-- 任务分配 -->
|
<u-popup :show="show" :round="10" mode="bottom">
|
<view class="fp">
|
<view class="fp_head">
|
<text @click="closeFP">取消</text>
|
<text @click="allocation">确认分配</text>
|
</view>
|
<view class="fp_box">
|
<u--form labelPosition="left" :model="model" :rules="rules1" ref="uForm1">
|
<u-form-item label="处理人" labelWidth="80" prop="passOnUserName" @click="seleUser" required>
|
<u--input v-model="model.passOnUserName" border="none" placeholder="请选择处理人" disabledColor="#ffffff"
|
disabled></u--input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item>
|
<u-form-item label="说明" labelWidth="80" labelPosition="top" prop="info">
|
<u--textarea v-model="model.info" placeholder="请输入说明" style="margin-top: 15rpx;"
|
maxlength="200" count></u--textarea>
|
</u-form-item>
|
<u-form-item label="上传图片" labelWidth="80" prop="multifileList" labelPosition="top">
|
<UploadImage
|
:fileList="model.multifileList"
|
folder="WORKORDER_LOG_FILE_PATH"
|
@dele="deletePic"
|
@getFileList="afterRead"
|
style="margin-top: 15rpx;"
|
/>
|
</u-form-item>
|
</u--form>
|
</view>
|
</view>
|
</u-popup>
|
<!-- 任务关闭 -->
|
<u-popup :show="show1" :round="10" mode="bottom">
|
<view class="fp">
|
<view class="fp_head">
|
<text @click="closeGB">取消</text>
|
<text @click="closeWorkOrder">确认关闭</text>
|
</view>
|
<view class="fp_box">
|
<u--form labelPosition="left" :model="model" :rules="rules" ref="uForm">
|
<u-form-item label="说明" labelWidth="120" labelPosition="top" prop="info" required>
|
<u--textarea v-model="model.info" placeholder="请输入说明" style="margin-top: 15rpx;"
|
maxlength="200" count></u--textarea>
|
</u-form-item>
|
<u-form-item label="上传图片" labelWidth="120" prop="multifileList" labelPosition="top" required>
|
<UploadImage
|
:fileList="model.multifileList"
|
folder="WORKORDER_LOG_FILE_PATH"
|
@dele="deletePic"
|
@getFileList="afterRead"
|
style="margin-top: 15rpx;"
|
/>
|
</u-form-item>
|
</u--form>
|
</view>
|
</view>
|
</u-popup>
|
<!-- 抄送 -->
|
<u-popup :show="show3" :round="10" mode="bottom">
|
<view class="fp">
|
<view class="fp_head">
|
<text @click="show3 = false">取消</text>
|
<text @click="send">确认抄送</text>
|
</view>
|
<view class="fp_box">
|
<u--form labelPosition="left" :model="model" :rules="rules1" ref="uForm2">
|
<u-form-item label="选择抄送人" labelWidth="80" prop="passOnUserName" @click="seleUser1" required>
|
<u--input v-model="model.passOnUserName" border="none" placeholder="请选择抄送人" disabledColor="#ffffff"
|
disabled></u--input>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
</u-form-item>
|
<u-form-item label="说明" labelWidth="80" labelPosition="top" prop="info">
|
<u--textarea v-model="model.info" placeholder="请输入说明" style="margin-top: 15rpx;"
|
maxlength="200" count></u--textarea>
|
</u-form-item>
|
</u--form>
|
</view>
|
</view>
|
</u-popup>
|
<!-- 催促弹窗 -->
|
<u-modal :show="show2" @confirm="urge" @cancel="show2 = false"></u-modal>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
import UploadImage from '@/components/uploadImage/uploadImage.vue'
|
export default {
|
components: { UploadImage },
|
computed: {
|
...mapState(['userInfo'])
|
},
|
data() {
|
return {
|
id: null,
|
info: null,
|
show: false,
|
show1: false,
|
show2: false,
|
show3: false,
|
model: {
|
name: '',
|
info: '',
|
multifileList: [],
|
passOnUserId: '',
|
passOnUserName: ''
|
},
|
rules: {
|
info: {
|
type: 'string',
|
required: true,
|
message: '说明不能为空',
|
trigger: ['blur', 'change']
|
},
|
multifileList: {
|
type: 'array',
|
min: 1,
|
required: true,
|
message: '图片不能为空',
|
trigger: ['blur', 'change']
|
}
|
},
|
rules1: {
|
passOnUserName: {
|
type: 'string',
|
required: true,
|
message: '处理人不能为空',
|
trigger: ['blur', 'change']
|
}
|
}
|
};
|
},
|
onLoad(option) {
|
this.id = option.id
|
this.getDetails()
|
},
|
methods: {
|
seleUser1() {
|
var that = this
|
that.$ww.selectEnterpriseContact({
|
fromDepartmentId: -1,
|
mode: 'multi',
|
type: ['user'],
|
}).then(res =>{
|
console.log(res)
|
if (res.errCode === 0) {
|
that.model.passOnUserName = res.result.userList.map(item => item.name).join(',')
|
that.model.passOnUserId = res.result.userList.map(item => item.id).join(',')
|
}
|
})
|
},
|
send() {
|
var that = this
|
that.$refs.uForm2.validate().then(async () => {
|
let res = await that.$u.api.sendCopy({
|
info: that.model.info,
|
userIds: that.model.passOnUserId,
|
workorderId: that.info.id
|
})
|
if (res.code === 200) {
|
that.show3 = false
|
that.getDetails()
|
uni.showToast({ title: '操作成功', icon: 'none' })
|
}
|
}).catch(errors => {
|
|
})
|
},
|
previewImage(current, urls) {
|
uni.previewImage({
|
current,
|
urls
|
});
|
},
|
openGB() {
|
this.stopScroll()
|
this.show1 = true
|
},
|
closeGB() {
|
this.canScroll()
|
this.show1 = false
|
},
|
openFP() {
|
this.stopScroll()
|
this.show = true
|
},
|
closeFP() {
|
this.canScroll()
|
this.show = false
|
},
|
// 选择人员
|
seleUser() {
|
var that = this
|
that.$ww.selectEnterpriseContact({
|
fromDepartmentId: -1,
|
mode: 'single',
|
type: ['user'],
|
}).then(res =>{
|
console.log(res)
|
if (res.errCode === 0) {
|
that.model.passOnUserName = res.result.userList.map(item => item.name).join(',')
|
that.model.passOnUserId = res.result.userList.map(item => item.id).join(',')
|
}
|
})
|
},
|
// 任务状态
|
statusName(status) {
|
|
},
|
returnStatus(status) {
|
if ([3,4,5].includes(status)) {
|
return '已处理'
|
} else {
|
return '待处理'
|
}
|
},
|
// 任务分配
|
allocation() {
|
var that = this
|
that.$refs.uForm1.validate().then(async () => {
|
let res = await that.$u.api.passOn({
|
info: that.model.info,
|
passOnUserId: that.model.passOnUserId,
|
multifileList: that.model.multifileList,
|
workorderId: that.info.id,
|
passOnType: this.info.status
|
})
|
if (res.code === 200) {
|
uni.showToast({ title: '操作成功', icon: 'none' })
|
that.canScroll()
|
that.show = false
|
that.getDetails()
|
}
|
}).catch(errors => {
|
|
})
|
},
|
// 工单催促
|
async urge() {
|
let res = await this.$u.api.urge({ workorderId: this.info.id })
|
if (res.code === 200) {
|
uni.showToast({ title: '催促成功', icon: 'none' })
|
this.getDetails()
|
this.show2 = false
|
}
|
},
|
// 关闭工单
|
closeWorkOrder() {
|
var that = this
|
that.$refs.uForm.validate().then(async () => {
|
let res = await that.$u.api.closeWorkOrder({
|
info: that.model.info,
|
multifileList: that.model.multifileList,
|
workorderId: that.info.id
|
})
|
if (res.code === 200) {
|
uni.showToast({
|
title: '操作成功',
|
icon: 'none'
|
})
|
that.canScroll()
|
that.show1 = false
|
that.getDetails()
|
}
|
}).catch(errors => {
|
|
})
|
},
|
// 获取详情
|
async getDetails() {
|
let res = await this.$u.api.detail({ id: this.id })
|
if (res.code === 200) {
|
res.data.managerId = res.data.managerId ? res.data.managerId : ''
|
this.info = res.data
|
}
|
},
|
// 删除图片
|
deletePic(index) {
|
this.model.multifileList.splice(index, 1)
|
},
|
// 新增图片
|
afterRead(arr) {
|
this.model.multifileList = [...this.model.multifileList, ...arr]
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.dca {
|
width: 100%;
|
|
.fp {
|
width: 100%;
|
|
.fp_head {
|
width: 100%;
|
height: 74rpx;
|
padding: 0 42rpx;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
border-bottom: 1rpx solid #EFEFEF;
|
|
text {
|
&:nth-child(1) {
|
color: rgba(16, 16, 16, 1);
|
font-size: 28rpx;
|
}
|
|
&:nth-child(2) {
|
color: rgba(56, 117, 197, 1);
|
font-size: 28rpx;
|
}
|
}
|
}
|
|
.fp_box {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
|
}
|
}
|
|
.dca_process {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
|
.dca_process_title {
|
color: rgba(16, 16, 16, 1);
|
font-size: 28rpx;
|
}
|
|
.dca_process_close {
|
width: 100%;
|
height: 84rpx;
|
line-height: 84rpx;
|
text-align: center;
|
color: rgba(255,255,255,1);
|
font-size: 28rpx;
|
background-color: rgba(56,117,197,1);
|
margin-top: 98rpx;
|
}
|
|
.dca_process_lc {
|
width: 100%;
|
margin-top: 30rpx;
|
|
.lc {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
|
.lc_item {
|
width: 100%;
|
padding-left: 70rpx;
|
box-sizing: border-box;
|
position: relative;
|
margin-bottom: 38rpx;
|
|
&:last-child {
|
margin: 0;
|
}
|
|
.lc_item_dian {
|
position: absolute;
|
top: 0;
|
left: 15rpx;
|
width: 20rpx;
|
height: 20rpx;
|
border-radius: 50%;
|
background-color: #3875C5;
|
}
|
|
.lc_item_xian {
|
width: 1rpx;
|
height: calc(100% + 38rpx);
|
position: absolute;
|
left: 25rpx;
|
top: 0;
|
background-color: #3875C5;
|
}
|
|
.lc_item_title {
|
color: rgba(16,16,16,1);
|
font-size: 28rpx;
|
}
|
|
.lc_item_info {
|
color: rgba(16,16,16,1);
|
font-size: 24rpx;
|
margin-top: 22rpx;
|
}
|
|
.lc_item_content {
|
width: 100%;
|
margin-top: 22rpx;
|
padding: 30rpx;
|
border-radius: 8rpx;
|
box-sizing: border-box;
|
background-color: rgba(239,239,239,1);
|
|
.lc_item_content_item {
|
width: 100%;
|
display: flex;
|
align-items: start;
|
margin-bottom: 24rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.lc_item_content_item_label {
|
width: 100rpx;
|
flex-shrink: 0;
|
color: rgba(16,16,16,1);
|
font-size: 24rpx;
|
}
|
.lc_item_content_item_val {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
position: relative;
|
.lc_item_content_item_val_cui {
|
position: absolute;
|
right: 0;
|
top: 0;
|
color: rgba(56,117,197,1);
|
font-size: 24rpx;
|
}
|
text {
|
color: rgba(16,16,16,1);
|
font-size: 24rpx;
|
}
|
}
|
.lc_item_content_item_img {
|
flex: 1;
|
display: flex;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
.imagezw {
|
width: 128rpx;
|
height: 0;
|
}
|
.image {
|
width: 128rpx;
|
height: 128rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
.fp {
|
width: 100%;
|
|
.fp_head {
|
width: 100%;
|
height: 74rpx;
|
padding: 0 42rpx;
|
box-sizing: border-box;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
border-bottom: 1rpx solid #EFEFEF;
|
|
text {
|
&:nth-child(1) {
|
color: rgba(16, 16, 16, 1);
|
font-size: 28rpx;
|
}
|
|
&:nth-child(2) {
|
color: rgba(56, 117, 197, 1);
|
font-size: 28rpx;
|
}
|
}
|
}
|
|
.fp_box {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
|
}
|
}
|
|
.footer {
|
width: 100%;
|
height: 84rpx;
|
display: flex;
|
align-items: center;
|
box-sizing: border-box;
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
border-top: 1rpx solid rgba(239, 239, 239, 1);
|
padding-bottom: env(safe-area-inset-bottom);
|
|
.footer_btn {
|
flex: 1;
|
height: 84rpx;
|
line-height: 84rpx;
|
text-align: center;
|
background-color: #ffffff;
|
color: #222222;
|
font-size: 24rpx;
|
}
|
}
|
|
.dca_head {
|
width: 100%;
|
padding: 32rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
display: flex;
|
flex-direction: column;
|
position: relative;
|
|
.dca_head_chao {
|
position: absolute;
|
top: 32rpx;
|
right: 32rpx;
|
color: rgba(32,110,238,1);
|
font-size: 28rpx;
|
text-decoration: underline;
|
}
|
|
text {
|
&:nth-child(1) {
|
color: rgba(56, 117, 197, 1);
|
font-size: 32rpx;
|
}
|
|
&:nth-child(2) {
|
color: rgba(154, 154, 154, 1);
|
font-size: 24rpx;
|
margin-top: 14rpx;
|
}
|
}
|
}
|
|
.dca_list {
|
width: 100%;
|
|
.dca_list_item {
|
width: 100%;
|
padding: 36rpx 30rpx;
|
box-sizing: border-box;
|
border-bottom: 1rpx solid #EFEFEF;
|
display: flex;
|
|
&:last-child {
|
border: none;
|
}
|
|
.dca_list_item_label {
|
flex-shrink: 0;
|
width: 150rpx;
|
color: rgba(108, 108, 108, 1);
|
font-size: 28rpx;
|
}
|
|
.dca_list_item_value {
|
flex: 1;
|
color: rgba(0, 0, 0, 1);
|
font-size: 28rpx;
|
}
|
|
.dca_list_item_to {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
|
text {
|
color: rgba(32, 110, 238, 1);
|
font-size: 28rpx;
|
}
|
}
|
|
.dca_list_item_tu {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
flex-wrap: wrap;
|
margin-top: 30rpx;
|
|
.dca_list_item_tu_item {
|
width: 156rpx;
|
height: 156rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
margin-bottom: 30rpx;
|
|
image {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
|
.dca_list_item_tu_zw {
|
width: 156rpx;
|
height: 0;
|
}
|
}
|
}
|
}
|
}
|
</style>
|