index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="mine">
  3. <div class="condition">
  4. <el-date-picker v-model="dates"
  5. type="daterange"
  6. range-separator="->"
  7. start-placeholder="开始日期"
  8. end-placeholder="结束日期"></el-date-picker>
  9. <el-input placeholder="请输入项目"
  10. class="search"
  11. v-model="product">
  12. <i slot="prefix"
  13. class="el-input__icon el-icon-search"></i>
  14. </el-input>
  15. <el-input placeholder="请输入优惠券"
  16. class="search"
  17. v-model="coupon">
  18. <i slot="prefix"
  19. class="el-input__icon el-icon-search"></i>
  20. </el-input>
  21. <el-input placeholder="请输入内容"
  22. class="search"
  23. v-model="searchText">
  24. <i slot="prefix"
  25. class="el-input__icon el-icon-search"></i>
  26. </el-input>
  27. <el-button type="primary"
  28. class="searchButton"
  29. @click="getOrderList()">搜索</el-button>
  30. </div>
  31. <div class="user-list">
  32. <el-table ref="multipleTable"
  33. :data="tableData"
  34. tooltip-effect="dark"
  35. height="500"
  36. style="width: 100%;border-radius: 8px;"
  37. @row-click="handleSelectionChange">
  38. <el-table-column label="头像"
  39. width="120">
  40. <template slot-scope="scope">
  41. <div class="head-img">
  42. <img :src="scope.row.avatar_url"
  43. alt />
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="nickname"
  48. label="昵称"
  49. width="120"></el-table-column>
  50. <el-table-column prop="mobile"
  51. label="联系电话"
  52. show-overflow-tooltip></el-table-column>
  53. <el-table-column prop="order_time"
  54. label="预约时间"
  55. show-overflow-tooltip></el-table-column>
  56. <el-table-column prop="date"
  57. label="状态"
  58. show-overflow-tooltip>
  59. <template slot-scope="scope">
  60. <div :style="scope.row.status==0?'color: #FC3019':scope.row.status==5?'color: #A999EA':'color: #61D09D;'">{{ scope.row.status==0?'未支付':scope.row.status==5?'已取消':'待使用' }}</div>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <div class="pagin">
  65. <el-pagination background
  66. layout="prev, pager, next"
  67. @size-change="handleSizeChange"
  68. @current-change="handleCurrentChange"
  69. :current-page.sync="currentPage1"
  70. :total="total"></el-pagination>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import api from "../../server/home";
  77. export default {
  78. components: {},
  79. data () {
  80. return {
  81. searchText: "",
  82. dates: "",
  83. coupon: "",
  84. limit: 10,
  85. total: 0,
  86. product: "",
  87. coupon: "",
  88. couponList: [
  89. {
  90. value: "选项1",
  91. label: "黄金糕"
  92. },
  93. {
  94. value: "选项2",
  95. label: "双皮奶"
  96. }
  97. ],
  98. tableData: [
  99. {
  100. date: "2022.04.25 14:30",
  101. name: "滴滴滴",
  102. headImg:
  103. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
  104. phone: "13346783645",
  105. status: "已完成"
  106. },
  107. {
  108. date: "2022.04.25 14:30",
  109. name: "滴滴滴",
  110. headImg:
  111. "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
  112. phone: "13346783645",
  113. status: "已完成"
  114. }
  115. ],
  116. currentPage1: 1,
  117. multipleSelection: ""
  118. };
  119. },
  120. computed: {},
  121. watch: {},
  122. methods: {
  123. // 获取订单列表
  124. getOrderList () {
  125. let start_date = "",
  126. end_date = "";
  127. if (this.dates && this.dates.length > 0) {
  128. start_date = utils.formatTime(this.dates[0], "yyyy-MM-dd");
  129. end_date = utils.formatTime(this.dates[1], "yyyy-MM-dd");
  130. }
  131. let params = {
  132. page: this.currentPage1,
  133. limit: this.limit,
  134. keywords: this.searchText,
  135. project_name: this.product,
  136. coupon_name: this.coupon,
  137. start_date: start_date,
  138. end_date: end_date
  139. };
  140. api.getOrderList(params).then(res => {
  141. if (res.code == 200) {
  142. this.tableData = res.data.list;
  143. this.total = res.data.total;
  144. }
  145. });
  146. },
  147. handleCurrentChange (e) {
  148. this.currentPage1 = e;
  149. this.getOrderList();
  150. },
  151. handleSizeChange (val) {
  152. },
  153. handleSelectionChange (row, column, event) {
  154. this.$router.push({
  155. path: "/historicalOrder/details",
  156. query: {
  157. id: row.id
  158. }
  159. });
  160. }
  161. },
  162. created () {
  163. this.getOrderList();
  164. },
  165. mounted () { }
  166. };
  167. </script>
  168. <style lang='less' scoped>
  169. .mine {
  170. .condition {
  171. display: flex;
  172. .coupon-select {
  173. width: 174px;
  174. margin-left: 18px;
  175. }
  176. .search {
  177. width: 152px;
  178. margin-left: 18px;
  179. }
  180. .searchButton {
  181. margin-left: 18px;
  182. width: 68px;
  183. background: #fa7d22;
  184. border-radius: 2px;
  185. border-color: #fa7d22;
  186. }
  187. }
  188. .user-list {
  189. margin-top: 18px;
  190. padding: 0 12px;
  191. width: 100%;
  192. background: #ffffff;
  193. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  194. border-radius: 8px;
  195. .head-img {
  196. width: 36px;
  197. height: 36px;
  198. border-radius: 50%;
  199. img {
  200. width: 100%;
  201. height: 100%;
  202. }
  203. }
  204. .pagin {
  205. padding: 20px 0;
  206. .el-pagination {
  207. text-align: center;
  208. }
  209. }
  210. /deep/ .el-table th > .cell {
  211. font-size: 14px !important;
  212. font-family: PingFangSC-Regular, PingFang SC;
  213. font-weight: 400;
  214. color: #999999;
  215. line-height: 20px;
  216. }
  217. /deep/ .el-table td,
  218. .el-table th.is-leaf {
  219. border-bottom: none;
  220. }
  221. }
  222. .color0 {
  223. color: #fc3019;
  224. }
  225. .color1 {
  226. color: #3ef3ed;
  227. }
  228. .color2 {
  229. color: #00eeee;
  230. }
  231. .color3 {
  232. color: #61d09d;
  233. }
  234. .color4 {
  235. color: #3115cc;
  236. }
  237. .color5 {
  238. color: #fc3019;
  239. }
  240. .color6 {
  241. color: #a999ea;
  242. }
  243. }
  244. </style>