huangyw 2 years ago
parent
commit
11fad4a284

+ 383 - 261
src/xt_pages/Pharmacy/DrugDispensing.vue View File

1
-<template><!--药品发药页面-->
1
+<template>
2
+  <!--药品发药页面-->
2
   <div class="main-contain new-main-contain">
3
   <div class="main-contain new-main-contain">
3
     <div class="position">
4
     <div class="position">
4
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
46
             </el-button>
47
             </el-button>
47
           </div>
48
           </div>
48
 
49
 
49
-          <el-table v-if="state == 1"
50
+          <el-table
51
+            v-if="state == 1"
50
             :height="tableHeight"
52
             :height="tableHeight"
51
             :data="waiting_drug"
53
             :data="waiting_drug"
52
             border
54
             border
56
             @current-change="handleCurrentChange"
58
             @current-change="handleCurrentChange"
57
           >
59
           >
58
             <el-table-column prop="name" label="名称" width="100">
60
             <el-table-column prop="name" label="名称" width="100">
59
-               <template slot-scope="scope">
60
-                {{scope.row.name}}
61
+              <template slot-scope="scope">
62
+                {{ scope.row.name }}
61
               </template>
63
               </template>
62
             </el-table-column>
64
             </el-table-column>
63
             <el-table-column prop="specifications" label="规格" width="100">
65
             <el-table-column prop="specifications" label="规格" width="100">
64
               <template slot-scope="scope">
66
               <template slot-scope="scope">
65
-                {{scope.row.specifications}}
67
+                {{ scope.row.specifications }}
66
               </template>
68
               </template>
67
             </el-table-column>
69
             </el-table-column>
68
             <el-table-column prop="stock" label="库存" width="100">
70
             <el-table-column prop="stock" label="库存" width="100">
69
-               <template slot-scope="scope">
70
-                {{scope.row.stock}}
71
+              <template slot-scope="scope">
72
+                {{ scope.row.stock }}
71
               </template>
73
               </template>
72
             </el-table-column>
74
             </el-table-column>
73
           </el-table>
75
           </el-table>
83
             ref="table02"
85
             ref="table02"
84
           >
86
           >
85
             <el-table-column prop="name" label="名称" width="100">
87
             <el-table-column prop="name" label="名称" width="100">
86
-               <template slot-scope="scope">
87
-                {{scope.row.name}}
88
+              <template slot-scope="scope">
89
+                {{ scope.row.name }}
88
               </template>
90
               </template>
89
             </el-table-column>
91
             </el-table-column>
90
             <el-table-column prop="specifications" label="规格" width="100">
92
             <el-table-column prop="specifications" label="规格" width="100">
91
               <template slot-scope="scope">
93
               <template slot-scope="scope">
92
-                {{scope.row.specifications}}
94
+                {{ scope.row.specifications }}
93
               </template>
95
               </template>
94
             </el-table-column>
96
             </el-table-column>
95
             <el-table-column prop="stock" label="库存" width="100">
97
             <el-table-column prop="stock" label="库存" width="100">
96
-               <template slot-scope="scope">
97
-                {{scope.row.stock}}
98
+              <template slot-scope="scope">
99
+                {{ scope.row.stock }}
98
               </template>
100
               </template>
99
             </el-table-column>
101
             </el-table-column>
100
           </el-table>
102
           </el-table>
102
       </div>
104
       </div>
103
       <div class="mainRight">
105
       <div class="mainRight">
104
         <div class="titlelist">
106
         <div class="titlelist">
105
-<!--          <el-button type="primary" @click="tt">调试</el-button>-->
106
-          <el-button type="primary" @click="dispense" v-if="state == 1">发药</el-button>
107
+          <!--          <el-button type="primary" @click="tt">调试</el-button>-->
108
+          <el-button type="primary" @click="dispense" v-if="state == 1"
109
+            >发药</el-button
110
+          >
107
           <el-button type="primary" @click="toPrint">打印</el-button>
111
           <el-button type="primary" @click="toPrint">打印</el-button>
108
-<!--          <el-button @click="tt">调试</el-button>-->
109
-<!--          <el-button type="primary" @click="toSetting">设置</el-button>-->
112
+          <!--          <el-button @click="tt">调试</el-button>-->
113
+          <!--          <el-button type="primary" @click="toSetting">设置</el-button>-->
110
         </div>
114
         </div>
111
         <el-divider></el-divider>
115
         <el-divider></el-divider>
112
         <div>
116
         <div>
116
             border
120
             border
117
             style="width: 1328px"
121
             style="width: 1328px"
118
             @selection-change="handleSelectionChange"
122
             @selection-change="handleSelectionChange"
119
-             v-if="state == 1"
123
+            v-if="state == 1"
120
           >
124
           >
121
-            <el-table-column type="selection" width="55" align="center"> </el-table-column>
122
-            <el-table-column type="index" label="序号" width="120" align="center">
125
+            <el-table-column type="selection" width="55" align="center">
123
             </el-table-column>
126
             </el-table-column>
124
-            <el-table-column prop="name" label="患者名称" width="180" align="center">
125
-                <template slot-scope="scope">
126
-                 {{scope.row.name}}
127
+            <el-table-column
128
+              type="index"
129
+              label="序号"
130
+              width="120"
131
+              align="center"
132
+            >
133
+            </el-table-column>
134
+            <el-table-column
135
+              prop="name"
136
+              label="患者名称"
137
+              width="180"
138
+              align="center"
139
+            >
140
+              <template slot-scope="scope">
141
+                {{ scope.row.name }}
127
               </template>
142
               </template>
128
             </el-table-column>
143
             </el-table-column>
129
-            <el-table-column prop="name" label="单次用量" width="170" align="center">
130
-               <template  slot-scope="scope">
131
-                 {{scope.row.single_dosage}}
132
-               </template>
144
+            <el-table-column
145
+              prop="name"
146
+              label="单次用量"
147
+              width="170"
148
+              align="center"
149
+            >
150
+              <template slot-scope="scope">
151
+                {{ scope.row.single_dosage }}
152
+              </template>
133
             </el-table-column>
153
             </el-table-column>
134
-            <el-table-column prop="name" label="用法" width="160" align="center">
135
-               <template  slot-scope="scope">
136
-                 {{scope.row.usage}}
137
-               </template>
154
+            <el-table-column
155
+              prop="name"
156
+              label="用法"
157
+              width="160"
158
+              align="center"
159
+            >
160
+              <template slot-scope="scope">
161
+                {{ scope.row.usage }}
162
+              </template>
138
             </el-table-column>
163
             </el-table-column>
139
-            <el-table-column prop="name" label="频率" width="160" align="center">
140
-                <template  slot-scope="scope">
141
-                 {{scope.row.frequency}}
142
-               </template>
164
+            <el-table-column
165
+              prop="name"
166
+              label="频率"
167
+              width="160"
168
+              align="center"
169
+            >
170
+              <template slot-scope="scope">
171
+                {{ scope.row.frequency }}
172
+              </template>
143
             </el-table-column>
173
             </el-table-column>
144
-            <el-table-column prop="name" label="天数" width="160" align="center">
145
-               <template  slot-scope="scope">
146
-                 {{scope.row.days}}
147
-               </template>
174
+            <el-table-column
175
+              prop="name"
176
+              label="天数"
177
+              width="160"
178
+              align="center"
179
+            >
180
+              <template slot-scope="scope">
181
+                {{ scope.row.days }}
182
+              </template>
148
             </el-table-column>
183
             </el-table-column>
149
-            <el-table-column prop="name" label="总量" width="160" align="center">
150
-                <template  slot-scope="scope">
151
-                 {{scope.row.total}}
152
-               </template>
184
+            <el-table-column
185
+              prop="name"
186
+              label="总量"
187
+              width="160"
188
+              align="center"
189
+            >
190
+              <template slot-scope="scope">
191
+                {{ scope.row.total }}
192
+              </template>
153
             </el-table-column>
193
             </el-table-column>
154
-            <el-table-column prop="name" label="数据来源" width="162" align="center">
155
-                <template  slot-scope="scope">
156
-                  {{scope.row.data_sources}}
157
-               </template>
194
+            <el-table-column
195
+              prop="name"
196
+              label="数据来源"
197
+              width="162"
198
+              align="center"
199
+            >
200
+              <template slot-scope="scope">
201
+                {{ scope.row.data_sources }}
202
+              </template>
158
             </el-table-column>
203
             </el-table-column>
159
           </el-table>
204
           </el-table>
160
         </div>
205
         </div>
166
             style="width: 1328px"
211
             style="width: 1328px"
167
             v-if="state == 2"
212
             v-if="state == 2"
168
           >
213
           >
169
-<!--            <el-table-column type="selection" width="55"> </el-table-column>-->
170
-            <el-table-column type="index" label="序号" width="120" align="center">
214
+            <!--            <el-table-column type="selection" width="55"> </el-table-column>-->
215
+            <el-table-column
216
+              type="index"
217
+              label="序号"
218
+              width="120"
219
+              align="center"
220
+            >
221
+            </el-table-column>
222
+            <el-table-column
223
+              prop="name"
224
+              label="患者名称"
225
+              width="180"
226
+              align="center"
227
+            >
228
+              <template slot-scope="scope">
229
+                {{ scope.row.name }}
230
+              </template>
171
             </el-table-column>
231
             </el-table-column>
172
-            <el-table-column prop="name" label="患者名称" width="180" align="center">
173
-                <template slot-scope="scope">
174
-                 {{scope.row.name}}
232
+            <el-table-column
233
+              prop="name"
234
+              label="单次用量"
235
+              width="170"
236
+              align="center"
237
+            >
238
+              <template slot-scope="scope">
239
+                {{ scope.row.single_dosage }}
175
               </template>
240
               </template>
176
             </el-table-column>
241
             </el-table-column>
177
-            <el-table-column prop="name" label="单次用量" width="170" align="center">
178
-               <template  slot-scope="scope">
179
-                 {{scope.row.single_dosage}}
180
-               </template>
242
+            <el-table-column
243
+              prop="name"
244
+              label="用法"
245
+              width="160"
246
+              align="center"
247
+            >
248
+              <template slot-scope="scope">
249
+                {{ scope.row.usage }}
250
+              </template>
181
             </el-table-column>
251
             </el-table-column>
182
-            <el-table-column prop="name" label="用法" width="160" align="center">
183
-               <template  slot-scope="scope">
184
-                 {{scope.row.usage}}
185
-               </template>
252
+            <el-table-column
253
+              prop="name"
254
+              label="频率"
255
+              width="160"
256
+              align="center"
257
+            >
258
+              <template slot-scope="scope">
259
+                {{ scope.row.frequency }}
260
+              </template>
186
             </el-table-column>
261
             </el-table-column>
187
-            <el-table-column prop="name" label="频率" width="160" align="center">
188
-                <template  slot-scope="scope">
189
-                 {{scope.row.frequency}}
190
-               </template>
262
+            <el-table-column
263
+              prop="name"
264
+              label="天数"
265
+              width="160"
266
+              align="center"
267
+            >
268
+              <template slot-scope="scope">
269
+                {{ scope.row.days }}
270
+              </template>
191
             </el-table-column>
271
             </el-table-column>
192
-            <el-table-column prop="name" label="天数" width="160" align="center">
193
-               <template  slot-scope="scope">
194
-                 {{scope.row.days}}
195
-               </template>
272
+            <el-table-column
273
+              prop="name"
274
+              label="总量"
275
+              width="160"
276
+              align="center"
277
+            >
278
+              <template slot-scope="scope">
279
+                {{ scope.row.total }}
280
+              </template>
196
             </el-table-column>
281
             </el-table-column>
197
-            <el-table-column prop="name" label="总量" width="160" align="center">
198
-                <template  slot-scope="scope">
199
-                 {{scope.row.total}}
200
-               </template>
282
+            <el-table-column
283
+              prop="name"
284
+              label="数据来源"
285
+              width="162"
286
+              align="center"
287
+            >
288
+              <template slot-scope="scope">
289
+                {{ scope.row.data_sources }}
290
+              </template>
201
             </el-table-column>
291
             </el-table-column>
202
-            <el-table-column prop="name" label="数据来源" width="162" align="center">
203
-                <template  slot-scope="scope">
204
-                  {{scope.row.data_sources}}
205
-               </template>
292
+            <el-table-column
293
+              prop="name"
294
+              label="领药人"
295
+              width="160"
296
+              align="center"
297
+            >
298
+              <template slot-scope="scope">
299
+                {{ scope.row.people }}
300
+              </template>
206
             </el-table-column>
301
             </el-table-column>
207
-              <el-table-column prop="name" label="领药人" width="160" align="center">
208
-                <template  slot-scope="scope">
209
-                  {{scope.row.people}}
210
-                </template>
211
-              </el-table-column>
212
           </el-table>
302
           </el-table>
213
         </div>
303
         </div>
214
-        <div style="margin-top:12px;" v-if="state == 1">领药人:
304
+        <div style="margin-top: 12px" v-if="state == 1">
305
+          领药人:
215
           <el-select v-model="admin_user_id" placeholder="请选择">
306
           <el-select v-model="admin_user_id" placeholder="请选择">
216
             <el-option
307
             <el-option
217
               v-for="item in doctorList"
308
               v-for="item in doctorList"
218
               :key="item.admin_user_id"
309
               :key="item.admin_user_id"
219
               :label="item.user_name"
310
               :label="item.user_name"
220
-              :value="item.admin_user_id">
311
+              :value="item.admin_user_id"
312
+            >
221
             </el-option>
313
             </el-option>
222
-           </el-select>
314
+          </el-select>
223
         </div>
315
         </div>
224
       </div>
316
       </div>
225
 
317
 
229
           <el-radio v-model="is_open" label="1">是</el-radio>
321
           <el-radio v-model="is_open" label="1">是</el-radio>
230
           <el-radio v-model="is_open" label="2">否</el-radio>
322
           <el-radio v-model="is_open" label="2">否</el-radio>
231
         </span>
323
         </span>
232
-        <div style="height: 50px; background: #c7ebfc; border-radius: 5px;padding: 7px;">
233
-          <i class="el-icon-info" style="color: #3399ff;font-size: 17px;"></i>
324
+        <div
325
+          style="
326
+            height: 50px;
327
+            background: #c7ebfc;
328
+            border-radius: 5px;
329
+            padding: 7px;
330
+          "
331
+        >
332
+          <i class="el-icon-info" style="color: #3399ff; font-size: 17px"></i>
234
           若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
333
           若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
235
         </div>
334
         </div>
236
         <span slot="footer" class="dialog-footer">
335
         <span slot="footer" class="dialog-footer">
253
 <script>
352
 <script>
254
 import drugPrint from "./print/drugPrint.vue";
353
 import drugPrint from "./print/drugPrint.vue";
255
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
354
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
256
-import { getTodayAdviceList,getPharmacyBaseDrug,updatePharmacyBaseDrug,SaveSetting,getPharmacyConfig,getUserdDrugList } from "@/api/his/advice";
355
+import {
356
+  getTodayAdviceList,
357
+  getPharmacyBaseDrug,
358
+  updatePharmacyBaseDrug,
359
+  SaveSetting,
360
+  getPharmacyConfig,
361
+  getUserdDrugList,
362
+} from "@/api/his/advice";
257
 import {
363
 import {
258
   dispensemedicine,
364
   dispensemedicine,
259
   waitingmedicine,
365
   waitingmedicine,
260
   getpatientswithdrugs,
366
   getpatientswithdrugs,
261
   medicinedeparture,
367
   medicinedeparture,
262
-  getcurrentname
263
-} from "@/api/pharmacy"
264
-const moment = require('moment')
368
+  getcurrentname,
369
+} from "@/api/pharmacy";
370
+const moment = require("moment");
265
 export default {
371
 export default {
266
   components: {
372
   components: {
267
     BreadCrumb,
373
     BreadCrumb,
280
       alreadmount: 0,
386
       alreadmount: 0,
281
       tableData: [],
387
       tableData: [],
282
       tableData_list: [],
388
       tableData_list: [],
283
-      tableList:[],
389
+      tableList: [],
284
       multipleSelection: [],
390
       multipleSelection: [],
285
-      start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
286
-      patientList:[],
287
-      keywords:"",
288
-      dialogVisible:false,
289
-      is_open:"2",
290
-      isVisibility:"",
291
-      propsTable:"",
292
-      doctorList:[],
293
-      admin_user_id:0,
294
-      waiting_drug:[],//待发药列表
295
-      issued_drug:[],//已发药列表
296
-      currentRow:null,
297
-      tmp:0,
391
+      start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
392
+      patientList: [],
393
+      keywords: "",
394
+      dialogVisible: false,
395
+      is_open: "2",
396
+      isVisibility: "",
397
+      propsTable: "",
398
+      doctorList: [],
399
+      admin_user_id: 0,
400
+      waiting_drug: [], //待发药列表
401
+      issued_drug: [], //已发药列表
402
+      currentRow: null,
403
+      tmp: 0,
298
     };
404
     };
299
   },
405
   },
300
 
406
 
301
   methods: {
407
   methods: {
302
-    tt(){
303
-      console.log("this.currentRow",this.currentRow)
304
-      this.$router.go(0)
408
+    tt() {
409
+      console.log("this.currentRow", this.currentRow);
410
+      this.$router.go(0);
305
     },
411
     },
306
-    async fun3(){
307
-      console.log("fun3")
308
-      this.fun1().then(val => {
412
+    async fun3() {
413
+      console.log("fun3");
414
+      this.fun1().then((val) => {
309
         this.fun2();
415
         this.fun2();
310
-      })
416
+      });
311
     },
417
     },
312
-    async fun4(tps){
313
-      console.log("fun3",tps)
314
-      this.fun1().then(val => {
315
-        console.log("this.issued_drug",this.issued_drug)
316
-        for(let i = 0;i < this.issued_drug.length;i++){
317
-          if(tps == this.issued_drug[i].id){
418
+    async fun4(tps) {
419
+      console.log("fun3", tps);
420
+      this.fun1().then((val) => {
421
+        console.log("this.issued_drug", this.issued_drug);
422
+        for (let i = 0; i < this.issued_drug.length; i++) {
423
+          if (tps == this.issued_drug[i].id) {
318
             this.$refs.table02.setCurrentRow(this.issued_drug[i]);
424
             this.$refs.table02.setCurrentRow(this.issued_drug[i]);
319
-            this.handleCurrentChange(this.issued_drug[i])
425
+            this.handleCurrentChange(this.issued_drug[i]);
320
           }
426
           }
321
         }
427
         }
322
-      })
428
+      });
323
     },
429
     },
324
-    async fun5(tps){
325
-      console.log("fun3",tps)
326
-      this.fun1().then(val => {
327
-        console.log("this.issued_drug",this.waiting_drug)
328
-        for(let i = 0;i < this.waiting_drug.length;i++){
329
-          if(tps == this.waiting_drug[i].id){
430
+    async fun5(tps) {
431
+      console.log("fun3", tps);
432
+      this.fun1().then((val) => {
433
+        console.log("this.issued_drug", this.waiting_drug);
434
+        for (let i = 0; i < this.waiting_drug.length; i++) {
435
+          if (tps == this.waiting_drug[i].id) {
330
             this.$refs.table01.setCurrentRow(this.waiting_drug[i]);
436
             this.$refs.table01.setCurrentRow(this.waiting_drug[i]);
331
-            this.handleCurrentChange(this.waiting_drug[i])
437
+            this.handleCurrentChange(this.waiting_drug[i]);
332
           }
438
           }
333
         }
439
         }
334
-      })
440
+      });
335
     },
441
     },
336
-    changeTimes(){
442
+    changeTimes() {
337
       // alert("aa")
443
       // alert("aa")
338
       // this.getdruglist();
444
       // this.getdruglist();
339
       this.fun3();
445
       this.fun3();
340
     },
446
     },
341
     //初始化
447
     //初始化
342
-    init(){
343
-      this.state = 1
344
-      this.tableData = null
345
-      this.currentRow = null
448
+    init() {
449
+      this.state = 1;
450
+      this.tableData = null;
451
+      this.currentRow = null;
346
     },
452
     },
347
-    lala(){
348
-      this.currentRow = null
349
-      this.tableData = null
350
-      this.selectedbydefault()
453
+    lala() {
454
+      this.currentRow = null;
455
+      this.tableData = null;
456
+      this.selectedbydefault();
351
     },
457
     },
352
-     searchAction() {
458
+    searchAction() {
353
       // this.getlist();
459
       // this.getlist();
354
-       this.tableData = null
355
-       this.currentRow = null
356
-       this.getdruglist();
460
+      this.tableData = null;
461
+      this.currentRow = null;
462
+      this.getdruglist();
357
     },
463
     },
358
     // 跳转打印页面
464
     // 跳转打印页面
359
     toPrint() {
465
     toPrint() {
360
-
361
-      if (this.state == 1 && this.multipleSelection.length == 0){
466
+      if (this.state == 1 && this.multipleSelection.length == 0) {
362
         this.$message.error("未选择任何数据");
467
         this.$message.error("未选择任何数据");
363
-        return
468
+        return;
364
       }
469
       }
365
-      if (this.state == 2 && this.tableData == null){
366
-          this.$message.error("未选择任何数据");
367
-          return
470
+      if (this.state == 2 && this.tableData == null) {
471
+        this.$message.error("未选择任何数据");
472
+        return;
368
       }
473
       }
369
-      this.$refs.drugprint.show(this.tableData,this.currentRow,this.state,this.multipleSelection,this.start_time);
474
+      this.$refs.drugprint.show(
475
+        this.tableData,
476
+        this.currentRow,
477
+        this.state,
478
+        this.multipleSelection,
479
+        this.start_time
480
+      );
370
     },
481
     },
371
     //列表选择
482
     //列表选择
372
     handleSelectionChange(val) {
483
     handleSelectionChange(val) {
373
       this.multipleSelection = val;
484
       this.multipleSelection = val;
374
     },
485
     },
375
     //默认选中
486
     //默认选中
376
-    selectedbydefault(){
377
-      if(this.state == 1 && this.waiting_drug.length > 0){
487
+    selectedbydefault() {
488
+      if (this.state == 1 && this.waiting_drug.length > 0) {
378
         this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
489
         this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
379
-        this.handleCurrentChange(this.waiting_drug[0])
490
+        this.handleCurrentChange(this.waiting_drug[0]);
380
       }
491
       }
381
-      if(this.state == 2 && this.issued_drug.length >0){
492
+      if (this.state == 2 && this.issued_drug.length > 0) {
382
         this.$refs.table02.setCurrentRow(this.issued_drug[0]);
493
         this.$refs.table02.setCurrentRow(this.issued_drug[0]);
383
-        this.handleCurrentChange(this.issued_drug[0])
494
+        this.handleCurrentChange(this.issued_drug[0]);
384
       }
495
       }
385
     },
496
     },
386
     //包装selectedbydefault
497
     //包装selectedbydefault
387
-    fun2(){
388
-      console.log("3333333this.waitmount_data",this.waiting_drug)
498
+    fun2() {
499
+      console.log("3333333this.waitmount_data", this.waiting_drug);
389
       // return new Promise((resolve, reject) => {
500
       // return new Promise((resolve, reject) => {
390
-      if(this.state == 1 && this.waiting_drug.length > 0){
501
+      if (this.state == 1 && this.waiting_drug.length > 0) {
391
         this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
502
         this.$refs.table01.setCurrentRow(this.waiting_drug[0]);
392
-        this.handleCurrentChange(this.waiting_drug[0])
503
+        this.handleCurrentChange(this.waiting_drug[0]);
393
       }
504
       }
394
-      if(this.state == 2 && this.issued_drug.length >0){
505
+      if (this.state == 2 && this.issued_drug.length > 0) {
395
         this.$refs.table02.setCurrentRow(this.issued_drug[0]);
506
         this.$refs.table02.setCurrentRow(this.issued_drug[0]);
396
-        this.handleCurrentChange(this.issued_drug[0])
507
+        this.handleCurrentChange(this.issued_drug[0]);
397
       }
508
       }
398
       // });
509
       // });
399
     },
510
     },
400
     // 药品发药
511
     // 药品发药
401
     dispense() {
512
     dispense() {
402
       var tps = this.currentRow.id;
513
       var tps = this.currentRow.id;
403
-      if(this.multipleSelection.length < 1){
404
-        this.$message.error("未选择任何信息")
405
-        return
514
+      if (this.multipleSelection.length < 1) {
515
+        this.$message.error("未选择任何信息");
516
+        return;
406
       }
517
       }
407
       var tmp = "";
518
       var tmp = "";
408
-      console.log("初始值",tmp)
409
-      for (var i=0;i < this.multipleSelection.length;i++){
410
-        tmp = tmp + this.multipleSelection[i].id + ","
519
+      console.log("初始值", tmp);
520
+      for (var i = 0; i < this.multipleSelection.length; i++) {
521
+        tmp = tmp + this.multipleSelection[i].id + ",";
411
       }
522
       }
412
       var params = {
523
       var params = {
413
         creater: this.admin_user_id,
524
         creater: this.admin_user_id,
414
         ids: tmp,
525
         ids: tmp,
415
-      }
526
+      };
416
       medicinedeparture(params).then((res) => {
527
       medicinedeparture(params).then((res) => {
417
-        if (res.data.state == 1){
418
-          this.$message.success("操作成功")
528
+        if (res.data.state == 1) {
529
+          this.$message.success("操作成功");
419
           this.getdruglist();
530
           this.getdruglist();
420
           //刷新列表
531
           //刷新列表
421
           this.handleCurrentChange(this.currentRow);
532
           this.handleCurrentChange(this.currentRow);
422
           this.fun4(tps);
533
           this.fun4(tps);
423
           this.state = 2;
534
           this.state = 2;
424
-          this.multipleSelection = []
425
-        }else{
426
-          this.$message.error("操作失败:" + res.data.msg)
535
+          this.multipleSelection = [];
536
+        } else {
537
+          this.$message.error("操作失败:" + res.data.msg);
427
           //刷新列表
538
           //刷新列表
428
           this.handleCurrentChange(this.currentRow);
539
           this.handleCurrentChange(this.currentRow);
429
           this.fun5(tps);
540
           this.fun5(tps);
430
           this.state = 1;
541
           this.state = 1;
431
         }
542
         }
432
-      })
543
+      });
433
     },
544
     },
434
     //获取药品列表
545
     //获取药品列表
435
-    getdruglist(){
546
+    getdruglist() {
436
       var params = {
547
       var params = {
437
         keyword: this.keywords,
548
         keyword: this.keywords,
438
         time: this.start_time,
549
         time: this.start_time,
439
-      }
550
+      };
440
       waitingmedicine(params).then((res) => {
551
       waitingmedicine(params).then((res) => {
441
-        if (res.data.state == 1){
442
-          this.waiting_drug = res.data.data.list
552
+        if (res.data.state == 1) {
553
+          this.waiting_drug = res.data.data.list;
443
         }
554
         }
444
-      })
555
+      });
445
       dispensemedicine(params).then((res) => {
556
       dispensemedicine(params).then((res) => {
446
-        if (res.data.state == 1){
447
-          this.issued_drug = res.data.data.list
557
+        if (res.data.state == 1) {
558
+          this.issued_drug = res.data.data.list;
448
         }
559
         }
449
-      })
560
+      });
450
     },
561
     },
451
-    async fun1(){
562
+    async fun1() {
452
       var params = {
563
       var params = {
453
         keyword: this.keywords,
564
         keyword: this.keywords,
454
         time: this.start_time,
565
         time: this.start_time,
455
-      }
566
+      };
456
       await waitingmedicine(params).then((res) => {
567
       await waitingmedicine(params).then((res) => {
457
-        if (res.data.state == 1){
458
-          this.waiting_drug = res.data.data.list
568
+        if (res.data.state == 1) {
569
+          this.waiting_drug = res.data.data.list;
459
         }
570
         }
460
-        console.log("fun1lil1111i")
461
-      })
571
+        console.log("fun1lil1111i");
572
+      });
462
       await dispensemedicine(params).then((res) => {
573
       await dispensemedicine(params).then((res) => {
463
-        if (res.data.state == 1){
464
-          this.issued_drug = res.data.data.list
574
+        if (res.data.state == 1) {
575
+          this.issued_drug = res.data.data.list;
465
         }
576
         }
466
-        console.log("fun122222222")
467
-      })
468
-      console.log("fun1")
577
+        console.log("fun122222222");
578
+      });
579
+      console.log("fun1");
469
     },
580
     },
470
 
581
 
471
-    morencreatename(){
472
-      var param ={}
582
+    morencreatename() {
583
+      var param = {};
473
       getcurrentname(param).then((res) => {
584
       getcurrentname(param).then((res) => {
474
-        console.log("res(药)",res)
475
-        if (res.data.state == 1){
585
+        console.log("res(药)", res);
586
+        if (res.data.state == 1) {
476
           this.admin_user_id = res.data.data.list;
587
           this.admin_user_id = res.data.data.list;
477
-          console.log("this.admin_user_id(药)",this.admin_user_id)
588
+          console.log("this.admin_user_id(药)", this.admin_user_id);
478
         }
589
         }
479
       });
590
       });
480
     },
591
     },
481
     //获取领药人选项
592
     //获取领药人选项
482
-    getlist(){
593
+    getlist() {
483
       var params = {
594
       var params = {
484
-        start_time:this.start_time,
485
-        keywords:this.keywords,
486
-      }
487
-      getTodayAdviceList(params).then(response=>{
488
-         if(response.data.state == 1){
489
-           this.doctorList = response.data.data.doctorlist
490
-           console.log("this.admin_user_id(药2)",this.admin_user_id)
491
-           // this.admin_user_id = this.doctorList[0].admin_user_id
492
-           // this.admin_user_id = this.tmp
493
-         }
494
-      })
595
+        start_time: this.start_time,
596
+        keywords: this.keywords,
597
+      };
598
+      getTodayAdviceList(params).then((response) => {
599
+        if (response.data.state == 1) {
600
+          this.doctorList = response.data.data.doctorlist;
601
+          console.log("this.admin_user_id(药2)", this.admin_user_id);
602
+          // this.admin_user_id = this.doctorList[0].admin_user_id
603
+          // this.admin_user_id = this.tmp
604
+        }
605
+      });
495
     },
606
     },
496
-   //  //获取药品的患者信息
497
-    informationofdrugs(val){
607
+    //  //获取药品的患者信息
608
+    informationofdrugs(val) {
498
       var params = {
609
       var params = {
499
         // patient_id: this.currentRow.
610
         // patient_id: this.currentRow.
500
-      }
611
+      };
501
     },
612
     },
502
     handleCurrentChange(val) {
613
     handleCurrentChange(val) {
503
       this.currentRow = val;
614
       this.currentRow = val;
504
-      if(this.state == 1){
505
-        this.getdrugsdetails(0)
615
+      if (this.state == 1) {
616
+        this.getdrugsdetails(0);
506
       }
617
       }
507
-      if (this.state == 2){
508
-        this.getdrugsdetails(1)
618
+      if (this.state == 2) {
619
+        this.getdrugsdetails(1);
509
       }
620
       }
510
     },
621
     },
511
-    getdrugsdetails(val){
622
+    getdrugsdetails(val) {
512
       var params = {
623
       var params = {
513
-        drug_id:this.currentRow.id,
514
-        is_medicine:val,
515
-        time:this.start_time,
516
-      }
624
+        drug_id: this.currentRow.id,
625
+        is_medicine: val,
626
+        time: this.start_time,
627
+      };
517
       getpatientswithdrugs(params).then((res) => {
628
       getpatientswithdrugs(params).then((res) => {
518
-        if (res.data.state == 1){
519
-          this.tableData = res.data.data.list;//列表数据
520
-        }else {
629
+        if (res.data.state == 1) {
630
+          this.tableData = res.data.data.list; //列表数据
631
+        } else {
521
           this.$message.error(res.data.msg);
632
           this.$message.error(res.data.msg);
522
         }
633
         }
523
-      })
634
+      });
524
     },
635
     },
525
 
636
 
526
-    toSetting(){
527
-      getPharmacyConfig().then(response=>{
528
-        if(response.data.state == 1){
529
-           this.dialogVisible = true
530
-           var config = response.data.data.config
531
-           this.is_open = config.is_open.toString()
637
+    toSetting() {
638
+      getPharmacyConfig().then((response) => {
639
+        if (response.data.state == 1) {
640
+          this.dialogVisible = true;
641
+          var config = response.data.data.config;
642
+          this.is_open = config.is_open.toString();
532
         }
643
         }
533
-      })
644
+      });
534
     },
645
     },
535
-    SaveSetting(){
646
+    SaveSetting() {
536
       var params = {
647
       var params = {
537
-        is_open:parseInt(this.is_open),
538
-      }
539
-     SaveSetting(params).then(response=>{
540
-       if(response.data.state == 1){
541
-         var config = response.data.data.config
542
-         this.$message.success("保存成功!")
543
-         this.dialogVisible = false
544
-       }
545
-     })
648
+        is_open: parseInt(this.is_open),
649
+      };
650
+      SaveSetting(params).then((response) => {
651
+        if (response.data.state == 1) {
652
+          var config = response.data.data.config;
653
+          this.$message.success("保存成功!");
654
+          this.dialogVisible = false;
655
+        }
656
+      });
546
     },
657
     },
547
-    getUserlist(drug_id){
548
-       var params = {
549
-        start_time:this.start_time,
550
-        drug_id:drug_id,
551
-      }
552
-      getUserdDrugList(params).then(response=>{
553
-       if(response.data.state == 1){
554
-           var advicelist = response.data.data.advicelist
555
-           for(let i=0;i<advicelist.length;i++){
556
-             advicelist[i].type = 1
557
-             advicelist[i].day = " "
558
-             this.tableList.push(advicelist[i])
559
-           }
560
-           var hisAdviceList = response.data.data.hisAdviceList
561
-           for(let i=0;i<hisAdviceList.length;i++){
562
-             hisAdviceList[i].type = 2
563
-             this.tableList.push(hisAdviceList[i])
564
-           }
565
-           var patient = response.data.data.patient
566
-           this.patientList = patient
658
+    getUserlist(drug_id) {
659
+      var params = {
660
+        start_time: this.start_time,
661
+        drug_id: drug_id,
662
+      };
663
+      getUserdDrugList(params).then((response) => {
664
+        if (response.data.state == 1) {
665
+          var advicelist = response.data.data.advicelist;
666
+          for (let i = 0; i < advicelist.length; i++) {
667
+            advicelist[i].type = 1;
668
+            advicelist[i].day = " ";
669
+            this.tableList.push(advicelist[i]);
670
+          }
671
+          var hisAdviceList = response.data.data.hisAdviceList;
672
+          for (let i = 0; i < hisAdviceList.length; i++) {
673
+            hisAdviceList[i].type = 2;
674
+            this.tableList.push(hisAdviceList[i]);
675
+          }
676
+          var patient = response.data.data.patient;
677
+          this.patientList = patient;
567
         }
678
         }
568
-      })
569
-    }
679
+      });
680
+    },
570
   },
681
   },
571
   created() {
682
   created() {
572
     this.init();
683
     this.init();
613
     display: flex;
724
     display: flex;
614
     justify-content: flex-end;
725
     justify-content: flex-end;
615
   }
726
   }
727
+  .el-button {
728
+    height: 34px;
729
+    width: 65px;
730
+  }
731
+  .el-table{
732
+    margin-top: -13px;
733
+  }
734
+  /deep/ .el-divider {
735
+    height: 2px;
736
+    margin-top: 10px;
737
+  }
616
 }
738
 }
617
 
739
 
618
 /deep/ .el-table--scrollable-x .el-table__body-wrapper {
740
 /deep/ .el-table--scrollable-x .el-table__body-wrapper {

+ 268 - 207
src/xt_pages/Pharmacy/PatientDispensing.vue View File

1
-<template><!--患者发药-->
1
+<template>
2
+  <!--患者发药-->
2
   <div class="main-contain new-main-contain">
3
   <div class="main-contain new-main-contain">
3
     <div class="position">
4
     <div class="position">
4
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
22
             >
23
             >
23
             </el-date-picker>
24
             </el-date-picker>
24
           </div>
25
           </div>
25
-<!--          <el-button @click="testsss">调试1</el-button>-->
26
-<!--          <el-button @click="testsss2">调试2</el-button>-->
26
+          <!--          <el-button @click="testsss">调试1</el-button>-->
27
+          <!--          <el-button @click="testsss2">调试2</el-button>-->
27
           <div class="list">
28
           <div class="list">
28
             <el-radio-group v-model="state" @change="lala()">
29
             <el-radio-group v-model="state" @change="lala()">
29
-              <el-radio :label="1" >待发药{{ waitmount }}人</el-radio>
30
-              <el-radio :label="2" >已发药{{ alreadmount }}人</el-radio>
30
+              <el-radio :label="1">待发药{{ waitmount }}人</el-radio>
31
+              <el-radio :label="2">已发药{{ alreadmount }}人</el-radio>
31
             </el-radio-group>
32
             </el-radio-group>
32
           </div>
33
           </div>
33
           <div
34
           <div
51
             </el-button>
52
             </el-button>
52
           </div>
53
           </div>
53
 
54
 
54
-          <el-table :height="tableHeight" ref="table01" :data="waitmount_data" highlight-current-row @current-change="handleCurrentChange" border style="width: 100%" v-if="state == 1">
55
-            <el-table-column prop="date" label="患者姓名" width="100" >
55
+          <el-table
56
+            :height="tableHeight"
57
+            ref="table01"
58
+            :data="waitmount_data"
59
+            highlight-current-row
60
+            @current-change="handleCurrentChange"
61
+            border
62
+            style="width: 100%"
63
+            v-if="state == 1"
64
+          >
65
+            <el-table-column prop="date" label="患者姓名" width="100">
56
               <template slot-scope="scope">
66
               <template slot-scope="scope">
57
-                <span >{{scope.row.Name ? scope.row.Name : ""}}</span>
67
+                <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
58
               </template>
68
               </template>
59
             </el-table-column>
69
             </el-table-column>
60
             <el-table-column prop="name" label="透析号" width="100">
70
             <el-table-column prop="name" label="透析号" width="100">
61
               <template slot-scope="scope">
71
               <template slot-scope="scope">
62
-                <span>{{scope.row.DialysisNo ? scope.row.DialysisNo : ""}}</span>
72
+                <span>{{
73
+                  scope.row.DialysisNo ? scope.row.DialysisNo : ""
74
+                }}</span>
63
               </template>
75
               </template>
64
             </el-table-column>
76
             </el-table-column>
65
           </el-table>
77
           </el-table>
66
-          <el-table :height="tableHeight" ref="table02" :data="alreadmount_data" highlight-current-row @current-change="handleCurrentChange" border style="width: 100%" v-if="state == 2">
67
-            <el-table-column prop="date" label="患者姓名" width="100" >
68
-              <template slot-scope="scope" >
69
-                <span>{{scope.row.Name ? scope.row.Name : ""}}</span>
78
+          <el-table
79
+            :height="tableHeight"
80
+            ref="table02"
81
+            :data="alreadmount_data"
82
+            highlight-current-row
83
+            @current-change="handleCurrentChange"
84
+            border
85
+            style="width: 100%"
86
+            v-if="state == 2"
87
+          >
88
+            <el-table-column prop="date" label="患者姓名" width="100">
89
+              <template slot-scope="scope">
90
+                <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
70
               </template>
91
               </template>
71
             </el-table-column>
92
             </el-table-column>
72
             <el-table-column prop="name" label="透析号" width="100">
93
             <el-table-column prop="name" label="透析号" width="100">
73
               <template slot-scope="scope">
94
               <template slot-scope="scope">
74
-                <span>{{scope.row.DialysisNo ? scope.row.DialysisNo : ""}}</span>
95
+                <span>{{
96
+                  scope.row.DialysisNo ? scope.row.DialysisNo : ""
97
+                }}</span>
75
               </template>
98
               </template>
76
             </el-table-column>
99
             </el-table-column>
77
           </el-table>
100
           </el-table>
86
             >退药</el-button
109
             >退药</el-button
87
           >
110
           >
88
           <el-button type="primary" @click="toPrint">打印</el-button>
111
           <el-button type="primary" @click="toPrint">打印</el-button>
89
-<!--          <el-button @click="tiaoshi">调试</el-button>-->
90
-          <el-button type="primary" v-if="state == 1" @click="toSetting">设置</el-button>
112
+          <!--          <el-button @click="tiaoshi">调试</el-button>-->
113
+          <el-button type="primary" v-if="state == 1" @click="toSetting"
114
+            >设置</el-button
115
+          >
91
         </div>
116
         </div>
92
-        <el-divider></el-divider>
117
+        <el-divider style="margin-top: 10px"></el-divider>
93
         <div>
118
         <div>
94
           <el-table
119
           <el-table
95
             :height="tableHeight"
120
             :height="tableHeight"
97
             border
122
             border
98
             style="width: 100%"
123
             style="width: 100%"
99
           >
124
           >
100
-            <el-table-column type="index" label="序号" width="120" align="center">
125
+            <el-table-column
126
+              type="index"
127
+              label="序号"
128
+              width="120"
129
+              align="center"
130
+            >
101
             </el-table-column>
131
             </el-table-column>
102
-            <el-table-column  label="名称" width="200" align="center">
132
+            <el-table-column label="名称" width="200" align="center">
103
               <template slot-scope="scope">
133
               <template slot-scope="scope">
104
-                <span>{{scope.row.Name  ? scope.row.Name  : ""}}</span>
134
+                <span>{{ scope.row.Name ? scope.row.Name : "" }}</span>
105
               </template>
135
               </template>
106
             </el-table-column>
136
             </el-table-column>
107
-            <el-table-column  label="单次用量" width="150" align="center">
137
+            <el-table-column label="单次用量" width="150" align="center">
108
               <template slot-scope="scope">
138
               <template slot-scope="scope">
109
-                <span>{{scope.row.SingleDosage  ? scope.row.SingleDosage  : ""}}</span>
139
+                <span>{{
140
+                  scope.row.SingleDosage ? scope.row.SingleDosage : ""
141
+                }}</span>
110
               </template>
142
               </template>
111
             </el-table-column>
143
             </el-table-column>
112
-            <el-table-column  label="用法" width="160" align="center">
144
+            <el-table-column label="用法" width="160" align="center">
113
               <template slot-scope="scope">
145
               <template slot-scope="scope">
114
-                <span>{{scope.row.Usage  ? scope.row.Usage  : ""}}</span>
146
+                <span>{{ scope.row.Usage ? scope.row.Usage : "" }}</span>
115
               </template>
147
               </template>
116
             </el-table-column>
148
             </el-table-column>
117
-            <el-table-column  label="频率" width="160" align="center">
149
+            <el-table-column label="频率" width="160" align="center">
118
               <template slot-scope="scope">
150
               <template slot-scope="scope">
119
-                <span>{{scope.row.Frequency  ? scope.row.Frequency  : ""}}</span>
151
+                <span>{{
152
+                  scope.row.Frequency ? scope.row.Frequency : ""
153
+                }}</span>
120
               </template>
154
               </template>
121
             </el-table-column>
155
             </el-table-column>
122
-            <el-table-column  label="天数" width="140" align="center">
156
+            <el-table-column label="天数" width="140" align="center">
123
               <template slot-scope="scope">
157
               <template slot-scope="scope">
124
-                <span>{{scope.row.Days  ? scope.row.Days  : ""}}</span>
158
+                <span>{{ scope.row.Days ? scope.row.Days : "" }}</span>
125
               </template>
159
               </template>
126
             </el-table-column>
160
             </el-table-column>
127
-            <el-table-column  label="总量" width="140" align="center">
161
+            <el-table-column label="总量" width="140" align="center">
128
               <template slot-scope="scope">
162
               <template slot-scope="scope">
129
-                <span>{{scope.row.Total  ? scope.row.Total  : ""}}</span>
163
+                <span>{{ scope.row.Total ? scope.row.Total : "" }}</span>
130
               </template>
164
               </template>
131
             </el-table-column>
165
             </el-table-column>
132
-            <el-table-column  label="开立医生" width="150" align="center">
166
+            <el-table-column label="开立医生" width="150" align="center">
133
               <template slot-scope="scope">
167
               <template slot-scope="scope">
134
-                <span>{{scope.row.Doctor  ? scope.row.Doctor  : ""}}</span>
168
+                <span>{{ scope.row.Doctor ? scope.row.Doctor : "" }}</span>
135
               </template>
169
               </template>
136
             </el-table-column>
170
             </el-table-column>
137
-            <el-table-column  label="数据来源" width="162" align="center">
171
+            <el-table-column label="数据来源" width="162" align="center">
138
               <template slot-scope="scope">
172
               <template slot-scope="scope">
139
-                <span>{{scope.row.DataSources  ? scope.row.DataSources  : ""}}</span>
173
+                <span>{{
174
+                  scope.row.DataSources ? scope.row.DataSources : ""
175
+                }}</span>
140
               </template>
176
               </template>
141
             </el-table-column>
177
             </el-table-column>
142
-            <el-table-column  label="备注" width="170" align="center">
178
+            <el-table-column label="备注" width="170" align="center">
143
               <template slot-scope="scope">
179
               <template slot-scope="scope">
144
-                <span>{{scope.row.Remarks  ? scope.row.Remarks  : ""}}</span>
180
+                <span>{{ scope.row.Remarks ? scope.row.Remarks : "" }}</span>
145
               </template>
181
               </template>
146
             </el-table-column>
182
             </el-table-column>
147
           </el-table>
183
           </el-table>
148
         </div>
184
         </div>
149
-<!--        <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
185
+        <!--        <div v-if="state == 2" style="margin-top: 25px">诊断时间:{{ timedate }}</div>-->
150
       </div>
186
       </div>
151
       <el-dialog title="设置" :visible.sync="dialogVisible" width="30%">
187
       <el-dialog title="设置" :visible.sync="dialogVisible" width="30%">
152
         <span style="font-size: 17px">请选择药品是否要通过药房管理出库</span>
188
         <span style="font-size: 17px">请选择药品是否要通过药房管理出库</span>
154
           <el-radio v-model="is_open" label="1">是</el-radio>
190
           <el-radio v-model="is_open" label="1">是</el-radio>
155
           <el-radio v-model="is_open" label="2">否</el-radio>
191
           <el-radio v-model="is_open" label="2">否</el-radio>
156
         </span>
192
         </span>
157
-        <div style="height: 50px; background: #c7ebfc; border-radius: 5px;padding: 7px;">
158
-          <i class="el-icon-info" style="color: #3399ff;font-size: 17px;"></i>
193
+        <div
194
+          style="
195
+            height: 50px;
196
+            background: #c7ebfc;
197
+            border-radius: 5px;
198
+            padding: 7px;
199
+          "
200
+        >
201
+          <i class="el-icon-info" style="color: #3399ff; font-size: 17px"></i>
159
           若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
202
           若选择为是,则通过药房发药的药品都会在发药之后进行出库,否则按原来的方式进行出库管理
160
         </div>
203
         </div>
161
         <span slot="footer" class="dialog-footer">
204
         <span slot="footer" class="dialog-footer">
177
 <script>
220
 <script>
178
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
221
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
179
 import patientPrint from "./print/patientPrint.vue";
222
 import patientPrint from "./print/patientPrint.vue";
180
-import { getPharmacyConfig,SaveSetting } from "@/api/his/advice";
223
+import { getPharmacyConfig, SaveSetting } from "@/api/his/advice";
181
 import {
224
 import {
182
   waitingdrug,
225
   waitingdrug,
183
   issueddrugs,
226
   issueddrugs,
184
   todaynumber,
227
   todaynumber,
185
   getpharmacycontent,
228
   getpharmacycontent,
186
   dispensingmedicine,
229
   dispensingmedicine,
187
-  drugwithdrawal
188
-} from "@/api/pharmacy"
189
-const moment = require('moment')
230
+  drugwithdrawal,
231
+} from "@/api/pharmacy";
232
+const moment = require("moment");
190
 export default {
233
 export default {
191
   components: {
234
   components: {
192
     BreadCrumb,
235
     BreadCrumb,
194
   },
237
   },
195
   data() {
238
   data() {
196
     return {
239
     return {
197
-      patient_id:0,
240
+      patient_id: 0,
198
       crumbs: [
241
       crumbs: [
199
         { path: false, name: "药房管理" },
242
         { path: false, name: "药房管理" },
200
         { path: "/Pharmacy/patiantDispensing", name: "患者发药" },
243
         { path: "/Pharmacy/patiantDispensing", name: "患者发药" },
201
       ],
244
       ],
202
       tableHeight: 400,
245
       tableHeight: 400,
203
-      start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
204
-      state: 1,//1待发药,2已发药
205
-      waitmount: 0,//待发药人数
246
+      start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
247
+      state: 1, //1待发药,2已发药
248
+      waitmount: 0, //待发药人数
206
       waitmount_data: [],
249
       waitmount_data: [],
207
-      alreadmount: 0,//已发药人数
250
+      alreadmount: 0, //已发药人数
208
       alreadmount_data: [],
251
       alreadmount_data: [],
209
       keywords: "",
252
       keywords: "",
210
       tableData: [],
253
       tableData: [],
211
       propsTable: [],
254
       propsTable: [],
212
       tableData_list: [],
255
       tableData_list: [],
213
       isVisibility: false,
256
       isVisibility: false,
214
-      currentRow:null,
215
-      dialogVisible:false,
216
-      is_open:"2",
257
+      currentRow: null,
258
+      dialogVisible: false,
259
+      is_open: "2",
217
     };
260
     };
218
   },
261
   },
219
-  watch: {
220
-  },
262
+  watch: {},
221
   created() {
263
   created() {
222
     this.init();
264
     this.init();
223
     this.gettodaynumber();
265
     this.gettodaynumber();
226
     // this.selectedbydefault();
268
     // this.selectedbydefault();
227
   },
269
   },
228
   methods: {
270
   methods: {
229
-    tiaoshi(){
230
-      console.log("this.tableData",this.tableData)
271
+    tiaoshi() {
272
+      console.log("this.tableData", this.tableData);
231
     },
273
     },
232
-    async fun3(){
233
-      console.log("fun3")
234
-        this.fun1().then(val => {
235
-          this.fun2();
236
-        })
274
+    async fun3() {
275
+      console.log("fun3");
276
+      this.fun1().then((val) => {
277
+        this.fun2();
278
+      });
237
     },
279
     },
238
-    async fun4(tmp){
239
-      console.log("fun3")
240
-      this.fun1().then(val => {
241
-        console.log("this.alreadmount_data",this.alreadmount_data)
242
-        for (let i = 0;i < this.alreadmount_data.length;i++){
243
-          console.log("tmp = ",tmp)
244
-          if (this.alreadmount_data[i].PatientID == tmp){
245
-            console.log("i = ",i)
280
+    async fun4(tmp) {
281
+      console.log("fun3");
282
+      this.fun1().then((val) => {
283
+        console.log("this.alreadmount_data", this.alreadmount_data);
284
+        for (let i = 0; i < this.alreadmount_data.length; i++) {
285
+          console.log("tmp = ", tmp);
286
+          if (this.alreadmount_data[i].PatientID == tmp) {
287
+            console.log("i = ", i);
246
             this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
288
             this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
247
-            this.handleCurrentChange(this.alreadmount_data[i])
289
+            this.handleCurrentChange(this.alreadmount_data[i]);
248
           }
290
           }
249
         }
291
         }
250
-      })
292
+      });
251
     },
293
     },
252
-    async fun5(tmp){
253
-      console.log("fun5555")
254
-      this.fun1().then(val => {
255
-        console.log("this.alreadmount_data",this.waitmount_data)
256
-        for (let i = 0;i < this.waitmount_data.length;i++){
257
-          console.log("tmp = ",tmp)
258
-          if (this.waitmount_data[i].PatientID == tmp){
259
-            console.log("i = ",i)
294
+    async fun5(tmp) {
295
+      console.log("fun5555");
296
+      this.fun1().then((val) => {
297
+        console.log("this.alreadmount_data", this.waitmount_data);
298
+        for (let i = 0; i < this.waitmount_data.length; i++) {
299
+          console.log("tmp = ", tmp);
300
+          if (this.waitmount_data[i].PatientID == tmp) {
301
+            console.log("i = ", i);
260
             this.$refs.table01.setCurrentRow(this.waitmount_data[i]);
302
             this.$refs.table01.setCurrentRow(this.waitmount_data[i]);
261
-            this.handleCurrentChange(this.waitmount_data[i])
303
+            this.handleCurrentChange(this.waitmount_data[i]);
262
           }
304
           }
263
         }
305
         }
264
-      })
306
+      });
265
     },
307
     },
266
 
308
 
267
-    lala(){
268
-      console.log("this.state!!!!!!",this.state)
309
+    lala() {
310
+      console.log("this.state!!!!!!", this.state);
269
       //初始化状态
311
       //初始化状态
270
-      this.tableData = null
271
-      this.currentRow = null
272
-      this.selectedbydefault()
312
+      this.tableData = null;
313
+      this.currentRow = null;
314
+      this.selectedbydefault();
273
     },
315
     },
274
     //选中行数
316
     //选中行数
275
     handleCurrentChange(val) {
317
     handleCurrentChange(val) {
276
       this.currentRow = val;
318
       this.currentRow = val;
277
-      console.log("this.currentRow",this.currentRow)
278
-      if(this.state == 1){
279
-        this.getpatientdetails(0)
319
+      console.log("this.currentRow", this.currentRow);
320
+      if (this.state == 1) {
321
+        this.getpatientdetails(0);
280
       }
322
       }
281
-      if(this.state == 2){
282
-        this.getpatientdetails(1)
323
+      if (this.state == 2) {
324
+        this.getpatientdetails(1);
283
       }
325
       }
284
     },
326
     },
285
-    init(){
327
+    init() {
286
       // console.log("初始化了")
328
       // console.log("初始化了")
287
-      this.state = 1
288
-      this.tableData = null
289
-      this.currentRow = null
329
+      this.state = 1;
330
+      this.tableData = null;
331
+      this.currentRow = null;
290
     },
332
     },
291
-    testsss(){
292
-     this.state = 1;
333
+    testsss() {
334
+      this.state = 1;
293
     },
335
     },
294
     //默认选中的
336
     //默认选中的
295
-    selectedbydefault(){
296
-      if(this.state == 1 && this.waitmount_data.length > 0){
337
+    selectedbydefault() {
338
+      if (this.state == 1 && this.waitmount_data.length > 0) {
297
         this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
339
         this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
298
-        this.handleCurrentChange(this.waitmount_data[0])
340
+        this.handleCurrentChange(this.waitmount_data[0]);
299
       }
341
       }
300
-      if(this.state == 2 && this.alreadmount_data.length >0){
342
+      if (this.state == 2 && this.alreadmount_data.length > 0) {
301
         this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
343
         this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
302
-        this.handleCurrentChange(this.alreadmount_data[0])
344
+        this.handleCurrentChange(this.alreadmount_data[0]);
303
       }
345
       }
304
     },
346
     },
305
     //包装selectedbydefault
347
     //包装selectedbydefault
306
-    fun2(){
307
-      console.log("3333333this.waitmount_data",this.waitmount_data)
348
+    fun2() {
349
+      console.log("3333333this.waitmount_data", this.waitmount_data);
308
       // return new Promise((resolve, reject) => {
350
       // return new Promise((resolve, reject) => {
309
-        if(this.state == 1 && this.waitmount_data.length > 0){
310
-          this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
311
-          this.handleCurrentChange(this.waitmount_data[0])
312
-        }
313
-        if(this.state == 2 && this.alreadmount_data.length >0){
314
-          this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
315
-          this.handleCurrentChange(this.alreadmount_data[0])
316
-        }
351
+      if (this.state == 1 && this.waitmount_data.length > 0) {
352
+        this.$refs.table01.setCurrentRow(this.waitmount_data[0]);
353
+        this.handleCurrentChange(this.waitmount_data[0]);
354
+      }
355
+      if (this.state == 2 && this.alreadmount_data.length > 0) {
356
+        this.$refs.table02.setCurrentRow(this.alreadmount_data[0]);
357
+        this.handleCurrentChange(this.alreadmount_data[0]);
358
+      }
317
       // });
359
       // });
318
     },
360
     },
319
-    changeTimes(){
361
+    changeTimes() {
320
       this.gettodaynumber();
362
       this.gettodaynumber();
321
       this.getwaitmount();
363
       this.getwaitmount();
322
       this.fun3();
364
       this.fun3();
323
     },
365
     },
324
     //获取当天发药的人数
366
     //获取当天发药的人数
325
-    gettodaynumber(){
326
-      console.log("aaa")
367
+    gettodaynumber() {
368
+      console.log("aaa");
327
       var params = {
369
       var params = {
328
         time: this.start_time,
370
         time: this.start_time,
329
-      }
371
+      };
330
       todaynumber(params).then((res) => {
372
       todaynumber(params).then((res) => {
331
-        if (res.data.state == 1){
373
+        if (res.data.state == 1) {
332
           this.waitmount = res.data.data.itotal;
374
           this.waitmount = res.data.data.itotal;
333
           this.alreadmount = res.data.data.wtotal;
375
           this.alreadmount = res.data.data.wtotal;
334
         }
376
         }
335
-      })
377
+      });
336
       // console.log("2222222")
378
       // console.log("2222222")
337
     },
379
     },
338
     //获取发药人列表
380
     //获取发药人列表
339
-    getwaitmount(){
381
+    getwaitmount() {
340
       var params = {
382
       var params = {
341
         keyword: this.keywords,
383
         keyword: this.keywords,
342
         time: this.start_time,
384
         time: this.start_time,
343
-      }
385
+      };
344
       waitingdrug(params).then((res) => {
386
       waitingdrug(params).then((res) => {
345
-        if (res.data.state == 1){
387
+        if (res.data.state == 1) {
346
           this.waitmount_data = res.data.data.list;
388
           this.waitmount_data = res.data.data.list;
347
         }
389
         }
348
-      })
390
+      });
349
       issueddrugs(params).then((res) => {
391
       issueddrugs(params).then((res) => {
350
-        if (res.data.state == 1){
392
+        if (res.data.state == 1) {
351
           this.alreadmount_data = res.data.data.list;
393
           this.alreadmount_data = res.data.data.list;
352
         }
394
         }
353
-      })
395
+      });
354
     },
396
     },
355
     //包装getwaitmount
397
     //包装getwaitmount
356
-    async fun1(){
398
+    async fun1() {
357
       // return new Promise((resolve, reject) => {
399
       // return new Promise((resolve, reject) => {
358
-        var params = {
359
-          keyword: this.keywords,
360
-          time: this.start_time,
400
+      var params = {
401
+        keyword: this.keywords,
402
+        time: this.start_time,
403
+      };
404
+      await waitingdrug(params).then((res) => {
405
+        if (res.data.state == 1) {
406
+          this.waitmount_data = res.data.data.list;
407
+          console.log("1111111");
361
         }
408
         }
362
-        await waitingdrug(params).then((res) => {
363
-          if (res.data.state == 1){
364
-            this.waitmount_data = res.data.data.list;
365
-            console.log("1111111")
366
-          }
367
-        })
368
-        await issueddrugs(params).then((res) => {
369
-          if (res.data.state == 1){
370
-            this.alreadmount_data = res.data.data.list;
371
-            console.log("1111111s")
372
-          }
373
-        })
374
-        console.log("222222222")
409
+      });
410
+      await issueddrugs(params).then((res) => {
411
+        if (res.data.state == 1) {
412
+          this.alreadmount_data = res.data.data.list;
413
+          console.log("1111111s");
414
+        }
415
+      });
416
+      console.log("222222222");
375
 
417
 
376
       // })
418
       // })
377
     },
419
     },
378
     //获取患者信息详情
420
     //获取患者信息详情
379
-    getpatientdetails(val){
421
+    getpatientdetails(val) {
380
       var params = {
422
       var params = {
381
-        patient_id:this.currentRow.PatientID,
423
+        patient_id: this.currentRow.PatientID,
382
         is_medicine: val,
424
         is_medicine: val,
383
-        time:this.start_time,
384
-      }
425
+        time: this.start_time,
426
+      };
385
       getpharmacycontent(params).then((res) => {
427
       getpharmacycontent(params).then((res) => {
386
-        if (res.data.state == 1){
428
+        if (res.data.state == 1) {
387
           this.tableData = res.data.data.list;
429
           this.tableData = res.data.data.list;
388
-        }else{
430
+        } else {
389
           this.$message.error(res.data.msg);
431
           this.$message.error(res.data.msg);
390
         }
432
         }
391
-      })
433
+      });
392
     },
434
     },
393
     // 跳转打印页面
435
     // 跳转打印页面
394
     toPrint() {
436
     toPrint() {
395
-      if (this.tableData == null){
437
+      if (this.tableData == null) {
396
         this.$message.error("未选择任何数据");
438
         this.$message.error("未选择任何数据");
397
-        return
439
+        return;
398
       }
440
       }
399
-      this.$refs.patientprint.show(this.tableData,this.currentRow,this.state,this.start_time);
441
+      this.$refs.patientprint.show(
442
+        this.tableData,
443
+        this.currentRow,
444
+        this.state,
445
+        this.start_time
446
+      );
400
     },
447
     },
401
 
448
 
402
     // 搜索患者
449
     // 搜索患者
409
     dispense() {
456
     dispense() {
410
       var tmp = this.currentRow.PatientID;
457
       var tmp = this.currentRow.PatientID;
411
       var params = {
458
       var params = {
412
-        patient_id:this.currentRow.PatientID,
413
-        time:this.start_time,
459
+        patient_id: this.currentRow.PatientID,
460
+        time: this.start_time,
414
       };
461
       };
415
       this.$confirm("确定是否对该药品进行发药?", "患者发药", {
462
       this.$confirm("确定是否对该药品进行发药?", "患者发药", {
416
         confirmButtonText: "确 定",
463
         confirmButtonText: "确 定",
417
         cancelButtonText: "取 消",
464
         cancelButtonText: "取 消",
418
         type: "warning",
465
         type: "warning",
419
-      }).then(() => {
420
-        dispensingmedicine(params).then((res) => {
421
-          if(res.data.state == 1){
422
-            this.$message.success('操作成功');
423
-            this.gettodaynumber();
424
-            this.searchAction();
425
-            this.tableData = null;
426
-            this.fun4(tmp);
427
-            this.state = 2;
428
-            // console.log("this.alreadmount_data",this.alreadmount_data)
429
-            // for (let i = 0;i < this.alreadmount_data.length;i++){
430
-            //   console.log("tmp = ",tmp)
431
-            //     if (this.alreadmount_data[i].PatientID == tmp){
432
-            //       console.log("i = ",i)
433
-            //       this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
434
-            //       this.handleCurrentChange(this.alreadmount_data[i])
435
-            //     }
436
-            // }
437
-          }else {
438
-            this.$message.error(res.data.msg);
439
-          }
466
+      })
467
+        .then(() => {
468
+          dispensingmedicine(params).then((res) => {
469
+            if (res.data.state == 1) {
470
+              this.$message.success("操作成功");
471
+              this.gettodaynumber();
472
+              this.searchAction();
473
+              this.tableData = null;
474
+              this.fun4(tmp);
475
+              this.state = 2;
476
+              // console.log("this.alreadmount_data",this.alreadmount_data)
477
+              // for (let i = 0;i < this.alreadmount_data.length;i++){
478
+              //   console.log("tmp = ",tmp)
479
+              //     if (this.alreadmount_data[i].PatientID == tmp){
480
+              //       console.log("i = ",i)
481
+              //       this.$refs.table02.setCurrentRow(this.alreadmount_data[i]);
482
+              //       this.handleCurrentChange(this.alreadmount_data[i])
483
+              //     }
484
+              // }
485
+            } else {
486
+              this.$message.error(res.data.msg);
487
+            }
488
+          });
440
         })
489
         })
441
-      }).catch(() => {});
490
+        .catch(() => {});
442
     },
491
     },
443
 
492
 
444
-    toSetting(){
445
-      getPharmacyConfig().then(response=>{
446
-        if(response.data.state == 1){
447
-          this.dialogVisible = true
448
-          var config = response.data.data.config
449
-          this.is_open = config.is_open.toString()
493
+    toSetting() {
494
+      getPharmacyConfig().then((response) => {
495
+        if (response.data.state == 1) {
496
+          this.dialogVisible = true;
497
+          var config = response.data.data.config;
498
+          this.is_open = config.is_open.toString();
450
         }
499
         }
451
-      })
500
+      });
452
     },
501
     },
453
-    SaveSetting(){
502
+    SaveSetting() {
454
       var params = {
503
       var params = {
455
-        is_open:parseInt(this.is_open),
456
-      }
457
-      SaveSetting(params).then(response=>{
458
-        if(response.data.state == 1){
459
-          var config = response.data.data.config
460
-          this.$message.success("保存成功!")
461
-          this.dialogVisible = false
504
+        is_open: parseInt(this.is_open),
505
+      };
506
+      SaveSetting(params).then((response) => {
507
+        if (response.data.state == 1) {
508
+          var config = response.data.data.config;
509
+          this.$message.success("保存成功!");
510
+          this.dialogVisible = false;
462
         }
511
         }
463
-      })
512
+      });
464
     },
513
     },
465
     // 药品退药
514
     // 药品退药
466
     endispense() {
515
     endispense() {
467
       var tmp = this.currentRow.PatientID;
516
       var tmp = this.currentRow.PatientID;
468
       var params = {
517
       var params = {
469
-        patient_id:this.currentRow.PatientID,
470
-        time:this.start_time,
518
+        patient_id: this.currentRow.PatientID,
519
+        time: this.start_time,
471
       };
520
       };
472
       this.$confirm("确定是否对该药品进行退药?", "患者退药", {
521
       this.$confirm("确定是否对该药品进行退药?", "患者退药", {
473
         confirmButtonText: "确 定",
522
         confirmButtonText: "确 定",
474
         cancelButtonText: "取 消",
523
         cancelButtonText: "取 消",
475
         type: "warning",
524
         type: "warning",
476
-      }).then(() => {
477
-        drugwithdrawal(params).then((res) => {
478
-          if(res.data.state == 1){
479
-            this.$message.success('操作成功');
480
-            this.gettodaynumber();
481
-            this.searchAction();
482
-            this.tableData = null;
483
-            this.fun5(tmp);
484
-            this.state = 1;
485
-          }else {
486
-            this.$message.error(res.data.msg);
487
-          }
525
+      })
526
+        .then(() => {
527
+          drugwithdrawal(params).then((res) => {
528
+            if (res.data.state == 1) {
529
+              this.$message.success("操作成功");
530
+              this.gettodaynumber();
531
+              this.searchAction();
532
+              this.tableData = null;
533
+              this.fun5(tmp);
534
+              this.state = 1;
535
+            } else {
536
+              this.$message.error(res.data.msg);
537
+            }
538
+          });
488
         })
539
         })
489
-      }).catch(() => {});
540
+        .catch(() => {});
490
     },
541
     },
491
   },
542
   },
492
-
493
 };
543
 };
494
 </script>
544
 </script>
495
 
545
 
528
     display: flex;
578
     display: flex;
529
     justify-content: flex-end;
579
     justify-content: flex-end;
530
   }
580
   }
581
+  .el-table {
582
+    margin-top: -13px;
583
+  }
584
+  .el-button {
585
+    height: 34px;
586
+    width: 65px;
587
+  }
588
+  /deep/ .el-divider {
589
+    height: 2px;
590
+    margin-top: 10px;
591
+  }
531
 }
592
 }
532
 
593
 
533
-/deep/ .el-input__inner{
594
+/deep/ .el-input__inner {
534
   padding-right: 15px;
595
   padding-right: 15px;
535
 }
596
 }
536
 
597
 

+ 2 - 2
src/xt_pages/Pharmacy/print/drugPrint.vue View File

228
 }
228
 }
229
 .print_style {
229
 .print_style {
230
   position: absolute;
230
   position: absolute;
231
-  right: 10px;
232
-  top: 42px;
231
+  right: 65px;
232
+  top: 50px;
233
 }
233
 }
234
 
234
 
235
 .list_title {
235
 .list_title {