瀏覽代碼

批量打印

XMLWAN 4 年之前
父節點
當前提交
afeec7b0b9

+ 25 - 0
src/utils/tools.js 查看文件

175
   // console.log((shouji + (shichang - t) * weichi).toFixed(1))
175
   // console.log((shouji + (shichang - t) * weichi).toFixed(1))
176
   return (shouji + (shichang - t) * weichi).toFixed(1)
176
   return (shouji + (shichang - t) * weichi).toFixed(1)
177
 }
177
 }
178
+
179
+
180
+export function formatDate (date, format) {
181
+  if (/(y+)/.test(format)) {
182
+      format= format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
183
+  }
184
+  let o = {
185
+      'M+': date.getMonth() + 1,
186
+      'd+': date.getDate(),
187
+      'h+': date.getHours(),
188
+      'm+': date.getMinutes(),
189
+      's+': date.getSeconds()
190
+  };
191
+  for (let k in o) {
192
+      if (new RegExp(`(${k})`).test(format)) {
193
+          let str = o[k] + '';
194
+          format= format.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
195
+      }
196
+  }
197
+  return format;
198
+};
199
+
200
+function padLeftZero (str) {
201
+  return ('00' + str).substr(str.length);
202
+};

+ 42 - 6
src/xt_pages/outpatientDoctorStation/components/inquiriesDetail.vue 查看文件

6
     :before-close="_close"
6
     :before-close="_close"
7
     class="detailDialog"
7
     class="detailDialog"
8
   >
8
   >
9
-    <div style="position: absolute;right:20px;">
9
+    <div style="position: absolute;right:20px;z-index:99">
10
       <el-button v-if="activeName == 'first'" @click="open(1)" type="primary">打印</el-button>
10
       <el-button v-if="activeName == 'first'" @click="open(1)" type="primary">打印</el-button>
11
       <el-button v-if="activeName == 'second'" @click="open(2)" type="primary">打印</el-button>
11
       <el-button v-if="activeName == 'second'" @click="open(2)" type="primary">打印</el-button>
12
     </div>
12
     </div>
25
           <div class="RP">
25
           <div class="RP">
26
             Rp
26
             Rp
27
           </div>
27
           </div>
28
-          <new-prescription-table ref="prescription_tables"
29
-                                  :prescription="curPrescriptions"></new-prescription-table>
28
+          <new-prescription-table ref="prescription_tables" :prescription="curPrescriptions"></new-prescription-table>
30
         </el-tabs>
29
         </el-tabs>
31
 
30
 
32
       </el-tab-pane>
31
       </el-tab-pane>
34
         <div class="detailMain">
33
         <div class="detailMain">
35
           <span style="width:240px;">处方号:{{order.prescription_number}}</span>
34
           <span style="width:240px;">处方号:{{order.prescription_number}}</span>
36
           <span style="width:200px;">医生:{{order.doctor}}</span>
35
           <span style="width:200px;">医生:{{order.doctor}}</span>
37
-          <span style="width:200px;">科室:{{order.departments}}</span>
36
+          <span style="width:200px;">科室:{{getDepartMent(order.departments)}}</span>
38
           <span style="width:200px;">创建时间: {{getTimes(order.ctime,"{y}-{m}-{d} {h}:{i}")}}</span>
37
           <span style="width:200px;">创建时间: {{getTimes(order.ctime,"{y}-{m}-{d} {h}:{i}")}}</span>
39
         </div>
38
         </div>
40
         <div class="commonCell">
39
         <div class="commonCell">
76
         </div>
75
         </div>
77
         <div class="commonCell">
76
         <div class="commonCell">
78
           <p>过敏史</p>
77
           <p>过敏史</p>
79
-          <div>{{order.sick_history}}</div>
78
+          <div>{{case_history.past_history}}</div>
80
         </div>
79
         </div>
81
         <div class="commonCell">
80
         <div class="commonCell">
82
           <p>既往史</p>
81
           <p>既往史</p>
106
   import { getHisPrescriptionInfo } from '@/api/his/his'
105
   import { getHisPrescriptionInfo } from '@/api/his/his'
107
   import NewPrescriptionTable from './newPrescriptionTable'
106
   import NewPrescriptionTable from './newPrescriptionTable'
108
   import { uParseTime } from '@/utils/tools'
107
   import { uParseTime } from '@/utils/tools'
108
+ import { getAllDoctorList } from "@/api/project/project"
109
+import moment from 'moment';
109
 
110
 
110
   export default {
111
   export default {
111
     components: { NewPrescriptionTable },
112
     components: { NewPrescriptionTable },
138
         search_input: '',
139
         search_input: '',
139
         case_history:{},
140
         case_history:{},
140
         order:{},
141
         order:{},
142
+        doctorList:[],
143
+        departmentList:[]
141
       }
144
       }
142
     },
145
     },
143
     methods: {
146
     methods: {
144
       open(index){
147
       open(index){
145
         if(index == 1){
148
         if(index == 1){
146
 
149
 
150
+          //  /outpatientDoctorStation/print?record=2020-12-11&prescription_id=157&ids=157,159&patient_id=1064
147
         }else if(index == 2){
151
         }else if(index == 2){
148
-
152
+           var record_date = this.format(this.case_history.sick_date)    
153
+          this.$router.push("/outpatientDoctorStation/recordPrint?record="+record_date+"&patient_id="+this.case_history.patient_id)
149
         }
154
         }
150
       },
155
       },
151
       getTimes(time,temp) {
156
       getTimes(time,temp) {
202
             this.patientInfo = response.data.data.order.patient
207
             this.patientInfo = response.data.data.order.patient
203
             this.hisPatientInfo = response.data.data.order.his_patient
208
             this.hisPatientInfo = response.data.data.order.his_patient
204
             this.case_history = response.data.data.order.case_history
209
             this.case_history = response.data.data.order.case_history
210
+            console.log("历史详情",this.case_history)
205
             this.order = response.data.data.order
211
             this.order = response.data.data.order
206
 
212
 
207
 
213
 
270
         // this.clear()
276
         // this.clear()
271
         this.visible = false
277
         this.visible = false
272
       },
278
       },
279
+     getAllDoctorList(){
280
+      getAllDoctorList().then(response=>{
281
+        if(response.data.state == 1){
282
+            var doctor =  response.data.data.doctor 
283
+            this.doctorList = doctor
284
+             var department = response.data.data.department
285
+             console.log("department",department)
286
+             this.departmentList = department
287
+            }
288
+         })   
289
+      },
290
+      getDepartMent(id){
291
+         var name = ""
292
+         for(let i=0;i<this.departmentList.length;i++){
293
+           if(id == this.departmentList[i].id){
294
+              name = this.departmentList[i].name
295
+           }
296
+         }
297
+         return name
298
+      },
299
+
300
+      format(time){
301
+        moment.locale()
302
+        var times = time*1000
303
+        times = moment(times).format('YYYY-MM-DD')
304
+        return times
305
+      }
306
+    },
307
+    created(){
308
+      this.getAllDoctorList()
273
     }
309
     }
274
   }
310
   }
275
 </script>
311
 </script>

+ 16 - 5
src/xt_pages/outpatientDoctorStation/recordTemplate/printOne.vue 查看文件

41
 
41
 
42
         <div class="printTitle">病历内容</div>
42
         <div class="printTitle">病历内容</div>
43
         <div class="recordTitle">
43
         <div class="recordTitle">
44
-            <div>科别:{{hispatient.departments?hispatient.departments:''}}</div>
44
+            <div>科别:{{getDeparment(hispatient.departments)?getDeparment(hispatient.departments):''}}</div>
45
             <div>姓名:{{patient.name?patient.name:''}}</div>
45
             <div>姓名:{{patient.name?patient.name:''}}</div>
46
             <div>性别:
46
             <div>性别:
47
                 <span v-if="patient.gender == 1">男</span>
47
                 <span v-if="patient.gender == 1">男</span>
102
     },
102
     },
103
     data(){
103
     data(){
104
         return{
104
         return{
105
-            educationOptions:[]
105
+            educationOptions:[],
106
+            departmentList:[]
106
         }                   
107
         }                   
107
     },
108
     },
108
     methods:{
109
     methods:{
121
                var doctor =  response.data.data.doctor
122
                var doctor =  response.data.data.doctor
122
 
123
 
123
                this.doctorList = doctor
124
                this.doctorList = doctor
124
-            //    var department = response.data.data.department
125
-            //    console.log("department",department)
126
-            //    this.departmentList = department
125
+               var department = response.data.data.department
126
+               console.log("department",department)
127
+               this.departmentList = department
127
              }
128
              }
128
            })   
129
            })   
129
        },
130
        },
156
          }
157
          }
157
       })
158
       })
158
     },
159
     },
160
+    getDeparment(id){
161
+    console.log("id---",id)
162
+     var name = ''
163
+     for(let i=0;i<this.departmentList.length;i++){
164
+         if(id == this.departmentList[i].id){
165
+            name = this.departmentList[i].name
166
+         }
167
+      }
168
+      return name
169
+    }
159
     },
170
     },
160
     created(){
171
     created(){
161
       this.educationOptions = getDataConfig("patient", "education_types");
172
       this.educationOptions = getDataConfig("patient", "education_types");