Browse Source

批量打印

XMLWAN 4 years ago
parent
commit
403baaed72

+ 1 - 1
src/router/index_路由未分离前.js View File

@@ -886,7 +886,7 @@ export const xt_asyncRouterMap = [
886 886
         component: () => import('@/xt_pages/stock/index'),
887 887
         name: 'config',
888 888
         meta: { title: 'config' }
889
-      }
889
+      },   
890 890
     ]
891 891
   },
892 892
   {

+ 9 - 1
src/router/modules/selfPreparedMedicine.js View File

@@ -37,6 +37,14 @@ export default {
37 37
         component: () => import('@/xt_pages/stock/selfPreparedMedicine/info'),
38 38
         name: 'selfPreparedMedicineInfo',
39 39
         meta: { title: 'selfPreparedMedicineInfo', noCache: true }
40
-    }
40
+    },
41
+    {
42
+      path: '/stock/stockprint',
43
+      component: () => import('@/xt_pages/stock/stockPrint'),
44
+      name: 'stockqueryprint',
45
+      hidden: true,
46
+      is_menu: false,
47
+      meta: { title: 'stockprint', noCache: true }
48
+     },
41 49
   ]
42 50
 }

+ 8 - 54
src/xt_pages/outpatientDoctorStation/components/medicalRecord.vue View File

@@ -8,51 +8,6 @@
8 8
     >
9 9
         <div>
10 10
             <el-tabs v-model="activeName">
11
-                <!-- <el-tab-pane label="历史病历" name="first">
12
-                    <div style="display:flex;align-items: center;margin-bottom:10px;">
13
-                        <el-input size="small" v-model.trim="search_input" class="filter-item" style="width:140px;"/>
14
-                        <el-button size="small" style="margin:0 10px;" class="filter-item" type="primary" @click="searchAction">搜索</el-button>
15
-                        <span>日期:</span>
16
-                        <el-date-picker
17
-                        size="small"
18
-                        style="width:140px;margin:0 10px;"
19
-                        v-model="value1"
20
-                        type="date"
21
-                        placeholder="选择日期">
22
-                        </el-date-picker>
23
-                        <el-date-picker
24
-                        style="width:140px;"
25
-                        size="small"
26
-                        v-model="value1"
27
-                        type="date"
28
-                        placeholder="选择日期">
29
-                        </el-date-picker>
30
-                    </div>
31
-                    <el-table :data="tableData" border height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
32
-                        <el-table-column align="center" type="index" width="60" label="序号"></el-table-column>
33
-                        <el-table-column align="center" prop="name" label="病历编号">
34
-                            <template slot-scope="scope">{{ scope.row.id }}</template>
35
-                        </el-table-column>
36
-                        <el-table-column align="center" prop="name" label="名称">
37
-                            <template slot-scope="scope">{{ scope.row.date }}</template>
38
-                        </el-table-column>
39
-                        <el-table-column align="center" prop="name" label="创建人">
40
-                            <template slot-scope="scope">{{ scope.row.date }}</template>
41
-                        </el-table-column>
42
-                        <el-table-column align="center" prop="name" label="创建日期">
43
-                            <template slot-scope="scope">{{ scope.row.date }}</template>
44
-                        </el-table-column>
45
-                        <el-table-column align="center" prop="name" label="模板说明">
46
-                            <template slot-scope="scope">{{ scope.row.date }}</template>
47
-                        </el-table-column>
48
-                        <el-table-column align="center" prop="name" label="操作" width='200'>
49
-                            <template slot-scope="scope">
50
-                                <el-button type="primary" size="mini">调用</el-button>
51
-                                <el-button type="primary" size="mini" @click="toHistoryDetail">详情</el-button>
52
-                            </template>
53
-                        </el-table-column>
54
-                    </el-table>
55
-                </el-tab-pane> -->
56 11
                 <el-tab-pane label="病历模板" name="first">
57 12
                     <div style="display:flex;align-items: center;margin-bottom:10px;">
58 13
                         <el-input size="small"  v-model.trim="search_input" class="filter-item" style="width:140px;"/>
@@ -77,7 +32,7 @@
77 32
                     </div>
78 33
                     <el-table :data="tempalateData" border height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
79 34
                         <el-table-column align="center" type="index" width="60" label="序号"></el-table-column>
80
-                        <el-table-column align="center" prop="name" label="病历编号">
35
+                        <el-table-column align="center" prop="name" width="60" label="病历编号">
81 36
                             <template slot-scope="scope">{{ scope.row.id }}</template>
82 37
                         </el-table-column>
83 38
                         <el-table-column align="center" prop="name" label="名称">
@@ -134,6 +89,7 @@ export default {
134 89
             search_input:"",
135 90
             start_time:"",
136 91
             end_time:"",
92
+            mode_status:0,
137 93
         }
138 94
     },
139 95
     methods:{
@@ -146,8 +102,9 @@ export default {
146 102
             this.form.name = "";
147 103
             this.form.intro = "";
148 104
         },
149
-        show() {
150
-            // this.clear()
105
+        show(id) {
106
+            this.mode_status = id
107
+            this.getlist()
151 108
             this.visible = true
152 109
         },
153 110
         hide() {
@@ -161,7 +118,6 @@ export default {
161 118
             this.$refs.recordTemplateDetail.show(id)
162 119
         },
163 120
         totemplateDetailTwo(id){
164
-        console.log("id0---",id)
165 121
          this.$emit('func',id)
166 122
          this.visible = false
167 123
         },
@@ -179,9 +135,6 @@ export default {
179 135
               var template =  response.data.data.template
180 136
               console.log("templagte",template)
181 137
               this.tempalateData = template
182
-            //   var history =  response.data.data.history
183
-            //   console.log("history",history)
184
-            //   this.tableData = history
185 138
             }
186 139
           })
187 140
         },
@@ -199,9 +152,10 @@ export default {
199 152
       },
200 153
     },
201 154
     created(){
202
-       console.log("99999999999999999")
203 155
        this.getlist()
204
-    }
156
+    },
157
+   
158
+    
205 159
 }
206 160
 </script>
207 161
 

+ 6 - 6
src/xt_pages/outpatientDoctorStation/components/saveRecordTemplate.vue View File

@@ -7,10 +7,6 @@
7 7
         class="recordDialog"
8 8
     >
9 9
         <el-form class="recordForm" :model="form"  ref="form" label-width="80px">
10
-            <!-- <el-form-item label="模板类别:" prop="name" style="width:100%;">
11
-                <el-radio v-model="mode_type" label="1">私人模板</el-radio>
12
-                <el-radio v-model="mode_type" label="2">公共模板</el-radio>
13
-            </el-form-item> -->
14 10
             <el-form-item label="模板名称: " prop="name" style="width:100%;">
15 11
                 <el-input v-model="template_name" placeholder=""></el-input>
16 12
             </el-form-item>
@@ -58,7 +54,8 @@ export default {
58 54
             start_time:"",
59 55
             user_name:"",
60 56
             template_name:"",
61
-            template_remark:""
57
+            template_remark:"",
58
+            mode_status:0,
62 59
         }
63 60
      },
64 61
     
@@ -74,7 +71,7 @@ export default {
74 71
         },
75 72
         show(obj) {
76 73
          console.log("obj",obj)
77
-         this.chief_conplain= obj.chief_conplain
74
+         this.chief_conplain= obj.chief_conplaint
78 75
          this.past_history = obj.past_history
79 76
          this.history_of_present_illness = obj.history_of_present_illness
80 77
          this.personal_history = obj.personal_history
@@ -101,10 +98,13 @@ export default {
101 98
              diagnostic:this.diagnostic,
102 99
             }
103 100
          console.log("params",params)
101
+       
104 102
           SaveHisPatientCaseHistoryTemplate(params).then(response=>{
105 103
               if(response.data.state == 1){
104
+                 this.mode_status = 1
106 105
                  this.$message.success("保存成功")
107 106
                  this.visible = false
107
+                
108 108
               }
109 109
           })   
110 110
         }

+ 7 - 2
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

@@ -182,6 +182,7 @@
182 182
         selecting_schs: [],
183 183
         index:0,
184 184
         admin_info:{},
185
+        
185 186
       }
186 187
     },
187 188
     methods: {
@@ -239,6 +240,7 @@
239 240
             }
240 241
 
241 242
             this.prescriptionList = response.data.data.list.prescription
243
+           
242 244
             this.patientid = this.patientTableData[0].patient_id
243 245
 
244 246
           }
@@ -576,7 +578,9 @@
576 578
         } else if (index == 2) {
577 579
           this.$router.push('/outpatientDoctorStation/recordPrint?record='+this.record_date+"&patient_id="+this.patientid)
578 580
         } else if (index == 3) {
579
-          this.$refs.medicalRecord.show()
581
+           var mode_status =   this.$refs.saveRecordTemplate.mode_status
582
+           console.log("数据返回",mode_status)
583
+          this.$refs.medicalRecord.show(mode_status)
580 584
         } else if (index == 4) {
581 585
           this.$refs.saveRecordTemplate.show(this.case_history)
582 586
         }
@@ -681,7 +685,8 @@
681 685
             that.timer = false
682 686
           },400)
683 687
         }
684
-      }
688
+      },
689
+    
685 690
     }
686 691
   }
687 692
 </script>

+ 241 - 0
src/xt_pages/stock/stockPrint.vue View File

@@ -0,0 +1,241 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <span class="main_title">自备药查询表</span>
16
+                    </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:{{time_now}}
19
+                    </div>
20
+                    <div class="table_panel">
21
+                        <table class="table">
22
+                            <thead>
23
+                                <tr>
24
+                                    <td width="60">商品编码</td>
25
+                                    <td width="80">耗材名称</td>
26
+                                    <td width="80">耗材类型</td>
27
+                                    <td width="80">规格型号</td>
28
+                                    <td width="80">入库数量</td>
29
+                                    <td width="80">入库退货</td>
30
+                                    <td width="80">实际入库</td>
31
+                                    <td width="80">出库数量</td>
32
+                                    <td width="80">出库退库</td>
33
+                                    <td width="80">实际出库</td>
34
+                                    <td width="80">剩余库存</td>
35
+                                </tr>
36
+                            </thead>
37
+                            <tbody>
38
+                                <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
39
+                                    <td>{{item.good_code}}</td>
40
+                                    <td>{{item.good_name}}</td>
41
+                                    <td>{{item.type.type_name}}</td>
42
+                                    <td>{{item.specification_name}}</td>
43
+                                    <td>{{stockInCount(item)}}</td>
44
+                                    <td>{{salesReturnCount(item)}}</td>
45
+                                    <td> {{ stockInCount(item) - salesReturnCount(item) }}</td>
46
+                                    <td>{{ stockOutCount(item) }}</td>
47
+                                    <td>{{cancelStockCount(item) }}</td>
48
+                                    <td>{{ stockOutCount(item) - cancelStockCount(item)}}</td>
49
+                                    <td>{{stockInCount(item) -salesReturnCount(item) -stockOutCount(item) +cancelStockCount(item)}}</td>
50
+                                </tr>
51
+                            </tbody>
52
+                        </table>
53
+                    </div>
54
+                </div>
55
+            </div>
56
+        </div>
57
+    </div>
58
+</template>
59
+
60
+<script>
61
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
62
+import { getAllStockQueryList } from "@/api/stock";
63
+import print from 'print-js'
64
+const moment = require('moment')
65
+export default {
66
+    components:{
67
+        BreadCrumb
68
+    },
69
+    data(){
70
+        return{
71
+          crumbs: [
72
+            { path: false, name: '库存管理' },
73
+            { path: false, name: '自备药查询' },
74
+            { path: false, name: '自备药打印' },
75
+          ],
76
+          start_time:"",
77
+          end_time:"",
78
+          drug_name:"",
79
+          drug_spec:"",
80
+          keyword:"",
81
+          tableData:[],
82
+          time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
83
+          type_name:"",
84
+          limit:20,
85
+          page:1,
86
+          WarehouseInfo: {
87
+          loading: false,
88
+          warehouseInfoDate: []
89
+         },
90
+        }
91
+    },
92
+    methods:{
93
+      printAction: function() {
94
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
95
+          printJS({
96
+          printable: 'print_content',
97
+          type: 'html',
98
+          documentTitle: '  ',
99
+          style: style,
100
+          scanStyles: false
101
+          })
102
+      },
103
+      getlist(){
104
+         const Params = {
105
+            page: this.page,
106
+            limit: this.limit,
107
+            keyword: this.keywords,
108
+            start_time:this.start_time,
109
+            end_time:this.end_time,
110
+            type_name:this.type_name,
111
+        };
112
+         this.WarehouseInfo.loading = true;
113
+         this.WarehouseInfo.warehouseInfoDate = [];
114
+         getAllStockQueryList(Params).then(response => {
115
+           if (response.data.state == 0) {
116
+            this.WarehouseInfo.loading = false;
117
+            this.$message.error(response.data.msg);
118
+            return false;
119
+          } else {
120
+            this.WarehouseInfo.loading = false;
121
+            this.total = response.data.data.total;
122
+          for (let i = 0; i < response.data.data.list.length; i++) {
123
+            this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
124
+          }
125
+         }
126
+            console.log("打印数据源头",this.WarehouseInfo.warehouseInfoDate)
127
+          });
128
+      },
129
+       stockInCount: function(row) {
130
+      let total = 0;
131
+      for (let i = 0; i < row.query_warehousing_info.length; i++) {
132
+        total = total + row.query_warehousing_info[i].warehousing_count;
133
+      }
134
+      return total;
135
+    },
136
+    salesReturnCount: function(row) {
137
+      let total = 0;
138
+      for (let i = 0; i < row.query_sales_return_info.length; i++) {
139
+        total = total + row.query_sales_return_info[i].count;
140
+      }
141
+      return total;
142
+    },
143
+    stockOutCount: function(row) {
144
+      let total = 0;
145
+      for (let i = 0; i < row.query_warehouseout_info.length; i++) {
146
+        total = total + row.query_warehouseout_info[i].count;
147
+      }
148
+      return total;
149
+    },
150
+    cancelStockCount: function(row) {
151
+      let total = 0;
152
+      for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
153
+        total = total + row.query_cancel_stock_info[i].count;
154
+      }
155
+      return total;
156
+    },
157
+    },
158
+    created(){
159
+      var starttime =  this.$route.query.start_time
160
+      this.start_time = starttime
161
+      var endtime =  this.$route.query.end_time
162
+      this.end_time = endtime
163
+      var type_name = this.$route.query.type_name
164
+      this.type_name = type_name
165
+      var keyword = this.$route.query.keyword
166
+      this.keyword = keyword
167
+
168
+      this.getlist()
169
+    }
170
+}
171
+</script>
172
+
173
+
174
+<style rel="stylesheet/scss" lang="scss" scoped>
175
+.print_main_content {
176
+  background-color: white;
177
+  max-width: 1500px;
178
+  margin: 0 auto;
179
+  padding: 0 0 20px 0;
180
+
181
+  .order_title_panl {
182
+    text-align: center;
183
+
184
+    .main_title {
185
+      font-size: 18px;
186
+      line-height: 40px;
187
+      font-weight: 500;
188
+    }
189
+  }
190
+  .table_panel {
191
+    .table {
192
+      width: 100%;
193
+      border: 1px solid;
194
+      border-collapse: collapse;
195
+      padding: 2px;
196
+      
197
+
198
+      thead {
199
+        tr {
200
+          td {
201
+            border: 1px solid;
202
+            text-align: center;
203
+            font-size: 18px;
204
+            padding: 15px 5px;
205
+          }
206
+        }
207
+      }
208
+      tbody {
209
+        tr {
210
+          td {
211
+            border: 1px solid;
212
+            text-align: center;
213
+            font-size: 18px;
214
+            padding: 10px 5px;
215
+            white-space: pre-line;
216
+            .proj {
217
+              padding: 5px 0;
218
+              text-align: left;
219
+
220
+              .proj_title {
221
+                font-size: 16px;
222
+                font-weight: 500;
223
+                line-height: 25px;
224
+              }
225
+
226
+              .proj_item {
227
+                font-size: 15px;
228
+                line-height: 20px;
229
+
230
+                .zone_name {
231
+                  font-weight: 500;
232
+                }
233
+              }
234
+            }
235
+          }
236
+        }
237
+      }
238
+    }
239
+  }
240
+}
241
+</style>

+ 49 - 29
src/xt_pages/stock/stockQuery.vue View File

@@ -6,34 +6,41 @@
6 6
     <div class="app-container ">
7 7
       <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8 8
         <div>
9
-          <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
9
+          <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
+          @change="changeTypeName">
10 11
             <el-option
11
-              v-for="item in options"
12
-              :key="item.value"
13
-              :label="item.label"
14
-              :value="item.value">
12
+              v-for="item in goodType"
13
+              :key="item.id"
14
+              :label="item.type_name"
15
+              :value="item.id">
15 16
             </el-option>
16 17
           </el-select>
17
-          <el-time-select
18
-            style="width:140px;"
19
-            v-model="value"
20
-            :picker-options="{
21
-              start: '08:30',
22
-              step: '00:15',
23
-              end: '18:30'
24
-            }"
25
-            placeholder="选择时间">
26
-          </el-time-select>-
27
-          <el-time-select
28
-            style="width:140px;"
29
-            v-model="value"
30
-            :picker-options="{
31
-              start: '08:30',
32
-              step: '00:15',
33
-              end: '18:30'
34
-            }"
35
-            placeholder="选择时间">
36
-          </el-time-select>
18
+          <el-date-picker
19
+            size="small"
20
+            v-model="start_time"
21
+            prefix-icon="el-icon-date"
22
+            :editable="false"
23
+            style="width: 196px;"
24
+            type="date"
25
+            placeholder="选择日期时间"
26
+            align="right"
27
+            format="yyyy-MM-dd"
28
+            value-format="yyyy-MM-dd"
29
+            @change="startTimeChange"
30
+           ></el-date-picker>-
31
+            <el-date-picker
32
+              size="small"
33
+              v-model="end_time"
34
+              prefix-icon="el-icon-date"
35
+              :editable="false"
36
+              style="width: 196px;"
37
+              type="date"
38
+              placeholder="选择日期时间"
39
+              align="right"
40
+              format="yyyy-MM-dd"
41
+              value-format="yyyy-MM-dd"
42
+              @change="endTimeChange"
43
+          ></el-date-picker>
37 44
           <el-input
38 45
             size="small"
39 46
             style="width: 200px;margin-left:10px;"
@@ -52,7 +59,7 @@
52 59
         </div>
53 60
         <div>
54 61
           <el-button size="small" type="primary" @click="exportList">导出</el-button>
55
-          <el-button size="small" type="primary">打印</el-button>
62
+          <el-button size="small" type="primary" @click="toPrint">打印</el-button>
56 63
         </div>
57 64
       </div>
58 65
       
@@ -198,7 +205,8 @@ export default {
198 205
         warehouseInfoDate: []
199 206
       },
200 207
       options:[],
201
-      value:""
208
+      value:"",
209
+      type_name:""
202 210
     };
203 211
   },
204 212
   methods: {
@@ -207,8 +215,12 @@ export default {
207 215
       const Params = {
208 216
         page: this.page,
209 217
         limit: this.limit,
210
-        keyword: this.keywords
218
+        keyword: this.keywords,
219
+        start_time:this.start_time,
220
+        end_time:this.end_time,
221
+        type_name:this.type_name,
211 222
       };
223
+      console.log("params-----",Params)
212 224
       this.WarehouseInfo.loading = true;
213 225
       this.WarehouseInfo.warehouseInfoDate = [];
214 226
       getAllStockQueryList(Params).then(response => {
@@ -256,6 +268,7 @@ export default {
256 268
           for (let i = 0; i < response.data.data.goodType.length; i++) {
257 269
             this.goodType.push(response.data.data.goodType[i]);
258 270
           }
271
+          console.log("商品类型",this.goodType)
259 272
         }
260 273
       });
261 274
     },
@@ -343,7 +356,14 @@ export default {
343 356
        },
344 357
        formatJson(filterVal, jsonData) {
345 358
         return jsonData.map(v => filterVal.map(j => v[j]));
346
-     },
359
+      },
360
+      changeTypeName(){
361
+       this.GetAllStockQuery()
362
+      },
363
+      toPrint(){
364
+        this.$router.push("/stock/stockprint?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keywords+"&type_name="+this.type_name)
365
+        
366
+      }
347 367
   }
348 368
 };
349 369
 </script>