Bläddra i källkod

消息bug修复,首页新增办理进度

cfort 3 år sedan
förälder
incheckning
32a0cb2a9c

+ 3 - 1
src/business/platform/form/utils/custom/requestType.js

@@ -31,5 +31,7 @@ export const requestPath = {
     // 设置流程
     setProcess: 'business/v3/bpm/definition/saveSetting/vo',
     // 获取流水号
-    getId: 'platform/v3/identity/getNextIdByAlias'
+    getId: 'platform/v3/identity/getNextIdByAlias',
+    // 发送内部消息
+    sendNotice: '/platform/v3/msg/innerMessage/save'
 }

+ 4 - 0
src/components/ibps-selector/selector.vue

@@ -97,6 +97,10 @@ export default {
     },
     inputBorderStyle: {
       type: String
+    },
+    size: {
+      type: String,
+      default: 'mini'
     }
   },
   data() {

+ 72 - 58
src/layout/header-aside/components/header-message/index.vue

@@ -6,7 +6,7 @@
             effect="dark"
             placement="bottom"
         >
-            <el-button class="ibps-ml-0 ibps-mr btn-text can-hover" type="text">
+            <el-button class="ibps-ml-0 ibps-mr btn-text can-hover" type="text" @click="clickMore">
                 <el-badge :max="9999" :value="messageCount">
                     <ibps-icon name="bell-o" size="16" />
                 </el-badge>
@@ -14,15 +14,17 @@
         </el-tooltip>
         <el-popover
             v-else
+            v-model="popShow"
             placement="bottom-end"
             width="350"
-            trigger="click"
+            trigger="manual"
             popper-class="header-message-popper"
         >
             <el-button
                 slot="reference"
                 class="ibps-ml-0 ibps-mr btn-text can-hover"
                 type="text"
+                @click="openPop"
             >
                 <el-badge :max="9999" :value="messageCount">
                     <ibps-icon name="bell-o" size="16" />
@@ -64,6 +66,7 @@
         <!-- 消息明细 -->
         <inner-detail-dialog
             :id="editId"
+            :subId="subId"
             :visible="dialogFormVisible"
             :title="$t('layout.header-aside.header-message.details')"
             inside
@@ -85,12 +88,14 @@
         data() {
             return {
                 editId: '',
+                subId: '',
                 dialogFormVisible: false,
                 isControl: true,
                 messageList: [],
                 messageCount: 0,
                 infoMessage: '',
-                countNumber: 0
+                countNumber: 0,
+                popShow: false
             }
         },
         computed: {
@@ -124,61 +129,62 @@
                     const data = response.data
                     this.messageList = data.dataResult
                     this.messageCount = data.pageResult ? data.pageResult.totalCount : 0
-                    if (this.countNumber == 0) {
-                        // if(response.data.pageResult.totalCount>0){
-                        //     this.$message.warning('您有'+response.data.pageResult.totalCount+'条未处理的 [ 待审批 / 被驳回任务消息 ],请及时处理!!!')
-                        // }
-                    } else if (this.countNumber < data.pageResult.totalCount) {
-                        //如果上次记录数量低于本次  进行提醒,准备待办
-                        let _this = this
-                        let h = this.$createElement
-                        let num = data.pageResult.totalCount - this.countNumber
-                        this.infoMessage = this.$notify({
-                            title: '您有新的待办任务产生!',
-                            message: h('p', null, [
-                                h('span', null, '任务内容: ' + data.dataResult[0].subject),
-                                h('br'),
-                                h('span', null, '生成时间: '),
-                                h('span', { style: 'color: #FF8C00;font-size:12px;' }, data.dataResult[0].createTime),
-                                h('br'),
-                                h('el-button', {
-                                    attrs: {
-                                        size: 'mini',
-                                        type: 'primary',
-                                        plain: true
-                                    },
-                                    on: {
-                                        click: () => {
-                                            _this.cancelInfo()
-                                        }
-                                    }
-                                }, '进入办理'),
-                                h('el-button', {
-                                    attrs: {
-                                        size: 'mini',
-                                        plain: true
-                                    },
-                                    on: {
-                                        click: () => {
-                                            _this.$notify.closeAll()
-                                        } // 路由加载之后,调用关闭消息弹窗的方法
-                                    }
-                                }, '忽略全部')
-                            ]),
-                            type: 'warning',
-                            duration: 0
-                        })
-                    }
-                    if (this.countNumber == 0) {
-                        this.countNumber = data.pageResult.totalCount
-                        // setInterval(() => {
-                        //     if(this.isControl &&  response.message == "获取收到的内部消息列表成功!"){
-                        //         this.loadData()
-                        //     }
-                        // }, 60000)
-                    } else {
-                        this.countNumber = data.pageResult.totalCount
-                    }
+                    this.countNumber = data.pageResult.totalCount
+                    // if (this.countNumber == 0) {
+                    //     // if(response.data.pageResult.totalCount>0){
+                    //     //     this.$message.warning('您有'+response.data.pageResult.totalCount+'条未处理的 [ 待审批 / 被驳回任务消息 ],请及时处理!!!')
+                    //     // }
+                    // } else if (this.countNumber < data.pageResult.totalCount) {
+                    //     //如果上次记录数量低于本次  进行提醒,准备待办
+                    //     let _this = this
+                    //     let h = this.$createElement
+                    //     let num = data.pageResult.totalCount - this.countNumber
+                    //     this.infoMessage = this.$notify({
+                    //         title: '您有新的待办任务产生!',
+                    //         message: h('p', null, [
+                    //             h('span', null, '任务内容: ' + data.dataResult[0].subject),
+                    //             h('br'),
+                    //             h('span', null, '生成时间: '),
+                    //             h('span', { style: 'color: #FF8C00;font-size:12px;' }, data.dataResult[0].createTime),
+                    //             h('br'),
+                    //             h('el-button', {
+                    //                 attrs: {
+                    //                     size: 'mini',
+                    //                     type: 'primary',
+                    //                     plain: true
+                    //                 },
+                    //                 on: {
+                    //                     click: () => {
+                    //                         _this.cancelInfo()
+                    //                     }
+                    //                 }
+                    //             }, '进入办理'),
+                    //             h('el-button', {
+                    //                 attrs: {
+                    //                     size: 'mini',
+                    //                     plain: true
+                    //                 },
+                    //                 on: {
+                    //                     click: () => {
+                    //                         _this.$notify.closeAll()
+                    //                     } // 路由加载之后,调用关闭消息弹窗的方法
+                    //                 }
+                    //             }, '忽略全部')
+                    //         ]),
+                    //         type: 'warning',
+                    //         duration: 0
+                    //     })
+                    // }
+                    // if (this.countNumber == 0) {
+                    //     this.countNumber = data.pageResult.totalCount
+                    //     // setInterval(() => {
+                    //     //     if(this.isControl &&  response.message == "获取收到的内部消息列表成功!"){
+                    //     //         this.loadData()
+                    //     //     }
+                    //     // }, 60000)
+                    // } else {
+                    //     this.countNumber = data.pageResult.totalCount
+                    // }
                 }).catch(() => {
                     this.isControl = false
                 })
@@ -188,11 +194,19 @@
                 this.$notify.closeAll()
             },
             handelInteriorClick(message) {
+                this.subId = message.subId
                 this.editId = message.id
                 this.dialogFormVisible = true
             },
+            openPop() {
+                this.popShow = !this.popShow
+                if (this.popShow) {
+                    this.loadData()
+                }
+            },
             clickMore() {
                 // 更多消息
+                this.popShow = !this.popShow
                 this.$router.push('/message')
             },
             closeDialog(visible) {

+ 1 - 0
src/store/getters.js

@@ -3,6 +3,7 @@ export default {
   userId: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.id : '', // 用户ID
   name: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.name : '', // 姓名
   status: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.status : '', // 用户状态
+  orgId: state => state.ibps.user.info && state.ibps.user.info.org ? state.ibps.user.info.org.id : '', // 用户部门ID
   isSuper: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === 'Y' : false, // 是否超级管理员
   account: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : '', // 用户名
   regOpen: state => state.ibps.user.regOpen, // 注册状态

+ 135 - 115
src/views/platform/message/inner/detail/dialog.vue

@@ -1,123 +1,143 @@
-
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    :class="[inside?'inside-dialog':'inner-dialog']"
-    append-to-body
-    top="5vh"
-    width="65%"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <inner-message
-      :id="id"
-      ref="innerMessage"
-      :inside="inside"
-      :readonly="readonly"
-      @callback="handleCallback"
-    />
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :class="[inside ? 'inside-dialog' : 'inner-dialog']"
+        append-to-body
+        top="10vh"
+        width="65%"
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <inner-message
+            :id="id"
+            ref="innerMessage"
+            :inside="inside"
+            :readonly="readonly"
+            @callback="handleCallback"
+        />
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+    </el-dialog>
 </template>
 <script>
-import InnerMessage from './index'
-export default {
-  components: {
-    InnerMessage
-  },
-  props: {
-    inside: {
-      type: Boolean,
-      default: false
-    },
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    id: String,
-    title: String
-  },
-  data() {
-    return {
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      toolbars: [
-        { key: 'cancel', label: '关闭' }
-      ]
+    import InnerMessage from './index'
+    export default {
+        components: { InnerMessage },
+        props: {
+            inside: {
+                type: Boolean,
+                default: false
+            },
+            visible: {
+                type: Boolean,
+                default: false
+            },
+            readonly: {
+                type: Boolean,
+                default: false
+            },
+            id: String,
+            // 子表ID
+            subId: String,
+            title: String
+        },
+        data() {
+            const btn1 = [
+                { key: 'confirm', label: '确认' },
+                { key: 'cancel', label: '关闭' }
+            ]
+            const btn2 = [
+                { key: 'cancel', label: '关闭' }
+            ]
+            const toolbars = this.subId ? btn1 : btn2
+            return {
+                dialogVisible: this.visible,
+                dialogLoading: false,
+                toolbars
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = this.visible
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            handleActionEvent({ key }) {
+                switch (key) {
+                    case 'cancel':
+                        this.closeDialog()
+                        break
+                    case 'confirm':
+                        this.confirmMsg()
+                        break
+                    default:
+                        break
+                }
+            },
+            // 关闭当前窗口
+            closeDialog() {
+                this.$emit('close', false)
+            },
+            // 获取表单数据
+            getFormData() {
+                this.$nextTick(() => {
+                    this.$refs.innerMessage.getFormData()
+                    this.handleCallback(true)
+                })
+            },
+            // 消息确认,受控文件用
+            confirmMsg() {
+                // TODO
+                this.$confirm('是否已查阅受控文件?一经确认即代表xxxxxx', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning',
+                    showClose: false,
+                    closeOnClickModal: false
+                }).then(() => {
+                    // TODO 受控文件逻辑处理
+                    console.log('暂无')
+                    this.closeDialog()
+                }).catch(() => { })
+            },
+            handleCallback(res) {
+                this.$emit('callback', res)
+            }
+        }
     }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    // 回复
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
-    },
-    /**
-     * 获取表单数据
-     */
-    getFormData() {
-      this.$nextTick(() => {
-        this.$refs.innerMessage.getFormData()
-        this.handleCallback(true)
-      })
-    },
-    handleCallback(res) {
-      this.$emit('callback', res)
-    }
-  }
-}
 </script>
 <style lang="scss">
-.inner-dialog{
-  .el-dialog__body{
-    padding: 20px 20px;
-    height: calc(80vh - 110px) !important;
-  }
-  .list{
-  .el-form-item__content{
-    margin-left: 0px!important;
-      .el-table--border{
-        height: 300px !important;
-      }
+    .inner-dialog {
+        .el-dialog__body {
+            padding: 20px 20px;
+            height: calc(40vh) !important;
+        }
+        .list {
+            .el-form-item__content {
+                margin-left: 0px !important;
+                .el-table--border {
+                    height: 300px !important;
+                }
+            }
+        }
+        .ibps-container-crud__header {
+            display: none;
+        }
+    }
+    .inside-dialog {
+        .el-dialog__body {
+            padding: 20px 20px;
+            height: calc(50vh - 110px) !important;
+        }
     }
-  }
-  .ibps-container-crud__header{
-    display: none;
-  }
-}
-.inside-dialog{
-  .el-dialog__body{
-    padding: 20px 20px;
-    height: calc(50vh - 110px) !important;
-  }
-}
 </style>

+ 2 - 2
src/views/platform/message/inner/detail/index.vue

@@ -60,7 +60,7 @@
         </el-form-item>
         
       </el-col>
-      <el-col v-if="!inside" :span="24">
+      <!-- <el-col v-if="!inside" :span="24">
         <el-form-item class="list">
           <el-tabs v-model="activeName" class="detail" @tab-click="handleClick">
             <el-tab-pane label="已回复信息列表" name="replied" style="height:300px;">
@@ -71,7 +71,7 @@
             </el-tab-pane>
           </el-tabs>
         </el-form-item>
-      </el-col>
+      </el-col> -->
     </el-row>
   </el-form>
 </template>

+ 1 - 1
src/views/platform/message/inner/send.vue

@@ -71,7 +71,7 @@ export default {
         receiver: '',
         groupId: '',
         groupName: '',
-        canreply: '1',
+        canreply: '0',
         fileMsg: '',
         content: '',
         id: '',

+ 256 - 22
src/views/system/dashboard/components/new-home.vue

@@ -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(',')
             }
         }
     }

+ 1 - 1
src/views/system/dashboard/page.vue

@@ -527,7 +527,7 @@
                 if (usersList.length) {
                     return
                 } else {
-                    let sql = 'select id_ as userId, name_ as userName from ibps_party_employee'
+                    let sql = 'select id_ as userId, name_ as userName, mobile_ as phone from ibps_party_employee'
                     curdPost('sql', sql).then(res => {
                         const { data } = res.variables
                         this.$store.dispatch('ibps/param/setUsersList', data)