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

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

@@ -595,14 +595,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 +636,7 @@
                     }
                     result.all.push(item)
                 })
+                // console.log('处理后数据:', result)
                 // 有过期数据才执行过期数据处理
                 if (result.expire.length) {
                     this.dealExpile(result.expire, noticeList)
@@ -661,6 +672,8 @@
             },
             // 处理已过期数据
             dealExpile(data, noticeList) {
+                // console.log('已过期流程数据:', data)
+                // console.log('过期事务表数据:', noticeList)
                 const { userId } = this.$store.getters
                 let addList = []
                 let sendList = []
@@ -711,7 +724,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 +734,7 @@
                     tableName: 't_gqswb',
                     paramWhere: addList
                 }
-                console.log(addList, sendList)
+                // console.log('新增过期事务表数据:', addList, '发送消息数据', sendList)
                 if (addList.length) {
                     curdPost('add', JSON.stringify(addParams))
                 }
@@ -738,6 +752,7 @@
                         deleteList.push(item.id_)
                     }
                 })
+                // console.log('过期事务表中需删除的数据:', deleteList)
                 if (!deleteList.length) {
                     return
                 }
@@ -917,4 +932,4 @@
         background: #f9ffff;
         color: #000000;
     }
-</style>
+</style>