Просмотр исходного кода

Merge branch 'master' of http://119.23.210.103:3000/wy/lh_firm_former

liujiayin 2 лет назад
Родитель
Сommit
b1c58b6eb0
1 измененных файлов с 26 добавлено и 10 удалено
  1. 26 10
      src/views/system/dashboard/components/new-home.vue

+ 26 - 10
src/views/system/dashboard/components/new-home.vue

@@ -10,6 +10,7 @@
                             :height="height"
                             title=""
                             category-key="FLOW_TYPE"
+                            :hasPermission="true"
                             @node-click="handleNodeClick"
                             @expand-collapse="handleExpandCollapse"
                         />
@@ -595,14 +596,24 @@
                     parameters: [],
                     sorts: []
                 }
-                let sql = `select id_, shi_wu_id_ as taskId from t_gqswb where position('${userId}' in chu_li_ren_id_)`
-                Promise.all([pending(params), curdPost('sql', sql)]).then(([res1, res2]) => {
+                let sql = `select id_, shi_wu_id_ as taskId from t_gqswb where position('${userId}' in chu_li_ren_id_) FOR UPDATE`
+                // 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)
+                // })
+                pending(params).then(res1 => {
                     let workData = res1.data && res1.data.dataResult
-                    let noticeData = res2.variables && res2.variables.data
-                    if (!workData || !workData.length) {
-                        return
-                    }
-                    this.dealData(workData, noticeData)
+                    curdPost('sql', sql).then(res2 => {
+                        let noticeData = res2.variables && res2.variables.data
+                        if (!workData || !workData.length) {
+                            return
+                        }
+                        this.dealData(workData, noticeData)
+                    })
                 })
             },
             // 处理数据
@@ -626,6 +637,7 @@
                     }
                     result.all.push(item)
                 })
+                // console.log('处理后数据:', result)
                 // 有过期数据才执行过期数据处理
                 if (result.expire.length) {
                     this.dealExpile(result.expire, noticeList)
@@ -661,6 +673,8 @@
             },
             // 处理已过期数据
             dealExpile(data, noticeList) {
+                // console.log('已过期流程数据:', data)
+                // console.log('过期事务表数据:', noticeList)
                 const { userId } = this.$store.getters
                 let addList = []
                 let sendList = []
@@ -711,7 +725,8 @@
                             subject: msgTitle[item.workType],
                             content: `<p>事务【${item.workName}】${msgContent[item.workType]}<p>`,
                             receiverId: userId,
-                            canreply: '0'
+                            canreply: '0',
+                            taskId: item.taskId
                         }
                         sendList.push(msg)
                     }
@@ -720,7 +735,7 @@
                     tableName: 't_gqswb',
                     paramWhere: addList
                 }
-                console.log(addList, sendList)
+                // console.log('新增过期事务表数据:', addList, '发送消息数据', sendList)
                 if (addList.length) {
                     curdPost('add', JSON.stringify(addParams))
                 }
@@ -738,6 +753,7 @@
                         deleteList.push(item.id_)
                     }
                 })
+                // console.log('过期事务表中需删除的数据:', deleteList)
                 if (!deleteList.length) {
                     return
                 }
@@ -917,4 +933,4 @@
         background: #f9ffff;
         color: #000000;
     }
-</style>
+</style>