yxk_h5_master/pages/daily/dailyDetail.vue

159 lines
4.6 KiB
Vue

<template>
<view class="page">
<view class="top_container" style="padding-right: 30upx;clear: both;overflow: auto;" v-show="num==2">
<view class="btn" @click="sendMsg()">回复</view>
</view>
<view class="detail_name_container">
<view :class="[current_num==1?'current':'']" @click="changecurrent(1)">日志信息</view>
<view :class="[current_num==2?'current':'']" @click="changecurrent(2)">回复消息</view>
</view>
<view v-if="current_num==1">
<view class="myContainer myContentBox">
<view class="top_container">基本信息</view>
<view class="list_item">
<view class="list_item_name">姓名</view>
<view class="list_item_content content_right">{{info.createByName}}</view>
</view>
<view class="list_item">
<view class="list_item_name">部门</view>
<view class="list_item_content content_right">{{info.deptName}}</view>
</view>
<view class="list_item">
<view class="list_item_name">创建时间</view>
<view class="list_item_content content_right">{{info.create_time}}</view>
</view>
</view>
<view class="myContainer redMi acceptTitle">今日完成工作</view>
<view class="myContainer myContentBox">
<view class="resultContent">{{info.com_content||''}}</view>
</view>
<view class="myContainer acceptTitle">未完成工作</view>
<view class="myContainer myContentBox">
<view class="resultContent">{{info.uncom_content||''}}</view>
</view>
<view class="myContainer acceptTitle">需协调工作</view>
<view class="myContainer myContentBox">
<view class="resultContent">{{info.need_concert_content||''}}</view>
</view>
<view class="myContainer acceptTitle">必做事项</view>
<view class="myContainer myContentBox">
<view class="resultContent">{{info.must_contet||''}}</view>
</view>
<view class="myContainer acceptTitle">待定事项</view>
<view class="myContainer myContentBox">
<view class="resultContent">{{info.wait_contet||''}}</view>
</view>
<view v-if="initFileList.length>0">
<view class="myContainer acceptTitle">图片</view>
<view class="myCon myContentBox">
<view class="resultContent" style="height: 26upx; padding: 0px;"></view>
<view class="img-wrap" v-for="(items,index) in initFileList" :key='index'>
<view class="img-box">
<img :src="config.imgURL+'/'+items.filePath" />
</view>
</view>
</view>
</view>
</view>
<view v-else-if="current_num==2">
<view class="myCon myContentBox" v-if="approvalList.length>0">
<uni-steps :options="approvalList" :active="approvalList.length" direction="column" />
</view>
</view>
<view class="goHome" @click='goMain("dailyInfo")'>
<img src="../../static/img/gohome.png">
</view>
</view>
</template>
<script>
import {
config
} from '../../request/js/config.js'
import uniSteps from '@/components/uni-steps/uni-steps.vue'
export default{
components: {
uniSteps
},
data(){
return {
current_num:1,
config:config,
info:{},
initFileList:[],
id:'',
approvalList:[],
num:''
}
},
onLoad(option) {
this.id=option.id;
this.num = option.num;
if(this.id==undefined){
uni.reLaunch({
url: 'daily'
});
return false;
}
var _this = this;
this.$http.request({
url: '/apis/dailyReport/detail',
params: {
id:_this.id
},
}).then(res=>{
if(res.data.code == 0){
this.info = res.data.dailyReport;
this.initFileList = res.data.initFileList;
if(res.data.commentList && res.data.commentList.length>0){
res.data.commentList.forEach(function(val,index){
var myjson = {
title: val.createByName+':'+val.comment,
desc: val.createTime?('时间:'+val.createTime):'时间:'
}
// if(val.isDealed){
// _this.active = index;
// }
_this.approvalList.push(myjson);
});
}
}else{
uni.showToast({
title: '获取信息失败',
duration: 1000,
icon:"none"
});
}
}).catch(err=>{
console.log(err)
});
},
methods:{
changecurrent(num){
this.current_num=num;
},
sendMsg(){
uni.redirectTo({
url: "sendMsg?id="+this.id
});
},
}
}
</script>
<style scoped>
.btn{
width: 160upx;
height:68upx;
text-align: center;
line-height: 68upx;
border-radius: 10upx;
background-color: #3382FF;
color: #fff;
font-size: 28upx;
float: left;
margin-right: 30upx;
float:right
}
</style>