Przeglądaj źródła

交接班完成后生成快照

cyy 7 miesięcy temu
rodzic
commit
6d65097d79
1 zmienionych plików z 42 dodań i 7 usunięć
  1. 42 7
      src/views/platform/message/inner/detail/dialog.vue

+ 42 - 7
src/views/platform/message/inner/detail/dialog.vue

@@ -233,13 +233,27 @@ export default {
                       .then((r) => {
                         let mid = r.variables.data[0]
                         if (mid.jie_ban_ren_.split(',').length === mid.znum) {
-                          this.$common.request('updates', {
-                            tableName: 't_jjbjlb',
-                            paramWhere: [{ id_: this.tableId }],
-                            paramCond: {
-                              shi_fou_guo_shen_: '已完成'
-                            }
-                          })
+                          this.$common
+                            .request('updates', {
+                              tableName: 't_jjbjlb',
+                              paramWhere: [{ id_: this.tableId }],
+                              paramCond: {
+                                shi_fou_guo_shen_: '已完成'
+                              }
+                            })
+                            .then(async (params) => {
+                              await this.createSnapshoot(this.tableId).then(
+                                (res) => {
+                                  this.$common.request('updates', {
+                                    tableName: 't_jjbjlb',
+                                    paramWhere: [{ id_: this.tableId }],
+                                    paramCond: {
+                                      kuai_zhao_: res
+                                    }
+                                  })
+                                }
+                              )
+                            })
                         }
                       })
                   }
@@ -257,6 +271,27 @@ export default {
     handleCallback(res) {
       this.$emit('callback', res)
     },
+    createSnapshoot(id) {
+      const { first = '' } = this.$store.getters.level
+      const url = this.$getReportFile(
+        '/人员/检验科交接班登记表.rpx',
+        `id_=${id}&org_=${first}`
+      )
+      return new Promise((resolve, reject) => {
+        this.$common
+          .snapshoot({
+            url: url,
+            name: '检验科交接班登记表',
+            type: 'pdf'
+          })
+          .then((res) => {
+            resolve(res.data.id)
+          })
+          .catch((error) => {
+            reject(error)
+          })
+      })
+    },
     acquire(res) {
       let mid = {
         key: 'viewDetails',