index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="mine">
  3. <!-- 头部今日数据 -->
  4. <div class="topBox">
  5. <div class="title">
  6. <h2>今日数据</h2>
  7. <div class="date">{{dataTotal.date}}</div>
  8. </div>
  9. <div class="redact">
  10. <div class="amountData">
  11. <el-card>
  12. <div class="titleBox">
  13. <div class="title">销售金额:</div>
  14. <div class="money">¥{{dataTotal.total_price}}</div>
  15. </div>
  16. </el-card>
  17. <el-card>
  18. <div class="titleBox">
  19. <div class="title">消耗金额:</div>
  20. <div class="money">¥{{dataTotal.card_expend_price}}</div>
  21. </div>
  22. </el-card>
  23. <el-card>
  24. <div class="titleBox">
  25. <div class="title">实收金额:</div>
  26. <div class="money">¥{{dataTotal.payer_price}}</div>
  27. </div>
  28. </el-card>
  29. </div>
  30. <!-- 创建订单 -->
  31. <div class="createOrder" @click="createOrder">创建订单</div>
  32. </div>
  33. </div>
  34. <!-- 订单列表 -->
  35. <div class="orderList">
  36. <el-table
  37. ref="multipleTable"
  38. :data="tableData"
  39. tooltip-effect="dark"
  40. height="500"
  41. style="width: 100%; border-radius: 8px"
  42. @row-click="goOrderDetail"
  43. >
  44. <el-table-column prop="create_at" label="订单时间"></el-table-column>
  45. <el-table-column prop="nickname" label="用户姓名"></el-table-column>
  46. <el-table-column prop="order_type" label="订单类型">
  47. <template slot-scope="scope">
  48. <div>{{scope.row.order_type==1?'服务项目':'销售类型'}}</div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="payer_price" label="实收金额"></el-table-column>
  52. <el-table-column prop="pay_way" label="支付方式"></el-table-column>
  53. <el-table-column prop="suser_names" label="美容师"></el-table-column>
  54. <el-table-column label="操作">
  55. <template slot-scope="scope">
  56. <div class="checkBtn" @click.stop="checkOrder(scope.row.id)">查看</div>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <div class="pagin">
  61. <el-pagination
  62. background
  63. layout="prev, pager, next"
  64. @current-change="handleCurrentChange"
  65. :current-page.sync="currentPage"
  66. :total="total"
  67. ></el-pagination>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import api from "../../server/home";
  74. export default {
  75. data() {
  76. return {
  77. tableData: [], //订单列表数据
  78. dataTotal: "", //管理订单统计
  79. total: 0, //列表总条数
  80. currentPage: 1 //页数
  81. };
  82. },
  83. methods: {
  84. //创建订单
  85. createOrder() {
  86. this.$router.push("/revenueManage/createOrder");
  87. },
  88. // 进入订单详情
  89. checkOrder(e) {
  90. this.$router.push(`/revenueManage/details?id=${e}`);
  91. },
  92. // 进入订单详情
  93. goOrderDetail(e) {
  94. let id = e.id;
  95. this.$router.push(`/revenueManage/details?id=${id}`);
  96. },
  97. // 获取订单列表
  98. getOrderList() {
  99. api
  100. .tradeList({
  101. page: this.currentPage,
  102. limit: 10
  103. })
  104. .then(res => {
  105. if (res.code == 200) {
  106. this.tableData = res.data.list;
  107. this.total = res.data.total;
  108. }
  109. });
  110. },
  111. // 获取营收管理订单统计
  112. getDataTotal() {
  113. api.tradeDataTotal().then(res => {
  114. if (res.code == 200) {
  115. this.dataTotal = res.data;
  116. }
  117. });
  118. },
  119. handleCurrentChange(e) {
  120. this.currentPage = e
  121. this.getOrderList()
  122. }
  123. },
  124. created() {
  125. // 获取订单列表
  126. this.getOrderList();
  127. // 获取营收管理订单统计
  128. this.getDataTotal();
  129. }
  130. };
  131. </script>
  132. <style scoped lang='less'>
  133. .mine {
  134. // 头部今日数据
  135. .topBox {
  136. width: 857px;
  137. height: 100px;
  138. background-color: #fff;
  139. border-radius: 10px;
  140. padding: 14px;
  141. box-sizing: border-box;
  142. .title {
  143. display: flex;
  144. align-items: center;
  145. h2 {
  146. margin-right: 20px;
  147. }
  148. .date {
  149. font-weight: 700;
  150. }
  151. }
  152. .redact {
  153. display: flex;
  154. width: 100%;
  155. justify-content: space-between;
  156. .amountData {
  157. margin-top: 6px;
  158. display: flex;
  159. /deep/ .el-card {
  160. margin-right: 16px;
  161. }
  162. .titleBox {
  163. display: flex;
  164. margin-right: 20px;
  165. .title {
  166. font-weight: 700;
  167. margin-right: 5px;
  168. }
  169. }
  170. }
  171. .createOrder {
  172. width: 90px;
  173. height: 30px;
  174. border-radius: 4px;
  175. background-color: #fa7d22;
  176. color: #fff;
  177. text-align: center;
  178. line-height: 30px;
  179. }
  180. }
  181. }
  182. // 订单列表
  183. .orderList {
  184. margin-top: 18px;
  185. padding: 0 12px;
  186. width: 857px;
  187. background: #ffffff;
  188. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  189. border-radius: 8px;
  190. .checkBtn {
  191. width: 50px;
  192. height: 25px;
  193. background: #fa7d22;
  194. border-radius: 2px;
  195. line-height: 25px;
  196. text-align: center;
  197. color: #fff;
  198. }
  199. .pagin {
  200. padding: 20px 0;
  201. .el-pagination {
  202. text-align: center;
  203. }
  204. }
  205. /deep/ .el-table tbody tr:hover > td {
  206. background-color: transparent !important;
  207. }
  208. /deep/ .el-table th > .cell {
  209. font-size: 14px !important;
  210. font-family: PingFangSC-Regular, PingFang SC;
  211. font-weight: 400;
  212. color: #999999;
  213. line-height: 20px;
  214. }
  215. /deep/ .el-table td,
  216. .el-table th.is-leaf {
  217. border-bottom: none;
  218. }
  219. }
  220. }
  221. </style>