YpPlanDetails.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div class="layout_container">
  4. <div class="layout_main layout_el-table">
  5. <el-table :data="ypPlanDetailData.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border stripe highlight-current-row>
  6. <el-table-column type="index" label="序号" width="60" fixed/>
  7. <el-table-column prop="remark" label="备注" width="120" fixed/>
  8. <el-table-column prop="drugName" label="药品名称" width="220" show-overflow-tooltip fixed/>
  9. <el-table-column prop="specification" label="规格" width="150" show-overflow-tooltip/>
  10. <el-table-column prop="packRetprice" label="零售价" width="100"/>
  11. <el-table-column prop="buyPrice" label="购入价" width="100"/>
  12. <el-table-column prop="amount" label="库存量" width="100" />
  13. <el-table-column prop="manuName" label="制药厂" width="150" show-overflow-tooltip/>
  14. <el-table-column prop="amount3" label="3天用量" width="100" />
  15. <el-table-column prop="amount7" label="7天用量" width="100" />
  16. <el-table-column prop="amount14" label="14天用量" width="100" />
  17. <el-table-column prop="amount30" label="30天用量" width="100" />
  18. <el-table-column prop="amount60" label="60天用量" width="100" />
  19. <el-table-column prop="days" label="可用天数" width="100" />
  20. <el-table-column prop="buyAmount" label="采购计划" width="100" />
  21. <el-table-column prop="unit" label="单位" width="100" />
  22. <el-table-column prop="buyFee" label="购入金额" width="100" />
  23. <el-table-column prop="impDate" label="导入时间" width="140" />
  24. </el-table>
  25. </div>
  26. <div>
  27. <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
  28. :total="ypPlanDetailData.length" layout="total, sizes, prev, pager, next, jumper"
  29. style="margin-top: 5px" @size-change="handleSizeChange"
  30. @current-change="handleCurrentChange">
  31. </el-pagination>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script setup name="YpPlanDetails">
  37. import { ref, onMounted, nextTick, watch } from 'vue'
  38. const props = defineProps({
  39. ypPlanDetails: {
  40. type: Object,
  41. default: []
  42. }
  43. })
  44. const ypPlanDetailData = ref([])
  45. const pageSize = ref(20)
  46. const currentPage = ref(1)
  47. const handleSizeChange = (val) => {
  48. pageSize.value = val
  49. }
  50. const handleCurrentChange = (val) => {
  51. currentPage.value = val
  52. }
  53. onMounted(() => {
  54. nextTick(() => {
  55. ypPlanDetailData.value = props.ypPlanDetails
  56. })
  57. })
  58. watch(() => props.ypPlanDetails, () => {
  59. ypPlanDetailData.value = props.ypPlanDetails
  60. })
  61. </script>