seimin 2 years ago
parent
commit
b9410872a6
3 changed files with 102 additions and 13 deletions
  1. 1 1
      config/index.js
  2. 99 11
      src/components/showModel/showModel.vue
  3. 2 1
      src/views/incidentList.vue

+ 1 - 1
config/index.js

@@ -14,7 +14,7 @@ module.exports = {
14
     proxyTable: {
14
     proxyTable: {
15
       '/service': {//自定义名字,代表的是以下target中的内容
15
       '/service': {//自定义名字,代表的是以下target中的内容
16
         // target: host.host+'/service/',//微信
16
         // target: host.host+'/service/',//微信
17
-        target: 'http://weixintest11.ngser.dashitech.com',//微信
17
+        target: 'http://192.168.3.105',//微信
18
         changeOrigin: true,//是否允许跨域
18
         changeOrigin: true,//是否允许跨域
19
         // pathRewrite: {
19
         // pathRewrite: {
20
         //   '^/service': ''
20
         //   '^/service': ''

+ 99 - 11
src/components/showModel/showModel.vue

@@ -20,16 +20,30 @@
20
         <div v-if="info" class="showModel__info">{{ info }}</div>
20
         <div v-if="info" class="showModel__info">{{ info }}</div>
21
         <div class="select-wrap" v-if="selectName === 'user'">
21
         <div class="select-wrap" v-if="selectName === 'user'">
22
           <cube-select
22
           <cube-select
23
+            v-model="selectBranchId"
24
+            :options="selectDataBranch"
25
+            placeholder="请选择院区"
26
+            @change="changeBranch($event)"
27
+          ></cube-select>
28
+          <cube-select
29
+            v-model="selectDutyId"
30
+            :options="selectDataDuty"
31
+            placeholder="请选择责任科室"
32
+            @change="changeDuty($event)"
33
+            style="margin-top:0.2rem;"
34
+          ></cube-select>
35
+          <cube-select
23
             v-model="selectGroupId"
36
             v-model="selectGroupId"
24
             :options="selectDataGroup"
37
             :options="selectDataGroup"
25
             placeholder="请选择工作组"
38
             placeholder="请选择工作组"
26
             @change="changeGroup($event)"
39
             @change="changeGroup($event)"
40
+            style="margin-top:0.2rem;"
27
           ></cube-select>
41
           ></cube-select>
28
           <cube-select
42
           <cube-select
29
             v-model="selectUserId"
43
             v-model="selectUserId"
30
             :options="selectDataUser"
44
             :options="selectDataUser"
31
             placeholder="请选择指派对象"
45
             placeholder="请选择指派对象"
32
-            style="margin-top:0.5rem;"
46
+            style="margin-top:0.2rem;"
33
           ></cube-select>
47
           ></cube-select>
34
         </div>
48
         </div>
35
         <div v-if="textName === 'textarea'">
49
         <div v-if="textName === 'textarea'">
@@ -73,23 +87,24 @@
73
 export default {
87
 export default {
74
   data() {
88
   data() {
75
     return {
89
     return {
90
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
76
       logs: [],
91
       logs: [],
77
       time: 5, //5秒后自动关闭
92
       time: 5, //5秒后自动关闭
78
       timer: null, //5秒后自动关闭,定时器
93
       timer: null, //5秒后自动关闭,定时器
79
       timerFlag: true, //是否显示取消自动关闭按钮
94
       timerFlag: true, //是否显示取消自动关闭按钮
80
       selectDataUser: [], //select数据-用户
95
       selectDataUser: [], //select数据-用户
81
-      selectUserId: 0, //select选中的数据-用户
96
+      selectUserId: undefined, //select选中的数据-用户
82
       selectDataGroup: [], //select数据-工作组
97
       selectDataGroup: [], //select数据-工作组
83
-      selectGroupId: 0, //select选中的数据-工作组
98
+      selectGroupId: undefined, //select选中的数据-工作组
99
+      selectDataBranch: [], //select数据-院区
100
+      selectBranchId: undefined, //select选中的数据-院区
101
+      selectDataDuty: [], //select数据-责任科室
102
+      selectDutyId: undefined, //select选中的数据-责任科室
84
       textareaData: "" //textarea的数据
103
       textareaData: "" //textarea的数据
85
     };
104
     };
86
   },
105
   },
87
   watch: {
106
   watch: {
88
     disjunctor(newValue) {
107
     disjunctor(newValue) {
89
-      if (newValue && this.selectName === "user") {
90
-        this.selectGroupId = 0;
91
-        this.selectUserId = 0;
92
-      }
93
       if (newValue && this.textName === "textarea") {
108
       if (newValue && this.textName === "textarea") {
94
         this.textareaData = "";
109
         this.textareaData = "";
95
       }
110
       }
@@ -168,6 +183,16 @@ export default {
168
     changeGroup(groupId) {
183
     changeGroup(groupId) {
169
       this.getZpUser(groupId);
184
       this.getZpUser(groupId);
170
     },
185
     },
186
+    //选择院区
187
+    changeBranch(branchId) {
188
+      console.log(branchId);
189
+      this.getZpDuty(branchId);
190
+    },
191
+    //选择责任科室
192
+    changeDuty(dutyId) {
193
+      console.log(dutyId);
194
+      this.getZpGroup(dutyId);
195
+    },
171
     // 获取指派对象
196
     // 获取指派对象
172
     getZpUser(groupId) {
197
     getZpUser(groupId) {
173
       this.selectDataUser = [];
198
       this.selectDataUser = [];
@@ -197,12 +222,17 @@ export default {
197
         });
222
         });
198
     },
223
     },
199
     // 获取工作组
224
     // 获取工作组
200
-    getZpGroup() {
225
+    getZpGroup(dutyId) {
201
       this.selectDataGroup = [];
226
       this.selectDataGroup = [];
227
+      this.selectDataUser = [];
228
+      this.selectUserId = undefined;
202
       var postData = {
229
       var postData = {
203
         idx: 0,
230
         idx: 0,
204
         sum: 1000,
231
         sum: 1000,
205
-        group: {}
232
+        group: {
233
+          duty:{id:dutyId},
234
+          selectType: "nouser"
235
+        }
206
       };
236
       };
207
       this.$http
237
       this.$http
208
         .post("service/user/data/fetchDataList/group", postData)
238
         .post("service/user/data/fetchDataList/group", postData)
@@ -216,6 +246,63 @@ export default {
216
           });
246
           });
217
         });
247
         });
218
     },
248
     },
249
+    // 获取院区
250
+    getZpBranch() {
251
+      this.selectDataBranch = [];
252
+      this.selectDataBranch = [];
253
+      this.selectBranchId = undefined;
254
+      this.selectDataGroup = [];
255
+      this.selectGroupId = undefined;
256
+      this.selectDataUser = [];
257
+      this.selectUserId = undefined;
258
+      var postData = {
259
+        idx: 0,
260
+        sum: 1000
261
+      };
262
+      this.$http
263
+        .post("service/user/data/fetchDataList/branch", postData)
264
+        .then(res => {
265
+          res.data.list = res.data.list || [];
266
+          this.selectDataBranch = res.data.list.map(v => {
267
+            return {
268
+              text: v.hosName,
269
+              value: v.id
270
+            };
271
+          });
272
+          if(this.loginUser.duty){
273
+            this.selectBranchId = this.loginUser.duty.branch;
274
+          }else if(this.loginUser.branch){
275
+            this.selectBranchId = this.loginUser.branch?this.loginUser.branch.id:undefined;
276
+          }
277
+          this.getZpDuty(this.selectBranchId);
278
+        });
279
+    },
280
+    // 获取责任科室
281
+    getZpDuty(branchId) {
282
+      this.selectDataDuty = [];
283
+      this.selectDataGroup = [];
284
+      this.selectGroupId = undefined;
285
+      this.selectDataUser = [];
286
+      this.selectUserId = undefined;
287
+      var postData = {
288
+        idx: 0,
289
+        sum: 1000,
290
+        dutyDepartment:{
291
+          branch:branchId
292
+        }
293
+      };
294
+      this.$http
295
+        .post("service/user/data/fetchDataList/dutyDepartment", postData)
296
+        .then(res => {
297
+          res.data.list = res.data.list || [];
298
+          this.selectDataDuty = res.data.list.map(v => {
299
+            return {
300
+              text: v.dept,
301
+              value: v.id
302
+            };
303
+          });
304
+        });
305
+    },
219
     // 单选框选中
306
     // 单选框选中
220
     radioChange(item) {
307
     radioChange(item) {
221
       this.$emit("radioChange", item.target.value);
308
       this.$emit("radioChange", item.target.value);
@@ -247,8 +334,9 @@ export default {
247
   },
334
   },
248
   created() {
335
   created() {
249
     if (this.selectName === "user") {
336
     if (this.selectName === "user") {
250
-      this.getZpGroup();
251
-      this.getZpUser();
337
+      this.getZpBranch();
338
+      // this.getZpGroup();
339
+      // this.getZpUser();
252
     }
340
     }
253
     if (this.textName === "textarea") {
341
     if (this.textName === "textarea") {
254
       this.getLogs();
342
       this.getLogs();

+ 2 - 1
src/views/incidentList.vue

@@ -144,7 +144,8 @@
144
     </div>
144
     </div>
145
     <load-ing v-show="loadShow"></load-ing>
145
     <load-ing v-show="loadShow"></load-ing>
146
     <!-- 指派弹窗 -->
146
     <!-- 指派弹窗 -->
147
-    <showModel
147
+    <showModel 
148
+      v-if="models.disjunctor"
148
       :title="models.title"
149
       :title="models.title"
149
       :icon="models.icon"
150
       :icon="models.icon"
150
       :disjunctor="models.disjunctor"
151
       :disjunctor="models.disjunctor"