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.

117 lines
3.5 KiB

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