| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- <template>
- <div class="group-box" :style="{height:height}">
- <div class="group-title">
- 工作任务
- <el-link @click="linkTo">更多 <i class="el-icon-caret-right" /></el-link>
- </div>
- <vuescroll v-if="data" :ops="ops" style="height: calc(100% - 40px)">
- <div class="task-management">
- <div
- v-for="(item, index) in dataList"
- :key="index"
- class="item"
- @click="linkTo"
- >
- <div class="icon">
- <i class="el-icon-tickets" />
- </div>
- <div class="info">
- <div class="lf">
- <h4 class="taskTitle">{{ item.taskTitle }}</h4>
- <span v-if="item.handleAccountId" style="font-size: 8px;color:#c4c1c1;">
- <i class="el-icon-user" />
- <span style="padding:0 6px;">{{ item.status===0?item.curAccountName:item.handleAccountName }}</span>
- </span>
- </div>
- <div class="rt">
- <div class="el-tag-taskCat">
- <el-tag size="mini" class="custom-tag" :class="'tag-'+item.taskCatId">{{ item.taskCatTitle }}</el-tag>
- </div>
- <template v-if="item.taskStatus===0">
- <vac :end-time="item.expectedEndTime">
- <p
- slot="process"
- slot-scope="{ timeObj }"
- >
- <i class="el-icon-time" />
- <span style="padding-left:6px;">{{ `${timeObj.d}天${timeObj.h}:${timeObj.m}:${timeObj.s}` }}</span>
- </p>
- <p slot="finish">过期</p>
- </vac>
- </template>
- <template v-else>
- <span style="font-size: 8px;color:#868282;">{{ item.status | taskStatusFilter }}</span>
- </template>
- </div>
- </div>
- </div>
- </div>
- </vuescroll>
- </div>
- </template>
- <script>
- import commonMixin from '@/mixin/commonMethodMixin'
- import vuescroll from 'vuescroll'
- import { getTaskByList } from '@/api/system/taskApi'
- export default {
- name: 'WorkTask',
- components: {
- vuescroll
- },
- mixins: [commonMixin],
- props: {
- more: {
- type: String,
- default: undefined
- },
- height: {
- type: [String],
- default: 'calc(100vh - 85px)'
- }
- },
- data() {
- return {
- ops: {
- bar: {
- keepShow: false,
- background: 'rgba(144, 147, 153, 0.4)',
- onlyShowBarOnScroll: false
- }
- },
- dataList: [],
- conditions: {}
- }
- },
- mounted() {
- this.getData()
- },
- methods: {
- linkTo() {
- if (this.more) {
- this.$router.push({
- path: this.more
- })
- }
- },
- // Fetch Data
- getData() {
- this.listLoading = true
- getTaskByList(this.conditions).then((resp) => {
- const { code, data, total, msg } = resp
- this.listLoading = false
- if (code === 200) {
- this.total = total
- this.dataList = data
- } else {
- this.$message.error(msg)
- }
- }).catch((error) => {
- console.log(error)
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .group-box {
- width: calc(100% - 15px);
- background-color: #0C3242;
- border-top: 4px solid #1F3C51;
- border-radius: 5px 5px 0 0;
- padding: 15px;
- .group-title {
- font-size: 16px;
- color: #FFF;
- margin-bottom: 15px;
- font-weight: bold;
- .el-link {
- float: right;
- font-size: 14px;
- color: #C1C6C8;
- -webkit-text-fill-color: #C1C6C8;
- }
- }
- .group-content{
- height: 80%;
- overflow: auto;
- }
- }
- .task-management{
- margin-top: 20px;
- .item{
- display: flex;
- justify-content: flex-start;
- line-height: 1;
- margin-bottom: 20px;
- position: relative;
- cursor: pointer;
- .info{
- flex: 1;
- &::after{
- display: block;
- content: "";
- clear: both;
- }
- .lf{
- float: left;
- }
- .rt{
- float: right;
- .el-tag-taskCat{
- text-align: right;
- margin-top: 5px;
- .custom-tag{
- color:#fff;
- border-color:#eaeaea;
- background-color:transparent;
- &.tag-2{color: #b97741;border-color:#b97741;}
- &.tag-3{color: #97cd38;border-color:#97cd38;}
- &.tag-4{color: #dc5a2c;border-color:#dc5a2c;}
- &.tag-5{color: #414ab9;border-color:#414ab9;}
- &.tag-6{color: #c13ac9;border-color:#c13ac9;}
- &.tag-7{color: #29c761;border-color:#29c761;}
- }
- }
- }
- }
- .tag{
- height: 22px;
- display: inline-block;
- position: absolute;
- right: 0;
- padding: 0 5px;
- line-height: 20px;
- font-size: 12px;
- color: #fff;
- border-radius: 4px;
- box-sizing: border-box;
- white-space: nowrap;
- // background-color: #c78148;
- border: 1px solid #868282;
- &.none{
- background-color: transparent;
- border-color: transparent;
- }
- }
- p,h4{
- margin: 0;
- font-size: 14px;
- }
- p{
- padding-top: 6px;
- font-size: 8px;
- color: #f5f5f5;
- }
- h4{
- .status{
- font-size: 12px;
- }
- &.taskTitle{
- padding-bottom: 6px;
- }
- }
- .icon{
- width: 36px;
- height: 36px;
- font-size: 20px;
- }
- }
- }
- </style>
|