dialysisDrugsDialog.vue 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <el-dialog
  3. title="统计表"
  4. width="800px"
  5. :visible.sync="visible"
  6. :before-close="_close"
  7. >
  8. <div>
  9. <el-date-picker
  10. style="width:140px;margin-right:10px"
  11. v-model="startTime"
  12. type="date"
  13. placeholder="选择日期"
  14. @change="changeStartTime">
  15. </el-date-picker>
  16. <el-date-picker
  17. style="width:140px;margin-right:10px"
  18. v-model="endTime"
  19. type="date"
  20. placeholder="选择日期"
  21. @change="changeEndTime">
  22. </el-date-picker>
  23. <el-select style="width:140px;margin-right:10px" v-model="delive_way" placeholder="请选择">
  24. <el-option
  25. v-for="item in deliveryWay"
  26. :key="item.id"
  27. :label="item.name"
  28. :value="item.id">
  29. </el-option>
  30. </el-select>
  31. <!-- <el-button icon="el-icon-printer" type="primary" @click="toPrint">打印</el-button> -->
  32. </div>
  33. <div style="margin-top:10px;">
  34. <el-table :data="tableData" border style="width: 100%" height="300">
  35. <el-table-column align="center" prop="address" label="药品名称">
  36. <template slot-scope="scope">
  37. {{scope.row.advice_name}}
  38. </template>
  39. </el-table-column>
  40. <el-table-column align="center" prop="address" label="药品规格">
  41. <template slot-scope="scope">
  42. {{scope.row.advice_desc}}
  43. </template>
  44. </el-table-column>
  45. <el-table-column align="center" prop="name" label="数量" width="100">
  46. <template slot-scope="scope">
  47. {{scope.row.Total}}
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </div>
  52. </el-dialog>
  53. </template>
  54. <script>
  55. const moment = require('moment')
  56. import { GetAllZone } from "@/api/dialysis";
  57. import { getDoctorAdviceCount } from "@/api/advice"
  58. export default {
  59. data(){
  60. return{
  61. visible: false,
  62. startTime:new Date(),
  63. endTime:new Date(),
  64. schedulArr: [
  65. {value: 0, label: '全部班'},
  66. {value: 1, label: '上午'},
  67. {value: 2, label: '中午'},
  68. {value: 3, label: '下午'},
  69. ],
  70. schedulType: 0,
  71. partitionArr:[],
  72. partitionType: 0,
  73. deliveryWay:[],
  74. tableData: [],
  75. delive_way:""
  76. }
  77. },
  78. created(){
  79. this.getAllZone()
  80. this.getlist()
  81. },
  82. methods:{
  83. _close: function(done) {
  84. done();
  85. },
  86. show() {
  87. this.visible = true;
  88. },
  89. getAllZone: function() {
  90. GetAllZone().then(response => {
  91. if (response.data.state == 0) {
  92. this.$message.error(response.data.msg);
  93. return false;
  94. } else {
  95. this.partitionArr = response.data.data.zone;
  96. this.partitionArr.unshift({ id: 0, name: "全部分区" });
  97. var dics = response.data.data.dics
  98. var obj = {id:0,name:"全部"}
  99. this.deliveryWay.push(obj)
  100. this.deliveryWay.push(...dics)
  101. }
  102. });
  103. },
  104. toPrint(){
  105. this.$router.push({
  106. path: '/dialysis/dialysisDrugs_print',
  107. // query: { date: date }
  108. })
  109. },
  110. getlist(){
  111. let newTimeStart = moment(this.startTime).format('YYYY-MM-DD')
  112. let newTimeEnd = moment(this.endTime).format('YYYY-MM-DD')
  113. var params = {
  114. start_time:newTimeStart,
  115. end_time:newTimeEnd,
  116. delive_way:this.delive_way,
  117. }
  118. getDoctorAdviceCount(params).then(response=>{
  119. if(response.data.state == 1){
  120. var list = response.data.data.list
  121. console.log("list",list)
  122. this.tableData = list
  123. }
  124. })
  125. },
  126. changeStartTime(val){
  127. var start = moment(val).format('YYYY-MM-DD')
  128. this.startTime = start
  129. this.getlist()
  130. },
  131. changeEndTime(val){
  132. var end = moment(val).format('YYYY-MM-DD')
  133. this.endTime = end
  134. this.getlist()
  135. }
  136. }
  137. }
  138. </script>