<template>
|
<view class="dca" v-if="info">
|
<view class="dca_head">
|
<text>主工单号:{{info.code}}</text>
|
<text v-if="[...info.qwnoticeMemberIds.split(','), ...info.managerId.split(',')].includes(userInfo.qwId)" @click="show = true">抄送</text>
|
</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.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.companyName}}</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.typeName}}</view>
|
</view>
|
<view class="dca_list_item" @click="jump">
|
<view class="dca_list_item_label">DCA类型</view>
|
<view class="dca_list_item_to">
|
<text>符合:{{info.dcaYesNum}} 不符合:{{info.dcaNoNum}}</text>
|
<u-icon name="arrow-right" color="#515151" size="13"></u-icon>
|
</view>
|
</view>
|
<view class="dca_list_item" style="flex-direction: column;">
|
<view class="dca_list_item_label">DCA图片</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>
|
<view class="dca_wt">
|
<view class="dca_wt_label">不符合项处理</view>
|
<view class="dca_wt_list">
|
<view class="dca_wt_list_item" v-for="(item, index) in info.dcaChildList" :key="index">
|
<view class="dca_wt_list_item_info">
|
<text>{{item.code}}</text>
|
<text :style="{ color: returnStatus(item.status) === '已处理' ? '#34C758' : '#FFBF6B' }">{{returnStatus(item.status)}}</text>
|
</view>
|
<view class="dca_wt_list_item_head">
|
<text>{{item.typeName}}/{{item.categoryName}}</text>
|
</view>
|
<view class="dca_wt_list_item_info">
|
{{item.problemTitle}}
|
</view>
|
<view class="dca_wt_list_item_btn" v-if="item.closeButton === 1">
|
<view class="btn" @click="handle(item.id)">处理</view>
|
</view>
|
<view class="dca_wt_list_item_btn" v-else>
|
<view class="btn" @click="handle(item.id)">查看</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<!-- 抄送 -->
|
<u-popup :show="show" :round="10" mode="bottom">
|
<view class="fp">
|
<view class="fp_head">
|
<text @click="show = false">取消</text>
|
<text @click="send">确认抄送</text>
|
</view>
|
<view class="fp_box">
|
<u--form labelPosition="left" :model="model" :rules="rules" 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>
|
</view>
|
</view>
|
</u-popup>
|
<!-- 抄送人 -->
|
<peng-tree
|
ref="pengTree"
|
:range="userList"
|
idKey="qwId"
|
:selectParent="false"
|
nameKey="name"
|
:multiple="true"
|
title="选择抄送人"
|
@confirm="selectUser"
|
@cancel="$refs.pengTree._hide()">
|
</peng-tree>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
import pengTree from '@/uni_modules/peng-tree/peng-tree/peng-tree.vue'
|
export default {
|
computed: {
|
...mapState(['userInfo'])
|
},
|
components: { pengTree },
|
data() {
|
return {
|
id: null,
|
info: null,
|
isShow: null,
|
show: false,
|
model: {
|
info: '',
|
passOnUserId: '',
|
passOnUserName: ''
|
},
|
rules: {
|
passOnUserName: {
|
type: 'string',
|
required: true,
|
message: '抄送人不能为空',
|
trigger: ['blur', 'change']
|
}
|
},
|
userList: []
|
};
|
},
|
onLoad(option) {
|
this.id = option.id
|
this.isShow = option.isShow
|
this.getDetails()
|
this.getUserInfo()
|
|
uni.$on('update', (data) => {
|
this.getDetails()
|
})
|
},
|
methods: {
|
selectUser(e) {
|
this.canScroll()
|
this.model.passOnUserName = e.map(item => item.name).join(',')
|
this.model.passOnUserId = e.map(item => item.id).join(',')
|
this.$refs.pengTree._hide()
|
},
|
async getUserInfo() {
|
let res = await this.$u.api.getCopySendUserPage({
|
capacity: 9999,
|
page: 1,
|
model: {}
|
})
|
if (res.code === 200) {
|
console.log(res)
|
this.userList = res.data.records
|
}
|
},
|
previewImage(current, urls) {
|
uni.previewImage({
|
current,
|
urls
|
});
|
},
|
seleUser() {
|
this.stopScroll()
|
this.$refs.pengTree._show()
|
// 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(',')
|
// }
|
// })
|
},
|
returnStatus(status) {
|
if ([3,4,5].includes(status)) {
|
return '已处理'
|
} else {
|
return '未处理'
|
}
|
},
|
getDetails() {
|
this.$u.api.detail({ id: this.id })
|
.then(res => {
|
res.data.managerId = res.data.managerId ? res.data.managerId : ''
|
this.info = res.data
|
})
|
},
|
jump() {
|
uni.navigateTo({
|
url: `/pages/type_dca/type_dca?theme=${this.info.typeId}&themeName=${this.info.typeName}&id=${this.id}`
|
})
|
},
|
handle(id) {
|
uni.navigateTo({
|
url: `/pages/workOrder_dca/workOrder_dca?id=${id}`
|
})
|
},
|
send() {
|
var that = this
|
that.$refs.uForm1.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.canScroll()
|
that.show = false
|
that.getDetails()
|
uni.showToast({ title: '操作成功', icon: 'none' })
|
}
|
}).catch(errors => {
|
|
})
|
}
|
}
|
}
|
</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_head {
|
width: 100%;
|
height: 96rpx;
|
line-height: 96rpx;
|
padding: 0 32rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
text {
|
&:nth-child(1) {
|
color: rgba(154,154,154,1);
|
font-size: 24rpx;
|
}
|
&:nth-child(2) {
|
color: rgba(32,110,238,1);
|
font-size: 28rpx;
|
text-decoration: underline;
|
}
|
}
|
}
|
.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;
|
}
|
}
|
}
|
}
|
.dca_wt {
|
width: 100%;
|
.dca_wt_label {
|
width: 100%;
|
padding: 18rpx 40rpx;
|
box-sizing: border-box;
|
color: rgba(16,16,16,1);
|
font-size: 28rpx;
|
border-bottom: 1rpx solid #EFEFEF;
|
}
|
.dca_wt_list {
|
width: 100%;
|
.dca_wt_list_item {
|
width: 100%;
|
padding: 26rpx 42rpx;
|
box-sizing: border-box;
|
border-bottom: 1rpx solid #EFEFEF;
|
.dca_wt_list_item_info {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
text {
|
&:nth-child(1) {
|
color: rgba(154,154,154,1);
|
font-size: 24rpx;
|
}
|
&:nth-child(2) {
|
color: rgba(255,191,107,0.66);
|
font-size: 28rpx;
|
}
|
}
|
}
|
.dca_wt_list_item_head {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
text {
|
color: rgba(16,16,16,1);
|
font-size: 28rpx;
|
}
|
}
|
.dca_wt_list_item_info {
|
width: 100%;
|
color: rgba(16,16,16,1);
|
font-size: 28rpx;
|
margin: 20rpx 0;
|
}
|
.dca_wt_list_item_btn {
|
width: 100%;
|
display: flex;
|
justify-content: end;
|
.btn {
|
width: 120rpx;
|
height: 50rpx;
|
line-height: 50rpx;
|
border-radius: 6rpx;
|
background-color: rgba(32,110,238,1);
|
color: rgba(255,255,255,1);
|
font-size: 24rpx;
|
text-align: center;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|