|
@@ -82,8 +82,9 @@
|
82
|
82
|
type="primary"
|
83
|
83
|
icon="el-icon-search"
|
84
|
84
|
@click="getAllQuery"
|
85
|
|
- >查询</el-button
|
86
|
|
- >
|
|
85
|
+ >查询</el-button>
|
|
86
|
+
|
|
87
|
+
|
87
|
88
|
</div>
|
88
|
89
|
|
89
|
90
|
<div style="margin-bottom: 20px;">
|
|
@@ -116,6 +117,15 @@
|
116
|
117
|
</div>
|
117
|
118
|
</template>
|
118
|
119
|
</el-autocomplete>
|
|
120
|
+
|
|
121
|
+ <el-button
|
|
122
|
+ style="float: right"
|
|
123
|
+ size="small"
|
|
124
|
+ icon="el-icon-printer"
|
|
125
|
+ @click="BatchPrintAction"
|
|
126
|
+ type="primary"
|
|
127
|
+ >批量打印
|
|
128
|
+ </el-button>
|
119
|
129
|
|
120
|
130
|
</div>
|
121
|
131
|
|
|
@@ -251,18 +261,222 @@
|
251
|
261
|
<el-button type="primary" @click="saveTextArea()">确 定</el-button>
|
252
|
262
|
</span>
|
253
|
263
|
</el-dialog>
|
|
264
|
+
|
|
265
|
+ <el-dialog
|
|
266
|
+ title="入库记录"
|
|
267
|
+ :visible.sync="dialogVisibleOne"
|
|
268
|
+ width="80%"
|
|
269
|
+ top="5vh"
|
|
270
|
+ :close-on-click-modal="false"
|
|
271
|
+ >
|
|
272
|
+ <!-- 查询条件区域 -->
|
|
273
|
+ <div class="filter-container">
|
|
274
|
+ <el-row :gutter="20">
|
|
275
|
+ <el-col :span="8">
|
|
276
|
+ <span class="demonstration">日期查询:</span>
|
|
277
|
+ <el-date-picker
|
|
278
|
+ size="small"
|
|
279
|
+ v-model="listQuery.start_time"
|
|
280
|
+ prefix-icon="el-icon-date"
|
|
281
|
+ @change="changeStartTime"
|
|
282
|
+ :editable="false"
|
|
283
|
+ style="width: 196px;"
|
|
284
|
+ type="date"
|
|
285
|
+ placeholder="选择日期时间"
|
|
286
|
+ align="right"
|
|
287
|
+ :picker-options="pickerOptions"
|
|
288
|
+ format="yyyy-MM-dd"
|
|
289
|
+ value-format="yyyy-MM-dd"
|
|
290
|
+ ></el-date-picker>
|
|
291
|
+ -
|
|
292
|
+ <el-date-picker
|
|
293
|
+ size="small"
|
|
294
|
+ v-model="listQuery.end_time"
|
|
295
|
+ prefix-icon="el-icon-date"
|
|
296
|
+ @change="changeEndTime"
|
|
297
|
+ :editable="false"
|
|
298
|
+ style="width: 196px;"
|
|
299
|
+ type="date"
|
|
300
|
+ placeholder="选择日期时间"
|
|
301
|
+ align="right"
|
|
302
|
+ :picker-options="pickerOptions"
|
|
303
|
+ format="yyyy-MM-dd"
|
|
304
|
+ value-format="yyyy-MM-dd"
|
|
305
|
+ ></el-date-picker>
|
|
306
|
+ </el-col>
|
|
307
|
+ <el-col :span="8">
|
|
308
|
+ <el-autocomplete
|
|
309
|
+ class="checkSearch"
|
|
310
|
+ popper-class="my-autocomplete"
|
|
311
|
+ v-model="drug_name"
|
|
312
|
+ :fetch-suggestions="querySearchAsync"
|
|
313
|
+ :trigger-on-focus="true"
|
|
314
|
+ placeholder="请输入药品名称"
|
|
315
|
+ @select="handleSelectOne"
|
|
316
|
+ style="width: 500px"
|
|
317
|
+ >
|
|
318
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
319
|
+ <template slot-scope="{ item }">
|
|
320
|
+ <div class="name">
|
|
321
|
+ {{
|
|
322
|
+ item.drug_name +
|
|
323
|
+ item.dose +
|
|
324
|
+ item.dose_unit +
|
|
325
|
+ "*" +
|
|
326
|
+ item.min_number +
|
|
327
|
+ item.min_unit +
|
|
328
|
+ "/" +
|
|
329
|
+ item.max_unit +
|
|
330
|
+ " " +
|
|
331
|
+ item.manufacturer
|
|
332
|
+ }}
|
|
333
|
+ </div>
|
|
334
|
+ </template>
|
|
335
|
+ </el-autocomplete>
|
|
336
|
+
|
|
337
|
+ </el-col>
|
|
338
|
+ <el-col :span="2">
|
|
339
|
+ <el-button type="primary" @click="handleQuery" style="width: 100%">查询</el-button>
|
|
340
|
+ </el-col>
|
|
341
|
+ </el-row>
|
|
342
|
+ </div>
|
|
343
|
+
|
|
344
|
+ <!-- 操作按钮区域 -->
|
|
345
|
+ <div class="operation-buttons" style="margin-bottom: 10px;">
|
|
346
|
+ <el-button type="primary" @click="toGoodPrint">打印</el-button>
|
|
347
|
+ <!-- <el-button type="primary" @click="toPrint">导出</el-button> -->
|
|
348
|
+ </div>
|
|
349
|
+
|
|
350
|
+ <!-- 表格区域 -->
|
|
351
|
+ <el-table
|
|
352
|
+ :data="tablePrintData"
|
|
353
|
+ border
|
|
354
|
+ style="width: 100%"
|
|
355
|
+ height="60vh"
|
|
356
|
+ v-loading="loading"
|
|
357
|
+ @selection-change="batchSelect"
|
|
358
|
+ element-loading-text="数据加载中"
|
|
359
|
+ >
|
|
360
|
+ <el-table-column align="center" type="selection" width="55">
|
|
361
|
+ </el-table-column>
|
|
362
|
+ <el-table-column prop="index" label="序号" width="60" align="center">
|
|
363
|
+ <template slot-scope="scope">
|
|
364
|
+ {{ scope.$index+1 }}
|
|
365
|
+ </template>
|
|
366
|
+ </el-table-column>
|
|
367
|
+
|
|
368
|
+ <el-table-column prop="medicalCode" label="医保编码" width="200" align="center">
|
|
369
|
+ <template slot-scope="scope">
|
|
370
|
+ {{ scope.row.social_security_directory_code }}
|
|
371
|
+ </template>
|
|
372
|
+ </el-table-column>
|
|
373
|
+ <el-table-column prop="name" label="药品名称" width="180" align="center">
|
|
374
|
+ <template slot-scope="scope">
|
|
375
|
+ {{ scope.row.drug_name }}
|
|
376
|
+ </template>
|
|
377
|
+ </el-table-column>
|
|
378
|
+ <el-table-column prop="specification" label="药品规格" width="200" align="center">
|
|
379
|
+ <template slot-scope="scope">
|
|
380
|
+ {{ scope.row.specification_name }}
|
|
381
|
+ </template>
|
|
382
|
+ </el-table-column>
|
|
383
|
+ <el-table-column prop="stockQuantity" label="入库数量" width="100" align="center">
|
|
384
|
+ <template slot-scope="scope">
|
|
385
|
+ {{ scope.row.warehousing_count }}
|
|
386
|
+ </template>
|
|
387
|
+ </el-table-column>
|
|
388
|
+ <el-table-column prop="unit" label="单位" width="80" align="center">
|
|
389
|
+ <template slot-scope="scope">
|
|
390
|
+ {{ scope.row.max_unit }}
|
|
391
|
+ </template>
|
|
392
|
+ </el-table-column>
|
|
393
|
+ <el-table-column prop="purchasePrice" label="进货单价" width="100" align="center">
|
|
394
|
+ <template slot-scope="scope">
|
|
395
|
+ {{ scope.row.price }}
|
|
396
|
+ </template>
|
|
397
|
+ </el-table-column>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+ <el-table-column prop="stockAmount" label="入库金额" width="120" align="center">
|
|
401
|
+ <template slot-scope="scope">
|
|
402
|
+ {{ scope.row.price * scope.row.warehousing_count }}
|
|
403
|
+ </template>
|
|
404
|
+ </el-table-column>
|
|
405
|
+ <el-table-column prop="purchasePrice" label="零售价" width="100" align="center">
|
|
406
|
+ <template slot-scope="scope">
|
|
407
|
+ {{ scope.row.retail_price }}
|
|
408
|
+ </template>
|
|
409
|
+ </el-table-column>
|
|
410
|
+ <el-table-column prop="batchNumber" label="批号" width="120" align="center">
|
|
411
|
+ <template slot-scope="scope">
|
|
412
|
+ {{ scope.row.batch_number }}
|
|
413
|
+ </template>
|
|
414
|
+ </el-table-column>
|
|
415
|
+ <el-table-column prop="productionDate" label="生产日期" width="120" align="center">
|
|
416
|
+ <template slot-scope="scope">
|
|
417
|
+ {{ getTime(scope.row.product_date) }}
|
|
418
|
+ </template>
|
|
419
|
+ </el-table-column>
|
|
420
|
+ <el-table-column prop="expiryDate" label="有效日期" width="120" align="center">
|
|
421
|
+ <template slot-scope="scope">
|
|
422
|
+ {{ getTime(scope.row.expiry_date) }}
|
|
423
|
+ </template>
|
|
424
|
+ </el-table-column>
|
|
425
|
+
|
|
426
|
+ <el-table-column prop="purchasePrice" label="生产厂家" width="100" align="center">
|
|
427
|
+ <template slot-scope="scope">
|
|
428
|
+ {{ scope.row.manufacturer_name }}
|
|
429
|
+ </template>
|
|
430
|
+ </el-table-column>
|
|
431
|
+
|
|
432
|
+ <el-table-column prop="purchasePrice" label="进销商" width="100" align="center">
|
|
433
|
+ <template slot-scope="scope">
|
|
434
|
+ {{ scope.row.dealer_name }}
|
|
435
|
+ </template>
|
|
436
|
+ </el-table-column>
|
|
437
|
+
|
|
438
|
+ <el-table-column prop="purchasePrice" label="入库时间" width="100" align="center">
|
|
439
|
+ <template slot-scope="scope">
|
|
440
|
+ {{ getTime(scope.row.ctime) }}
|
|
441
|
+ </template>
|
|
442
|
+ </el-table-column>
|
|
443
|
+
|
|
444
|
+ <el-table-column prop="purchasePrice" label="入库单备注" width="100" align="center">
|
|
445
|
+ <template slot-scope="scope">
|
|
446
|
+ {{ scope.row.remark}}
|
|
447
|
+ </template>
|
|
448
|
+ </el-table-column>
|
|
449
|
+ </el-table>
|
|
450
|
+
|
|
451
|
+ <div slot="footer" class="dialog-footer">
|
|
452
|
+ <el-button @click="dialogVisibleOne = false">关闭</el-button>
|
|
453
|
+ </div>
|
|
454
|
+ </el-dialog>
|
|
455
|
+
|
|
456
|
+ <drug-new-print
|
|
457
|
+ ref="drugPrint"
|
|
458
|
+ :visibility="isVisibility"
|
|
459
|
+ :propsTable="propsTable"
|
|
460
|
+ >
|
|
461
|
+ </drug-new-print>
|
254
|
462
|
</div>
|
|
463
|
+
|
|
464
|
+
|
255
|
465
|
</template>
|
256
|
466
|
|
257
|
467
|
<script>
|
258
|
468
|
import { uParseTime } from "@/utils/tools";
|
259
|
469
|
import { fetchAllAdminUsers } from "@/api/doctor";
|
260
|
470
|
import { GetAllConfig } from "@/api/stock";
|
261
|
|
-import { getDrugIndetail,getDrugWarehouseInfoPrint,ModityDrugCodeWarehouseInfo} from "@/api/drug/drug_stock"
|
|
471
|
+import { getDrugIndetail,getDrugWarehouseInfoPrint,ModityDrugCodeWarehouseInfo,getDrugWarehouseInfoPrintList} from "@/api/drug/drug_stock"
|
262
|
472
|
import { postSearchDrugList } from "@/api/data";
|
|
473
|
+import drugNewPrint from "../drugNewPrint.vue";
|
|
474
|
+const moment = require('moment')
|
263
|
475
|
export default {
|
264
|
476
|
name: "stockInDetail",
|
265
|
|
-
|
|
477
|
+ components: {
|
|
478
|
+ drugNewPrint,
|
|
479
|
+ },
|
266
|
480
|
created() {
|
267
|
481
|
var nowDate = new Date();
|
268
|
482
|
var nowYear = nowDate.getFullYear();
|
|
@@ -345,9 +559,110 @@ export default {
|
345
|
559
|
id:0,
|
346
|
560
|
drug_name:"",
|
347
|
561
|
drug_id:0,
|
|
562
|
+ dialogVisibleOne:false,
|
|
563
|
+ listQuery:{
|
|
564
|
+ start_time: moment().startOf('month').format('YYYY-MM-DD'),
|
|
565
|
+ end_time:moment().endOf('month').format('YYYY-MM-DD')
|
|
566
|
+ },
|
|
567
|
+ tableData: [],
|
|
568
|
+ pagination: {
|
|
569
|
+ currentPage: 1,
|
|
570
|
+ pageSize: 20,
|
|
571
|
+ total: 0
|
|
572
|
+ },
|
|
573
|
+ tablePrintData:[],
|
|
574
|
+ goodList:[],
|
|
575
|
+ goodsType:[],
|
|
576
|
+ idsList:[],
|
|
577
|
+ printData:[],
|
|
578
|
+ isVisibility: "",
|
|
579
|
+ propsTable: "",
|
|
580
|
+ drugInfoList:[],
|
|
581
|
+ manufacturerList:[],
|
|
582
|
+ dealerList:[],
|
|
583
|
+ drugList:[],
|
348
|
584
|
};
|
349
|
585
|
},
|
350
|
586
|
methods: {
|
|
587
|
+ batchSelect(selection){
|
|
588
|
+ if(selection.length == 0){
|
|
589
|
+ this.$message.error("请选中需要打印的内容")
|
|
590
|
+ return
|
|
591
|
+ }
|
|
592
|
+ this.printData = []
|
|
593
|
+ for(let i=0;i<selection.length;i++){
|
|
594
|
+ for(let j=0;j<this.tablePrintData.length;j++){
|
|
595
|
+ if(selection[i].id == this.tablePrintData[j].id){
|
|
596
|
+ this.printData.push(this.tablePrintData[j])
|
|
597
|
+ }
|
|
598
|
+ }
|
|
599
|
+ }
|
|
600
|
+ console.log("打印数据=====",this.printData)
|
|
601
|
+ },
|
|
602
|
+ toGoodPrint() {
|
|
603
|
+ this.$refs.drugPrint.show(
|
|
604
|
+ this.printData,
|
|
605
|
+ );
|
|
606
|
+ },
|
|
607
|
+ handleSelectOne(){
|
|
608
|
+ this.handleQuery()
|
|
609
|
+ },
|
|
610
|
+ handleQuery(){
|
|
611
|
+ var params = {
|
|
612
|
+ start_time:this.listQuery.start_time,
|
|
613
|
+ end_time:this.listQuery.end_time,
|
|
614
|
+ drug_id:this.drug_id,
|
|
615
|
+ }
|
|
616
|
+ getDrugWarehouseInfoPrintList(params).then(response=>{
|
|
617
|
+ if(response.data.state == 1){
|
|
618
|
+ var drugInfo = response.data.data.drugInfo
|
|
619
|
+ var manufacturerList = response.data.data.manufacturerList
|
|
620
|
+ var dealerList = response.data.data.dealerList
|
|
621
|
+ var drugList = response.data.data.drugList
|
|
622
|
+ console.log("drug_info=====",drugInfo)
|
|
623
|
+
|
|
624
|
+ if(drugInfo!=null && drugInfo.length>0){
|
|
625
|
+ for(let i=0;i<drugInfo.length;i++){
|
|
626
|
+ drugInfo[i].social_security_directory_code = ""
|
|
627
|
+ drugInfo[i].drug_name = ""
|
|
628
|
+ for(let j=0;j<drugList.length;j++){
|
|
629
|
+ if(drugInfo[i].drug_id == drugList[j].id){
|
|
630
|
+ drugInfo[i].specification_name = drugList[j].dose + drugList[j].dose_unit +"*" +drugList[j].min_number + drugList[j].min_unit + "/"+drugList[j].max_unit
|
|
631
|
+ drugInfo[i].social_security_directory_code = drugList[j].social_security_directory_code
|
|
632
|
+ drugInfo[i].drug_name = drugList[j].drug_name
|
|
633
|
+ }
|
|
634
|
+ }
|
|
635
|
+
|
|
636
|
+ for(let x=0;x<manufacturerList.length;x++){
|
|
637
|
+
|
|
638
|
+ if(drugInfo[i].manufacturer == manufacturerList[x].id) {
|
|
639
|
+ drugInfo[i].manufacturer_name = manufacturerList[x].manufacturer_name
|
|
640
|
+ }
|
|
641
|
+ }
|
|
642
|
+
|
|
643
|
+ for(let y=0;y<dealerList.length;y++){
|
|
644
|
+
|
|
645
|
+ if(drugInfo[i].dealer == dealerList[y].id) {
|
|
646
|
+ drugInfo[i].dealer_name = dealerList[y].dealer_name
|
|
647
|
+ }
|
|
648
|
+ }
|
|
649
|
+ }
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+ }
|
|
653
|
+
|
|
654
|
+ this.tablePrintData = []
|
|
655
|
+ console.log("drugInfo==========",drugInfo)
|
|
656
|
+ this.tablePrintData = drugInfo
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+ }
|
|
660
|
+ })
|
|
661
|
+
|
|
662
|
+ },
|
|
663
|
+ BatchPrintAction(){
|
|
664
|
+ this.dialogVisibleOne = true
|
|
665
|
+ },
|
351
|
666
|
querySearchAsync(keyword, cb) {
|
352
|
667
|
let key = "";
|
353
|
668
|
if (keyword != undefined) {
|