huangyw 2 gadus atpakaļ
vecāks
revīzija
9e133f04c5

+ 0 - 2
src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/index.vue Parādīt failu

@@ -66,13 +66,11 @@ export default {
66 66
                 scanStyles: false
67 67
             });
68 68
         },500)
69
-
70 69
     },
71 70
     getAllDoctorList(){
72 71
       getAllDoctorList().then(response=>{
73 72
         if(response.data.state == 1){
74 73
                var doctor =  response.data.data.doctor
75
-
76 74
                this.doctorList = doctor
77 75
              }
78 76
          })

+ 25 - 19
src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/printOne.vue Parādīt failu

@@ -39,12 +39,13 @@
39 39
                   : ""
40 40
               }}
41 41
             </div>
42
-             <div
43
-                v-for="item in getSingleTeam(i.prescriptions)" :key="item"
44
-                style="margin-bottom: 10px"
45
-              >
46
-                金额:{{ item }}
47
-              </div>
42
+            <div
43
+              v-for="item in getSingleTeam(i.prescriptions)"
44
+              :key="item"
45
+              style="margin-bottom: 10px"
46
+            >
47
+              金额:{{ item }}
48
+            </div>
48 49
           </div>
49 50
           <div
50 51
             style="
@@ -91,7 +92,6 @@
91 92
               >
92 93
                 {{ item.team.project_team }}
93 94
               </div>
94
-             
95 95
             </div>
96 96
           </div>
97 97
           <div
@@ -148,7 +148,7 @@ export default {
148 148
       doctor: "",
149 149
       org_id: "",
150 150
       singleProjectPrint: [],
151
-      total_copy:[]
151
+      total_copy: [],
152 152
     };
153 153
   },
154 154
 
@@ -178,24 +178,30 @@ export default {
178 178
       return "";
179 179
     },
180 180
 
181
-
182 181
     getTeam(prescriptions, isUpdate = false) {
183
-      console.log(prescriptions, "prescriptions");
184 182
       let projectPrint = [];
185
-      let total = 0;
186
-      prescriptions.map((item) => {
183
+      prescriptions.forEach((item) => {
184
+        // !此为修改前的处理方法,因考虑到可能有逻辑错误的存在故注释,若后续需求以这个为准可放开此条!
185
+        // if (item.project.length > 0) {
186
+        //   item.project.map((it) => {
187
+        //     if (it.type == 2) {
188
+        //       if (it.project.cost_classify == 3) {
189
+        //         projectPrint.push(it);
190
+        //       }
191
+        //     }
192
+        //   });
193
+        // }
194
+
187 195
         if (item.project.length > 0) {
188 196
           item.project.map((it) => {
189
-            if (it.type == 2) {
190
-              if (it.project.cost_classify == 3) {
191
-                projectPrint.push(it);
192
-              }
193
-            }
197
+            projectPrint.push(it);
194 198
           });
195 199
         }
196 200
       });
201
+
197 202
       let data = [];
198 203
       projectPrint.map((item) => {
204
+        console.log(item, "999");
199 205
         if (item.team.id == 0) {
200 206
           data.push(item);
201 207
         } else {
@@ -227,8 +233,8 @@ export default {
227 233
           });
228 234
         }
229 235
       });
230
-      let total_copy=[]
231
-      total_copy.push(total.toFixed(2))
236
+      let total_copy = [];
237
+      total_copy.push(total.toFixed(2));
232 238
       return total_copy;
233 239
     },
234 240
 

+ 9 - 14
src/xt_pages/outpatientDoctorStation/batch_print_template/index.vue Parādīt failu

@@ -67,7 +67,7 @@ export default {
67 67
        patient_id:"",
68 68
        prescription_id:"",
69 69
        ids:'',
70
-       paramsObj:{},
70
+      //  paramsObj:{},
71 71
        org_id:''
72 72
     };
73 73
   },
@@ -148,7 +148,6 @@ export default {
148 148
       this.patient_id = row.patient_id
149 149
       this.record_date = this.record_date
150 150
       this.prescription_id = this.prescription_id
151
-      console.log("row",row)
152 151
         // var params = {
153 152
         //   patient_id:row.patient_id,
154 153
         //   record_date:this.record_date,
@@ -178,21 +177,17 @@ export default {
178 177
   },
179 178
 
180 179
   created() {
181
-    this.org_id = this.$store.getters.xt_user.org_id
182
-    this.getAllDoctorList()
183
-    var record_date = this.paramsObj.record
184
-    this.record_date = record_date
185
-    console.log("record_date",record_date)
186
-    var prescription_id = this.paramsObj.prescription_id
187
-    this.prescription_id = prescription_id
188
-    this.patient_id = this.paramsObj.patient_id
189
-    this.ids = this.paramsObj.ids
190
-    // var record_date = this.$route.query.record
180
+    // console.log(this.paramsObj,'打印测试')
181
+    // this.org_id = this.$store.getters.xt_user.org_id
182
+    // this.getAllDoctorList()
183
+    // var record_date = this.paramsObj.record
191 184
     // this.record_date = record_date
192 185
     // console.log("record_date",record_date)
193
-    // var prescription_id = this.$route.query.prescription_id
186
+    // var prescription_id = this.paramsObj.prescription_id
194 187
     // this.prescription_id = prescription_id
195
-    this.getAllHisPatientList(record_date)
188
+    // this.patient_id = this.paramsObj.patient_id
189
+    // this.ids = this.paramsObj.ids
190
+    // this.getAllHisPatientList(record_date)
196 191
   },
197 192
   watch:{
198 193
     // paramsObj:{//深度监听,可监听到对象、数组的变化

+ 397 - 286
src/xt_pages/outpatientDoctorStation/batch_print_template/printOne.vue Parādīt failu

@@ -1,340 +1,451 @@
1 1
 <template>
2
-  <div id='prescriptionPrint'>
3
-    <div v-for="(i,index) in printData" :key="index">
4
-      <div v-for="(item,index) in i.prescriptions" :key="index">
5
-        <div id='prescription-print' class="prescription-print" style="page-break-after: always;">
6
-            <div class="printTitle" v-if="item.med_type == '1111'">{{orgname}}第一类精神处方笺</div>
7
-            <div class="printTitle"  v-if="item.med_type == '1112'">{{orgname}}第二类精神处方笺</div>
8
-            <div class="printTitle" v-if="item.med_type != '1111' && item.med_type != '1112'">{{orgname}}处方笺</div>
9
-            <!--<div class="printTitle">{{orgname}}处方笺</div>-->
10
-            <div class="infoTitle">
11
-                <p>姓名:{{i.his_patient.id != 0?i.his_patient.name:i.name}}</p>
12
-                <p>性别:
13
-                  <span>
14
-                    <span v-if="i.gender == 1">男</span>
15
-                    <span v-if="i.gender == 2">女</span>
16
-                  </span>
17
-                </p>
18
-                <p>年龄:{{i.his_patient.id != 0?getAge(i.his_patient):i.age}}岁</p>
2
+  <div id="prescriptionPrint">
3
+    <div v-for="(i, index) in printData" :key="index">
4
+      <div v-for="(item, index) in i.prescriptions" :key="index">
5
+        <div
6
+          id="prescription-print"
7
+          class="prescription-print"
8
+          style="page-break-after: always"
9
+        >
10
+          <div class="printTitle" v-if="item.med_type == '1111'">
11
+            {{ orgname }}第一类精神处方笺
12
+          </div>
13
+          <div class="printTitle" v-if="item.med_type == '1112'">
14
+            {{ orgname }}第二类精神处方笺
15
+          </div>
16
+          <div
17
+            class="printTitle"
18
+            v-if="item.med_type != '1111' && item.med_type != '1112'"
19
+          >
20
+            {{ orgname }}处方笺
21
+          </div>
22
+          <!--<div class="printTitle">{{orgname}}处方笺</div>-->
23
+          <div class="infoTitle">
24
+            <p>
25
+              姓名:{{ i.his_patient.id != 0 ? i.his_patient.name : i.name }}
26
+            </p>
27
+            <p>
28
+              性别:
29
+              <span>
30
+                <span v-if="i.gender == 1">男</span>
31
+                <span v-if="i.gender == 2">女</span>
32
+              </span>
33
+            </p>
34
+            <p>
35
+              年龄:{{
36
+                i.his_patient.id != 0 ? getAge(i.his_patient) : i.age
37
+              }}岁
38
+            </p>
39
+          </div>
40
+          <div class="infoMain">
41
+            <div style="margin-bottom: 10px">
42
+              门诊号:{{ i.his_patient.id != 0 ? i.his_patient.number : "" }}
19 43
             </div>
20
-            <div class="infoMain">
21
-                <div style="margin-bottom: 10px;">门诊号:{{i.his_patient.id != 0?i.his_patient.number:""}}</div>
22
-                <div style="margin-bottom: 10px;">科室:{{i.his_patient.id != 0?getDepart(i.his_patient.departments):''}}</div>
23
-                <div style="margin-bottom: 10px;">医保卡号:{{i.his_patient.id != 0?i.his_patient.id_card_no:""}}</div>
24
-                <div style="margin-bottom: 10px;" v-if="org_id != 10188">电话:{{i.phone}}</div>
25
-                <div style="margin-bottom: 10px;" v-else>日期:{{getTime(i.info.ctime)?getTime(i.info.ctime):""}}</div>
26
-                <div>地址:{{i.home_address}}</div>
27
-                <div style="display:flex;width:50%;">临床诊断:{{getDiagnosis(i.info.diagnosis)}}</div>
44
+            <div style="margin-bottom: 10px">
45
+              科室:{{
46
+                i.his_patient.id != 0
47
+                  ? getDepart(i.his_patient.departments)
48
+                  : ""
49
+              }}
28 50
             </div>
29
-            <div class="prescriptionBox">
30
-                <div class="Rp">Rp:</div>
31
-                <div class="drugsBox" v-for="(it,index) in item.advices" :key="index">
32
-                    <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div> -->
33
-                    <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;<span v-if="it.drug.min_unit != it.drug.dose_unit">{{it.drug.dose}}{{it.drug.dose_unit}}&nbsp;* &nbsp;</span>{{it.drug.min_number}}{{it.drug.min_unit}}/{{it.drug.max_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div>
34
-                    <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.execution_frequency}}&nbsp;{{it.delivery_way}}&nbsp;</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
35
-                </div>
36
-                <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
37
-                  <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
38
-                </div>
39
-
40
-                <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
41
-                    <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.type == 2?getProjectName(it.project_id)?getProjectName(it.project_id):"":it.good_info.good_name}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
42
-                    <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
43
-                </div>
44
-                <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
45
-                  <div class="drugsOne">{{it.project_id?it.project_id:""}}:&nbsp;{{it.price.toFixed(2)}}元/{{it.count}}次</div>
46
-                </div>
47
-                <div style="text-align:center;" >(以下空白)</div>
48
-
51
+            <div style="margin-bottom: 10px">
52
+              医保卡号:{{
53
+                i.his_patient.id != 0 ? i.his_patient.id_card_no : ""
54
+              }}
55
+            </div>
56
+            <div style="margin-bottom: 10px" v-if="org_id != 10188">
57
+              电话:{{ i.phone }}
58
+            </div>
59
+            <div style="margin-bottom: 10px" v-else>
60
+              日期:{{ getTime(i.info.ctime) ? getTime(i.info.ctime) : "" }}
61
+            </div>
62
+            <div>地址:{{ i.home_address }}</div>
63
+            <div style="display: flex; width: 50%">
64
+              临床诊断:{{ getDiagnosis(i.info.diagnosis)}}
65
+            </div>
66
+          </div>
67
+          <div class="prescriptionBox">
68
+            <div class="Rp">Rp:</div>
69
+            <div
70
+              class="drugsBox"
71
+              v-for="(it, index) in item.advices"
72
+              :key="index"
73
+            >
74
+              <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div> -->
75
+              <div class="drugsOne">
76
+                <span style="font-weight: bold">{{ index + 1 + "." }}</span
77
+                >{{ it.advice_name ? it.advice_name : "" }}&nbsp;&nbsp;<span
78
+                  v-if="it.drug.min_unit != it.drug.dose_unit"
79
+                  >{{ it.drug.dose }}{{ it.drug.dose_unit }}&nbsp;* &nbsp;</span
80
+                >{{ it.drug.min_number }}{{ it.drug.min_unit }}/{{
81
+                  it.drug.max_unit
82
+                }}&nbsp;×&nbsp; {{ it.prescribing_number
83
+                }}{{ it.prescribing_number_unit }}
84
+              </div>
85
+              <div style="margin-left: 100px">
86
+                <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
87
+                >&nbsp;&nbsp;<span
88
+                  >{{ it.execution_frequency }}&nbsp;{{
89
+                    it.delivery_way
90
+                  }}&nbsp;</span
91
+                >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
92
+              </div>
49 93
             </div>
50
-            <div class="doctorBox" v-if="org_id != 10188">
51
-                <p>医师:{{i.info.doctor?i.info.doctor:""}}</p>
52
-                <p>日期:{{getTime(i.info.ctime)?getTime(i.info.ctime):""}}</p>
94
+            <div
95
+              class="drugsBox"
96
+              v-for="(it, i) in item.additionalcharge"
97
+              :key="i"
98
+            >
99
+              <div class="drugsOne">
100
+                {{ it.item_name ? it.item_name : "" }}:&nbsp;{{ it.price }}元/{{
101
+                  it.count
102
+                }}次
103
+              </div>
53 104
             </div>
54
-            <div class="doctorBox" v-else>
55
-              <p>药师:</p>
56
-              <p>医师:{{i.info.doctor?i.info.doctor:""}}</p>
105
+
106
+            <div
107
+              class="drugsBox"
108
+              v-for="(it, index) in item.project"
109
+              :key="index"
110
+            >
111
+              <div class="drugsOne">
112
+                <span style="font-weight: bold">{{ index + 1 + "." }}</span
113
+                >{{
114
+                  it.type == 2
115
+                    ? getProjectName(it.project_id)
116
+                      ? getProjectName(it.project_id)
117
+                      : ""
118
+                    : it.good_info.good_name
119
+                }}&nbsp;&nbsp;{{ it.single_dose
120
+                }}{{ it.single_dose_unit }}&nbsp;×&nbsp; {{ it.count
121
+                }}{{ unit }}
122
+              </div>
123
+              <div style="margin-left: 100px">
124
+                <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
125
+                >&nbsp;&nbsp;<span>{{ it.delivery_way }}</span
126
+                >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
127
+              </div>
128
+            </div>
129
+            <div
130
+              class="drugsBox"
131
+              v-for="(it, i) in item.additionalcharge"
132
+              :key="i"
133
+            >
134
+              <div class="drugsOne">
135
+                {{ it.project_id ? it.project_id : "" }}:&nbsp;{{
136
+                  it.price.toFixed(2)
137
+                }}元/{{ it.count }}次
138
+              </div>
57 139
             </div>
58
-            <div class="actionBar" v-if="org_id != 10188">
59
-                  <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
140
+            <div style="text-align: center">(以下空白)</div>
141
+          </div>
142
+          <div class="doctorBox" v-if="org_id != 10188">
143
+            <p>医师:{{ i.info.doctor ? i.info.doctor : "" }}</p>
144
+            <p>
145
+              日期:{{ getTime(i.info.ctime) ? getTime(i.info.ctime) : "" }}
146
+            </p>
147
+          </div>
148
+          <div class="doctorBox" v-else>
149
+            <p>药师:</p>
150
+            <p>医师:{{ i.info.doctor ? i.info.doctor : "" }}</p>
151
+          </div>
152
+          <div class="actionBar" v-if="org_id != 10188">
153
+            <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
60 154
                   <p>配对:</p>
61 155
                   <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
62 156
                   <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
63 157
                   <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p> -->
64 158
 
65
-                  <p>审核:</p>
66
-                  <p>配对:</p>
67
-                  <p>核对:</p>
68
-                  <p>发药:</p>
69
-                  <p>药费:{{getTotalOne(item.advices).toFixed(2)?getTotalOne(item.advices).toFixed(2):0}}元</p>
70
-  <!--            <p>药费:466.2元</p>-->
71
-
72
-            </div>
73
-            <div class="actionBar" v-else>
74
-              <p style="visibility: hidden;">审核:</p>
75
-              <p style="visibility: hidden;">配对:</p>
76
-              <p style="visibility: hidden;">核对:</p>
77
-              <p style="visibility: hidden;">发药:</p>
78
-              <p>药费:{{getTotalOne(item.advices).toFixed(2)?getTotalOne(item.advices).toFixed(2):0}}元</p>
79
-  <!--            <p>药费:551.2元</p>-->
80
-  <!--            <p>药费:466.2元</p>-->
81
-
82
-
83
-            </div>
84
-            <div style="page-break-after:always"></div>
159
+            <p>审核:</p>
160
+            <p>配对:</p>
161
+            <p>核对:</p>
162
+            <p>发药:</p>
163
+            <p>
164
+              药费:{{
165
+                getTotalOne(item.advices).toFixed(2)
166
+                  ? getTotalOne(item.advices).toFixed(2)
167
+                  : 0
168
+              }}元
169
+            </p>
170
+            <!--            <p>药费:466.2元</p>-->
171
+          </div>
172
+          <div class="actionBar" v-else>
173
+            <p style="visibility: hidden">审核:</p>
174
+            <p style="visibility: hidden">配对:</p>
175
+            <p style="visibility: hidden">核对:</p>
176
+            <p style="visibility: hidden">发药:</p>
177
+            <p>
178
+              药费:{{
179
+                getTotalOne(item.advices).toFixed(2)
180
+                  ? getTotalOne(item.advices).toFixed(2)
181
+                  : 0
182
+              }}元
183
+            </p>
184
+            <!--            <p>药费:551.2元</p>-->
185
+            <!--            <p>药费:466.2元</p>-->
186
+          </div>
187
+          <div style="page-break-after: always"></div>
85 188
         </div>
86 189
       </div>
87 190
     </div>
88 191
   </div>
89
-
90
-
91 192
 </template>
92 193
 <script>
93
-import { jsGetAge, uParseTime } from '@/utils/tools'
94
-import {getAllDoctorList,getPrescriptionPrint,getHisPatientDetail} from "@/api/project/project"
95
-import {getInitData} from "@/api/his/his"
194
+import { jsGetAge, uParseTime } from "@/utils/tools";
195
+import {
196
+  getAllDoctorList,
197
+  getPrescriptionPrint,
198
+  getHisPatientDetail,
199
+} from "@/api/project/project";
200
+import { getInitData } from "@/api/his/his";
96 201
 export default {
97
-    props:{
98
-      patient_id:Number,
99
-      record_date:String,
100
-      prescription_id:Number,
101
-      ids:String,
102
-      printData:Array
103
-    },
104
-    data(){
105
-      return {
106
-        doctorList:[],
107
-        advicePrint:{},
108
-        patient:{},
109
-        tableData:[],
110
-        prescriptionInfo:[],
111
-        hisPatient:{},
112
-        department:[],
113
-        prescriptions:[],
114
-        projectList:[],
115
-        orgname:"",
116
-        diagnoses:[],
117
-        org_id: 0
202
+  props: {
203
+    patient_id: String,
204
+    record_date: String,
205
+    prescription_id: String,
206
+    ids: String,
207
+    printData: Array,
208
+  },
209
+  data() {
210
+    return {
211
+      doctorList: [],
212
+      advicePrint: {},
213
+      patient: {},
214
+      tableData: [],
215
+      prescriptionInfo: [],
216
+      hisPatient: {},
217
+      department: [],
218
+      prescriptions: [],
219
+      projectList: [],
220
+      orgname: "",
221
+      diagnoses: [],
222
+      org_id: 0,
223
+    };
224
+  },
225
+  methods: {
226
+    getAge(patient) {
227
+      var thisLen = patient.id_card_no.length;
228
+      var birth = "";
229
+      if (thisLen == 15) {
230
+        birth = "19" + patient.id_card_no.substr(6, 6);
231
+      } else {
232
+        birth = patient.id_card_no.substr(6, 8);
118 233
       }
234
+      var births =
235
+        birth.substr(0, 4) +
236
+        "-" +
237
+        birth.substr(4, 2) +
238
+        "-" +
239
+        birth.substr(6, 2);
240
+      return jsGetAge(births, "-");
119 241
     },
120
-   methods:{
121
-     getAge(patient){
122
-       var thisLen = patient.id_card_no.length
123
-       var birth = ''
124
-       if (thisLen == 15) {
125
-         birth = '19' + patient.id_card_no.substr(6, 6)
126
-       } else {
127
-         birth = patient.id_card_no.substr(6, 8)
128
-       }
129
-       var births =
130
-         birth.substr(0, 4) +
131
-         '-' +
132
-         birth.substr(4, 2) +
133
-         '-' +
134
-         birth.substr(6, 2)
135
-       return jsGetAge(births, '-')
136
-
137
-     },
138 242
 
139
-     getAllDoctorList(){
140
-      getAllDoctorList().then(response=>{
141
-        if(response.data.state == 1){
142
-               var doctor =  response.data.data.doctor
243
+    getAllDoctorList() {
244
+      getAllDoctorList().then((response) => {
245
+        if (response.data.state == 1) {
246
+          var doctor = response.data.data.doctor;
143 247
 
144
-               this.doctorList = doctor
145
-             }
146
-         })
147
-     },
248
+          this.doctorList = doctor;
249
+        }
250
+      });
251
+    },
148 252
 
149
-      getDoctor(id){
150
-        var name = ""
151
-        for(let i=0;i<this.doctorList.length;i++){
152
-          if(id == this.doctorList[i].admin_user_id){
153
-              name = this.doctorList[i].user_name
154
-          }
253
+    getDoctor(id) {
254
+      var name = "";
255
+      for (let i = 0; i < this.doctorList.length; i++) {
256
+        if (id == this.doctorList[i].admin_user_id) {
257
+          name = this.doctorList[i].user_name;
155 258
         }
156
-        return name
157
-      },
158
-      getTime(value, temp) {
159
-        if (value != undefined) {
160
-            return uParseTime(value, temp)
259
+      }
260
+      return name;
261
+    },
262
+    getTime(value, temp) {
263
+      if (value != undefined) {
264
+        return uParseTime(value, temp);
265
+      }
266
+      return "";
267
+    },
268
+    getPrescriptionPrint() {
269
+      var params = {
270
+        // patient_id:this.patient_id,
271
+        // record_date:this.record_date,
272
+        // prescription_id:this.prescription_id,
273
+        patient_id: this.patient_id,
274
+        record_date: this.record_date,
275
+        prescription_id: this.prescription_id,
276
+        ids: this.ids,
277
+      };
278
+      console.log("params", params);
279
+      getPrescriptionPrint(params).then((response) => {
280
+        if (response.data.state == 1) {
281
+          var advicePrint = response.data.data.advicePrint;
282
+          console.log("adviceprint9999", advicePrint);
283
+          this.advicePrint = advicePrint;
284
+          this.prescriptions = advicePrint;
285
+          console.log("处方222222", this.prescriptions);
286
+          var hisPatient = response.data.data.hisPatient;
287
+          console.log("hisPatient", hisPatient);
288
+          this.hisPatient = hisPatient;
289
+          var projectlist = response.data.data.projectlist;
290
+          console.log("所有项目列表", projectlist);
291
+          this.projectList = projectlist;
161 292
         }
162
-        return ''
163
-     },
164
-       getPrescriptionPrint(){
165
-         var params = {
166
-          // patient_id:this.patient_id,
167
-          // record_date:this.record_date,
168
-          // prescription_id:this.prescription_id,
169
-          patient_id:this.patient_id,
170
-          record_date:this.record_date,
171
-          prescription_id:this.prescription_id,
172
-          ids:this.ids
293
+      });
294
+    },
295
+    getHisPatientDetail() {
296
+      const params = {
297
+        patient_id: this.patient_id,
298
+      };
299
+      getHisPatientDetail(params).then((response) => {
300
+        if (response.data.state == 1) {
301
+          var hisPatient = response.data.data.hisPatient;
302
+          console.log("挂号病人", hisPatient);
303
+          this.hisPatient = hisPatient;
173 304
         }
174
-        console.log("params",params)
175
-       getPrescriptionPrint(params).then(response=>{
176
-         if(response.data.state == 1){
177
-            var advicePrint =  response.data.data.advicePrint
178
-            console.log("adviceprint9999",advicePrint)
179
-            this.advicePrint = advicePrint
180
-            this.prescriptions = advicePrint
181
-            console.log("处方222222",this.prescriptions)
182
-            var hisPatient = response.data.data.hisPatient
183
-            console.log("hisPatient",hisPatient)
184
-            this.hisPatient = hisPatient
185
-            var projectlist =  response.data.data.projectlist
186
-            console.log("所有项目列表",projectlist)
187
-            this.projectList = projectlist
188
-          }
189
-       })
190
-     },
191
-     getHisPatientDetail(){
192
-          const params = {
193
-              patient_id:this.patient_id
194
-          }
195
-       getHisPatientDetail(params).then(response=>{
196
-          if(response.data.state == 1){
197
-             var hisPatient =  response.data.data.hisPatient
198
-             console.log("挂号病人",hisPatient)
199
-             this.hisPatient = hisPatient
200
-          }
201
-       })
202
-     },
203
-     getInitData(){
204
-       getInitData().then(response=>{
205
-          if(response.data.state == 1){
206
-            this.department = response.data.data.department
207
-            this.diagnoses = response.data.data.diagnose
208
-            console.log("争端",this.diagnoses)
209
-          }
210
-       })
211
-     },
212
-     getDepart(id){
213
-         var name = ""
214
-       for(let i=0;i<this.department.length;i++){
215
-           if(id == this.department[i].id){
216
-               name = this.department[i].name
217
-           }
218
-       }
219
-       return name
220
-     },
305
+      });
306
+    },
307
+    getInitData() {
308
+      getInitData().then((response) => {
309
+        if (response.data.state == 1) {
310
+          this.department = response.data.data.department;
311
+          this.diagnoses = response.data.data.diagnose;
312
+          console.log("争端", this.diagnoses);
313
+        }
314
+      });
315
+    },
316
+    getDepart(id) {
317
+      var name = "";
318
+      for (let i = 0; i < this.department.length; i++) {
319
+        if (id == this.department[i].id) {
320
+          name = this.department[i].name;
321
+        }
322
+      }
323
+      return name;
324
+    },
221 325
     getTotalOne(advices) {
222
-      let total = 0
223
-      advices.map(item => {
224
-        total += item.price * item.prescribing_number
225
-      })
226
-      return total
326
+      let total = 0;
327
+      advices.map((item) => {
328
+        total += item.price * item.prescribing_number;
329
+      });
330
+      return total;
227 331
     },
228 332
 
229
-     getProjectName(id){
230
-        var project_name = ""
231
-        for(let i=0;i<this.projectList.length;i++){
232
-           if(id == this.projectList[i].id){
233
-               project_name = this.projectList[i].project_name
234
-           }
333
+    getProjectName(id) {
334
+      var project_name = "";
335
+      for (let i = 0; i < this.projectList.length; i++) {
336
+        if (id == this.projectList[i].id) {
337
+          project_name = this.projectList[i].project_name;
235 338
         }
236
-        return project_name
237
-     },
339
+      }
340
+      return project_name;
341
+    },
342
+
343
+    getDiagnosis(id) {
344
+      let id_ = id.split(",");
345
+      let nameArr = [];
346
+      let name = "";
238 347
 
239
-     getDiagnosis(id){
240
-        var name = ""
241
-        for(let i=0;i<this.diagnoses.length;i++){
242
-          if(id == this.diagnoses[i].id){
243
-             name = this.diagnoses[i].class_name
348
+      for (let i = 0; i < this.diagnoses.length; i++) {
349
+        for (let j = 0; j < id_.length; j++) {
350
+          if (id_[j] == this.diagnoses[i].id) {
351
+            nameArr[j] = this.diagnoses[i].class_name;
352
+            name = nameArr.join(',')
244 353
           }
245 354
         }
246
-        return name
247
-     }
248
-
249
-   },
250
-   created(){
251
-      console.log('this.printData',this.printData)
252
-      // this.getAllDoctorList()
253
-      this.getInitData()
254
-      // this.getPrescriptionPrint()
255
-      // this.getHisPatientDetail()
256
-      var xtuser = this.$store.getters.xt_user;
257
-      this.orgname = xtuser.org.org_name;
258
-      this.org_id = xtuser.org.id
259
-   },
260
-   watch:{
261
-     ids:function(val){
262
-      this.ids = val
355
+      }
356
+      return name;
357
+    },
358
+  },
359
+  created() {
360
+    console.log("this.printData", this.printData);
361
+    // this.getAllDoctorList()
362
+    this.getInitData();
363
+    // this.getPrescriptionPrint()
364
+    // this.getHisPatientDetail()
365
+    var xtuser = this.$store.getters.xt_user;
366
+    this.orgname = xtuser.org.org_name;
367
+    this.org_id = xtuser.org.id;
368
+  },
369
+  watch: {
370
+    ids: function (val) {
371
+      this.ids = val;
263 372
       // this.getPrescriptionPrint()
264
-    }
265
-   }
266
-}
373
+    },
374
+  },
375
+};
267 376
 </script>
268 377
 
269 378
 
270 379
 <style lang="scss" scoped>
271
-.prescription-print{
272
-  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
273
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
274
-    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
275
-    margin-bottom: 20px;
276
-    padding:20px 10px;
380
+.prescription-print {
381
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
382
+    0 0 60px rgba(0, 0, 0, 0.06) inset;
383
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
384
+    0 0 40px rgba(0, 0, 0, 0.06) inset;
385
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
386
+  margin-bottom: 20px;
387
+  padding: 20px 10px;
277 388
 }
278
-.printTitle{
279
-    font-size: 22px;
280
-    text-align: center;
281
-    font-weight: bold;
389
+.printTitle {
390
+  font-size: 22px;
391
+  text-align: center;
392
+  font-weight: bold;
282 393
 }
283
-.infoTitle{
284
-    display: flex;
285
-    border-bottom: 2px solid #000;
286
-    margin-top:10px;
287
-    line-height: 24px;
288
-    padding:0 10px;
394
+.infoTitle {
395
+  display: flex;
396
+  border-bottom: 2px solid #000;
397
+  margin-top: 10px;
398
+  line-height: 24px;
399
+  padding: 0 10px;
289 400
 }
290
-.infoTitle p{
291
-    width: 200px;
401
+.infoTitle p {
402
+  width: 200px;
292 403
 }
293
-.infoMain{
294
-    display: flex;
295
-    flex-wrap: wrap;
296
-    border-bottom: 2px solid #000;
297
-    padding:0 10px;
404
+.infoMain {
405
+  display: flex;
406
+  flex-wrap: wrap;
407
+  border-bottom: 2px solid #000;
408
+  padding: 0 10px;
298 409
 }
299
-.infoMain div{
300
-    width: 50%;
301
-    line-height: 24px;
410
+.infoMain div {
411
+  width: 50%;
412
+  line-height: 24px;
302 413
 }
303
-.prescriptionBox{
304
-    padding:0 10px;
305
-    min-height:450px;
414
+.prescriptionBox {
415
+  padding: 0 10px;
416
+  min-height: 450px;
306 417
 }
307
-.Rp{
308
-    font-size: 22px;
309
-    font-weight: bold;
418
+.Rp {
419
+  font-size: 22px;
420
+  font-weight: bold;
310 421
 }
311
-.drugsBox{
312
-    padding-left: 40px;
313
-    margin-bottom: 10px;
422
+.drugsBox {
423
+  padding-left: 40px;
424
+  margin-bottom: 10px;
314 425
 }
315
-.drugsBox div{
316
-    line-height: 20px;
426
+.drugsBox div {
427
+  line-height: 20px;
317 428
 }
318
-.drugsOne{
319
-    line-height: 24px;
429
+.drugsOne {
430
+  line-height: 24px;
320 431
 }
321
-.drugsOne span{
322
-    margin-right: 20px;
432
+.drugsOne span {
433
+  margin-right: 20px;
323 434
 }
324
-.doctorBox{
325
-    display: flex;
326
-    justify-content: space-between;
327
-    padding:0 10px;
328
-    line-height: 24px;
329
-    border-bottom: 2px solid #000;
435
+.doctorBox {
436
+  display: flex;
437
+  justify-content: space-between;
438
+  padding: 0 10px;
439
+  line-height: 24px;
440
+  border-bottom: 2px solid #000;
330 441
 }
331
-.actionBar{
332
-    display: flex;
333
-    justify-content: space-between;
334
-    line-height: 24px;
335
-    padding:0 10px;
442
+.actionBar {
443
+  display: flex;
444
+  justify-content: space-between;
445
+  line-height: 24px;
446
+  padding: 0 10px;
336 447
 }
337
-.actionBar p{
338
-    width:150px;
448
+.actionBar p {
449
+  width: 150px;
339 450
 }
340 451
 </style>

+ 18 - 6
src/xt_pages/outpatientDoctorStation/batch_print_treatTemplate/printOne.vue Parādīt failu

@@ -35,7 +35,7 @@
35 35
                 </div>
36 36
                 <div style="margin-bottom: 10px;width:25%">参保类型:{{i.his_patient.id != 0?i.his_patient.social_type:''}}
37 37
                 </div>
38
-                <div style="margin-bottom: 10px;width:50%;">联系电话:{{i.his_patient.id != 0 ? i.his_patient.phone_number : i.phone}}</div>
38
+                <div style="margin-bottom: 10px;width:50%;">联系电话:{{i.his_patient.id != 0 ? i.his_patient.phone : i.phone}}</div>
39 39
                 <div style="width:50%;">地址:{{i.home_address}}</div>
40 40
                 <div style="width:100%;">诊断:{{getDiagnosis(i.info.diagnosis)}}</div>
41 41
             </div>
@@ -261,6 +261,13 @@
261 261
         diagnoses: []
262 262
       }
263 263
     },
264
+
265
+    watch:{
266
+      printData:function(val){
267
+        console.log(val,'打印props')
268
+      }
269
+    },
270
+
264 271
     methods: {
265 272
       getAge(patient){
266 273
         var thisLen = patient.id_card_no.length
@@ -375,13 +382,18 @@
375 382
         })
376 383
       },
377 384
       getDiagnosis(id) {
378
-        var name = ''
379
-        for (let i = 0; i < this.diagnoses.length; i++) {
380
-          if (id == this.diagnoses[i].id) {
381
-            name = this.diagnoses[i].class_name
385
+      let id_ = id.split(",");
386
+      let nameArr = [];
387
+      let name = "";
388
+      for (let i = 0; i < this.diagnoses.length; i++) {
389
+        for (let j = 0; j < id_.length; j++) {
390
+          if (id_[j] == this.diagnoses[i].id) {
391
+            nameArr[j] = this.diagnoses[i].class_name;
392
+            name = nameArr.join(',')
382 393
           }
383 394
         }
384
-        return name
395
+      }
396
+      return name;
385 397
       }
386 398
     },
387 399
     created() {

+ 103 - 34
src/xt_pages/outpatientDoctorStation/pastInquiries.vue Parādīt failu

@@ -153,7 +153,7 @@
153 153
             style="float: right"
154 154
             size="small"
155 155
             icon="el-icon-printer"
156
-            @click="printThisPage"
156
+            @click="printThisPage(printData)"
157 157
             type="primary"
158 158
             >打印
159 159
           </el-button>
@@ -218,35 +218,49 @@ export default {
218 218
     };
219 219
   },
220 220
   methods: {
221
-    printThisPage() {
222
-      if (this.org_id == 10138) {
223
-        const style =
224
-          "@media print {#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 87%;}}}";
225
-        printJS({
226
-          printable: "printMain",
227
-          type: "html",
228
-          style: style,
229
-          scanStyles: false,
230
-        });
231
-      }if(this.printType == 3){
232
-        const style =
233
-          "@media print {html {zoom: 80%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}#prescriptionPrint div{box-shadow:none;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 20px;}.infoTitle{display: flex;margin-top:10px;line-height: 24px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}";
234
-        printJS({
235
-          printable: "printMain",
236
-          type: "html",
237
-          style: style,
238
-          scanStyles: false,
239
-        });
240
-      }else {
241
-        const style =
242
-          "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 80%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 20px;}.infoTitle{display: flex;margin-top:10px;line-height: 24px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}";
243
-        printJS({
244
-          printable: "printMain",
245
-          type: "html",
246
-          style: style,
247
-          scanStyles: false,
221
+    printThisPage(printData) {
222
+      printData.forEach((item) => {
223
+        const print = new Promise((resolve, reject) => {
224
+          if (item.prescriptions.length != 0) {
225
+            resolve(item.prescriptions);
226
+          } else {
227
+            reject(false);
228
+          }
248 229
         });
249
-      }
230
+        print
231
+          .then((printData) => {
232
+            if (this.org_id == 10138) {
233
+              const style =
234
+                "@media print {#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 88%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 87%;}}}";
235
+              printJS({
236
+                printable: "printMain",
237
+                type: "html",
238
+                style: style,
239
+                scanStyles: false,
240
+              });
241
+            }
242
+            if (this.printType == 3) {
243
+              const style =
244
+                "@media print {html {zoom: 80%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}#prescriptionPrint div{box-shadow:none;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 20px;}.infoTitle{display: flex;margin-top:10px;line-height: 24px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}";
245
+              printJS({
246
+                printable: "printMain",
247
+                type: "html",
248
+                style: style,
249
+                scanStyles: false,
250
+              });
251
+            } else {
252
+              const style =
253
+                "@media print {html {height: auto;margin: 0px;} #prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 80%;}}#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 20px;}.infoTitle{display: flex;margin-top:10px;line-height: 24px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:450px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}.NoCell{display: flex;justify-content: space-between;margin-bottom: 10px;}.underLine{display: inline-block;border-bottom: 1px solid #000;text-align: center;line-height: 24px;}.basicCell{display: flex;} .basicCell span{line-height: 24px;margin-bottom: 10px;}}";
254
+              printJS({
255
+                printable: "printMain",
256
+                type: "html",
257
+                style: style,
258
+                scanStyles: false,
259
+              });
260
+            }
261
+          })
262
+          .catch((reject) => {});
263
+      });
250 264
 
251 265
       this.innerVisible = false;
252 266
       // this.$nextTick(() => {
@@ -341,25 +355,80 @@ export default {
341 355
         this.$message.error("请至少选择一条需要打印的内容");
342 356
         return false;
343 357
       } else {
344
-
345 358
         var sch_ids = [];
346 359
         for (let index = 0; index < this.selecting_schs.length; index++) {
347 360
           sch_ids.push(this.selecting_schs[index].patient_id);
348 361
         }
349
-        console.log("sch_ids", sch_ids);
350 362
         let params = {
351 363
           record_date: this.record_date,
352 364
           patient_ids: sch_ids.join(","),
353 365
           type: type,
354 366
         };
355 367
         getBatchPrint(params).then((res) => {
356
-          let printData = res.data.data.patients;
357
-          this.printData = printData;
358
-          console.log("res", printData);
368
+          let Arr = res.data.data.patients;
369
+          let new_patients = [];
370
+          if (type != 3) {
371
+            Arr.forEach((i) => {
372
+              if (i.prescriptions.length != 0) {
373
+                new_patients.push(i);
374
+              }
375
+            });
376
+          } else {
377
+            // 过滤检查单数据出来,筛选出有检查项目的单子,不显示没有检查项目的单子
378
+            Arr.forEach((el) => {
379
+              el.prescriptions.forEach((o) => {
380
+                o.project.forEach((i) => {
381
+                  if (i.team.project_team != "") {
382
+                    new_patients.push(el);
383
+                  }
384
+                });
385
+              });
386
+            });
387
+            let projectPrint = [];
388
+            new_patients.forEach((el) => {
389
+              el.prescriptions.map((item) => {
390
+                if (item.project.length > 0) {
391
+                  item.project.map((it) => {
392
+                    // if (it.type == 2) {
393
+                    //   if (it.project.cost_classify == 3) {
394
+                    //     projectPrint.push(it);
395
+                    //   }
396
+                    // }
397
+                    projectPrint.push(it);
398
+                  });
399
+                }
400
+              });
401
+            });
402
+            console.log(projectPrint, "projectPrint----去重前");
403
+            // 数组去重
404
+            projectPrint = this.split_project(projectPrint);
405
+            // 配对
406
+            let data = [];
407
+            projectPrint.map((item) => {
408
+              if (item.team.id == 0) {
409
+                data.push(item);
410
+              } else {
411
+                if(item.team.project_team != ""){
412
+                  new_patients.push(item)
413
+                }
414
+              }
415
+            });
416
+          }
417
+
418
+          this.printData = new_patients;
359 419
         });
360 420
       }
361 421
       this.innerVisible = true;
362 422
     },
423
+
424
+    split_project(Arr) {
425
+      let hash = {};
426
+      Arr = Arr.reduce((preVal, curVal) => {
427
+        hash[curVal.id] ? "" : (hash[curVal.id] = true && preVal.push(curVal));
428
+        return preVal;
429
+      }, []);
430
+      return Arr;
431
+    },
363 432
   },
364 433
   created() {
365 434
     var nowDate = new Date();