index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <div id="app" class="contents" v-cloak>
  2. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
  3. <div slot="header">
  4. <div>
  5. <span>订单管理</span>
  6. <div style="float:right;margin:-6px 0px">
  7. </div>
  8. </div>
  9. </div>
  10. <div class="table-body">
  11. <el-form size="small" :inline="true" flex="dir:left cross:center">
  12. <div class="item-box" flex="dir:left cross:center">
  13. <el-date-picker @change="selectedDateTime" size="small"
  14. v-model="selectTime" type="daterange" value-format="yyyy-MM-dd"
  15. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
  16. </el-date-picker>
  17. </div>
  18. <div class="item-box" flex="dir:left cross:center" style="padding-left: 10px">
  19. <el-input size="small" style="width: 200px" v-model="searchData.member" placeholder="请输入会员昵称/ID"></el-input>
  20. </div>
  21. <div class="item-box" flex="dir:left cross:center" style="padding-left: 10px">
  22. <el-input size="small" style="width: 200px" v-model="searchData.name" placeholder="活动名称"></el-input>
  23. </div>
  24. <div class="item-box" flex="dir:left cross:center">
  25. <el-button size="small" type="primary" style="padding: 9px 15px !important;margin-right: 5px; margin-left: 25px;" @click="search">搜索
  26. </el-button>
  27. </div>
  28. <div class="item-box" flex="dir:left cross:center" v-if="searchData.date_start || searchData.date_end || searchData.member || searchData.name">
  29. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearch">清除搜索条件
  30. </el-button>
  31. </div>
  32. </el-form>
  33. <el-table v-loading=" listLoading" :data="list" stripe style="width: 100%">
  34. <el-table-column label="序号" prop="id" width="120"> </el-table-column>
  35. <el-table-column label="下单用户" width="200">
  36. <template slot-scope="scope">
  37. <div class="table-info-img-text">
  38. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  39. <div slot="error" class="image-slot">
  40. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  41. </div>
  42. </el-image>
  43. <div class="table-info-text">
  44. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  45. <div style="font-size: 12px;">id:{{scope.row.user.id}}</div>
  46. </div>
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="订单号" align="center">
  51. <template slot-scope="scope">
  52. <span>{{scope.row.order.order_no}}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="活动名称" align="left">
  56. <template slot-scope="scope">
  57. <span>{{scope.row.activity.name}}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="商品信息" align="left">
  61. <template slot-scope="scope">
  62. <div class="table-info-img-text">
  63. <el-image class="table-info-img" :src="scope.row.order.detail[0].pic_url">
  64. <div slot="error" class="image-slot">
  65. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  66. </div>
  67. </el-image>
  68. <div class="table-info-text">
  69. <div style="color:#000;"><com-ellipsis :text="scope.row.order.detail[0].goods_name" :line="1">{{scope.row.order.detail[0].goods_name}}</com-ellipsis></div>
  70. <div style="font-size: 12px;">
  71. 规格: {{scope.row.order.detail[0].goods_attr_name}}
  72. 数量: {{scope.row.order.detail[0].num}}
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="价格/数量" align="center">
  79. <template slot-scope="scope">
  80. <span>{{scope.row.order.detail[0].price}}/{{scope.row.order.detail[0].num}}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="实付款" align="center">
  84. <template slot-scope="scope">
  85. <span>{{scope.row.order.pay_money}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="支付时间" align="center">
  89. <template slot-scope="scope">
  90. {{scope.row.order.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="下单时间" align="center">
  94. <template slot-scope="scope">
  95. {{scope.row.order.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="更新时间" align="center">
  99. <template slot-scope="scope">
  100. {{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="操作" align="center">
  104. <template slot-scope="scope">
  105. <el-button type="text" @click="goToOrderDetail(scope.row)">查看详情</el-button>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <div style="text-align: right;margin: 20px 0;">
  110. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount">
  111. </el-pagination>
  112. </div>
  113. </div>
  114. </el-card>
  115. </div>
  116. <script>
  117. const app = new Vue({
  118. el: '#app',
  119. data: {
  120. list: [],
  121. listLoading: false,
  122. page: 1,
  123. level: 1,
  124. pageCount: 0,
  125. page_size: 15,
  126. searchData: {
  127. date_start: '',
  128. date_end: '',
  129. member: '',
  130. name: ''
  131. },
  132. selectTime: [],
  133. // 导出
  134. exportList: [],
  135. statusMap: [],
  136. today_commission: 0,
  137. total_commission: 0
  138. },
  139. mounted: function() {
  140. this.getList();
  141. },
  142. methods: {
  143. //搜索
  144. search() {
  145. this.page = 1;
  146. this.getList();
  147. },
  148. clearSearch() {
  149. this.searchData.memeber = '';
  150. this.searchData.date_end = '';
  151. this.searchData.date_start = '';
  152. this.searchData.name = '';
  153. this.selectTime = [];
  154. this.getList();
  155. },
  156. // 时间搜索触发
  157. selectedDateTime(params) {
  158. if (params != null) {
  159. this.searchData.date_start = params[0];
  160. this.searchData.date_end = params[1];
  161. } else {
  162. this.searchData.date_start = '';
  163. this.searchData.date_end = '';
  164. }
  165. this.getList()
  166. },
  167. pagination(currentPage) {
  168. let self = this;
  169. self.page = currentPage;
  170. self.getList();
  171. },
  172. getList() {
  173. this.listLoading = true;
  174. request({
  175. params: {
  176. r: 'business-activity/order/index',
  177. pagesize: 10,
  178. page: this.page,
  179. ...this.searchData,
  180. },
  181. method: 'get',
  182. }).then(e => {
  183. this.listLoading = false;
  184. if (e.data.code == 0) {
  185. this.statusMap = e.data.data.status_map;
  186. this.list = e.data.data.list;
  187. this.pageCount = e.data.data.page_count;
  188. } else {
  189. this.$message.error(e.data.msg)
  190. }
  191. }).catch(e => {
  192. console.log(e);
  193. });
  194. },
  195. goToOrderDetail(item) {
  196. let params = {
  197. r: 'mall/order/detail',
  198. id: item.order_id,
  199. };
  200. navigateTo(params);
  201. }
  202. },
  203. filters: {
  204. amount: function(val) {
  205. return parseFloat(val / 100).toFixed(2)
  206. }
  207. }
  208. });
  209. </script>
  210. <style>
  211. .table-body {
  212. padding: 20px;
  213. background-color: #fff;
  214. }
  215. .input-item {
  216. display: inline-block;
  217. width: 250px;
  218. margin: 0 0 20px;
  219. }
  220. .input-item .el-input__inner {
  221. border-right: 0;
  222. }
  223. .input-item .el-input__inner:hover {
  224. border: 1px solid #dcdfe6;
  225. border-right: 0;
  226. outline: 0;
  227. }
  228. .input-item .el-input__inner:focus {
  229. border: 1px solid #dcdfe6;
  230. border-right: 0;
  231. outline: 0;
  232. }
  233. .input-item .el-input-group__append {
  234. background-color: #fff;
  235. border-left: 0;
  236. width: 10%;
  237. padding: 0;
  238. }
  239. .input-item .el-input-group__append .el-button {
  240. padding: 0;
  241. }
  242. .input-item .el-input-group__append .el-button {
  243. margin: 0;
  244. }
  245. /* .table-body .el-button {
  246. padding: 0 !important;
  247. border: 0;
  248. margin: 0 5px;
  249. }
  250. */
  251. .el-table th>.cell {
  252. color: #333;
  253. font-weight: bold;
  254. font-size: 14px;
  255. }
  256. .el-table__footer-wrapper,
  257. .el-table__header-wrapper {
  258. border-bottom: 1.4px solid #D6D6D6;
  259. }
  260. .el-button--mini.is-circle {
  261. padding: 3px;
  262. }
  263. .contents .el-button+.el-button {
  264. margin-left: 0px;
  265. }
  266. </style>