seimin hace 2 años
padre
commit
b9410872a6
Se han modificado 3 ficheros con 102 adiciones y 13 borrados
  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 14
     proxyTable: {
15 15
       '/service': {//自定义名字,代表的是以下target中的内容
16 16
         // target: host.host+'/service/',//微信
17
-        target: 'http://weixintest11.ngser.dashitech.com',//微信
17
+        target: 'http://192.168.3.105',//微信
18 18
         changeOrigin: true,//是否允许跨域
19 19
         // pathRewrite: {
20 20
         //   '^/service': ''

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

@@ -20,16 +20,30 @@
20 20
         <div v-if="info" class="showModel__info">{{ info }}</div>
21 21
         <div class="select-wrap" v-if="selectName === 'user'">
22 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 36
             v-model="selectGroupId"
24 37
             :options="selectDataGroup"
25 38
             placeholder="请选择工作组"
26 39
             @change="changeGroup($event)"
40
+            style="margin-top:0.2rem;"
27 41
           ></cube-select>
28 42
           <cube-select
29 43
             v-model="selectUserId"
30 44
             :options="selectDataUser"
31 45
             placeholder="请选择指派对象"
32
-            style="margin-top:0.5rem;"
46
+            style="margin-top:0.2rem;"
33 47
           ></cube-select>
34 48
         </div>
35 49
         <div v-if="textName === 'textarea'">
@@ -73,23 +87,24 @@
73 87
 export default {
74 88
   data() {
75 89
     return {
90
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
76 91
       logs: [],
77 92
       time: 5, //5秒后自动关闭
78 93
       timer: null, //5秒后自动关闭,定时器
79 94
       timerFlag: true, //是否显示取消自动关闭按钮
80 95
       selectDataUser: [], //select数据-用户
81
-      selectUserId: 0, //select选中的数据-用户
96
+      selectUserId: undefined, //select选中的数据-用户
82 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 103
       textareaData: "" //textarea的数据
85 104
     };
86 105
   },
87 106
   watch: {
88 107
     disjunctor(newValue) {
89
-      if (newValue && this.selectName === "user") {
90
-        this.selectGroupId = 0;
91
-        this.selectUserId = 0;
92
-      }
93 108
       if (newValue && this.textName === "textarea") {
94 109
         this.textareaData = "";
95 110
       }
@@ -168,6 +183,16 @@ export default {
168 183
     changeGroup(groupId) {
169 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 197
     getZpUser(groupId) {
173 198
       this.selectDataUser = [];
@@ -197,12 +222,17 @@ export default {
197 222
         });
198 223
     },
199 224
     // 获取工作组
200
-    getZpGroup() {
225
+    getZpGroup(dutyId) {
201 226
       this.selectDataGroup = [];
227
+      this.selectDataUser = [];
228
+      this.selectUserId = undefined;
202 229
       var postData = {
203 230
         idx: 0,
204 231
         sum: 1000,
205
-        group: {}
232
+        group: {
233
+          duty:{id:dutyId},
234
+          selectType: "nouser"
235
+        }
206 236
       };
207 237
       this.$http
208 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 307
     radioChange(item) {
221 308
       this.$emit("radioChange", item.target.value);
@@ -247,8 +334,9 @@ export default {
247 334
   },
248 335
   created() {
249 336
     if (this.selectName === "user") {
250
-      this.getZpGroup();
251
-      this.getZpUser();
337
+      this.getZpBranch();
338
+      // this.getZpGroup();
339
+      // this.getZpUser();
252 340
     }
253 341
     if (this.textName === "textarea") {
254 342
       this.getLogs();

+ 2 - 1
src/views/incidentList.vue

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