web-retail-admin/src/views/dashboard/index.vue

619 lines
16 KiB
Vue
Raw Normal View History

2025-03-23 10:03:12 +08:00
<!--
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-10-24 10:45:39
-->
<template>
<div class="page">
<topBar
v-if="topList.length > 0 && userInfo.userType != 9"
2025-07-18 14:53:41 +08:00
:top-list="topList"
2025-03-23 10:03:12 +08:00
:moren="moren"
2025-07-18 14:53:41 +08:00
:wait-approval-num="waitApprovalNum"
:receive-approval-num="receiveApprovalNum"
/>
<div v-if="userInfo.userType != 9" class="main">
2025-03-23 10:03:12 +08:00
<div>
<div class="form_all">
<el-form ref="select" :model="select" label-width="auto">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="签呈编号">
<el-input
v-model="select.approvalCode"
2025-07-18 14:53:41 +08:00
clearable
2025-05-26 10:41:35 +08:00
:placeholder="'请输入'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<!-- 一层 -->
<el-col :span="6">
2025-05-26 10:41:35 +08:00
<el-form-item :label="'业务类型'">
2025-03-23 10:03:12 +08:00
<el-select
2025-07-18 14:53:41 +08:00
v-model="select.approvalBusiness"
2025-03-23 10:03:12 +08:00
clearable
filterable
>
<el-option
v-for="item in ywsqList"
:key="item.value"
:label="item.label"
:value="item.value"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务类型内容">
<el-input
v-model="select.approvalBusinessVal"
2025-07-18 14:53:41 +08:00
clearable
2025-05-26 10:41:35 +08:00
:placeholder="'请输入'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="情况说明">
<el-input
v-model="select.remark"
2025-07-18 14:53:41 +08:00
clearable
2025-05-26 10:41:35 +08:00
:placeholder="'请输入'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<!-- <el-col :span="6">
2025-05-26 10:41:35 +08:00
<el-form-item :label="'签呈状态'">
2025-03-23 10:03:12 +08:00
<el-select clearable
v-model="select.approveStatus">
<el-option v-for="item in approveStatusList"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12">
2025-05-26 10:41:35 +08:00
<el-form-item :label="'创建日期'">
2025-03-23 10:03:12 +08:00
<el-date-picker
v-model="select.creationTime"
value-format="yyyy-MM-dd"
type="daterange"
2025-05-26 10:41:35 +08:00
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
</el-form-item>
</el-col>
<!-- <el-col :span="8">
2025-05-26 10:41:35 +08:00
<el-form-item :label="'终审日期'">
2025-03-23 10:03:12 +08:00
<el-date-picker v-model="select.endTime"
value-format="yyyy-MM-dd"
type="daterange"
2025-05-26 10:41:35 +08:00
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'">
2025-03-23 10:03:12 +08:00
</el-date-picker>
</el-form-item>
</el-col> -->
<el-col :span="4">
<el-button type="primary" @click="getDataList">
2025-07-18 14:53:41 +08:00
{{ '搜索' }}</el-button>
2025-05-26 10:41:35 +08:00
<el-button @click="reset"> {{ '重置' }}</el-button>
2025-03-23 10:03:12 +08:00
</el-col>
</el-row>
</el-form>
</div>
<el-table
2025-07-18 14:53:41 +08:00
v-loading="loading"
2025-03-23 10:03:12 +08:00
:data="tableData"
height="700px"
2025-05-26 10:41:35 +08:00
:element-loading-text="'正在加载'"
2025-03-23 10:03:12 +08:00
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
>
<el-table-column
align="center"
prop="creation"
2025-05-26 10:41:35 +08:00
:label="'发起人'"
2025-07-18 14:53:41 +08:00
/>
<el-table-column align="center" prop="approvalCode" label="签呈编号" />
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="approvalBusinessVal"
2025-05-26 10:41:35 +08:00
:label="'业务类型'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="parentClassifyName"
:min-width="320"
2025-05-26 10:41:35 +08:00
:label="'签呈进度'"
2025-03-23 10:03:12 +08:00
>
<template slot-scope="scope">
<div class="bz_a">
<div
v-for="(item, index) in scope.row.detailList"
:key="index"
2025-07-18 14:53:41 +08:00
class="bz_i"
2025-03-23 10:03:12 +08:00
>
<div
:class="item.useTime == undefined ? 'qiu' : 'quan'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
<div
2025-07-18 14:53:41 +08:00
v-if="index != scope.row.detailList.length - 1"
2025-03-23 10:03:12 +08:00
:class="
scope.row.detailList[index + 1].useTime == undefined
? 'gun1'
: 'gun'
"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
<div class="time">{{ item.useTime }}</div>
<div class="zhi">
<div>{{ item.nickName }}</div>
<div>({{ item.deptName }})</div>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="approveStatusVal"
width="100"
2025-05-26 10:41:35 +08:00
:label="'审核状态'"
2025-03-23 10:03:12 +08:00
>
<template slot-scope="scope">
<el-button
v-show="scope.row.approvalFlag == 0"
type="text"
size="small"
2025-07-18 14:53:41 +08:00
@click="toFixed(scope.row.approvalCode, 0)"
2025-03-23 10:03:12 +08:00
>
2025-05-26 10:41:35 +08:00
{{ '审核' }}
2025-03-23 10:03:12 +08:00
</el-button>
</template>
</el-table-column>
<el-table-column
align="center"
prop="creationTime"
width="100"
2025-05-26 10:41:35 +08:00
:label="'创建日期'"
2025-07-18 14:53:41 +08:00
/>
2025-03-23 10:03:12 +08:00
<el-table-column
align="center"
prop="time"
2025-05-26 10:41:35 +08:00
:label="'操作'"
2025-03-23 10:03:12 +08:00
width="100"
fixed="right"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
2025-07-18 14:53:41 +08:00
@click="toFixed(scope.row.approvalCode, 0)"
2025-03-23 10:03:12 +08:00
>
2025-05-26 10:41:35 +08:00
{{ '查看签呈' }}
2025-03-23 10:03:12 +08:00
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="notice">
<div class="not_top">
2025-05-26 10:41:35 +08:00
<div>{{ '公告' }}</div>
<div class="not_t" @click="openNotice">{{ '发布公告' }}</div>
2025-03-23 10:03:12 +08:00
</div>
<div class="not_btm">
<div v-for="item in tableList" class="not_i" @click="goNotice(item)">
<div>{{ item.title }}</div>
<div class="hui">{{ item.creationTime }}</div>
</div>
</div>
</div>
</div>
<el-dialog
2025-05-26 10:41:35 +08:00
:title="'公告'"
2025-03-23 10:03:12 +08:00
:visible.sync="isNotice"
width="35%"
center
:before-close="handleClose"
>
<div class="title">
{{ noticeObj.title }}
</div>
2025-07-18 14:53:41 +08:00
<div class="img-auto" v-html="noticeObj.content" />
2025-03-23 10:03:12 +08:00
<!-- <span slot="footer"-->
<!-- class="dialog-footer">-->
<!-- <el-button type="primary"-->
2025-05-26 10:41:35 +08:00
<!-- @click="isNotice = false">{{'确认'}}</el-button>-->
2025-03-23 10:03:12 +08:00
<!-- </span>-->
</el-dialog>
</div>
</template>
<script>
2025-07-18 14:53:41 +08:00
import { mapGetters } from 'vuex'
import * as api from '@/api/manage.js'
import topBar from '@/components/topBar'
import * as not from '@/api/notice.js'
import topBarMixin from './mixins/top-bar-mixin'
2025-03-23 10:03:12 +08:00
export default {
2025-07-18 14:53:41 +08:00
name: 'Dashboard',
2025-03-23 10:03:12 +08:00
components: {
2025-07-18 14:53:41 +08:00
topBar
2025-03-23 10:03:12 +08:00
},
2025-07-18 14:53:41 +08:00
mixins: [topBarMixin],
2025-03-23 10:03:12 +08:00
computed: {
2025-07-18 14:53:41 +08:00
...mapGetters(['name', 'user'])
2025-03-23 10:03:12 +08:00
},
data() {
return {
queryParams: {
pageNum: 1,
2025-07-18 14:53:41 +08:00
pageSize: 50
2025-03-23 10:03:12 +08:00
},
select: {
websiteType: 2,
2025-07-18 14:53:41 +08:00
functionType: 1
2025-03-23 10:03:12 +08:00
},
approveStatusList: [],
total: 0,
tableData: [],
tableData1: [],
tabActive: 0,
loading: false,
select: {},
2025-07-18 14:53:41 +08:00
moren: 'dashboard',
2025-03-23 10:03:12 +08:00
ywsqList: [],
checkList: [],
tableList: [],
2025-07-18 14:53:41 +08:00
userInfo: '',
2025-03-23 10:03:12 +08:00
isNotice: false,
2025-07-18 14:53:41 +08:00
waitApprovalNum: '',
receiveApprovalNum: '',
2025-03-23 10:03:12 +08:00
noticeObj: [
{
2025-07-18 14:53:41 +08:00
title: '',
content: ''
}
]
}
2025-03-23 10:03:12 +08:00
},
mounted() {
// 获取列表
2025-07-18 14:53:41 +08:00
this.getDataList()
this.getApprove()
this.getSignType()
this.getNoticePop()
this.getApprovalStatus()
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
2025-03-23 10:03:12 +08:00
},
methods: {
reset() {
2025-07-18 14:53:41 +08:00
this.select = {}
this.getDataList()
2025-03-23 10:03:12 +08:00
},
handleClose() {
2025-07-18 14:53:41 +08:00
this.isNotice = false
2025-03-23 10:03:12 +08:00
},
getNoticePop() {
// this.getUser
2025-07-18 14:53:41 +08:00
const userInfo = JSON.parse(localStorage.getItem('userInfo'))
2025-03-23 10:03:12 +08:00
api
.noticeShow({
2025-07-18 14:53:41 +08:00
roles: userInfo.roleIds
2025-03-23 10:03:12 +08:00
})
.then((res) => {
if (res.data.length > 0) {
2025-07-18 14:53:41 +08:00
this.noticeObj = res.data[0]
this.isNotice = true
2025-03-23 10:03:12 +08:00
}
2025-07-18 14:53:41 +08:00
})
2025-03-23 10:03:12 +08:00
},
getApprovalStatus() {
api.approvalStatus().then((res) => {
2025-07-18 14:53:41 +08:00
this.approveStatusList = res.data
})
2025-03-23 10:03:12 +08:00
api.waitApprovalNum().then((res) => {
2025-07-18 14:53:41 +08:00
this.waitApprovalNum = res.data
})
2025-03-23 10:03:12 +08:00
api.receiveApprovalNum().then((res) => {
2025-07-18 14:53:41 +08:00
this.receiveApprovalNum = res.data
})
2025-03-23 10:03:12 +08:00
},
goNotice(item) {
this.$router.push({
2025-07-18 14:53:41 +08:00
path: '/announcement/noticeList/details',
2025-03-23 10:03:12 +08:00
query: {
pkId: item.pkId,
2025-07-18 14:53:41 +08:00
type: 1
2025-03-23 10:03:12 +08:00
// functionType:this.select.functionType
2025-07-18 14:53:41 +08:00
}
})
2025-03-23 10:03:12 +08:00
},
openNotice() {
this.$router.push({
2025-07-18 14:53:41 +08:00
path: '/announcement/noticeList/details',
2025-03-23 10:03:12 +08:00
query: {
2025-07-18 14:53:41 +08:00
isAdmin: true
}
})
2025-03-23 10:03:12 +08:00
},
getApprove() {
api.approvalBusiness().then((res) => {
2025-07-18 14:53:41 +08:00
this.ywsqList = res.data
})
2025-03-23 10:03:12 +08:00
},
getSignType() {
api.approvalOperation().then((res) => {
2025-07-18 14:53:41 +08:00
this.checkList = res.data
})
2025-03-23 10:03:12 +08:00
},
getDataList() {
2025-07-18 14:53:41 +08:00
this.loading = true
2025-03-23 10:03:12 +08:00
api.waitApproval(this.select).then((res) => {
2025-07-18 14:53:41 +08:00
this.tableData = res.data
this.loading = false
})
2025-03-23 10:03:12 +08:00
not.indexNoticeAdminList(this.select).then((res) => {
2025-07-18 14:53:41 +08:00
this.tableList = res.rows
2025-03-23 10:03:12 +08:00
this.tableList.forEach((item) => {
if (item.title.length > 20) {
2025-07-18 14:53:41 +08:00
item.title = item.title.substring(0, 20) + '...'
2025-03-23 10:03:12 +08:00
}
2025-07-18 14:53:41 +08:00
item.creationTime = item.creationTime.substring(0, 10)
})
})
2025-03-23 10:03:12 +08:00
},
toFixed(id, index) {
this.$router.push({
2025-07-18 14:53:41 +08:00
path: 'manageDetails',
2025-03-23 10:03:12 +08:00
query: {
id: id,
2025-07-18 14:53:41 +08:00
index: index
}
})
2025-03-23 10:03:12 +08:00
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
2025-07-18 14:53:41 +08:00
return 'warning-row'
2025-03-23 10:03:12 +08:00
} else if (rowIndex % 2 == 0) {
2025-07-18 14:53:41 +08:00
return 'success-row'
2025-03-23 10:03:12 +08:00
}
2025-07-18 14:53:41 +08:00
return ''
}
}
}
2025-03-23 10:03:12 +08:00
</script>
<style lang="scss" scoped>
.title {
color: #333;
font-weight: bold;
margin: 10px auto 10px 0;
font-size: 16px;
text-align: center;
}
::v-deep .el-dialog__header {
text-align: center;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding-bottom: 20px;
}
::v-deep .el-dialog__title {
font-size: 32px;
color: #333;
font-weight: bold;
}
::v-deep .el-dialog__headerbtn i {
font-size: 24px;
//visibility: hidden;
color: #333;
}
.img-auto {
text-align: center;
height: 615px;
overflow-y: auto;
::v-deep p {
font-size: 14px;
}
::v-deep img {
max-width: 100%;
height: auto;
}
}
::v-deep .el-dialog {
margin-top: 105px !important;
height: 820px;
margin-bottom: 0;
}
::v-deep .el-dialog__body {
padding-bottom: 20px;
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
}
.main {
display: flex;
padding: 0px;
// flex-direction: column;
background: #ffffff;
border-radius: 8px;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
.notice {
width: 556px;
height: 100%;
margin: 0 0 0 20px;
background: #ffffff;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
border-radius: 8px 8px 8px 8px;
.not_top {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
font-size: 16px;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
padding: 10px 10px 10px 10px;
.not_t {
font-size: 12px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #1678ff;
cursor: pointer;
}
}
.not_btm {
padding: 10px;
font-size: 14px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
.not_i {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 5px;
cursor: pointer;
.hui {
font-size: 10px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
}
}
}
}
.form_all {
padding: 0px 20px 0 0px;
// margin-bottom: 20px;
background: #fff;
border-radius: 8px;
}
.topbox {
align-items: center;
padding: 0px 0 3px 0;
display: flex;
// background: skyblue;
.levelList_i {
margin-left: 20px;
position: relative;
cursor: pointer;
padding: 0 5px;
width: 88px;
height: 34px;
border-radius: 17px;
border: 1px solid #cccccc;
font-size: 14px;
font-family: MicrosoftYaHei;
text-align: center;
line-height: 34px;
}
.act {
color: #ffffff;
background: #08143f;
}
.act1 {
border-bottom: 3px solid #1890ff !important;
}
.cha {
font-size: 16px;
color: #606266;
position: absolute;
top: 10px;
}
.li {
width: 40px;
margin: 0 auto;
border-bottom: 3px solid transparent;
}
}
.bz_a {
display: flex;
// justify-content: center;
// padding-left: 80px;
// padding:0px 0 45px 80px;
padding-bottom: 45px;
padding-top: 20px;
// padding-left: 30px;
display: flex;
justify-content: center;
.bz_i {
display: flex;
// flex-direction: column;
align-items: center;
position: relative;
// padding: 20px 0;
.quan {
width: 14px;
height: 14px;
border: 2px solid #1678ff;
border-radius: 50%;
}
.qiu {
width: 14px;
height: 14px;
background: #ccc;
border-radius: 50%;
}
.gun {
width: 80px;
height: 2px;
background: #1678ff;
}
.gun1 {
width: 80px;
height: 2px;
background: #ccc;
}
.time {
position: absolute;
top: -15px;
transform: translateX(-120%);
font-size: 10px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
.zhi {
line-height: 14px;
font-size: 8px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
position: absolute;
left: 3px;
// right: 0;
transform: translateX(-45%);
bottom: -30px;
white-space: nowrap;
}
}
.bz_i:last-child {
// width: 100px;
}
}
::v-deep .el-date-editor {
width: 100% !important;
}
::v-deep .el-table {
overflow: auto;
}
::v-deep .el-select {
width: 100%;
}
/* 这个是为了解决前面样式覆盖之后伪类带出来的竖线 */
::v-deep .el-table::after {
position: relative;
}
</style>