SalesReportRejectedNew.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="SalesReportRejectedNew">
  3. <!-- <div class="title">业绩达成报表(含退货)-产品确认单</div> -->
  4. <!-- stripe -->
  5. <el-table
  6. :data="tableData"
  7. v-loading="loading"
  8. border
  9. :max-height="maxHeight"
  10. :size="'mini'"
  11. style="width: 100%"
  12. row-key="id"
  13. default-expand-all
  14. :row-class-name="tableRowClassName"
  15. :tree-props="{ children: 'child', hasChildren: 'hasChildren' }"
  16. >
  17. <el-table-column prop="p" label="业绩类型" fixed="left" min-width="120">
  18. </el-table-column>
  19. <el-table-column label="本日金额" min-width="120" align="center">
  20. <el-table-column show-overflow-tooltip label="销售" min-width="120">
  21. <template slot-scope="scope">
  22. <span>{{ scope.row.dtotal | toThousandFilter }}</span>
  23. </template>
  24. </el-table-column>
  25. <el-table-column show-overflow-tooltip label="退款" min-width="120">
  26. <template slot-scope="scope">
  27. <span>{{ scope.row.thfee | toThousandFilter }}</span>
  28. </template>
  29. </el-table-column>
  30. </el-table-column>
  31. <el-table-column label="本周金额" min-width="120" align="center">
  32. <el-table-column show-overflow-tooltip label="销售" min-width="120">
  33. <template slot-scope="scope">
  34. <span>{{ scope.row.wtotal | toThousandFilter }}</span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column show-overflow-tooltip label="退款" min-width="120">
  38. <template slot-scope="scope">
  39. <span>{{ scope.row.wthfee | toThousandFilter }}</span>
  40. </template>
  41. </el-table-column>
  42. </el-table-column>
  43. <el-table-column label="本月金额" min-width="120" align="center">
  44. <el-table-column show-overflow-tooltip label="销售指标" min-width="120">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.tips | toThousandFilter }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column show-overflow-tooltip label="销售" min-width="120">
  50. <template slot-scope="scope">
  51. <span>{{ scope.row.total | toThousandFilter }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column show-overflow-tooltip label="销售完成率" min-width="95">
  55. <template slot-scope="scope">
  56. <span>{{ scope.row.rate ? scope.row.rate + "%" : "" }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column show-overflow-tooltip label="退款" min-width="120">
  60. <template slot-scope="scope">
  61. <span>{{ scope.row.mthfee | toThousandFilter }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column show-overflow-tooltip label="净销售" min-width="120">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.thtotal | toThousandFilter }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column show-overflow-tooltip label="净销售完成率" min-width="95">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.thrate ? scope.row.thrate + "%" : "" }}</span>
  72. </template>
  73. </el-table-column>
  74. </el-table-column>
  75. </el-table>
  76. </div>
  77. </template>
  78. <script>
  79. import asyncRequest from "@/api/index";
  80. import setHeight from "@/mixins/index";
  81. export default {
  82. name: "SalesReportRejectedNew",
  83. props: ["date"],
  84. mixins: [setHeight],
  85. watch: {
  86. date: function (val) {
  87. this.dataTime = val;
  88. if (val) {
  89. this.searchList();
  90. }
  91. },
  92. },
  93. data() {
  94. return {
  95. dataTime: this.date,
  96. loading: false,
  97. maxHeight: "0",
  98. tableData: [],
  99. };
  100. },
  101. async created() {
  102. window.onresize = () => {
  103. this.getHeight();
  104. };
  105. },
  106. mounted() {
  107. this.$nextTick(() => {
  108. this.getHeight();
  109. });
  110. this.searchList();
  111. },
  112. methods: {
  113. tableRowClassName({ row , rowIndex}) {
  114. if (row && row.child && row.child.length > 0||rowIndex===0) {
  115. return "warning-row";
  116. } else {
  117. return "";
  118. }
  119. },
  120. async searchList() {
  121. this.loading = true;
  122. this.tableData = [];
  123. const res = await asyncRequest.statlist({
  124. date: this.date ? this.date : "",
  125. });
  126. if (res.code === 0 && res.data && res.data.length > 0) {
  127. this.tableData = res.data;
  128. this.tableData.map((v1, i1) => {
  129. v1.id = i1 + "";
  130. v1.p = v1.p ? v1.p : v1.depart;
  131. if (v1.child && v1.child.length > 0) {
  132. v1.child.map((v2, i2) => {
  133. v2.id = "" + v1 + i2;
  134. return v2;
  135. });
  136. }
  137. return v1;
  138. });
  139. } else {
  140. this.tableData = [];
  141. }
  142. this.getHeight();
  143. this.loading = false;
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss" scoped>
  149. .SalesReportRejectedNew {
  150. }
  151. </style>