Browse Source

龙岗二院

XMLWAN 4 years ago
parent
commit
e3bb626368
3 changed files with 208 additions and 146 deletions
  1. 8 0
      src/api/patient/patient.js
  2. 162 134
      src/pages/main/dialog/AcceptsDialog.vue
  3. 38 12
      src/pages/my/index.vue

+ 8 - 0
src/api/patient/patient.js View File

940
     params: params
940
     params: params
941
   })
941
   })
942
 }
942
 }
943
+
944
+export function getOrgs(params) {
945
+  return request({
946
+    url: '/m/api/patient/getorgs',
947
+    method: 'get',
948
+    params: params
949
+  })
950
+}

+ 162 - 134
src/pages/main/dialog/AcceptsDialog.vue View File

21
                       :label="item.id" v-model="receiveTreatmentAsses.way">{{item.name}}
21
                       :label="item.id" v-model="receiveTreatmentAsses.way">{{item.name}}
22
             </el-radio>
22
             </el-radio>
23
 
23
 
24
-
25
             <!--<el-radio v-model="receiveTreatmentAsses.way" label="1"-->
24
             <!--<el-radio v-model="receiveTreatmentAsses.way" label="1"-->
26
               <!--&gt;步行</el-radio-->
25
               <!--&gt;步行</el-radio-->
27
             <!--&gt;-->
26
             <!--&gt;-->
53
                       :label="item.id" v-model="receiveTreatmentAsses.consciousness">{{item.name}}
52
                       :label="item.id" v-model="receiveTreatmentAsses.consciousness">{{item.name}}
54
             </el-radio>
53
             </el-radio>
55
 
54
 
56
-
57
-
58
           </el-form-item>
55
           </el-form-item>
59
           <el-form-item label="病人食欲: " v-if="isShow('病人食欲')">
56
           <el-form-item label="病人食欲: " v-if="isShow('病人食欲')">
60
             <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="1"-->
57
             <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="1"-->
101
             ></el-input>
98
             ></el-input>
102
           </el-form-item>
99
           </el-form-item>
103
 
100
 
104
-
105
           <el-form-item label="体位: " v-if="isShow('体位')">
101
           <el-form-item label="体位: " v-if="isShow('体位')">
106
             <!--<el-radio v-model="receiveTreatmentAsses.posture" label="1"-->
102
             <!--<el-radio v-model="receiveTreatmentAsses.posture" label="1"-->
107
               <!--&gt;自动体位</el-radio-->
103
               <!--&gt;自动体位</el-radio-->
179
             v-if="isShow('跌倒风险预防措施')"
175
             v-if="isShow('跌倒风险预防措施')"
180
           >
176
           >
181
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="1"-->
177
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="1"-->
182
-              <!--&gt;镇定剂</el-radio-->
178
+            <!--&gt;镇定剂</el-radio-->
183
             <!--&gt;-->
179
             <!--&gt;-->
184
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="2"-->
180
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="2"-->
185
-              <!--&gt;约束带</el-radio-->
181
+            <!--&gt;约束带</el-radio-->
186
             <!--&gt;-->
182
             <!--&gt;-->
187
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="3"-->
183
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="3"-->
188
-              <!--&gt;床栏</el-radio-->
184
+            <!--&gt;床栏</el-radio-->
189
             <!--&gt;-->
185
             <!--&gt;-->
190
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="4"-->
186
             <!--<el-radio v-model="receiveTreatmentAsses.precaution" label="4"-->
191
-              <!--&gt;加强宣教</el-radio-->
187
+            <!--&gt;加强宣教</el-radio-->
192
             <!--&gt;-->
188
             <!--&gt;-->
193
-
194
-            <el-radio v-for="(item,index) in precaution_arr" :key="index"
195
-                      :label="item.id" v-model="receiveTreatmentAsses.precaution">{{item.name}}
196
-            </el-radio>
189
+            <el-checkbox-group v-model="precautionTwo">
190
+              <el-checkbox
191
+                v-for="item in precaution_arr"
192
+                :label="item.name"
193
+                :key="item.id"
194
+              >{{ item.name }}</el-checkbox
195
+              >
196
+            </el-checkbox-group>
197
+
198
+<!--            <el-radio v-for="(item,index) in precaution_arr" :key="index"-->
199
+<!--                      :label="item.id" v-model="receiveTreatmentAsses.precaution">{{item.name}}-->
200
+<!--            </el-radio>-->
197
           </el-form-item>
201
           </el-form-item>
198
           <el-form-item
202
           <el-form-item
199
             label-width="110dp"
203
             label-width="110dp"
267
 <script>
271
 <script>
268
 import { commitAcceptsAssessment, getLastAccepts } from "@/api/dialysis";
272
 import { commitAcceptsAssessment, getLastAccepts } from "@/api/dialysis";
269
 import { Toast } from "vant";
273
 import { Toast } from "vant";
270
-import { getDataConfig } from '@/utils/data'
274
+import { getDataConfig } from "@/utils/data";
271
 
275
 
272
-import request from '@/utils/request'
276
+import request from "@/utils/request";
273
 
277
 
274
 export default {
278
 export default {
275
   name: "AcceptsDialog",
279
   name: "AcceptsDialog",
276
   data() {
280
   data() {
277
     return {
281
     return {
278
-      showTxt:'',
279
-      hasPermission:true,
282
+      showTxt: "",
283
+      hasPermission: true,
280
       way_arr: [],
284
       way_arr: [],
281
       consciousness_arr: [],
285
       consciousness_arr: [],
282
       appetite_arr: [],
286
       appetite_arr: [],
301
         sick_condition_other: "",
305
         sick_condition_other: "",
302
         score: "",
306
         score: "",
303
         psychological_other: "",
307
         psychological_other: "",
304
-        precaution: "1",
308
+        precaution: "",
305
         precaution_other: "",
309
         precaution_other: "",
306
-        admission_number:'',
307
-
308
-
310
+        admission_number: ""
309
       },
311
       },
310
       patient: {
312
       patient: {
311
         id: 0
313
         id: 0
312
       },
314
       },
313
-      record_date: ""
315
+      record_date: "",
316
+      precautionTwo: []
314
     };
317
     };
315
   },
318
   },
316
   props: {
319
   props: {
322
     }
325
     }
323
   },
326
   },
324
   created() {
327
   created() {
325
-    this.getPermission()
326
-    this.way_arr = getDataConfig('hemodialysis', 'way')
327
-    this.consciousness_arr = getDataConfig('hemodialysis', 'consciousness')
328
-    this.appetite_arr = getDataConfig('hemodialysis', 'appetite')
329
-    this.posture_arr = getDataConfig('hemodialysis', 'posture')
330
-    this.sick_condition_arr = getDataConfig('hemodialysis', 'sick_condition')
331
-    this.precaution_arr = getDataConfig('hemodialysis', 'precaution')
332
-    this.intake_arr = getDataConfig('hemodialysis', 'intake')
333
-    this.nutrition_arr = getDataConfig('hemodialysis', 'nutrition')
334
-
328
+    this.getPermission();
329
+    this.way_arr = getDataConfig("hemodialysis", "way");
330
+    this.consciousness_arr = getDataConfig("hemodialysis", "consciousness");
331
+    this.appetite_arr = getDataConfig("hemodialysis", "appetite");
332
+    this.posture_arr = getDataConfig("hemodialysis", "posture");
333
+    this.sick_condition_arr = getDataConfig("hemodialysis", "sick_condition");
334
+    this.precaution_arr = getDataConfig("hemodialysis", "precaution");
335
+    this.intake_arr = getDataConfig("hemodialysis", "intake");
336
+    this.nutrition_arr = getDataConfig("hemodialysis", "nutrition");
337
+    var arr = [];
338
+    var precaution = this.accepts.precaution.split(",");
339
+    console.log("precaution", precaution);
340
+    console.log("hhh", this.precaution_arr);
341
+    for (let i = 0; i < precaution.length; i++) {
342
+      for (let j = 0; j < this.precaution_arr.length; j++) {
343
+        if (parseInt(precaution[i]) == this.precaution_arr[j].id) {
344
+          console.log("aaaa");
345
+          arr.push(this.precaution_arr[j].name);
346
+        }
347
+      }
348
+    }
349
+    this.precautionTwo = arr;
350
+    console.log("arr", arr);
335
 
351
 
336
     if (this.accepts == null || this.accepts.id == "") {
352
     if (this.accepts == null || this.accepts.id == "") {
337
       let ParamsQuery = {};
353
       let ParamsQuery = {};
338
       ParamsQuery["patient"] = this.$route.query.patient_id;
354
       ParamsQuery["patient"] = this.$route.query.patient_id;
339
-      getLastAccepts(ParamsQuery).then(response => {
340
-        if (response.data.state == 0) {
341
-          return false;
342
-        } else {
343
-          for (const key in response.data.data.receiveTreatmentAsses) {
344
-            this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
345
-            this.accepts['id'] = 0
346
-            this.accepts['creater'] = 0
347
-            this.receiveTreatmentAsses.way = this.accepts.way;
348
-            this.receiveTreatmentAsses.consciousness =
349
-              this.accepts.consciousness;
350
-            this.receiveTreatmentAsses.appetite = this.accepts.appetite ;
351
-            this.receiveTreatmentAsses.condition = this.accepts.condition + "";
352
-            this.receiveTreatmentAsses.posture = this.accepts.posture;
353
-            this.receiveTreatmentAsses.sick_condition =
354
-              this.accepts.sick_condition;
355
-            this.receiveTreatmentAsses.danger_level =
356
-              this.accepts.danger_level + "";
357
-            this.receiveTreatmentAsses.intake = this.accepts.intake;
358
-            this.receiveTreatmentAsses.nutrition = this.accepts.nutrition;
359
-            this.receiveTreatmentAsses.psychological_assessment =
360
-              this.accepts.psychological_assessment + "";
361
-            this.receiveTreatmentAsses.psychological_assessment_other = this.accepts.psychological_assessment_other;
362
-            this.receiveTreatmentAsses.score = this.accepts.score;
363
-            this.receiveTreatmentAsses.sick_condition_other = this.accepts.sick_condition_other;
364
-            this.receiveTreatmentAsses.psychological_other = this.accepts.psychological_other;
365
-
366
-            this.receiveTreatmentAsses.precaution =
367
-              this.accepts.precaution;
368
-            this.receiveTreatmentAsses.precaution_other = this.accepts.precaution_other;
369
-            this.receiveTreatmentAsses.admission_number = this.accepts.admission_number;
355
+      getLastAccepts(ParamsQuery)
356
+        .then(response => {
357
+          if (response.data.state == 0) {
358
+            return false;
359
+          } else {
360
+            for (const key in response.data.data.receiveTreatmentAsses) {
361
+              this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
362
+              this.accepts["id"] = 0;
363
+              this.accepts["creater"] = 0;
364
+              this.receiveTreatmentAsses.way = this.accepts.way;
365
+              this.receiveTreatmentAsses.consciousness = this.accepts.consciousness;
366
+              this.receiveTreatmentAsses.appetite = this.accepts.appetite;
367
+              this.receiveTreatmentAsses.condition =
368
+                this.accepts.condition + "";
369
+              this.receiveTreatmentAsses.posture = this.accepts.posture;
370
+              this.receiveTreatmentAsses.sick_condition = this.accepts.sick_condition;
371
+              this.receiveTreatmentAsses.danger_level =
372
+                this.accepts.danger_level + "";
373
+              this.receiveTreatmentAsses.intake = this.accepts.intake;
374
+              this.receiveTreatmentAsses.nutrition = this.accepts.nutrition;
375
+              this.receiveTreatmentAsses.psychological_assessment =
376
+                this.accepts.psychological_assessment + "";
377
+              this.receiveTreatmentAsses.psychological_assessment_other = this.accepts.psychological_assessment_other;
378
+              this.receiveTreatmentAsses.score = this.accepts.score;
379
+              this.receiveTreatmentAsses.sick_condition_other = this.accepts.sick_condition_other;
380
+              this.receiveTreatmentAsses.psychological_other = this.accepts.psychological_other;
370
 
381
 
382
+              this.receiveTreatmentAsses.precaution = this.accepts.precaution;
383
+              this.receiveTreatmentAsses.precaution_other = this.accepts.precaution_other;
384
+              this.receiveTreatmentAsses.admission_number = this.accepts.admission_number;
385
+            }
371
           }
386
           }
372
-        }
373
-      }).catch(error => {
374
-        Toast.fail("请求失败")
375
-      });
387
+        })
388
+        .catch(error => {
389
+          Toast.fail("请求失败");
390
+        });
376
     } else {
391
     } else {
377
       if (
392
       if (
378
         this.accepts.way == 0 &&
393
         this.accepts.way == 0 &&
390
         this.accepts.psychological_other == "" &&
405
         this.accepts.psychological_other == "" &&
391
         this.accepts.precaution == 0 &&
406
         this.accepts.precaution == 0 &&
392
         this.accepts.precaution_other == "" &&
407
         this.accepts.precaution_other == "" &&
393
-        this.accepts.score == ""&&
408
+        this.accepts.score == "" &&
394
         this.accepts.admission_number == ""
409
         this.accepts.admission_number == ""
395
-
396
       ) {
410
       ) {
397
         let ParamsQuery = {};
411
         let ParamsQuery = {};
398
         ParamsQuery["patient"] = this.$route.query.patient_id;
412
         ParamsQuery["patient"] = this.$route.query.patient_id;
402
           } else {
416
           } else {
403
             for (const key in response.data.data.receiveTreatmentAsses) {
417
             for (const key in response.data.data.receiveTreatmentAsses) {
404
               this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
418
               this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
405
-              this.accepts['id'] = 0
406
-              this.accepts['creater'] = 0
419
+              this.accepts["id"] = 0;
420
+              this.accepts["creater"] = 0;
407
 
421
 
408
               this.receiveTreatmentAsses.way = this.accepts.way;
422
               this.receiveTreatmentAsses.way = this.accepts.way;
409
-              this.receiveTreatmentAsses.consciousness =
410
-                this.accepts.consciousness;
423
+              this.receiveTreatmentAsses.consciousness = this.accepts.consciousness;
411
               this.receiveTreatmentAsses.appetite = this.accepts.appetite;
424
               this.receiveTreatmentAsses.appetite = this.accepts.appetite;
412
               this.receiveTreatmentAsses.condition =
425
               this.receiveTreatmentAsses.condition =
413
                 this.accepts.condition + "";
426
                 this.accepts.condition + "";
414
               this.receiveTreatmentAsses.posture = this.accepts.posture;
427
               this.receiveTreatmentAsses.posture = this.accepts.posture;
415
-              this.receiveTreatmentAsses.sick_condition =
416
-                this.accepts.sick_condition;
428
+              this.receiveTreatmentAsses.sick_condition = this.accepts.sick_condition;
417
               this.receiveTreatmentAsses.danger_level =
429
               this.receiveTreatmentAsses.danger_level =
418
                 this.accepts.danger_level + "";
430
                 this.accepts.danger_level + "";
419
               this.receiveTreatmentAsses.intake = this.accepts.intake;
431
               this.receiveTreatmentAsses.intake = this.accepts.intake;
420
-              this.receiveTreatmentAsses.nutrition =
421
-                this.accepts.nutrition ;
432
+              this.receiveTreatmentAsses.nutrition = this.accepts.nutrition;
422
               this.receiveTreatmentAsses.psychological_assessment =
433
               this.receiveTreatmentAsses.psychological_assessment =
423
                 this.accepts.psychological_assessment + "";
434
                 this.accepts.psychological_assessment + "";
424
               this.receiveTreatmentAsses.psychological_assessment_other =
435
               this.receiveTreatmentAsses.psychological_assessment_other =
426
               this.receiveTreatmentAsses.score = this.accepts.score;
437
               this.receiveTreatmentAsses.score = this.accepts.score;
427
               this.receiveTreatmentAsses.sick_condition_other = this.accepts.sick_condition_other;
438
               this.receiveTreatmentAsses.sick_condition_other = this.accepts.sick_condition_other;
428
 
439
 
429
-              this.receiveTreatmentAsses.precaution =
430
-                this.accepts.precaution;
440
+              this.receiveTreatmentAsses.precaution = this.accepts.precaution;
431
               this.receiveTreatmentAsses.precaution_other = this.accepts.precaution_other;
441
               this.receiveTreatmentAsses.precaution_other = this.accepts.precaution_other;
432
               this.receiveTreatmentAsses.psychological_other = this.accepts.psychological_other;
442
               this.receiveTreatmentAsses.psychological_other = this.accepts.psychological_other;
433
               this.receiveTreatmentAsses.admission_number = this.accepts.admission_number;
443
               this.receiveTreatmentAsses.admission_number = this.accepts.admission_number;
434
-
435
             }
444
             }
436
           }
445
           }
437
         });
446
         });
438
       } else {
447
       } else {
439
         this.receiveTreatmentAsses.way = this.accepts.way;
448
         this.receiveTreatmentAsses.way = this.accepts.way;
440
-        this.receiveTreatmentAsses.consciousness =
441
-          this.accepts.consciousness;
442
-        this.receiveTreatmentAsses.appetite = this.accepts.appetite ;
449
+        this.receiveTreatmentAsses.consciousness = this.accepts.consciousness;
450
+        this.receiveTreatmentAsses.appetite = this.accepts.appetite;
443
         this.receiveTreatmentAsses.condition = this.accepts.condition + "";
451
         this.receiveTreatmentAsses.condition = this.accepts.condition + "";
444
         this.receiveTreatmentAsses.posture = this.accepts.posture;
452
         this.receiveTreatmentAsses.posture = this.accepts.posture;
445
-        this.receiveTreatmentAsses.sick_condition =
446
-          this.accepts.sick_condition;
453
+        this.receiveTreatmentAsses.sick_condition = this.accepts.sick_condition;
447
         this.receiveTreatmentAsses.danger_level =
454
         this.receiveTreatmentAsses.danger_level =
448
           this.accepts.danger_level + "";
455
           this.accepts.danger_level + "";
449
-        this.receiveTreatmentAsses.intake = this.accepts.intake ;
456
+        this.receiveTreatmentAsses.intake = this.accepts.intake;
450
         this.receiveTreatmentAsses.nutrition = this.accepts.nutrition;
457
         this.receiveTreatmentAsses.nutrition = this.accepts.nutrition;
451
         this.receiveTreatmentAsses.psychological_assessment =
458
         this.receiveTreatmentAsses.psychological_assessment =
452
           this.accepts.psychological_assessment + "";
459
           this.accepts.psychological_assessment + "";
495
       return false;
502
       return false;
496
     },
503
     },
497
     commitInfo: function() {
504
     commitInfo: function() {
498
-      let mode = 1
505
+      var arr = [];
506
+      for (let i = 0; i < this.precaution_arr.length; i++) {
507
+        for (let j = 0; j < this.precautionTwo.length; j++) {
508
+          if (this.precaution_arr[i].name == this.precautionTwo[j]) {
509
+            arr.push(this.precaution_arr[i].id);
510
+          }
511
+        }
512
+      }
513
+      console.log("arr", arr);
514
+      var obj = arr.join(",");
515
+      this.receiveTreatmentAsses.precaution = obj;
516
+      let mode = 1;
499
       Toast.loading({ forbidClick: true, duration: 0 });
517
       Toast.loading({ forbidClick: true, duration: 0 });
518
+
500
       let ParamsQuery = this.receiveTreatmentAsses;
519
       let ParamsQuery = this.receiveTreatmentAsses;
520
+      console.log("ParamsQuery", ParamsQuery);
501
       // ParamsQuery["patient"] =  this.patient.id
521
       // ParamsQuery["patient"] =  this.patient.id
502
       ParamsQuery["patient"] = this.$route.query.patient_id;
522
       ParamsQuery["patient"] = this.$route.query.patient_id;
503
       ParamsQuery["record_date"] = this.record_date;
523
       ParamsQuery["record_date"] = this.record_date;
504
-      if (this.accepts.id > 0){
505
-        mode = 2
506
-        if(this.accepts.creater  != this.$store.getters.user.admin.id){
507
-          mode = 3
524
+      if (this.accepts.id > 0) {
525
+        mode = 2;
526
+        if (this.accepts.creater != this.$store.getters.user.admin.id) {
527
+          mode = 3;
508
         }
528
         }
509
       }
529
       }
510
       ParamsQuery["mode"] = mode;
530
       ParamsQuery["mode"] = mode;
511
-      commitAcceptsAssessment(ParamsQuery).then(response => {
512
-        if (response.data.state == 0) {
513
-          Toast.fail(response.data.msg);
514
-          return false;
515
-        } else {
516
-          Toast.success("提交成功");
517
-          for (const key in response.data.data.receiveTreatmentAsses) {
518
-            this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
531
+      commitAcceptsAssessment(ParamsQuery)
532
+        .then(response => {
533
+          if (response.data.state == 0) {
534
+            Toast.fail(response.data.msg);
535
+            return false;
536
+          } else {
537
+            Toast.success("提交成功");
538
+            for (const key in response.data.data.receiveTreatmentAsses) {
539
+              this.accepts[key] = response.data.data.receiveTreatmentAsses[key];
540
+            }
541
+            this.finish();
519
           }
542
           }
520
-          this.finish();
521
-        }
522
-      }).catch(error => {
523
-        Toast.fail("请求失败")
524
-      });
543
+        })
544
+        .catch(error => {
545
+          Toast.fail("请求失败");
546
+        });
525
     },
547
     },
526
     finish: function() {
548
     finish: function() {
527
       this.$emit("finish");
549
       this.$emit("finish");
529
     close: function() {
551
     close: function() {
530
       this.$emit("close");
552
       this.$emit("close");
531
     },
553
     },
532
-    getPermission(){
533
-      request.get("/m/api/permission/get",{
534
-        params:{
535
-          create_url:"/m/api/dialysis/acceptsAssessment?mode=1",
536
-          modify_url:"/m/api/dialysis/acceptsAssessment?mode=2",
537
-          modify_other_url:"/m/api/dialysis/acceptsAssessment?mode=3",
538
-          module:2
539
-        }
540
-      }).then(res => {
541
-        console.log(res)
542
-        console.log("接诊",this.accepts)
543
-        if(res.data.state == 0){
544
-          this.hasPermission = false
545
-        }else if(res.data.state == 1){
546
-          if(this.accepts.id != "" && this.accepts.creater != 0){//有数据
547
-            if(this.accepts.creater == this.$store.getters.user.admin.id){//创建人是自己
548
-              if(res.data.data.is_has_modify == false){
549
-                this.hasPermission = false
550
-                this.showTxt = "你没有修改接诊评估权限"
554
+    getPermission() {
555
+      request
556
+        .get("/m/api/permission/get", {
557
+          params: {
558
+            create_url: "/m/api/dialysis/acceptsAssessment?mode=1",
559
+            modify_url: "/m/api/dialysis/acceptsAssessment?mode=2",
560
+            modify_other_url: "/m/api/dialysis/acceptsAssessment?mode=3",
561
+            module: 2
562
+          }
563
+        })
564
+        .then(res => {
565
+          console.log(res);
566
+          console.log("接诊", this.accepts);
567
+
568
+          if (res.data.state == 0) {
569
+            this.hasPermission = false;
570
+          } else if (res.data.state == 1) {
571
+            if (this.accepts.id != "" && this.accepts.creater != 0) {
572
+              // 有数据
573
+              if (this.accepts.creater == this.$store.getters.user.admin.id) {
574
+                // 创建人是自己
575
+                if (res.data.data.is_has_modify == false) {
576
+                  this.hasPermission = false;
577
+                  this.showTxt = "你没有修改接诊评估权限";
578
+                }
579
+              } else {
580
+                // 创建人不是自己
581
+                if (res.data.data.is_has_modify_other == false) {
582
+                  this.hasPermission = false;
583
+                  this.showTxt = "你没有修改他人接诊评估权限";
584
+                }
551
               }
585
               }
552
-            }else{//创建人不是自己
553
-              if(res.data.data.is_has_modify_other == false){
554
-                this.hasPermission = false
555
-                this.showTxt = "你没有修改他人接诊评估权限"
586
+            } else if (this.accepts.id == "" || this.accepts.creater == 0) {
587
+              if (res.data.data.is_has_create == false) {
588
+                this.hasPermission = false;
589
+                this.showTxt = "你没有新增接诊评估权限";
556
               }
590
               }
557
             }
591
             }
558
-          }else if(this.accepts.id == "" || this.accepts.creater == 0){
559
-            if(res.data.data.is_has_create  == false){
560
-              this.hasPermission = false
561
-              this.showTxt = "你没有新增接诊评估权限"
562
-            }
563
           }
592
           }
564
-        }
565
-      })
593
+        });
566
     }
594
     }
567
   }
595
   }
568
 };
596
 };
593
     }
621
     }
594
   }
622
   }
595
 }
623
 }
596
-.warnTxt{
624
+.warnTxt {
597
   font-size: 0.5rem;
625
   font-size: 0.5rem;
598
   height: 1rem;
626
   height: 1rem;
599
   line-height: 1rem;
627
   line-height: 1rem;

+ 38 - 12
src/pages/my/index.vue View File

73
            ><img src="../../assets/images/m01.png" alt
73
            ><img src="../../assets/images/m01.png" alt
74
           /></span>
74
           /></span>
75
           <span v-if="item.org_logo !== ''"><img :src="item.org_logo"/></span>
75
           <span v-if="item.org_logo !== ''"><img :src="item.org_logo"/></span>
76
-          <p  @click="toManage(item.creator, item.id)">{{ item.org_name }}</p>
76
+          <p  @click="toManage(item.admin_user_id)">{{ item.org_name }}</p>
77
         </div>
77
         </div>
78
 
78
 
79
         <div class="myInfoRight">
79
         <div class="myInfoRight">
80
           <div
80
           <div
81
-            v-if="item.creator == cretor || position == '子管理员'"
81
+            v-if="item.creator == $store.getters.user.org.creator && position == 1"
82
             class="myInfoRightBtn"
82
             class="myInfoRightBtn"
83
             @click="toEditOrg()"
83
             @click="toEditOrg()"
84
           >
84
           >
87
           <van-icon
87
           <van-icon
88
             class="arrow"
88
             class="arrow"
89
             name="arrow"
89
             name="arrow"
90
-            @click="toManage(item.creator, item.id)"
90
+            @click="toManage(item.admin_user_id)"
91
           />
91
           />
92
         </div>
92
         </div>
93
       </div>
93
       </div>
161
   getMyInformationThree,
161
   getMyInformationThree,
162
   getMyOrgInformation,
162
   getMyOrgInformation,
163
   getMyInformationFour,
163
   getMyInformationFour,
164
-  getRolePosition
164
+  getRolePosition,
165
+  getOrgs
165
 } from "@/api/patient/patient";
166
 } from "@/api/patient/patient";
166
 import { uParseTime } from "@/utils/tools";
167
 import { uParseTime } from "@/utils/tools";
167
 import { GetHomeData } from "@/api/home";
168
 import { GetHomeData } from "@/api/home";
179
       isCreateOrg: false,
180
       isCreateOrg: false,
180
       org_id: 0,
181
       org_id: 0,
181
       cretor: 0,
182
       cretor: 0,
182
-      position: ""
183
+      position: 0
183
     };
184
     };
184
   },
185
   },
185
   methods: {
186
   methods: {
203
       GetHomeData().then(response => {
204
       GetHomeData().then(response => {
204
         if (response.data.state === 1) {
205
         if (response.data.state === 1) {
205
           var orgs = response.data.data.orgs;
206
           var orgs = response.data.data.orgs;
206
-          console.log("orgs", orgs);
207
-          this.organaziton = orgs;
207
+          // console.log("orgs", orgs);
208
+          // this.organaziton = orgs;
208
           this.isCreateOrg = response.data.data.isCreateOrg;
209
           this.isCreateOrg = response.data.data.isCreateOrg;
209
           var cretor = response.data.data.cretor;
210
           var cretor = response.data.data.cretor;
210
           //  console.log("cretor", cretor);
211
           //  console.log("cretor", cretor);
212
         }
213
         }
213
       });
214
       });
214
     },
215
     },
216
+    getOrgs() {
217
+      getOrgs().then(response => {
218
+        if (response.data.state === 1) {
219
+          var orgs = response.data.data.orgs;
220
+          console.log("orgs", orgs);
221
+          this.organaziton = orgs;
222
+        }
223
+      });
224
+    },
225
+    getRoleids(ids) {
226
+      var arr = [];
227
+      arr = ids.split(",");
228
+      var arr2 = [...new Set(arr)];
229
+      console.log(arr2);
230
+      getRoleids(arr2).then(response => {});
231
+    },
215
     getMyInformation(id) {
232
     getMyInformation(id) {
216
       getMyInformation(id).then(response => {
233
       getMyInformation(id).then(response => {
217
         if (response.data.state === 1) {
234
         if (response.data.state === 1) {
249
         );
266
         );
250
       }
267
       }
251
     },
268
     },
252
-    toManage(id, orgid) {
253
-      console.log("id是", id);
254
-      this.$router.push("/organizationinfo?id=" + id + "&orgid=" + orgid);
269
+    toManage(id) {
270
+      this.$router.push("/organizationinfo?id=" + id + "&orgid=" + this.org_id);
255
     },
271
     },
256
     toEditOrg() {
272
     toEditOrg() {
257
       // this.$router.push('/editorg?id=' + id)
273
       // this.$router.push('/editorg?id=' + id)
293
     getRolePosition() {
309
     getRolePosition() {
294
       getRolePosition().then(response => {
310
       getRolePosition().then(response => {
295
         if (response.data.state === 1) {
311
         if (response.data.state === 1) {
296
-          var cretorPosition = response.data.data.cretorPosition;
297
-          this.position = cretorPosition.role_name;
312
+          var names = response.data.data.names;
313
+          console.log("names", names);
314
+          var arr = [];
315
+          arr = names.split(",");
316
+          var arr2 = [...new Set(arr)];
317
+          console.log("arr2", arr2);
318
+          for (let i = 0; i < arr2.length; i++) {
319
+            if (arr2[i] == "超级管理员" || arr2[i] == "子管理员") {
320
+              this.position = 1;
321
+            }
322
+          }
298
         }
323
         }
299
       });
324
       });
300
     }
325
     }
316
       this.getMyInformationFour();
341
       this.getMyInformationFour();
317
     }
342
     }
318
     this.getRolePosition();
343
     this.getRolePosition();
344
+    this.getOrgs();
319
   }
345
   }
320
 };
346
 };
321
 </script>
347
 </script>