list.php 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ?>
  4. <style>
  5. .el-table th>.cell {
  6. color: #333;
  7. font-weight: bold;
  8. font-size: 14px;
  9. }
  10. .table1 .el-table__footer-wrapper,
  11. .table1 .el-table__header-wrapper {
  12. border-bottom: 1.4px solid #D6D6D6;
  13. }
  14. .user_img{
  15. position: relative;
  16. margin-right: 8px;
  17. /* height: 50px;
  18. width: 50px; */
  19. }
  20. .default-avatar{
  21. width: 50px;
  22. height: 50px;
  23. border-radius: 50%;
  24. margin-right: 8px;
  25. }
  26. .uer-nickname {
  27. flex: 1;
  28. }
  29. .name-box {
  30. display: flex;
  31. flex-direction: column;
  32. }
  33. </style>
  34. <div id="app">
  35. <div class="table-body" style="min-width: 1000px;">
  36. <div slot="header" class="clearfix" style="height: 20px;">
  37. <span>订单流水</span>
  38. </div>
  39. <div slot="header" class="clearfix" style="margin-top: 20px;">
  40. <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
  41. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入订单编号" v-model="search.order_no" clearable></el-input>
  42. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入会员昵称/ID/手机号" v-model="search.keyword" clearable></el-input>
  43. <el-select size="small" v-model="search.order_status" @change='toSearch' class="select" style="margin-right: 20px;width: 150px;" placeholder="请选择订单状态">
  44. <el-option label="全部状态" value=""></el-option>
  45. <el-option :key="index" :label="item" :value="index" v-for="(item, index) in order_status_map" v-if="index != 0"></el-option>
  46. </el-select>
  47. <el-date-picker
  48. style="margin-right: 20px;"
  49. size="small"
  50. v-model="selectDate"
  51. type="daterange"
  52. value-format="yyyy-MM-dd"
  53. range-separator="至"
  54. start-placeholder="开始日期"
  55. end-placeholder="结束日期">
  56. </el-date-picker>
  57. <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
  58. </div>
  59. </div>
  60. <template>
  61. <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
  62. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  63. <el-table-column label="会员信息" >
  64. <template slot-scope="scope">
  65. <div class="user_img" flex="cross:center">
  66. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  67. <div slot="error" class="image-slot">
  68. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  69. </div>
  70. </el-image>
  71. <div class="name-box">
  72. <div class="uer-nickname over1" style="color:#000;">{{scope.row.user.nickname}}</div>
  73. <div class="user-realname">{{scope.row.mobile == null || scope.row.mobile == '' ? scope.row.user.mobile : scope.row.mobile}}</div>
  74. </div>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="goods_name" label="商品名称" align="center">
  79. <template slot-scope="scope">
  80. <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
  81. <el-table-column prop="goods_name" label="">
  82. <template slot-scope="gScope">
  83. <com-ellipsis :line="1" :text="gScope.row.goods_name+''"></com-ellipsis>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="price" label="商品价格" align="center" width="150">
  90. <template slot-scope="scope">
  91. <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
  92. <el-table-column prop="price" label="" align="center">
  93. </el-table-column>
  94. </el-table>
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="price" label="退款金额" align="center" width="150">
  98. <template slot-scope="scope">
  99. <el-table :data="scope.row.detail" size="mini" style="width: 100%" :show-header="false">
  100. <el-table-column prop="refund_price" label="" align="center">
  101. </el-table-column>
  102. </el-table>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="order_no" label="订单编号" align="center"></el-table-column>
  106. <el-table-column prop="goods_price" label="订单金额" align="center"></el-table-column>
  107. <el-table-column label="订单时间" align="center">
  108. <template slot-scope="scope">
  109. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="pay_money" label="实付金额" align="center"></el-table-column>
  113. <el-table-column label="订单状态" align="center">
  114. <template slot-scope="scope">
  115. <el-tag size="small" type="info">{{order_status_map[scope.row.order_status] ? order_status_map[scope.row.order_status] : '未知状态'}}</el-tag>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <div flex="main:right cross:center" style="margin-top: 20px;">
  120. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  121. style="display: inline-block;float: right;" background @current-change="pageChange"
  122. layout="prev, pager, next" :total="pagination.totalCount">
  123. </el-pagination>
  124. </div>
  125. </template>
  126. </div>
  127. </div>
  128. <script>
  129. const app = new Vue({
  130. el: '#app',
  131. data() {
  132. return {
  133. listLoading: false,
  134. list: [],
  135. pagination: {
  136. total: 0
  137. },
  138. loading: false,
  139. LoadDataType: -1, //默认显示全部数据
  140. dialogFormVisible: false, //默认不显示弹窗
  141. group_buy_attr_list: [],
  142. goodsDetail: {},
  143. dialogLoading:false,
  144. commander_level_limit_text:'',
  145. user_level_limit_text:'',
  146. level_map:null,
  147. selectDate:'',
  148. search: {
  149. page: 1,
  150. limit:10,
  151. start:'',
  152. end:'',
  153. keyword: '',
  154. level: '',
  155. user_id: '',
  156. order_no: '',
  157. order_status: '',
  158. },
  159. show: false,
  160. level: {
  161. show: false,
  162. area: null,
  163. },
  164. current_area:null,
  165. order_status_map: {},
  166. }
  167. },
  168. methods: {
  169. //状态按钮的点击事件
  170. toSearch() {
  171. if(this.selectDate && this.selectDate[0]){
  172. this.search.start = this.selectDate[0];
  173. this.search.end = this.selectDate[1];
  174. }else{
  175. this.search.start = '';
  176. this.search.end = '';
  177. }
  178. this.search.page = 1;
  179. this.loadData();
  180. },
  181. toSearchActivity() {
  182. this.loadData()
  183. },
  184. pageChange(page) {
  185. this.search.page = page;
  186. this.loadData();
  187. },
  188. // 请求获取数据--获取拼团商品列表
  189. loadData() {
  190. this.listLoading = true;
  191. let params = {
  192. r: 'area/data/list'
  193. };
  194. params = Object.assign(params, this.search);
  195. request({
  196. params: params,
  197. method: 'get',
  198. }).then(e => {
  199. let res = e.data;
  200. this.listLoading = false;
  201. if (res.code === 0) {
  202. try {
  203. this.list = res.data.list;
  204. this.order_status_map = res.data.order_status_map;
  205. this.pagination = res.data.pagination; //拿到关于页码页容量的数据
  206. } catch (e) {
  207. console.error(e)
  208. }
  209. } else {
  210. this.$message.error(res.msg);
  211. }
  212. }).catch(e => {});
  213. },
  214. editClick() {
  215. this.show = true;
  216. },
  217. levelSuccess() {
  218. this.loadData();
  219. },
  220. editLevel(row) {
  221. this.level.show = true;
  222. this.current_area = row;
  223. },
  224. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  225. if (row.detail.length > 1) {
  226. if (columnIndex !== 2 && columnIndex !== 3) {
  227. return {
  228. rowspan: row.detail.length,
  229. colspan: 1
  230. }
  231. }
  232. return {
  233. rowspan: 0,
  234. colspan: 0
  235. };
  236. }
  237. }
  238. },
  239. // 加载的时候获取到列表页
  240. mounted() {
  241. // 数据初始化
  242. this.LoadDataType = -1;
  243. this.search.user_id = getQuery('user_id');
  244. this.loadData();
  245. }
  246. })
  247. </script>