绩效考核手机版
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.
 
 
 
 

485 lines
13 KiB

<template>
<view class="container">
<uni-card :is-shadow="false" style="margin-bottom: 10px;">
<view class="">
<text class="uni-body">审批编号{{mainDataCont.orderid}}</text>
</view>
<view class="" v-for="(item,index) in mainDataCont.list" :key="index">
<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.dimension}}</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.target}}</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.targetsun}}</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.detailedtargent}}</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.standard}}</view>
<view class="demo-uni-col light">{{item.standardmoney}}</view>
</uni-col>
</uni-row>
<uni-row class="demo-uni-row" >
<uni-col :span="5">
<view class="demo-uni-col dark">{{item.lanmuname}}:</view>
</uni-col>
<uni-col :span="19">
<view class="demo-uni-col light">{{item.scoreval}}{{item.unit}}</view>
<view class="demo-uni-col light">{{item.moneyval}}元</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.reason}}</view>
</uni-col>
</uni-row>
</view>
<uni-row class="demo-uni-row" v-if="mainDataCont.enclosure" >
<uni-col :span="5">
<view class="demo-uni-col dark">附件:</view>
</uni-col>
<uni-col :span="19">
<uni-grid style="margin-top: 20rpx;" :column="3" :highlight="true" >
<uni-grid-item v-for="(encItem, encindex) in mainDataCont.enclosure" :index="encindex" :key="encindex">
<view class="grid-item-box" v-if="encItem.filetype==1" style="background-color: #fff;">
<image :src="encItem.filepath" ></image>
</view>
<view class="grid-item-box" v-if="encItem.filetype==2" style="background-color: #fff;">
<uni-icons type="videocam" :size="30" color="#777" />
<text class="text">{{encItem.filename}}</text>
</view>
<view class="grid-item-box" v-if="encItem.filetype>2" style="background-color: #fff;">
<uni-icons type="wallet" :size="30" color="#777" />
<text class="text">{{encItem.filename}}</text>
</view>
</uni-grid-item>
</uni-grid>
</uni-col>
</uni-row>
</uni-card>
<uni-card :isShadow="false" v-if="mainDataCont.isset==1" style="margin-bottom: 10px;">
<view class="zgcs">
整改措施
</view>
<uni-forms ref="baseForm" :model="baseFormData" labelWidth="80px">
<view class="appideabox">
<uni-easyinput type="textarea" v-model="baseFormData.approvalIdea" placeholder="请输入整改措施" />
</view>
<uni-forms-item label="附件上传">
<u-upload
:fileList="baseFormData.fileList"
@afterRead="afterRead"
@delete="deletePic"
name="3"
multiple
:maxCount="10"
:previewFullImage="true"
></u-upload>
</uni-forms-item>
<view class="example-body">
<button :loading="loading" type="primary" @click="xingOperation()">提交</button>
</view>
</uni-forms>
</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 {
uploadIsTrue:true,
loading:false,
active:1,
headerVerify:{
userkey:"",
token:"",
userCont:""
},
receiveData:{
},
contdata:[],
flowList:[],
mainDataCont:{
isset:1,
orderid:"",
title:{},
enclosure:"",
stepper:1
},
baseFormData:{
approvalIdea:"", //操作原因
fileList: [], //附件列表
},
};
},
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.id,
class:1,
num:_this.receiveData.num
}
//获取审批列表
uni.request({
url:_this.$commonMethod.localhostUrl+'/kpiapi/postweb/lookflowmapcorra',
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',
})
}
});
},
// 删除图片
deletePic(event) {
console.log(event,"event---->")
this.baseFormData.fileList.splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this.baseFormData.fileList.length
lists.map((item) => {
this.baseFormData.fileList.push({
...item,
status: 'uploading',
message: '上传中'
})
})
this.uploadIsTrue = false
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
// console.log(lists[i],"====================>lists[i]")
// console.log(result,"====================>result")
let resultData = JSON.parse(result)
// console.log(resultData,"====================>resultData")
let item = this.baseFormData.fileList[fileListLen]
this.baseFormData.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url:resultData.data.url,
filepath:resultData.data.physicspath,
type:resultData.data.type
}))
fileListLen++
}
this.uploadIsTrue = true
},
//上传模组
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let _this = this
let a = uni.uploadFile({
url: _this.$commonMethod.localhostUrl+'/api/upordown', // 仅为示例,非真实的接口地址
filePath: url,
name: 'file',
formData: {
type: 1
},
header: {
'X-Requested-With': 'XMLHttpRequest',
// 'Content-Type': 'application/json', //自定义请求头信息
// 'User-Agent':250,
'user-key': _this.headerVerify.userkey,
'user-token': _this.headerVerify.token
},
success: (res ) => {
// console.log(res.data)
const resData = JSON.parse(res.data)
// console.log(resData.code,"resData=======>")
setTimeout(() => {
resolve(res.data)
}, 1000)
// return resData
}
});
})
},
//提交整改措施
xingOperation(){
let _this = this
_this.loading = true
if(_this.uploadIsTrue == false){
_this.$refs.uToast.show({
message: "图片还未上传完毕!请等待!",
duration: 1000 * 2,
position:'bottom',
complete(){
_this.loading=false
}
})
return
}
let fileAry = new Array
if(_this.baseFormData.fileList != null && _this.baseFormData.fileList.length > 0){
_this.baseFormData.fileList.forEach(itemk=>{
let filecont = {
filename:itemk.name,
filepath:itemk.url,
type:itemk.type
}
fileAry.push(filecont)
})
}
uni.request({
url:_this.$commonMethod.localhostUrl+'/kpiapi/postweb/post_rectification_measures',
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.receiveData.id, //订单号码
content:_this.baseFormData.approvalIdea,
register:_this.receiveData.num,
enclosure:fileAry
},
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(){
_this.$commonMethod.JumpUrl('/pages/approval/postdingxin?orderid='+_this.receiveData.id+'&class=1')
}
})
}else{
_this.$refs.uToast.show({
message: callBackDate.msg,
duration: 1000 * 3,
position:'bottom',
complete(){
_this.loading = false
}
})
}
},
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;
}
.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;
}
.zgcs{
text-align: center;
font-size: 16px;
font-weight: bold;
}
</style>