|
|
@@ -57,7 +57,7 @@
|
|
|
<el-table-column
|
|
|
prop="subject"
|
|
|
label="事务名称"
|
|
|
- width="300"
|
|
|
+ width="250"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">{{ scope.row.subject | getWorkInfo('name') }}</template>
|
|
|
@@ -69,10 +69,26 @@
|
|
|
<el-table-column
|
|
|
show-overflow-tooltip
|
|
|
width="120"
|
|
|
- label="状态"
|
|
|
+ label="事务状态"
|
|
|
>
|
|
|
<template slot-scope="scope">{{ '待' + scope.row.name }}</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip width="100">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <span>办理进度</span>
|
|
|
+ <el-tooltip effect="dark" placement="top">
|
|
|
+ <div slot="content">
|
|
|
+ 普通事务:接收三天之内为待办理,三天之后为已超时
|
|
|
+ <br/>
|
|
|
+ 计划事务:月底前七天内为即将超时,超过接收当月月底为已超时,其余为待办理
|
|
|
+ </div>
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="stateOption[scope.row.state].type">{{ stateOption[scope.row.state].label }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="startDept"
|
|
|
show-overflow-tooltip
|
|
|
@@ -95,7 +111,7 @@
|
|
|
<template v-else-if="['over', 'finish'].includes(activeTab)">
|
|
|
<el-table-column
|
|
|
show-overflow-tooltip
|
|
|
- label="状态"
|
|
|
+ label="事务状态"
|
|
|
width="100"
|
|
|
>
|
|
|
<template slot-scope="scope">{{ scope.row.curNode ? scope.row.status == 'running' ? '已发起' : '已' + scope.row.curNode : contOfValue(scope.row.status) }}</template>
|
|
|
@@ -164,6 +180,8 @@
|
|
|
import homeCalendar from './home-calendar'
|
|
|
import { pending, handledTask } from '@/api/platform/office/bpmReceived'
|
|
|
import { myDraft, removeDraft } from '@/api/platform/office/bpmInitiated'
|
|
|
+ import { queryOrgManager } from '@/api/platform/org/employee'
|
|
|
+ import { save } from '@/api/platform/message/innerMessage'
|
|
|
import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
|
|
|
import ActionUtils from '@/utils/action'
|
|
|
import IbpsTypeTree from '@/business/platform/cat/type/tree'
|
|
|
@@ -206,6 +224,20 @@
|
|
|
finish: 'inst.',
|
|
|
save: ''
|
|
|
}
|
|
|
+ const stateOption = {
|
|
|
+ wait: {
|
|
|
+ label: '待办理',
|
|
|
+ type: ''
|
|
|
+ },
|
|
|
+ soon: {
|
|
|
+ label: '即将超时',
|
|
|
+ type: 'warning'
|
|
|
+ },
|
|
|
+ overtime: {
|
|
|
+ label: '已超时',
|
|
|
+ type: 'danger'
|
|
|
+ }
|
|
|
+ }
|
|
|
const operate = {
|
|
|
wait: pending,
|
|
|
over: handledTask,
|
|
|
@@ -243,6 +275,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
tabList,
|
|
|
+ stateOption,
|
|
|
dataList: [],
|
|
|
paginate: {},
|
|
|
searchParams: {
|
|
|
@@ -257,7 +290,6 @@
|
|
|
proInstId: '',
|
|
|
loading: false,
|
|
|
drawer: false,
|
|
|
- newsDataCms: [],
|
|
|
dialogFormVisible: false,
|
|
|
orgName: '',
|
|
|
roleName: '',
|
|
|
@@ -268,6 +300,7 @@
|
|
|
timer: null,
|
|
|
processName: '',
|
|
|
userList: [],
|
|
|
+ orgInfo: {},
|
|
|
activeTab: 'wait',
|
|
|
width: 250,
|
|
|
height: document.body.clientHeight - 130
|
|
|
@@ -275,11 +308,8 @@
|
|
|
},
|
|
|
mounted: function () {
|
|
|
this.loadData()
|
|
|
- // 获取系统用户信息用于转换
|
|
|
- let sql = `select id_, name_ from ibps_party_employee where status_ = 'actived'`
|
|
|
- curdPost('sql', sql).then(res => {
|
|
|
- this.userList = res.variables && res.variables.data
|
|
|
- })
|
|
|
+ this.getUserList()
|
|
|
+ this.getOrgInfo()
|
|
|
if (this.timer) {
|
|
|
clearInterval(this.timer)
|
|
|
}
|
|
|
@@ -318,6 +348,37 @@
|
|
|
// 获取任务数据
|
|
|
this.getData(this.activeTab)
|
|
|
},
|
|
|
+ // 获取系统用户信息
|
|
|
+ getUserList() {
|
|
|
+ const { userList } = this.$store.getters
|
|
|
+ // store中有则无需请求
|
|
|
+ if (userList && userList.length) {
|
|
|
+ this.userList = userList
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let sql = 'select id_ as userId, name_ as userName, mobile_ as phone from ibps_party_employee'
|
|
|
+ curdPost('sql', sql).then(res => {
|
|
|
+ this.userList = res.variables && res.variables.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取用户部门信息
|
|
|
+ getOrgInfo() {
|
|
|
+ const { orgId } = this.$store.getters
|
|
|
+ if (!orgId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ parameters: [{key: 'Q^MANAGER_ORG_ID_^S', value: orgId}]
|
|
|
+ }
|
|
|
+ queryOrgManager(params).then(res => {
|
|
|
+ this.orgInfo = {}
|
|
|
+ const data = res.data.dataResult
|
|
|
+ if (data && data.length) {
|
|
|
+ const { id, name, mobile, account, gender, groupID, orgName } = data[0]
|
|
|
+ this.orgInfo = { id, name, mobile, account, gender, groupID, orgName }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
handleNodeClick(typeId) {
|
|
|
this.dataList = []
|
|
|
this.paginate = {}
|
|
|
@@ -344,14 +405,19 @@
|
|
|
instList.push(item.bpmnInstId)
|
|
|
})
|
|
|
let sql = `select b.bpmn_inst_id_, b.create_by_, a.name_ from ibps_bpm_inst b left join ibps_party_employee a on a.id_ = b.create_by_ where b.bpmn_inst_id_ in (${instList.join(',')}) order by find_in_set(b.bpmn_inst_id_,'${instList.join(',')}')`
|
|
|
+ let currentTime = Date.now()
|
|
|
curdPost('sql', sql).then(res => {
|
|
|
const data = res.variables && res.variables.data
|
|
|
data.forEach((item, index) => {
|
|
|
dataResult[index].submitBy = item.name_
|
|
|
+ dataResult[index].workName = dataResult[index].subject.includes('#') ? dataResult[index].subject.split('#')[0] : dataResult[index].subject.split('(')[0]
|
|
|
+ dataResult[index].workType = dataResult[index].workName.includes('计划') ? 'plan' : 'normal'
|
|
|
+ dataResult[index].state = this.judgeExpire(dataResult[index].createTime, currentTime, dataResult[index].workType, '1')
|
|
|
})
|
|
|
this.dataList = dataResult
|
|
|
this.paginate = pageResult
|
|
|
})
|
|
|
+ // this.urgeToManager()
|
|
|
} else {
|
|
|
this.dataList = dataResult
|
|
|
this.paginate = pageResult
|
|
|
@@ -366,7 +432,7 @@
|
|
|
search() {
|
|
|
this.dataList = []
|
|
|
this.paginate = {}
|
|
|
- this.getData()
|
|
|
+ this.getData(this.activeTab)
|
|
|
},
|
|
|
// 切换tab
|
|
|
changeTab() {
|
|
|
@@ -394,18 +460,6 @@
|
|
|
let s = taskState[cont]
|
|
|
return s ? s : '暂停'
|
|
|
},
|
|
|
- // 获取公告
|
|
|
- getMessage() {
|
|
|
- let sql = "select td.*,ie.NAME_ from t_dxtz td,ibps_party_employee ie where td.bian_zhi_ren_ = ie.id_ and td.fa_song_fang_shi_ like '%公告%' ORDER BY create_time_ desc"
|
|
|
-
|
|
|
- curdPost('sql', sql).then(res => {
|
|
|
- // console.log(res)
|
|
|
- if (res.state == 200) {
|
|
|
- let dbData = res.variables && res.variables.data
|
|
|
- this.newsDataCms = dbData
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
getFormatParams(v, pagination) {
|
|
|
const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
|
|
|
@@ -464,6 +518,186 @@
|
|
|
const { testingList } = this.$store.getters
|
|
|
let res = testingList.find(item => item.processKey === v)
|
|
|
return res ? res.name : ''
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 主管提醒
|
|
|
+ * 数据处理,将所有待办数据根据是否过期处理为两个数组
|
|
|
+ * 过期判断依据:普通事务-创建时间到当前时间超过三天即为过期;计划事务【事务名称中含计划】-创建当月月末前七天
|
|
|
+ * 逻辑说明:过期数组中不存于在主管提醒表中的数据插入主管提醒表,并发送内部通知,主管提醒表删除不存在于未过期数组中的数据
|
|
|
+ */
|
|
|
+ urgeToManager() {
|
|
|
+ const { userId } = this.$store.getters
|
|
|
+ let params = {
|
|
|
+ parameters: [],
|
|
|
+ sorts: []
|
|
|
+ }
|
|
|
+ let sql = `select id_, shu_ju_id_ as taskId from t_zgrwtxb where position('${userId}' in chu_li_ren_)`
|
|
|
+ Promise.all([pending(params), curdPost('sql', sql)]).then(([res1, res2]) => {
|
|
|
+ let workData = res1.data && res1.data.dataResult
|
|
|
+ let noticeData = res2.variables && res2.variables.data
|
|
|
+ if (!workData || !workData.length) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.dealData(workData, noticeData)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 处理数据
|
|
|
+ dealData(workList, noticeList) {
|
|
|
+ let result = {
|
|
|
+ expire: [],
|
|
|
+ unexpire: [],
|
|
|
+ all: []
|
|
|
+ }
|
|
|
+ let currentTime = Date.now()
|
|
|
+ // 筛选已过期数据
|
|
|
+ workList.forEach(item => {
|
|
|
+ // 截取流程名
|
|
|
+ item.workName = item.subject.includes('#') ? item.subject.split('#')[0] : item.subject.split('(')[0]
|
|
|
+ item.workType = item.workName.includes('计划') ? 'plan' : 'normal'
|
|
|
+ let isExpire = this.judgeExpire(item.createTime, currentTime, item.workType)
|
|
|
+ if (isExpire) {
|
|
|
+ result.expire.push(item)
|
|
|
+ } else {
|
|
|
+ result.unexpire.push(item)
|
|
|
+ }
|
|
|
+ result.all.push(item)
|
|
|
+ })
|
|
|
+ // 有过期数据才执行过期数据处理
|
|
|
+ if (result.expire.length) {
|
|
|
+ this.dealExpile(result.expire, noticeList)
|
|
|
+ }
|
|
|
+ // 主管提醒表中有数据才执行数据删除
|
|
|
+ if (noticeList && noticeList.length) {
|
|
|
+ this.dealUnexpile(result.all, noticeList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 判断是否过期、获取办理状态
|
|
|
+ judgeExpire(time, current, type, isState) {
|
|
|
+ let D = new Date(time)
|
|
|
+ let a = new Date(time).getTime()
|
|
|
+ let b = new Date(current).getTime()
|
|
|
+ // 创建时间当月最后一天的时间戳
|
|
|
+ let c = new Date(D.getFullYear(), D.getMonth() + 1, 0).getTime()
|
|
|
+ // 返回办理状态
|
|
|
+ if (isState) {
|
|
|
+ let state = ''
|
|
|
+ if (type === 'plan') {
|
|
|
+ state = b >= c ? 'overtime' : b + (86400000 * 7) > c ? 'soon' : 'wait'
|
|
|
+ } else {
|
|
|
+ state = a + (86400000 * 3) < b ? 'overtime' : 'wait'
|
|
|
+ }
|
|
|
+ return state
|
|
|
+ }
|
|
|
+ // 返回是否过期
|
|
|
+ if (type === 'plan') {
|
|
|
+ return b + (86400000 * 7) > c
|
|
|
+ } else {
|
|
|
+ return a + (86400000 * 3) < b
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理已过期数据
|
|
|
+ dealExpile(data, noticeList) {
|
|
|
+ const { userId } = this.$store.getters
|
|
|
+ let addList = []
|
|
|
+ let sendList = []
|
|
|
+ let msgContent = {
|
|
|
+ plan: '距离过期还剩七天,请及时处理!',
|
|
|
+ normal: '至今三天未处理,已超时,请及时处理!'
|
|
|
+ }
|
|
|
+ let msgTitle = {
|
|
|
+ plan: '计划事务即将到期提醒',
|
|
|
+ normal: '事务超时提醒'
|
|
|
+ }
|
|
|
+ data.forEach(item => {
|
|
|
+ let isExist = !!noticeList.find(i => i.taskId === item.taskId)
|
|
|
+ // 筛选出不存在于主管提醒表的过期数据
|
|
|
+ if (!isExist) {
|
|
|
+ // 无部门信息的用户无往主管表加数据
|
|
|
+ if (this.orgInfo.groupID) {
|
|
|
+ let obj = {
|
|
|
+ // 完成名称
|
|
|
+ code_: item.subject,
|
|
|
+ // 事务说明
|
|
|
+ names_: item.subject.includes('#') ? item.subject.split('#')[1] : '',
|
|
|
+ // 任务名称
|
|
|
+ ren_wu_ming_cheng: item.workName,
|
|
|
+ chu_li_ren_: this.getInfoByName(item.ownerName, 'id'),
|
|
|
+ chu_li_ren_dian_h: this.getInfoByName(item.ownerName, 'phone'),
|
|
|
+ bu_men_: this.orgInfo.orgName,
|
|
|
+ bu_men_id_: this.orgInfo.groupID,
|
|
|
+ // 主管ID与当前用户id相等时将主管ID设置为总裁【罗晓玲】的ID,主管电话设为空
|
|
|
+ zhu_guan_: this.orgInfo.id === userId ? '990927120278487040' : this.orgInfo.id,
|
|
|
+ zhu_guan_dian_hua: this.orgInfo.id === userId ? '' : this.orgInfo.mobile,
|
|
|
+ ren_wu_kai_shi_sh: item.createTime,
|
|
|
+ zhuang_tai_: `待${item.name}`,
|
|
|
+ shu_ju_id_: item.taskId,
|
|
|
+ // 任务类型
|
|
|
+ type_: item.workType
|
|
|
+ }
|
|
|
+ addList.push(obj)
|
|
|
+ }
|
|
|
+ let msg = {
|
|
|
+ subject: msgTitle[item.workType],
|
|
|
+ content: `<p>事务【${item.workName}】${msgContent[item.workType]}<p>`,
|
|
|
+ receiverId: userId,
|
|
|
+ canreply: '0'
|
|
|
+ }
|
|
|
+ sendList.push(msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let addParams = {
|
|
|
+ tableName: 't_zgrwtxb',
|
|
|
+ paramWhere: addList
|
|
|
+ }
|
|
|
+ // console.log(addList, sendList)
|
|
|
+ if (addList.length) {
|
|
|
+ curdPost('add', JSON.stringify(addParams))
|
|
|
+ }
|
|
|
+ if (sendList.length) {
|
|
|
+ this.sendMsg(sendList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 删除已办的提醒表数据
|
|
|
+ dealUnexpile(data, noticeList) {
|
|
|
+ // 清除存在于主管提醒表中【处理人含我】,但是不存在于待办中的数据
|
|
|
+ let deleteList = []
|
|
|
+ noticeList.forEach(item => {
|
|
|
+ let isExist = !!data.find(i => i.taskId === item.taskId)
|
|
|
+ if (!isExist) {
|
|
|
+ deleteList.push(item.id_)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!deleteList.length) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params = `{"tableName": "t_zgrwtxb","paramWhere":"{id_:'${deleteList.join(',')}'}"}`
|
|
|
+ curdPost('batchDelete', params).then(() => {}).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 发送站内消息
|
|
|
+ sendMsg(data) {
|
|
|
+ data.forEach(item => {
|
|
|
+ save(item).then(() => {}).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 通过名字获取id/电话
|
|
|
+ getInfoByName(names, type) {
|
|
|
+ let res = {
|
|
|
+ id: [],
|
|
|
+ phone: []
|
|
|
+ }
|
|
|
+ let temp = names.split(',')
|
|
|
+ temp.forEach(item => {
|
|
|
+ let t = this.userList.find(i => i.userName === item)
|
|
|
+ if (t) {
|
|
|
+ res.id.push(t.userId)
|
|
|
+ res.phone.push(t.phone)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return res[type].filter(i => i).join(',')
|
|
|
}
|
|
|
}
|
|
|
}
|