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.

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