You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <div style="display: flex">
  4. <el-table
  5. :data="patientRegister.patientRegisterAbs"
  6. border
  7. :height="patientRegister.prAsbItemHeight"
  8. size="small"
  9. highlight-current-row
  10. :summary-method="getSummaries"
  11. show-summary
  12. ref="patientRegister.patientRegisterAbs"
  13. >
  14. <el-table-column type="index" label="序号" width="50" />
  15. <el-table-column prop="asbitemName" label="已选组合项目" width="120" />
  16. <el-table-column prop="standardPrice" label="标准价" />
  17. <el-table-column prop="discount" label="折扣" />
  18. <el-table-column prop="amount" label="数量" width="50" />
  19. <el-table-column prop="chargePrice" label="价格" />
  20. <el-table-column prop="payTypeFlag" label="支付方式">
  21. <template slot-scope="scope">
  22. <div>
  23. {{
  24. ldddw(dict.payType, "id", scope.row.payTypeFlag, "displayName")
  25. }}
  26. </div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="isCharge" label="收费" width="50">
  30. <template slot-scope="scope">
  31. <el-checkbox :value="scope.row.isCharge == 'Y'" />
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="checkCompleteFlag" label="状态">
  35. <template slot-scope="scope">
  36. <div>
  37. {{
  38. ldddw(
  39. dict.checkCompleteFlag,
  40. "id",
  41. scope.row.checkCompleteFlag,
  42. "displayName"
  43. )
  44. }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="isLock" label="锁" width="50">
  49. <template slot-scope="scope">
  50. <el-checkbox :value="scope.row.isLock == 'Y'" />
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="creatorName" label="登记人"></el-table-column>
  54. <el-table-column prop="creationTime" label="登记日期" width="90">
  55. <template slot-scope="scope">
  56. <div>{{ lmoment(scope.row.creationTime, "yyyy-MM-DD") }}</div>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import moment from "moment";
  65. import { mapState } from "vuex";
  66. import { dddw } from "../../utlis/proFunc";
  67. export default {
  68. components: {},
  69. data() {
  70. return {};
  71. },
  72. created() {},
  73. //挂载完成
  74. mounted() {},
  75. computed: {
  76. ...mapState(["dict", "patientRegister"]),
  77. },
  78. methods: {
  79. ldddw(arrayData, key, value, display) {
  80. return dddw(arrayData, key, value, display);
  81. },
  82. lmoment(date, forMat) {
  83. return moment(new Date(date)).format(forMat);
  84. },
  85. //自定义计算列
  86. getSummaries(param) {
  87. const { columns, data } = param;
  88. const sumCol = [2, 5]; //需合计的列
  89. const sums = [];
  90. columns.forEach((column, index) => {
  91. //显示合计列
  92. if (index === 1) {
  93. sums[index] = "合计";
  94. return;
  95. }
  96. //不合计的列
  97. if (sumCol.indexOf(index) == -1) {
  98. sums[index] = "";
  99. return;
  100. }
  101. const values = data.map((item) => Number(item[column.property]));
  102. if (!values.every((value) => isNaN(value))) {
  103. sums[index] = values.reduce((prev, curr) => {
  104. const value = Number(curr);
  105. if (!isNaN(value)) {
  106. return prev + curr;
  107. } else {
  108. return prev;
  109. }
  110. }, 0);
  111. sums[index] = Math.round(sums[index], 2);
  112. sums[index] += " 元";
  113. } else {
  114. sums[index] = "N/A";
  115. }
  116. });
  117. return sums;
  118. },
  119. },
  120. };
  121. </script>
  122. <style scoped>
  123. .box {
  124. display: flex;
  125. }
  126. </style>