Parcourir la source

Merge branch '2022-10-17_vue_schedule_branch' of http://git.shengws.com/csx/Vue_New into 20220812

28169 il y a 2 ans
Parent
révision
69d434ed70

+ 2 - 0
src/api/his/his_hospital.js Voir le fichier

21
 
21
 
22
 
22
 
23
 
23
 
24
+
25
+

+ 13 - 0
src/api/schedule.js Voir le fichier

269
     params: params
269
     params: params
270
   })
270
   })
271
 }
271
 }
272
+
273
+
274
+
275
+export function CancelScheduleTwo(id) {
276
+  return request({
277
+    url: '/api/schedule/delete_two?id=' + id,
278
+    method: 'Delete'
279
+  })
280
+}
281
+
282
+
283
+
284
+

+ 2 - 0
src/xt_pages/hospitalStation/invoicePrint.vue Voir le fichier

38
   </div>
38
   </div>
39
 </template>
39
 </template>
40
 
40
 
41
+
42
+
41
 <script>
43
 <script>
42
 import printOne from "./invoiceTemplate/printOne";
44
 import printOne from "./invoiceTemplate/printOne";
43
 import printTwo from "./invoiceTemplate/printTwo";
45
 import printTwo from "./invoiceTemplate/printTwo";

+ 2 - 0
src/xt_pages/hospitalStation/outpatientChargesManagement.vue Voir le fichier

88
 
88
 
89
       <div class="mainRight">
89
       <div class="mainRight">
90
 
90
 
91
+
92
+
91
         <div class="mainCell fixedCell" style="margin-bottom:10px;">
93
         <div class="mainCell fixedCell" style="margin-bottom:10px;">
92
 
94
 
93
           <div>
95
           <div>

+ 2 - 0
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue Voir le fichier

286
                     </div>
286
                     </div>
287
                   </div>
287
                   </div>
288
 
288
 
289
+
290
+
289
                 </div>
291
                 </div>
290
                 <div class="centerRight">
292
                 <div class="centerRight">
291
                   <p class="centerRightTitle" style="padding-top: 10px;">就诊信息</p>
293
                   <p class="centerRightTitle" style="padding-top: 10px;">就诊信息</p>

+ 1 - 0
src/xt_pages/outpatientCharges/statementPrint.vue Voir le fichier

958
                 }
958
                 }
959
 
959
 
960
               }
960
               }
961
+
961
               console.log(list)
962
               console.log(list)
962
               let len = list.length / 2
963
               let len = list.length / 2
963
               let L_list = []
964
               let L_list = []

+ 3 - 0
src/xt_pages/outpatientCharges/summary.vue Voir le fichier

1882
             var hifmi_pay = 0.0;
1882
             var hifmi_pay = 0.0;
1883
             if (order.setl_detail && order.setl_detail.length > 0) {
1883
             if (order.setl_detail && order.setl_detail.length > 0) {
1884
               var jsonObj = JSON.parse(order.setl_detail);
1884
               var jsonObj = JSON.parse(order.setl_detail);
1885
+
1885
               console.log(jsonObj);
1886
               console.log(jsonObj);
1886
               if (jsonObj != null) {
1887
               if (jsonObj != null) {
1887
                 for (let i = 0; i < jsonObj.length; i++) {
1888
                 for (let i = 0; i < jsonObj.length; i++) {
1897
                 }
1898
                 }
1898
               }
1899
               }
1899
             }
1900
             }
1901
+
1902
+
1900
             var hifmi_pay = 0.0;
1903
             var hifmi_pay = 0.0;
1901
 
1904
 
1902
             console.log(order.setl_detail);
1905
             console.log(order.setl_detail);

+ 1 - 0
src/xt_pages/outpatientDoctorStation/checkPrint.vue Voir le fichier

15
       <div class='dialysisPage' style="padding-top:40px;">
15
       <div class='dialysisPage' style="padding-top:40px;">
16
         <printOne :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id" :newHisPatient="newHisPatient"></printOne>
16
         <printOne :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id" :newHisPatient="newHisPatient"></printOne>
17
       </div>
17
       </div>
18
+
18
   </div>
19
   </div>
19
 </template>
20
 </template>
20
 
21
 

+ 617 - 0
src/xt_pages/outpatientDoctorStation/checkTemplate/checkPrintTwo.vue Voir le fichier

1
+<template>
2
+  <div>
3
+    <div id="prescription-print3" class="prescription-print">
4
+
5
+      <div class="printTitle">检验申请单</div>
6
+
7
+      <div style="border: 1px solid #000">
8
+        <div
9
+          style="
10
+            display: flex;
11
+            justify-content: space-between;
12
+            border-bottom: 1px solid #000;
13
+            line-height: 40px;
14
+            padding: 0 10px;
15
+          "
16
+        >
17
+          <div>是否急诊:否</div>
18
+          <div>
19
+            结算方式:{{
20
+              faber && faber.transBody
21
+                ? getName(faber.transBody.outputlist1)
22
+                : ""
23
+            }}
24
+          </div>
25
+          <div>金额:{{ total }}</div>
26
+        </div>
27
+        <div
28
+          style="
29
+            display: flex;
30
+            justify-content: space-between;
31
+            border-bottom: 1px solid #000;
32
+            line-height: 40px;
33
+            padding: 0 10px;
34
+          "
35
+        >
36
+          <div>
37
+            姓名:{{
38
+              advicePrint[0].patient.name
39
+                ? advicePrint[0].patient.name.indexOf("(") > -1
40
+                ? advicePrint[0].patient.name.substring(
41
+                  0,
42
+                  advicePrint[0].patient.name.indexOf("(")
43
+                )
44
+                : advicePrint[0].patient.name
45
+                : ""
46
+            }}
47
+          </div>
48
+          <div>
49
+            性别:
50
+            <span v-if="advicePrint[0].patient.gender == 1">男</span>
51
+            <span v-if="advicePrint[0].patient.gender == 2">女</span>
52
+          </div>
53
+          <div>
54
+            年龄:{{
55
+              advicePrint[0].patient.age ? advicePrint[0].patient.age : ""
56
+            }}岁
57
+          </div>
58
+        </div>
59
+        <div style="margin-bottom: 20px; padding: 10px 10px 0">
60
+          病史摘要:{{
61
+            history.history_of_present_illness
62
+              ? history.history_of_present_illness
63
+              : ""
64
+          }}
65
+        </div>
66
+        <!-- <div style="margin-bottom:20px;padding:0 10px;">体格检查:
67
+                    <span>体温:{{ history.temperature ? history.temperature + '℃' : '/' }}</span>
68
+                    <span>脉搏:{{ history.pulse ? history.pulse + '次/分' : '/' }}</span>
69
+                    <span>呼吸:{{ history.breathing ? history.breathing + '次/分' : '/' }}</span>
70
+                    <span>血压:{{ history.sbp }}/{{ history.dbp }}mmHg</span>
71
+                </div> -->
72
+        <div style="margin-bottom: 20px; padding: 0 10px">
73
+          临床诊断:{{ getDiagnosis(advicePrint[0].info.diagnosis) }}
74
+        </div>
75
+        <div style="display: flex; margin-bottom: 20px; padding: 0 10px">
76
+          <div>检验项目:</div>
77
+          <div>
78
+            <div v-for="item in projectPrint" style="margin-bottom: 10px">
79
+              {{ item.project.project_name }}
80
+            </div>
81
+            <!--            <div v-for="item in singleProjectPrint" style="margin-bottom: 10px">-->
82
+            <!--              {{ item.project.project_name }}-->
83
+            <!--            </div>-->
84
+          </div>
85
+        </div>
86
+        <div
87
+          style="
88
+            display: flex;
89
+            justify-content: space-between;
90
+            border-top: 1px solid #000;
91
+            line-height: 40px;
92
+            padding: 0 10px;
93
+          "
94
+        >
95
+          <div>开单医生:{{ doctor ? doctor : "" }}</div>
96
+          <div>
97
+            开单日期:
98
+            {{ getTime(pre_time) ? getTime(pre_time).split(" ")[0] : "" }}
99
+          </div>
100
+          <div>
101
+            医生签字:
102
+
103
+            <img
104
+              v-if="setAdminUserES(advicePrint[0].creator)"
105
+              style="height: 30px"
106
+              :src="setAdminUserES(advicePrint[0].creator)"
107
+              alt=""
108
+              srcset=""
109
+            />
110
+            <span
111
+              style="width: 100px; display: inline-block"
112
+              v-else-if="advicePrint[0].doctor != ''"
113
+            >
114
+              {{ advicePrint[0].doctor ? advicePrint[0].doctor : "" }}
115
+            </span>
116
+            <span v-else>
117
+
118
+            </span>
119
+          </div>
120
+        </div>
121
+      </div>
122
+    </div>
123
+
124
+  </div>
125
+</template>
126
+
127
+<script>
128
+import { jsGetAge, uParseTime } from "@/utils/tools";
129
+import {
130
+  getAllDoctorList,
131
+  getPrescriptionPrint,
132
+  getHisPatientDetail,
133
+  getPatientCaseHistory,
134
+} from "@/api/project/project";
135
+import { getInitData } from "@/api/his/his";
136
+export default {
137
+  props: {
138
+    patient_id: Number,
139
+    record_date: String,
140
+    prescription_id: Number,
141
+    ids: String,
142
+  },
143
+  data() {
144
+    return {
145
+      doctorList_1: [],
146
+      doctorList: [],
147
+      advicePrint: {},
148
+      patient: {},
149
+      tableData: [],
150
+      prescriptionInfo: [],
151
+      hisPatient: {},
152
+      department: [],
153
+      prescriptions: [],
154
+      projectList: [],
155
+      doc_name: "",
156
+      orgname: "",
157
+      diagnoses: [],
158
+      pageArr: [],
159
+      faber: {},
160
+      total: 0,
161
+      projectPrint: [],
162
+      time: "",
163
+      doctor: "",
164
+      org_id: "",
165
+      singleProjectPrint: [],
166
+      operatorMaps: {},
167
+    };
168
+  },
169
+  methods: {
170
+    getPatientCaseHistory() {
171
+      const params = {
172
+        patient_id: this.patient_id,
173
+      };
174
+      getPatientCaseHistory(params).then((response) => {
175
+        if (response.data.state == 1) {
176
+          var history = response.data.data.history;
177
+          // console.log("中国history222222", history);
178
+          this.history = history;
179
+        }
180
+      });
181
+    },
182
+    getAllDoctorList() {
183
+      getAllDoctorList().then((response) => {
184
+        if (response.data.state == 1) {
185
+          var doctor = response.data.data.doctor;
186
+
187
+          this.doctorList = doctor;
188
+        }
189
+      });
190
+    },
191
+
192
+    getDoctor(id) {
193
+      var name = "";
194
+      for (let i = 0; i < this.doctorList.length; i++) {
195
+        if (id == this.doctorList[i].admin_user_id) {
196
+          name = this.doctorList[i].user_name;
197
+        }
198
+      }
199
+      return name;
200
+    },
201
+    getTime(value, temp) {
202
+      if (value != undefined) {
203
+        return uParseTime(value, temp);
204
+      }
205
+      return "";
206
+    },
207
+
208
+    getPrescriptionPrint() {
209
+      var params = {
210
+        // patient_id:this.patient_id,
211
+        // record_date:this.record_date,
212
+        // prescription_id:this.prescription_id,
213
+        patient_id: this.patient_id,
214
+        record_date: this.record_date,
215
+        prescription_id: this.prescription_id,
216
+        ids: this.ids,
217
+        p_type: 2,
218
+      };
219
+      // console.log("params", params);
220
+      getPrescriptionPrint(params).then((response) => {
221
+        if (response.data.state == 1) {
222
+          var advicePrint = response.data.data.advicePrint;
223
+          // console.log("adviceprint9999", advicePrint);
224
+          this.advicePrint = advicePrint;
225
+          this.prescriptions = advicePrint;
226
+          // console.log("处方222222", this.prescriptions);
227
+          var hisPatient = response.data.data.hisPatient;
228
+          // console.log("hisPatient", hisPatient);
229
+          this.hisPatient = hisPatient;
230
+          let projectPrint = [];
231
+          let total = 0;
232
+          this.advicePrint.map((item) => {
233
+            // console.log("imte233232323232323223", item.project);
234
+            if (item.project.length > 0) {
235
+              item.project.map((it) => {
236
+                if (it.type == 2) {
237
+                  if (it.project.cost_classify == 3) {
238
+                    projectPrint.push(it);
239
+                    total += it.project.price * parseInt(it.count);
240
+                  }
241
+                }
242
+              });
243
+            }
244
+          });
245
+          this.doctorList_1 = response.data.data.eles;
246
+          // console.log(this.doctorList_1, "医生列表");
247
+          if (this.doctorList_1.length > 0) {
248
+            var operatorsLen = this.doctorList_1.length;
249
+            for (var index = 0; index < operatorsLen; index++) {
250
+              this.$set(
251
+                this.operatorMaps,
252
+                this.doctorList_1[index].creator,
253
+                this.doctorList_1[index]
254
+              );
255
+            }
256
+          }
257
+          let data2 = [];
258
+          projectPrint.map((item) => {
259
+            data2.push(item);
260
+          });
261
+          this.projectPrint = data2;
262
+          console.log("列表", this.projectPrint);
263
+          this.total = total.toFixed(2);
264
+          this.pre_time = this.advicePrint[0].pre_time;
265
+          this.doctor = this.advicePrint[0].doctor;
266
+
267
+          var projectlist = response.data.data.projectlist;
268
+
269
+          var projectlist = response.data.data.projectlist;
270
+          // console.log("所有项目列表", projectlist);
271
+          this.projectList = projectlist;
272
+          this.getPage();
273
+          let outputlist1Name = response.data.data.his.patient_info
274
+            ? JSON.parse(response.data.data.his.patient_info)
275
+            : {};
276
+          this.faber = outputlist1Name;
277
+        }
278
+      });
279
+    },
280
+    // 电子签名
281
+    setAdminUserES(id) {
282
+      // console.log(id, "id");
283
+      if (id == 0) {
284
+        return "";
285
+      }
286
+      if (id in this.operatorMaps) {
287
+        // console.log(this.operatorMaps, "this.operatorMaps");
288
+        return this.operatorMaps[id].url;
289
+      } else {
290
+        // console.log("po");
291
+        return "";
292
+      }
293
+    },
294
+    getHisPatientDetail() {
295
+      const params = {
296
+        patient_id: this.patient_id,
297
+      };
298
+      getHisPatientDetail(params).then((response) => {
299
+        if (response.data.state == 1) {
300
+          var hisPatient = response.data.data.hisPatient;
301
+          // console.log("挂号病人", hisPatient);
302
+          this.hisPatient = hisPatient;
303
+        }
304
+      });
305
+    },
306
+    getInitData() {
307
+      getInitData().then((response) => {
308
+        if (response.data.state == 1) {
309
+          this.department = response.data.data.department;
310
+          this.diagnoses = response.data.data.diagnose.sort(this.compare("id"));
311
+          // console.log("争端", this.diagnoses);
312
+        }
313
+      });
314
+    },
315
+    getDepart(id) {
316
+      var name = "";
317
+      for (let i = 0; i < this.department.length; i++) {
318
+        if (id == this.department[i].id) {
319
+          name = this.department[i].name;
320
+        }
321
+      }
322
+      return name;
323
+    },
324
+    getTotalOne(id) {
325
+      var total = 0;
326
+      var addtotal = 0;
327
+      for (let i = 0; i < this.prescriptions.length; i++) {
328
+        if (id == this.prescriptions[i].id) {
329
+          if (this.prescriptions[i].project != null) {
330
+            for (let a = 0; a < this.prescriptions[i].project.length; a++) {
331
+              total =
332
+                total +
333
+                this.prescriptions[i].project[a].price *
334
+                this.prescriptions[i].project[a].count;
335
+            }
336
+          }
337
+
338
+          if (this.prescriptions[i].additionalcharge != null) {
339
+            for (
340
+              let a = 0;
341
+              a < this.prescriptions[i].additionalcharge.length;
342
+              a++
343
+            ) {
344
+              addtotal =
345
+                addtotal +
346
+                this.prescriptions[i].additionalcharge[a].price *
347
+                this.prescriptions[i].additionalcharge[a].count;
348
+            }
349
+          }
350
+          addtotal = Math.floor(addtotal * 100) / 100;
351
+        }
352
+      }
353
+
354
+      for (let i = 0; i < this.prescriptions.length; i++) {
355
+        if (id == this.prescriptions[i].id) {
356
+          if (this.prescriptions[i].advices != null) {
357
+            for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
358
+              total =
359
+                total +
360
+                this.prescriptions[i].advices[a].price *
361
+                this.prescriptions[i].advices[a].prescribing_number;
362
+            }
363
+          }
364
+
365
+          if (this.prescriptions[i].additionalcharge != null) {
366
+            for (
367
+              let a = 0;
368
+              a < this.prescriptions[i].additionalcharge.length;
369
+              a++
370
+            ) {
371
+              addtotal =
372
+                addtotal +
373
+                this.prescriptions[i].additionalcharge[a].price *
374
+                this.prescriptions[i].additionalcharge[a].count;
375
+            }
376
+          }
377
+          addtotal = Math.floor(addtotal * 100) / 100;
378
+        }
379
+      }
380
+
381
+      return total + addtotal;
382
+    },
383
+
384
+    getProjectName(id) {
385
+      var project_name = "";
386
+      for (let i = 0; i < this.projectList.length; i++) {
387
+        if (id == this.projectList[i].id) {
388
+          project_name = this.projectList[i].project_name;
389
+        }
390
+      }
391
+      return project_name;
392
+    },
393
+
394
+    getDiagnosis(ids) {
395
+      let newIds = ids.split(",").sort(function (a, b) {
396
+        return a - b;
397
+      });
398
+
399
+      var name = "";
400
+      let nameArr = [];
401
+      for (let i = 0; i < this.diagnoses.length; i++) {
402
+        // if(id == this.diagnoses[i].id){
403
+        //    name = this.diagnoses[i].class_name
404
+        // }
405
+
406
+        if (newIds.indexOf(this.diagnoses[i].id.toString()) > -1) {
407
+          // name += diagnoses[i].class_name + ' '
408
+          nameArr.push(this.diagnoses[i].class_name);
409
+        }
410
+      }
411
+      let newNameArr = [];
412
+      nameArr.map((item, index) => {
413
+        if (item == "尿毒症") {
414
+          newNameArr.push(item);
415
+          nameArr.splice(index, 1, "");
416
+        }
417
+      });
418
+      newNameArr.push(...nameArr);
419
+      return newNameArr.join(" ");
420
+    },
421
+    compare(property) {
422
+      return function (a, b) {
423
+        var value1 = a[property];
424
+        var value2 = b[property];
425
+        return value1 - value2; //升序排序
426
+      };
427
+    },
428
+    getPage() {
429
+      this.page = 1;
430
+      this.pageArr = [];
431
+
432
+      this.advicePrint.map((item) => {
433
+        let arr = [];
434
+        item.pageArr = [];
435
+        if (item.advices.length <= 5) {
436
+          this.page = 1;
437
+          arr.push(item.advices.length);
438
+          item.pageArr.push(arr);
439
+        } else if (item.advices.length > 5) {
440
+          this.page = parseInt(item.advices.length / 5);
441
+          let num = item.advices.length % 5;
442
+          for (var i = 0; i < this.page; i++) {
443
+            item.pageArr.push([5]);
444
+          }
445
+          if (num != 0) {
446
+            item.pageArr.push([num]);
447
+          }
448
+        }
449
+      });
450
+      // console.log('this.pageArr',this.pageArr)
451
+    },
452
+    getName(list) {
453
+      console.log("list", list);
454
+      let new_list = [];
455
+      for (let i = 0; i < list.length; i++) {
456
+        if (list[i].aac031 == "1") {
457
+          new_list.push(list[i]);
458
+        }
459
+      }
460
+
461
+      switch (new_list[0].bcc334) {
462
+        case "A31001":
463
+          return "深圳医保1档";
464
+          break;
465
+        case "A31002":
466
+          return "深圳医保2档";
467
+
468
+          break;
469
+        case "A31003":
470
+          return "深圳医保3档";
471
+
472
+          break;
473
+        case "A31004":
474
+          return "二档(少儿)";
475
+
476
+          break;
477
+        case "A31005":
478
+          return "学生二档";
479
+
480
+          break;
481
+        case "A31006":
482
+          return "大学生二档";
483
+
484
+          break;
485
+        case "A32001":
486
+          return "在职公务员";
487
+          break;
488
+        case "A32002":
489
+          return "在职驻深公务员";
490
+
491
+          break;
492
+        case "A39301":
493
+          return "家属统筹医疗";
494
+
495
+          break;
496
+        case "A41001":
497
+          return "工伤在职";
498
+
499
+          break;
500
+        case "A51001":
501
+          return "生育在职";
502
+
503
+          break;
504
+        case "A52001":
505
+          return "生育医疗一档";
506
+
507
+          break;
508
+        case "A52002":
509
+          return "生育医疗一档";
510
+
511
+          break;
512
+        case "C31001":
513
+          return "一档医疗退休";
514
+
515
+          break;
516
+        case "C31002":
517
+          return "二档医疗退休";
518
+          break;
519
+      }
520
+    },
521
+  },
522
+  created() {
523
+    this.getAllDoctorList();
524
+    this.getInitData();
525
+    this.getPrescriptionPrint();
526
+    this.getHisPatientDetail();
527
+    this.getPatientCaseHistory();
528
+    var xtuser = this.$store.getters.xt_user;
529
+    this.orgname = xtuser.org.org_name;
530
+    this.org_id = this.$store.getters.xt_user.org_id;
531
+  },
532
+  watch: {
533
+    ids: function (val) {
534
+      this.ids = val;
535
+      this.getPrescriptionPrint();
536
+    },
537
+  },
538
+};
539
+</script>
540
+
541
+
542
+<style lang="scss" scoped>
543
+.prescription-print {
544
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
545
+  0 0 60px rgba(0, 0, 0, 0.06) inset;
546
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
547
+  0 0 40px rgba(0, 0, 0, 0.06) inset;
548
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
549
+  margin-bottom: 20px;
550
+  padding: 20px 10px;
551
+}
552
+.printTitle {
553
+  font-size: 22px;
554
+  text-align: center;
555
+  font-weight: bold;
556
+  margin-bottom: 10px;
557
+}
558
+.infoTitle {
559
+  display: flex;
560
+  margin-top: 10px;
561
+  line-height: 24px;
562
+}
563
+.infoTitle div {
564
+  width: 200px;
565
+}
566
+.infoMain {
567
+  display: flex;
568
+  flex-wrap: wrap;
569
+  margin-top: 10px;
570
+}
571
+.infoMain div {
572
+  width: 50%;
573
+  line-height: 24px;
574
+}
575
+.prescriptionBox {
576
+  padding: 0 10px;
577
+  min-height: 400px;
578
+}
579
+.Rp {
580
+  font-size: 22px;
581
+  font-weight: bold;
582
+}
583
+.drugsBox {
584
+  padding-left: 40px;
585
+  margin-bottom: 10px;
586
+}
587
+.drugsBox div {
588
+  line-height: 20px;
589
+}
590
+.drugsOne {
591
+  line-height: 24px;
592
+}
593
+.drugsOne span {
594
+  margin-right: 20px;
595
+}
596
+.doctorBox {
597
+  display: flex;
598
+  justify-content: space-between;
599
+  padding: 0 10px;
600
+  line-height: 24px;
601
+  border-bottom: 2px solid #000;
602
+}
603
+.actionBar {
604
+  display: flex;
605
+  justify-content: space-between;
606
+  line-height: 24px;
607
+  padding: 0 10px;
608
+}
609
+.actionBar p {
610
+  width: 150px;
611
+}
612
+.under_line {
613
+  display: inline-block;
614
+  border-bottom: 1px solid #000;
615
+  flex: 1;
616
+}
617
+</style>

+ 1 - 0
src/xt_pages/outpatientDoctorStation/template/printThree.vue Voir le fichier

34
               style="margin-left: 50px; border: 1px solid #000"
34
               style="margin-left: 50px; border: 1px solid #000"
35
               >精二</span
35
               >精二</span
36
             >
36
             >
37
+
37
           </div>
38
           </div>
38
           <div style="display: flex;">
39
           <div style="display: flex;">
39
             <div style="width: 33%; display: flex">
40
             <div style="width: 33%; display: flex">

+ 2 - 0
src/xt_pages/workforce/components/ScheduleItem.vue Voir le fichier

35
           },
35
           },
36
       },
36
       },
37
   },
37
   },
38
+
39
+
38
   methods:{
40
   methods:{
39
         modeColor(name){
41
         modeColor(name){
40
             if(name == 'HD'){
42
             if(name == 'HD'){

+ 142 - 81
src/xt_pages/workforce/components/editTableData.vue Voir le fichier

1542
             ref="changeSchedule"
1542
             ref="changeSchedule"
1543
             :rules="changeRules"
1543
             :rules="changeRules"
1544
             label-width="90px"
1544
             label-width="90px"
1545
+
1545
         >
1546
         >
1546
           <el-form-item label="排班日期: ">
1547
           <el-form-item label="排班日期: ">
1547
             <el-input v-model="currentData.schedule_date" disabled></el-input>
1548
             <el-input v-model="currentData.schedule_date" disabled></el-input>
1827
       </div>
1828
       </div>
1828
       <span slot="footer" class="dialog-footer">
1829
       <span slot="footer" class="dialog-footer">
1829
          <el-button
1830
          <el-button
1830
-           type="primary"
1831
-           @click="coverSch()"
1831
+           type="danger"
1832
+           @click="tipDialogVisibleTwo = true"
1832
          >替换</el-button>
1833
          >替换</el-button>
1833
             <el-button
1834
             <el-button
1834
               type="primary"
1835
               type="primary"
1835
-              @click="changeSchTwo()"
1836
+              @click="tipDialogVisibleThree = true"
1836
             >交换</el-button>
1837
             >交换</el-button>
1837
         <el-button @click="tipDialogVisible = false">取 消</el-button>
1838
         <el-button @click="tipDialogVisible = false">取 消</el-button>
1838
       </span>
1839
       </span>
1839
     </el-dialog>
1840
     </el-dialog>
1840
 
1841
 
1842
+    <el-dialog
1843
+      title="提示"
1844
+      :visible.sync="tipDialogVisibleTwo"
1845
+      width="300px"
1846
+    >
1847
+      <div>
1848
+        是否将此位置排班替换
1849
+      </div>
1850
+      <span slot="footer" class="dialog-footer">
1851
+         <el-button
1852
+           type="primary"
1853
+           @click="coverSch()"
1854
+         >确定</el-button>
1855
+
1856
+        <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
1857
+      </span>
1858
+    </el-dialog>
1859
+
1860
+
1861
+    <el-dialog
1862
+      title="提示"
1863
+      :visible.sync="tipDialogVisibleThree"
1864
+      width="300px"
1865
+    >
1866
+      <div>
1867
+        是否将此位置排班互换
1868
+      </div>
1869
+      <span slot="footer" class="dialog-footer">
1870
+         <el-button
1871
+           type="primary"
1872
+           @click="changeSchTwo()"
1873
+         >确定</el-button>
1874
+        <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
1875
+      </span>
1876
+    </el-dialog>
1877
+
1841
 
1878
 
1842
   </div>
1879
   </div>
1843
 </template>
1880
 </template>
1857
   BatchSmartSch,
1894
   BatchSmartSch,
1858
 } from "@/api/schedule_template/sch_template";
1895
 } from "@/api/schedule_template/sch_template";
1859
 import {
1896
 import {
1897
+  CancelScheduleTwo,
1860
   CancelSchedule,
1898
   CancelSchedule,
1861
   ChangeSchedule,
1899
   ChangeSchedule,
1862
   CreateSchedule,
1900
   CreateSchedule,
1930
 
1968
 
1931
   data() {
1969
   data() {
1932
     return {
1970
     return {
1971
+      tipDialogVisibleTwo:false,
1972
+      tipDialogVisibleThree:false,
1933
       cur_date:"",
1973
       cur_date:"",
1934
       dataloading:false,
1974
       dataloading:false,
1935
       current_patient_data:[],
1975
       current_patient_data:[],
1938
       saveloading: false,
1978
       saveloading: false,
1939
       zones: [],
1979
       zones: [],
1940
       weeks: weekOptions,
1980
       weeks: weekOptions,
1981
+      first_weeks:[],
1941
       smart_keyword: "",
1982
       smart_keyword: "",
1942
       cur_smart_patient_id: 0,
1983
       cur_smart_patient_id: 0,
1943
       cur_smart_patient_name: "",
1984
       cur_smart_patient_name: "",
2352
     },
2393
     },
2353
     handleClick() {
2394
     handleClick() {
2354
       if (this.editableTabsValue == "1") {
2395
       if (this.editableTabsValue == "1") {
2396
+
2397
+        console.log(this.first_weeks)
2398
+        console.log(this.weeks)
2399
+
2400
+
2355
         for (let i = 0; i < this.weeks.length; i++) {
2401
         for (let i = 0; i < this.weeks.length; i++) {
2356
           var tempDate = new Date();
2402
           var tempDate = new Date();
2357
           var day = tempDate.getDay();
2403
           var day = tempDate.getDay();
2364
             this.weeks[i].is_edit = false;
2410
             this.weeks[i].is_edit = false;
2365
           }
2411
           }
2366
         }
2412
         }
2413
+
2414
+        for(let i = 0; i < this.weeks.length; i++){
2415
+          for(let b = 0; b < this.first_weeks.length; b++){
2416
+            if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
2417
+              console.log(this.weeks[i].week_type)
2418
+              console.log(this.first_weeks[b].week_type)
2419
+              console.log(this.first_weeks[b].order_id)
2420
+
2421
+              this.weeks[i].is_edit = false
2422
+            }
2423
+
2424
+          }
2425
+        }
2426
+
2427
+
2428
+
2367
       } else {
2429
       } else {
2368
         for (let i = 0; i < this.weeks.length; i++) {
2430
         for (let i = 0; i < this.weeks.length; i++) {
2369
           this.weeks[i].is_edit = true;
2431
           this.weeks[i].is_edit = true;
2531
       console.log(delTempData)
2593
       console.log(delTempData)
2532
 
2594
 
2533
 
2595
 
2534
-
2535
-      for (let i = 0; i < delTempData.length; i++) {
2536
-        for (let  b = 0; b < saveOrEditTempData.length; b++) {
2537
-          if(delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
2538
-            delTempData.splice(i,1)
2596
+      if(saveOrEditTempData.length > 0 ){
2597
+        for (let i = 0; i < delTempData.length; i++) {
2598
+          for (let  b = 0; b < saveOrEditTempData.length; b++) {
2599
+            if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
2600
+              delTempData.splice(i,1)
2601
+            }
2539
           }
2602
           }
2540
         }
2603
         }
2541
-      }
2542
-      console.log(delTempData)
2543
 
2604
 
2605
+      }
2544
       for (let i = 0; i < saveOrEditTempData.length; i++) {
2606
       for (let i = 0; i < saveOrEditTempData.length; i++) {
2545
         if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
2607
         if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
2546
           this.$message.error("分区或者床位不能空");
2608
           this.$message.error("分区或者床位不能空");
2549
       }
2611
       }
2550
 
2612
 
2551
 
2613
 
2552
-      if (saveOrEditTempData.length > 0 ) {
2553
-
2614
+      if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
2554
 
2615
 
2555
         let obj = {
2616
         let obj = {
2556
           smart_schs: saveOrEditTempData,
2617
           smart_schs: saveOrEditTempData,
2557
           del_schs:delTempData,
2618
           del_schs:delTempData,
2558
         };
2619
         };
2559
-        this.saveloading = true;
2560
-        BatchSmartSch(obj, this.cur_smart_patient_id).then((response) => {
2561
-          if (response.data.state == 1) {
2562
-            this.saveloading = false;
2563
-
2564
-            this.$message.success("保存成功");
2565
-            this.smartVisible = false;
2566
-            this.smart_keyword = "";
2567
-            this.getSchedules();
2568
-          } else {
2569
-            this.saveloading = false;
2570
-            this.smart_keyword = "";
2620
+        if(!this.saveloading){
2621
+          this.saveloading = true;
2622
+          BatchSmartSch(obj, this.cur_smart_patient_id).then((response) => {
2623
+            if (response.data.state == 1) {
2624
+              this.saveloading = false;
2625
+
2626
+              this.$message.success("保存成功");
2627
+              this.smartVisible = false;
2628
+              this.smart_keyword = "";
2629
+              this.getSchedules();
2630
+            } else {
2631
+              this.saveloading = false;
2632
+              this.smart_keyword = "";
2633
+
2634
+              this.$message.error(response.data.msg);
2635
+              return;
2636
+            }
2637
+          });
2638
+
2639
+
2640
+        }
2571
 
2641
 
2572
-            this.$message.error(response.data.msg);
2573
-            return;
2574
-          }
2575
-        });
2576
       } else {
2642
       } else {
2577
         this.$message.success("保存成功");
2643
         this.$message.success("保存成功");
2578
       }
2644
       }
2624
       return "";
2690
       return "";
2625
     },
2691
     },
2626
     handleSelect(val) {
2692
     handleSelect(val) {
2627
-      this.dataloading = true
2693
+      this.first_weeks = []
2694
+        this.dataloading = true
2628
       getSmartSchByPatient(val.id).then((response) => {
2695
       getSmartSchByPatient(val.id).then((response) => {
2629
         this.dataloading = false
2696
         this.dataloading = false
2630
         var sch = response.data.data.sch
2697
         var sch = response.data.data.sch
2685
                   ) {
2752
                   ) {
2686
                     this.weeks[b].is_edit = true;
2753
                     this.weeks[b].is_edit = true;
2687
                   } else {
2754
                   } else {
2755
+                    let obj = {
2756
+                      week_type:this.weeks[b].week_type,
2757
+                      order_id:schedules[i].order.id,
2758
+                    }
2759
+                    this.first_weeks.push(obj)
2688
                     this.weeks[b].is_edit = false;
2760
                     this.weeks[b].is_edit = false;
2689
                   }
2761
                   }
2690
                   this.editableTabs[0].checkedWeek.push(this.weeks[b]);
2762
                   this.editableTabs[0].checkedWeek.push(this.weeks[b]);
2946
           tableWeekArrage: [],
3018
           tableWeekArrage: [],
2947
         },
3019
         },
2948
       ];
3020
       ];
2949
-
3021
+      this.first_weeks = []
2950
       getPatientSmartSch(params).then((response) => {
3022
       getPatientSmartSch(params).then((response) => {
2951
         if (response.data.state == 0) {
3023
         if (response.data.state == 0) {
2952
           return false;
3024
           return false;
2998
                 is_edit = true;
3070
                 is_edit = true;
2999
               }
3071
               }
3000
               obj.is_edit = is_edit;
3072
               obj.is_edit = is_edit;
3073
+              console.log("schedules[i].order.id")
3001
 
3074
 
3075
+              console.log(schedules[i].order.id)
3002
 
3076
 
3003
               for (let b = 0; b < this.weeks.length; b++) {
3077
               for (let b = 0; b < this.weeks.length; b++) {
3004
                 if (schedules[i].schedule_week == this.weeks[b].week_type) {
3078
                 if (schedules[i].schedule_week == this.weeks[b].week_type) {
3006
                       this.weeks[b].week_type >= day &&
3080
                       this.weeks[b].week_type >= day &&
3007
                       schedules[i].order.id == 0
3081
                       schedules[i].order.id == 0
3008
                   ) {
3082
                   ) {
3009
-
3010
                     this.weeks[b].is_edit = true;
3083
                     this.weeks[b].is_edit = true;
3011
                   } else {
3084
                   } else {
3085
+                    let obj = {
3086
+                      week_type:this.weeks[b].week_type,
3087
+                      order_id:schedules[i].order.id,
3088
+                    }
3089
+                    this.first_weeks.push(obj)
3012
                     this.weeks[b].is_edit = false;
3090
                     this.weeks[b].is_edit = false;
3013
                   }
3091
                   }
3014
 
3092
 
3196
 
3274
 
3197
 
3275
 
3198
 
3276
 
3199
-    },curInfoDragStart(){
3277
+    },
3278
+    curInfoDragStart(){
3200
       this.cur_drag_obj = 1
3279
       this.cur_drag_obj = 1
3201
       this.cur_drag_info.patient_id = this.cur_info.patient_id
3280
       this.cur_drag_info.patient_id = this.cur_info.patient_id
3202
       this.cur_drag_info.patient_name = this.cur_info.patient_name
3281
       this.cur_drag_info.patient_name = this.cur_info.patient_name
3273
     dragendTwo(event) {},
3352
     dragendTwo(event) {},
3274
     isEditForDate(day){
3353
     isEditForDate(day){
3275
       var week = this.weekDay(day);
3354
       var week = this.weekDay(day);
3276
-      console.log(this.weekDays[week[0] - 1].valueOf())
3277
-      console.log( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 )
3278
-      console.log(this.weekDays[week[0] - 1] >= this.cur_date)
3279
       if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
3355
       if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
3280
         return true
3356
         return true
3281
       }else{
3357
       }else{
3285
     },
3361
     },
3286
     drag(e, day, index, name, row) {
3362
     drag(e, day, index, name, row) {
3287
       e.preventDefault();
3363
       e.preventDefault();
3288
-      console.log("拖动前")
3289
-      console.log(row)
3290
       for (var key in row) {
3364
       for (var key in row) {
3291
         if (key == day) {
3365
         if (key == day) {
3292
           console.log(row[key].patient_id)
3366
           console.log(row[key].patient_id)
3293
 
3367
 
3294
           if(row[key].patient_id > 0 ) {
3368
           if(row[key].patient_id > 0 ) {
3295
             this.cur_drag_obj = 2
3369
             this.cur_drag_obj = 2
3296
-            console.log(row)
3297
             var week = this.weekDay(day);
3370
             var week = this.weekDay(day);
3298
             this.cur_drag_info.schedule_date = this.weekDays[week[0] - 1];
3371
             this.cur_drag_info.schedule_date = this.weekDays[week[0] - 1];
3299
             this.cur_drag_info.schedule_type = week[1];
3372
             this.cur_drag_info.schedule_type = week[1];
3315
     },
3388
     },
3316
     allowDrop(e) {
3389
     allowDrop(e) {
3317
       e.preventDefault();
3390
       e.preventDefault();
3318
-    },coverSch(){
3319
-      this.$confirm('是否将此位置排班替换?', '替换', {
3320
-        confirmButtonText: '确 定',
3321
-        cancelButtonText: '取 消',
3322
-        type: 'warning'
3323
-      }).then(() => {
3324
-        let params={
3325
-          id_one:this.cur_drag_info.id,
3326
-          id_two:this.currentData.id
3327
-
3328
-        }
3329
-        CoverSch(params).then((response) => {
3330
-          if (response.data.state == 0) {
3331
-            this.$message.error(response.data.msg);
3332
-          } else {
3333
-            this.$message.success("替换成功");
3334
-            this.tipDialogVisible = false
3335
-            this.getSchedules();
3391
+    },
3392
+    coverSch(){
3393
+      let params={
3394
+        id_one:this.cur_drag_info.id,
3395
+        id_two:this.currentData.id
3336
 
3396
 
3337
-          }
3338
-        });
3397
+      }
3398
+      CoverSch(params).then((response) => {
3399
+        if (response.data.state == 0) {
3400
+          this.$message.error(response.data.msg);
3401
+          this.tipDialogVisibleTwo = false
3339
 
3402
 
3340
-      })
3341
-        .catch(() => {
3342
-        })
3343
-
3344
-    },changeSchTwo(){
3345
-      this.$confirm('是否将此位置排班互换?', '交换', {
3346
-        confirmButtonText: '确 定',
3347
-        cancelButtonText: '取 消',
3348
-        type: 'warning'
3349
-      }).then(() => {
3403
+        } else {
3404
+          this.$message.success("替换成功");
3405
+          this.tipDialogVisible = false
3406
+          this.tipDialogVisibleTwo = false
3407
+          this.getSchedules();
3408
+        }
3409
+      });
3410
+    },
3411
+    changeSchTwo(){
3350
         let params={
3412
         let params={
3351
           id_one:this.cur_drag_info.id,
3413
           id_one:this.cur_drag_info.id,
3352
           id_two:this.currentData.id
3414
           id_two:this.currentData.id
3355
         ExchangeSch(params).then((response) => {
3417
         ExchangeSch(params).then((response) => {
3356
           if (response.data.state == 0) {
3418
           if (response.data.state == 0) {
3357
             this.$message.error(response.data.msg);
3419
             this.$message.error(response.data.msg);
3420
+            this.tipDialogVisibleThree = false
3358
           } else {
3421
           } else {
3359
             this.$message.success("交换成功");
3422
             this.$message.success("交换成功");
3360
             this.tipDialogVisible = false
3423
             this.tipDialogVisible = false
3424
+            this.tipDialogVisibleThree = false
3361
             this.getSchedules();
3425
             this.getSchedules();
3362
 
3426
 
3363
           }
3427
           }
3364
         });
3428
         });
3365
-      })
3366
-        .catch(() => {
3367
-        })
3368
-
3369
     },
3429
     },
3370
     //        ----------------------------------
3430
     //        ----------------------------------
3371
     //        | !在html里面的chedule-item里绑定的|
3431
     //        | !在html里面的chedule-item里绑定的|
3407
             if(this.cur_drag_obj == 2 ){
3467
             if(this.cur_drag_obj == 2 ){
3408
               if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
3468
               if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
3409
                 if(row[key].patient_id == 0) { //空床位
3469
                 if(row[key].patient_id == 0) { //空床位
3410
-                  CancelSchedule(this.cur_drag_info.id).then((response) => {
3470
+                  CancelScheduleTwo(this.cur_drag_info.id).then((response) => {
3411
                     if (response.data.state == 0) {
3471
                     if (response.data.state == 0) {
3412
                       this.$message.error(response.data.msg);
3472
                       this.$message.error(response.data.msg);
3413
                     } else {
3473
                     } else {
3437
                           }
3497
                           }
3438
                         }
3498
                         }
3439
                       });
3499
                       });
3500
+                      //接口提交排班数据
3501
+                      that.currentData.mode_id = that.cur_drag_info.mode_id;
3502
+                      that.currentData.id = 0;
3503
+                      that.currentData.contagions = [];
3504
+                      that.currentData.patient_id = that.cur_drag_info.patient_id;
3505
+                      that.currentData.patient = that.cur_drag_info.patient_name;
3506
+                      that.setSchedule();
3440
                     }
3507
                     }
3441
                   });
3508
                   });
3442
-                  //接口提交排班数据
3443
-                  this.currentData.mode_id = this.cur_drag_info.mode_id;
3444
-                  this.currentData.id = 0;
3445
-                  this.currentData.contagions = [];
3446
-                  this.currentData.patient_id = this.cur_drag_info.patient_id;
3447
-                  this.currentData.patient = this.cur_drag_info.patient_name;
3448
-                  this.setSchedule();
3509
+
3449
                 }else{  //非空,替換或者交換位置
3510
                 }else{  //非空,替換或者交換位置
3450
                   this.tipDialogVisible = true
3511
                   this.tipDialogVisible = true
3451
                 }
3512
                 }
4343
 
4404
 
4344
     // 删除某一单元格内的患者透析排班
4405
     // 删除某一单元格内的患者透析排班
4345
     deletePatientMode(row) {
4406
     deletePatientMode(row) {
4346
-
4407
+      console.log(row)
4347
       if (row.schedule_id > 0) {
4408
       if (row.schedule_id > 0) {
4348
         this.CancelSchedule(row.schedule_id);
4409
         this.CancelSchedule(row.schedule_id);
4349
       }
4410
       }

+ 1 - 0
src/xt_pages/workforce/template.vue Voir le fichier

451
       this.dataloading = false
451
       this.dataloading = false
452
     },
452
     },
453
     setTemplate(items){
453
     setTemplate(items){
454
+
454
       if(this.template_mode.mode == 1){
455
       if(this.template_mode.mode == 1){
455
         this.first_template = items[0]
456
         this.first_template = items[0]
456
       }else   if(this.template_mode.mode == 2){
457
       }else   if(this.template_mode.mode == 2){