Bladeren bron

新增分管领导可以发企业微信消息给相关人员

余思翰 7 maanden geleden
bovenliggende
commit
280fcfb680

+ 16
- 0
oa-ui/src/api/qywx/index.js Bestand weergeven

@@ -0,0 +1,16 @@
1
+/*
2
+ * @Author: ysh
3
+ * @Date: 2024-09-12 13:44:17
4
+ * @LastEditors: 
5
+ * @LastEditTime: 2024-09-12 13:46:52
6
+ */
7
+
8
+import request from '@/utils/request'
9
+
10
+export function sendQyMessage(data){
11
+  return request({
12
+    url: '/qyweixin/sendMessage',
13
+    method: 'post',
14
+    data: data
15
+  })
16
+}

+ 53
- 8
oa-ui/src/views/flowable/form/projectProcess/manageReview.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-08 13:56:14
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-12 11:35:24
5
+ * @LastEditTime: 2024-09-12 16:12:36
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -11,11 +11,13 @@
11 11
       <el-form-item label="交底情况:">
12 12
         <el-row>
13 13
           <el-checkbox v-model="safe" disabled>安全交底</el-checkbox>
14
-          <el-link class="ml20" type="primary" @click="openSafe = true">安全交底记录表</el-link>
14
+          <el-link class="ml20 mr20" type="primary" @click="openSafe = true">安全交底记录表</el-link>
15
+          <el-button plain type="warning" size="mini" @click="handleUrge('1')" v-if="!safe">发送企业微信消息催促相关人员</el-button>
15 16
         </el-row>
16 17
         <el-row>
17 18
           <el-checkbox v-model="tech" disabled>技术交底</el-checkbox>
18
-          <el-link class="ml20" type="primary" @click="openTech = true">技术交底记录表</el-link>
19
+          <el-link class="ml20 mr20" type="primary" @click="openTech = true">技术交底记录表</el-link>
20
+          <el-button plain type="warning" size="mini" @click="handleUrge('2')" v-if="!tech">发送企业微信消息催促相关人员</el-button>
19 21
         </el-row>
20 22
         <el-row>
21 23
           <el-checkbox v-model="plan" disabled>技术方案</el-checkbox>
@@ -55,10 +57,12 @@ import { parseTime } from "@/utils/ruoyi";
55 57
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
56 58
 import { getProjectComment, addProjectComment, updateProjectComment } from "@/api/oa/project/projectComment"
57 59
 import { getProject } from "@/api/oa/project/project"
58
-import { getUsersDeptLeaderByDept } from '@/api/system/post'
60
+import { getUsersDeptLeaderByDept, getUserByPost } from '@/api/system/post'
59 61
 import { getSafe } from "@/api/oa/safe/safe";
60 62
 import { getTechnical } from "@/api/oa/technical/technical";
61 63
 import { getTechnicalPlan } from "@/api/oa/technical/technicalPlan";
64
+import { sendQyMessage } from "@/api/qywx/index"
65
+import { getUser } from "@/api/system/user"
62 66
 import safeTab from '@/views/flowable/form/projectProcess/safeTab.vue';
63 67
 import PlanTab from '@/views/flowable/form/projectProcess/planTab.vue';
64 68
 import TechnicalTab from '@/views/flowable/form/projectProcess/technicalTab.vue';
@@ -98,11 +102,13 @@ export default {
98 102
       rules: {
99 103
         manageComment: [{ required: true, message: "请输入审核意见", trigger: "blur" }]
100 104
       },
101
-      deptLeaderList: []
105
+      deptLeaderList: [],
106
+      project: null
102 107
     }
103 108
   },
104 109
   created() {
105 110
     if (this.$route.query.taskName != '项目登记' && this.$route.query.taskName != '项目安排') {
111
+      this.haveJD();
106 112
       this.initForm();
107 113
     }
108 114
   },
@@ -120,6 +126,7 @@ export default {
120 126
     initForm() {
121 127
       getProject(this.taskForm.formId).then(res => {
122 128
         if (res.data) {
129
+          this.project = res.data
123 130
           this.projectLeader = res.data.projectLeader;
124 131
         }
125 132
       })
@@ -145,7 +152,6 @@ export default {
145 152
           }
146 153
         }
147 154
       })
148
-      this.haveJD();
149 155
     },
150 156
     async haveJD() {
151 157
       let formId = this.taskForm.formId;
@@ -190,7 +196,8 @@ export default {
190 196
       //     this.$modal.msgSuccess(response.msg);
191 197
       //     this.$emit("goBack");
192 198
       //   });
193
-      // });
199
+      // }); 
200
+
194 201
       getNextFlowNode(params).then(res => {
195 202
         getProject(this.taskForm.formId).then(res => {
196 203
           if (res.data) {
@@ -204,7 +211,45 @@ export default {
204 211
 
205 212
       });
206 213
     },
207
-
214
+    async handleUrge(type) {
215
+      let message = ''
216
+      let user = []
217
+      let userStirngList = []
218
+      if (type == '1') {
219
+        let { data } = await getUserByPost({ postName: "专职安全员" });
220
+        user.push(data[0].userId)
221
+        message = "<font color='warning'>请尽快进行安全交底:</font>  \n>" +
222
+          "项目编号:" + this.project.projectNumber + "  \n>" +
223
+          "项目名称:" + this.project.projectName + "  \n>"
224
+      } else if (type == '2') {
225
+        message = "<font color='warning'>请尽快进行技术交底:</font>   \n>" +
226
+          "项目编号:" + this.project.projectNumber + "  \n>" +
227
+          "项目名称:" + this.project.projectName + "  \n>"
228
+      }
229
+      let deptList = (this.project.undertakingDept.split(',')).map(Number)
230
+      for (let d of deptList) {
231
+        let { data } = await getUsersDeptLeaderByDept({ deptId: d });
232
+        user.push(data.userId)
233
+      }
234
+      user.push(this.projectLeader)
235
+      for (let u of user) {
236
+        let { data } = await getUser(u)
237
+        userStirngList.push(data.pinyin)
238
+      }
239
+      let userString = userStirngList.join('|')
240
+      this.$confirm('是否发送企业微信消息?', '提示', {
241
+        confirmButtonText: '确定',
242
+        cancelButtonText: '取消',
243
+        type: 'warning'
244
+      }).then(() => {
245
+        let formData = new FormData();
246
+        formData.append('message', message)
247
+        formData.append('userString', userString + '|YuSiHan|WangRongHua')
248
+        sendQyMessage(formData).then(() => {
249
+          this.$message.success('消息已发送!')
250
+        })
251
+      })
252
+    }
208 253
   },
209 254
 }
210 255
 </script>

+ 1
- 1
oa-ui/src/views/oa/project/info.vue Bestand weergeven

@@ -274,7 +274,7 @@
274 274
             <el-descriptions-item>
275 275
               <template slot="label">
276 276
                 <svg-icon slot="prefix" icon-class="user" />
277
-                经营发展部审核
277
+                经营副总审核
278 278
               </template>
279 279
               <div>
280 280
                 <el-input disabled type="textarea" v-model="projectComment.jyComment"></el-input>

Laden…
Annuleren
Opslaan