You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
374 lines
9.7 KiB
374 lines
9.7 KiB
<template>
|
|
<view class="container">
|
|
<uni-card :is-shadow="false">
|
|
<view class="">
|
|
<text class="uni-body">审批编号:{{mainDataCont.orderid}}</text>
|
|
</view>
|
|
<view class="titlesize">
|
|
<text class="uni-body ">{{mainDataCont.title}}</text>
|
|
</view>
|
|
</uni-card>
|
|
|
|
<uni-card :is-shadow="false" v-for="(item,index) in mainDataCont.list" :key="index" style="margin-bottom: 10px;">
|
|
|
|
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">指标:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.title}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">零奖值:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.zeroprize}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">全奖值:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.allprize}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">实际值:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.score}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">权重分:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.weight}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">封顶值:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.cappingval}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">达成率:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.achievement}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">指标得分:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.actual}}{{item.unit}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
<uni-row class="demo-uni-row" >
|
|
<uni-col :span="5">
|
|
<view class="demo-uni-col dark">说明:</view>
|
|
</uni-col>
|
|
<uni-col :span="19">
|
|
<view class="demo-uni-col light">{{item.content}}</view>
|
|
</uni-col>
|
|
</uni-row>
|
|
|
|
|
|
</uni-card>
|
|
|
|
<uni-card :isShadow="false" v-if="mainDataCont.isset==2" style="margin-bottom: 10px;">
|
|
<view class="appideabox">
|
|
<uni-easyinput type="textarea" v-model="approvalIdea" placeholder="请输入审批意见" />
|
|
</view>
|
|
<view class="example-body">
|
|
<uni-row>
|
|
<uni-col :span="11"><button :loading="loading" type="primary" @click="xingOperation(1)">批准</button></uni-col>
|
|
<uni-col :span="2" style="min-height: 1px;"></uni-col>
|
|
<uni-col :span="11"><button :loading="loading" type="warn" @click="xingOperation(2)" >驳回</button></uni-col>
|
|
</uni-row>
|
|
</view>
|
|
</uni-card>
|
|
|
|
|
|
|
|
<uni-card :isShadow="false" >
|
|
<uni-steps :options="flowList" active-color="#007AFF" :active="active" direction="column" />
|
|
</uni-card>
|
|
<u-toast ref="uToast"></u-toast>
|
|
</view>
|
|
</template>
|
|
|
|
<script> //定量
|
|
export default {
|
|
data() {
|
|
return {
|
|
loading:false,
|
|
approvalIdea:"",
|
|
active:1,
|
|
headerVerify:{
|
|
userkey:"",
|
|
token:"",
|
|
userCont:""
|
|
},
|
|
receiveData:{
|
|
},
|
|
contdata:[],
|
|
flowList:[],
|
|
mainDataCont:{
|
|
isset:1,
|
|
orderid:"",
|
|
title:{},
|
|
enclosure:"",
|
|
stepper:1
|
|
}
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
console.log("option",option)
|
|
// console.log("option",JSON.parse(option.data))
|
|
let _this = this
|
|
//判断Token是否有效
|
|
let systemCache = _this.$commonMethod.getSystemCacheDate('myCache')
|
|
if(!systemCache){
|
|
_this.$commonMethod.JumpUrl('/pages/login/login')
|
|
}else{
|
|
let currentTime = new Date().getTime() - systemCache.tokenTime
|
|
if (currentTime >= 10800000){
|
|
_this.$commonMethod.verifyPowerIsTrue('myCache')
|
|
}
|
|
}
|
|
_this.headerVerify.userkey = systemCache.userKey
|
|
_this.headerVerify.token = systemCache.token
|
|
_this.headerVerify.userCont = systemCache.userInfo
|
|
_this.receiveData =option
|
|
},
|
|
onReady(){
|
|
this.getDataCont()
|
|
},
|
|
methods:{
|
|
//获取数据
|
|
getDataCont(){
|
|
let _this = this
|
|
_this.mainDataCont.list = []
|
|
let sunTargetDate = {
|
|
id:_this.receiveData.orderid,
|
|
class:_this.receiveData.class*1
|
|
}
|
|
//获取审批列表
|
|
uni.request({
|
|
url:_this.$commonMethod.localhostUrl+'/kpiapi/postweb/lookflowmap',
|
|
header: {
|
|
'Content-Type': 'application/json', //自定义请求头信息
|
|
// 'User-Agent':250,
|
|
'user-key': _this.headerVerify.userkey,
|
|
'user-token':_this.headerVerify.token
|
|
},
|
|
method:'POST',//请求方式,必须为大写
|
|
data:sunTargetDate,
|
|
success: (res) => {
|
|
console.log(res)
|
|
let callBackDate = res.data
|
|
if(callBackDate.code == 0){
|
|
console.log("列表值---------------->",callBackDate.data)
|
|
_this.contdata=callBackDate.data
|
|
|
|
_this.mainDataCont = {
|
|
isset:_this.contdata.isset,
|
|
orderid:_this.contdata.orderid,
|
|
title:_this.contdata.title,
|
|
enclosure:_this.contdata.enclosure,
|
|
list:_this.contdata.list,
|
|
stepper:_this.contdata.stepper
|
|
}
|
|
|
|
_this.contdata.flowmapall.forEach(item=>{
|
|
let userList = new Array //节点审批人
|
|
console.log(item.userlist,"item.userlist")
|
|
if(item.userlist != null && item.userlist.length > 0){
|
|
item.userlist.forEach(usItem=>{
|
|
let usLog = new Array //节点审批人审批记录
|
|
if(usItem.log != null && usItem.log.length > 0){
|
|
usItem.log.forEach(logItem=>{
|
|
let logCont = {
|
|
state:logItem.state,
|
|
time:logItem.time,
|
|
enclosure:logItem.enclosure
|
|
}
|
|
usLog.push(logCont)
|
|
});
|
|
}
|
|
let userCont = { //节点审批人信息
|
|
id:usItem.id,
|
|
name:usItem.name,
|
|
icon:usItem.icon,
|
|
groupname:usItem.companyname,
|
|
departmentname:usItem.departmentname,
|
|
postname:usItem.postname,
|
|
workshopname:usItem.workshopname,
|
|
log:usLog
|
|
}
|
|
userList.push(userCont)
|
|
});
|
|
}
|
|
|
|
let flowCont = { //流程图
|
|
title: item.nodename,
|
|
desc: item.step,
|
|
state: item.state,
|
|
userlist:userList
|
|
}
|
|
_this.flowList.push(flowCont)
|
|
|
|
})
|
|
|
|
console.log("_this.flowList---》",_this.flowList,_this.mainDataCont)
|
|
|
|
}else{
|
|
_this.$refs.uToast.show({
|
|
message: callBackDate.msg,
|
|
duration: 1000 * 2,
|
|
position:'bottom',
|
|
})
|
|
}
|
|
},
|
|
fail:function(e){
|
|
_this.$refs.uToast.show({
|
|
message: e,
|
|
duration: 1000 * 2,
|
|
position:'bottom',
|
|
})
|
|
}
|
|
});
|
|
},
|
|
//审批处理
|
|
xingOperation(data){
|
|
console.log("审批处理",data)
|
|
let _this = this
|
|
_this.loading = true
|
|
// console.log("审批处理-----1------>",vlaIsTrue)
|
|
// console.log("审批处理-----2------>",_this.approvalIdea)
|
|
|
|
uni.request({
|
|
url:_this.$commonMethod.localhostUrl+'/kpiapi/examine/postnatureappflow',
|
|
header: {
|
|
'Content-Type': 'application/json', //自定义请求头信息
|
|
// 'User-Agent':250,
|
|
'user-key': _this.headerVerify.userkey,
|
|
'user-token': _this.headerVerify.token
|
|
},
|
|
method:'POST',//请求方式,必须为大写
|
|
data:{
|
|
// group:_this.headerVerify.userCont.company, //公司
|
|
orderid:_this.mainDataCont.orderid, //订单号码
|
|
yesorno:vlaIsTrue,
|
|
content:_this.approvalIdea,
|
|
stepper:_this.mainDataCont.stepper
|
|
},
|
|
success: (res) => {
|
|
console.log(res)
|
|
let callBackDate = res.data
|
|
if(callBackDate.code == 0){
|
|
_this.loading = false
|
|
let chartDate = callBackDate.data
|
|
console.log('接口返回--login--2--',chartDate);
|
|
_this.mainDataCont.isset = 1
|
|
_this.$refs.uToast.show({
|
|
message: callBackDate.msg,
|
|
duration: 1000 * 1,
|
|
position:'bottom',
|
|
complete(){
|
|
uni.navigateBack();
|
|
}
|
|
})
|
|
}else{
|
|
_this.loading = false
|
|
_this.$refs.uToast.show({
|
|
message: callBackDate.msg,
|
|
duration: 1000 * 1,
|
|
position:'bottom',
|
|
})
|
|
}
|
|
},
|
|
fail:function(e){
|
|
_this.loading = false
|
|
console.log('接口返回--login--2--',e);
|
|
_this.$refs.uToast.show({
|
|
message: e,
|
|
duration: 1000 * 1,
|
|
position:'bottom',
|
|
})
|
|
},
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.titlesize{
|
|
font-size: 40rpx;
|
|
color: #000000;
|
|
margin-top: 20rpx;
|
|
}
|
|
|
|
.titlesize{
|
|
font-size: 40rpx;
|
|
color: #000000;
|
|
margin-top: 20rpx;
|
|
}
|
|
.demo-uni-col{
|
|
padding-top: 20rpx;
|
|
|
|
}
|
|
.grid-item-box{
|
|
overflow: hidden;
|
|
image{
|
|
width: 94%;
|
|
height: 78px;
|
|
margin:2px 3%;
|
|
}
|
|
}
|
|
.card-actions {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-around;
|
|
align-items: center;
|
|
height: 45px;
|
|
border-top: 1px #eee solid;
|
|
}
|
|
|
|
.card-actions-item {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
}
|
|
|
|
.card-actions-item-text {
|
|
font-size: 12px;
|
|
color: #666;
|
|
margin-left: 5px;
|
|
}
|
|
.example-body {
|
|
/* #ifndef APP-NVUE */
|
|
display: block;
|
|
/* #endif */
|
|
// padding: 5rpx 10rpx 0;
|
|
overflow: hidden;
|
|
}
|
|
.appideabox{
|
|
padding: 10px 0;
|
|
}
|
|
</style>
|
|
|