货无忧
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.
 
 
 
 
 

540 lines
12 KiB

<template>
<view>
<u-navbar title="积分指标" bgColor="rgb(211, 131, 42)" leftIconColor="#fff" titleStyle="color:#fff" placeholder
border=true :autoBack="true" leftIconSize='35'></u-navbar>
<view class="tabtip">
<view @click="setstate(0)">
<view :class="status==0?'xz':''">积分项</view>
</view>
<view @click="setstate(1)">
<view :class="status==1?'xz':''">已提交积分</view>
</view>
</view>
<view v-show="status==0" class="content-box">
<view class="schbox">
<view>考核部门:</view>
<view class="searchBox" @click="showPopUp.chooseDepartment = true">
<!-- <uni-data-select v-model="assessDept1" :localdata="deepList" @change="getTypeList"></uni-data-select> -->
{{industryTitle||'请选择考核部门'}}
</view>
</view>
<view class="collapse">
<view v-for="item,index in collapse" :key="index">
<view class="title-box" @click="()=>{
crrColl = index === crrColl ? -1 : index
}">
<view class="title">{{item.name}}</view>
<u-icon :name="crrColl==index?'arrow-up':'arrow-down'" color="#303133" size="28"></u-icon>
</view>
<template v-if="crrColl==index">
<view class="sub" @click="goEdit(item,sub)" v-for="sub,idx in item.children" :key="idx">
<view class="tag" style="margin-right: 10px;">{{idx + 1}}</view>
<view class="">
{{sub.name}}
</view>
<view :class="sub.isCommit === 0 ? 'red': 'green'">
{{sub.isCommit === 0 ? '未考核': '已考核'}}
</view>
</view>
</template>
</view>
</view>
</view>
<view v-show="status==1">
<view class="content-box">
<view class="schbox">
<view>考核时间:</view>
<view @click='showCalendar' class="inputsr">
<view class="timeInput">
{{datatime|| '请选择时间'}}
</view>
<view @click.stop.prevent>
<u-icon @click='showCalendar' style="margin-right: 10rpx;" v-if="!datatime" name="calendar"
color="#999999" size="50"></u-icon>
<u-icon @click="cleartime" style="margin-right: 10rpx;" v-else name="close-circle" color="#999999"
size="40"></u-icon>
</view>
</view>
</view>
<view class="schbox">
<view>考核部门:</view>
<view>
<uni-data-select v-model="assessDept" :localdata="deepList" @change="change"></uni-data-select>
</view>
<view @click="pageClick()">查询</view>
</view>
<uni-table border stripe emptyText="暂无更多数据" style="width:100%">
<uni-tr>
<uni-th align="center" width="40rpx">序号</uni-th>
<uni-th align="center" width="100rpx">考核时间</uni-th>
<uni-th align="center" width="100rpx">考核部门</uni-th>
<uni-th align="center" width="150rpx">考核指标</uni-th>
<uni-th align="center" width="100rpx">考核状态</uni-th>
<uni-th align="center" width="40rpx">分数</uni-th>
</uni-tr>
<block v-for="(item,index) in dataList" :key="index">
<uni-tr @click="goDetail(item)" @tap="goDetail(item)">
<uni-td align="center">{{index+1}}</uni-td>
<uni-td align="center" :style="{color:item.isObjection?'#D3832A':''}">{{item.createTime}}</uni-td>
<uni-td align="center">{{item.assessDeptName}}</uni-td>
<uni-td align="center">{{item.classifyName}}</uni-td>
<uni-td align="center">{{item.indicatorsStatusName}}</uni-td>
<uni-td align="center">{{item.point}}</uni-td>
</uni-tr>
</block>
</uni-table>
</view>
<pageView :totalNum="totalNum" :pageCount="pageCount" :crrNum="crrNum" @pageClick="pageClick" />
</view>
<l-calendar v-model:value="show" :initStartDate='date[0]' :initEndDate='date[1]' @hide='showCalendar'
@change="onConfirm"></l-calendar>
<view class="mask" v-if="showPopUp.chooseDepartment">
<view class="container">
<!-- 顶部按钮 -->
<view class="header_button">
<view class="button close" @click="showPopUp.chooseDepartment = false">
取消
</view>
<view class="button" @click="handleSearch">
确认
</view>
</view>
<!-- 树形 -->
<scroll-view scroll-y="true" class="scvbw">
<MyTree :tree-data="treeData" @node-click="nodeClick" :activeId="activeId"></MyTree>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import pageView from '@/compoment/pageView/pageView.vue'
import {
classifyList,
deptTree,
myApiIndicators,
getCurrentTree
} from '@/api/user.js'
export default {
components: {
pageView
},
data() {
return {
crrNum: 1,
pageCount: 10,
totalNum: 0,
status: 1,
collapse: [],
crrColl: 0,
show: false,
date: [],
datatime: '',
assessDept: '',
assessDept1: '',
deepList: [],
dataList: [],
showPopUp: {
chooseDepartment: false
},
/** 部门 */
treeData: [],
activeId: 0,
activeIds: 0,
/** 部门名称 */
industryTitle: ''
}
},
created() {
// this.getTypeList()
this.initData()
this.initTree()
},
onShow() {
this.getList()
if (this.activeIds) this.initCollapse()
},
methods: {
nodeClick(val) {
console.log(val)
this.activeId = val.id
},
getList() {
let json = {
current: this.crrNum,
size: this.pageCount,
assessDept: this.assessDept
}
if (this.date && this.date.length) {
json.startTime = this.date[0]
json.endTime = this.date[1]
}
myApiIndicators(json).then(res => {
this.totalNum = res.data.total;
this.dataList = res.data.records.map(item => {
item.createTime = uni.$u.timeFormat(item.createTime, 'yyyy-mm-dd');
return item
})
})
},
async handleSearch() {
const ids = []
// 递归函数, 获取所有id
const recursionFn = (_arr) => {
let _flag = false
for (let iterator of _arr) {
if (_flag) break
if (iterator.id !== this.activeId) {
if (iterator.children && iterator.children.length !== 0) _flag = recursionFn(iterator.children)
if (_flag) ids.unshift(iterator.id)
} else {
_flag = true
this.industryTitle = iterator.title
ids.unshift(iterator.id)
}
}
return _flag
}
recursionFn(this.treeData)
this.showPopUp.chooseDepartment = false
this.collapse = []
if (ids.length === 0) return
this.activeIds = ids.join(',')
this.initCollapse()
console.log('ids :>> ', ids);
},
async initCollapse() {
let res = await classifyList({
deptId: this.activeIds,
})
this.collapse = res.data
},
async initData() {
let res = await deptTree({})
this.deepList = res.data.map(item => {
return {
value: item.id,
text: item.deptName
}
})
},
async initTree() {
const res = await getCurrentTree({})
if (res.code !== 200) return
this.treeData = res.data[0].children
},
async getTypeList() {
this.collapse = []
if (!this.assessDept1) return
let res = await classifyList({
deptId: this.assessDept1
})
this.collapse = res.data
},
pageClick(e) {
this.crrNum = e || 1;
this.getList()
},
setstate(status) {
this.status = status
},
showCalendar() {
this.show = !this.show
},
onConfirm(e) {
this.date[0] = e.startDate
this.date[1] = e.endDate
this.datatime = e.startDate + ' 至 ' + e.endDate
},
cleartime() {
this.date = []
this.datatime = ''
},
goEdit(item, sub) {
console.log('sub :>> ', sub);
console.log('222 :>> ', 222);
uni.navigateTo({
url: `/pagesHome/pages/integralEdit/integralEdit?oneId=${item.id}&twoId=${sub.id}&twoName=${sub.name}&deptId=${this.activeId}&deptIds=${this.activeIds}&industryTitle=${this.industryTitle}&deduction=${sub.description}`
})
},
goDetail(item) {
console.log('111 :>> ', 111);
uni.navigateTo({
url: `/pagesHome/pages/integralEdit/integralEdit?id=${item.id}&classifyId=${item.classifyId}`
})
},
handleChange(e) {
console.log('e :>> ', e);
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .uni-table-th,
::v-deep .uni-table-td {
padding: 10rpx 0;
}
.my-table {
text-align: center;
.tb-head {
display: flex;
align-items: center;
font-size: 28rpx;
}
.tb-body {
display: flex;
align-items: center;
font-size: 26rpx;
padding: 5rpx 0;
}
.td1 {
width: 80rpx;
}
.td2 {
width: 200rpx;
}
.td3 {
flex: 1;
overflow: hidden; //超出隐藏
text-overflow: ellipsis; //文本超出时显示省略号
white-space: nowrap; //设置文本不换行
}
.td4 {
flex: 1;
overflow: hidden; //超出隐藏
text-overflow: ellipsis; //文本超出时显示省略号
white-space: nowrap; //设置文本不换行
}
.td5 {
width: 80rpx;
}
}
.content-box {
background-color: #fff;
margin: 10rpx;
}
.inputsr {
width: 400upx !important;
height: 64upx;
border-radius: 8upx 8upx 8upx 8upx;
opacity: 1;
border: 2upx solid #EEEEEE;
padding: 16upx 18upx;
box-sizing: border-box;
padding-right: 0;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26upx;
font-weight: 400;
color: #092C4D;
>.timeInput {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
font-size: 26upx;
}
}
.schbox {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15upx 32upx;
box-sizing: border-box;
background-color: #ffffff;
>view:nth-of-type(1) {
font-size: 28upx;
font-weight: 400;
color: #092C4D;
}
>view:nth-of-type(2) {
flex: 1;
}
>view:nth-of-type(3) {
margin-left: 10upx;
width: 128upx;
height: 64upx;
background: #D3832A;
border-radius: 8upx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32upx;
font-weight: 400;
color: #FFFFFF;
}
}
.collapse {
margin-top: 10upx;
font-size: 30rpx;
color: #303133;
.title-box {
display: flex;
box-sizing: border-box;
padding: 20rpx 30rpx;
align-items: center;
border-bottom: 1px solid #eee;
.title {
flex: 1;
}
}
.sub {
display: flex;
align-items: center;
padding: 20rpx 30rpx 20rpx 60rpx;
border-bottom: 1px solid #eee;
color: #666;
>view {
&:nth-child(2) {
flex: 1;
}
&:nth-child(3) {
width: fit-content;
flex: none;
font-family: 宋体;
margin-left: 20upx;
&.red {
color: #f00;
}
&.green {
color: #0f0;
}
}
}
.tag {
width: 40upx;
height: 40upx;
background: var(--subjectColor);
text-align: center;
line-height: 40upx;
border-radius: 50%;
color: #fff;
}
}
}
.tabtip {
display: flex;
align-items: center;
justify-content: space-between;
>view {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #ffffff;
font-size: 32upx;
font-weight: 400;
color: #90A0AF;
>view {
height: 80upx;
border-bottom: 8upx solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
}
.xz {
color: #D3832A;
border-bottom: 8upx solid #D3832A;
// border-radius: 5upx;
}
}
.mask {
z-index: 99;
position: fixed;
width: 100vw;
height: 100vh;
background: #00000080;
top: 0;
left: 0;
.container {
border-top-left-radius: 10upx;
border-top-right-radius: 10upx;
height: 70vh;
width: 100%;
background-color: #fff;
position: absolute;
bottom: 0;
left: 0;
}
.header_button {
margin: 10upx;
display: flex;
justify-content: space-between;
.button {
padding: 15upx 50upx;
background: var(--subjectColor);
border-radius: 10upx;
color: #fff;
&.close {
background: #c9c9c9;
}
}
}
}
.scvbw {
height: calc(70vh - 90upx);
}
.searchBox {
padding: 15upx 30upx;
background-color: #efefef;
border-radius: 10upx;
}
</style>