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

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

余思翰 8 месяцев назад
Родитель
Сommit
280fcfb680

+ 16
- 0
oa-ui/src/api/qywx/index.js Просмотреть файл

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 Просмотреть файл

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-04-08 13:56:14
3
  * @Date: 2024-04-08 13:56:14
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-12 11:35:24
5
+ * @LastEditTime: 2024-09-12 16:12:36
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="app-container">
8
   <div class="app-container">
11
       <el-form-item label="交底情况:">
11
       <el-form-item label="交底情况:">
12
         <el-row>
12
         <el-row>
13
           <el-checkbox v-model="safe" disabled>安全交底</el-checkbox>
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
         </el-row>
16
         </el-row>
16
         <el-row>
17
         <el-row>
17
           <el-checkbox v-model="tech" disabled>技术交底</el-checkbox>
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
         </el-row>
21
         </el-row>
20
         <el-row>
22
         <el-row>
21
           <el-checkbox v-model="plan" disabled>技术方案</el-checkbox>
23
           <el-checkbox v-model="plan" disabled>技术方案</el-checkbox>
55
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
57
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
56
 import { getProjectComment, addProjectComment, updateProjectComment } from "@/api/oa/project/projectComment"
58
 import { getProjectComment, addProjectComment, updateProjectComment } from "@/api/oa/project/projectComment"
57
 import { getProject } from "@/api/oa/project/project"
59
 import { getProject } from "@/api/oa/project/project"
58
-import { getUsersDeptLeaderByDept } from '@/api/system/post'
60
+import { getUsersDeptLeaderByDept, getUserByPost } from '@/api/system/post'
59
 import { getSafe } from "@/api/oa/safe/safe";
61
 import { getSafe } from "@/api/oa/safe/safe";
60
 import { getTechnical } from "@/api/oa/technical/technical";
62
 import { getTechnical } from "@/api/oa/technical/technical";
61
 import { getTechnicalPlan } from "@/api/oa/technical/technicalPlan";
63
 import { getTechnicalPlan } from "@/api/oa/technical/technicalPlan";
64
+import { sendQyMessage } from "@/api/qywx/index"
65
+import { getUser } from "@/api/system/user"
62
 import safeTab from '@/views/flowable/form/projectProcess/safeTab.vue';
66
 import safeTab from '@/views/flowable/form/projectProcess/safeTab.vue';
63
 import PlanTab from '@/views/flowable/form/projectProcess/planTab.vue';
67
 import PlanTab from '@/views/flowable/form/projectProcess/planTab.vue';
64
 import TechnicalTab from '@/views/flowable/form/projectProcess/technicalTab.vue';
68
 import TechnicalTab from '@/views/flowable/form/projectProcess/technicalTab.vue';
98
       rules: {
102
       rules: {
99
         manageComment: [{ required: true, message: "请输入审核意见", trigger: "blur" }]
103
         manageComment: [{ required: true, message: "请输入审核意见", trigger: "blur" }]
100
       },
104
       },
101
-      deptLeaderList: []
105
+      deptLeaderList: [],
106
+      project: null
102
     }
107
     }
103
   },
108
   },
104
   created() {
109
   created() {
105
     if (this.$route.query.taskName != '项目登记' && this.$route.query.taskName != '项目安排') {
110
     if (this.$route.query.taskName != '项目登记' && this.$route.query.taskName != '项目安排') {
111
+      this.haveJD();
106
       this.initForm();
112
       this.initForm();
107
     }
113
     }
108
   },
114
   },
120
     initForm() {
126
     initForm() {
121
       getProject(this.taskForm.formId).then(res => {
127
       getProject(this.taskForm.formId).then(res => {
122
         if (res.data) {
128
         if (res.data) {
129
+          this.project = res.data
123
           this.projectLeader = res.data.projectLeader;
130
           this.projectLeader = res.data.projectLeader;
124
         }
131
         }
125
       })
132
       })
145
           }
152
           }
146
         }
153
         }
147
       })
154
       })
148
-      this.haveJD();
149
     },
155
     },
150
     async haveJD() {
156
     async haveJD() {
151
       let formId = this.taskForm.formId;
157
       let formId = this.taskForm.formId;
190
       //     this.$modal.msgSuccess(response.msg);
196
       //     this.$modal.msgSuccess(response.msg);
191
       //     this.$emit("goBack");
197
       //     this.$emit("goBack");
192
       //   });
198
       //   });
193
-      // });
199
+      // }); 
200
+
194
       getNextFlowNode(params).then(res => {
201
       getNextFlowNode(params).then(res => {
195
         getProject(this.taskForm.formId).then(res => {
202
         getProject(this.taskForm.formId).then(res => {
196
           if (res.data) {
203
           if (res.data) {
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
 </script>
255
 </script>

+ 1
- 1
oa-ui/src/views/oa/project/info.vue Просмотреть файл

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

Загрузка…
Отмена
Сохранить