order-list.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <style>
  2. .el-table th>.cell {
  3. color: #333;
  4. font-weight: bold;
  5. font-size: 14px;
  6. }
  7. .table1 .el-table__footer-wrapper,
  8. .table1 .el-table__header-wrapper {
  9. border-bottom: 1.4px solid #D6D6D6;
  10. }
  11. .user_img {
  12. position: relative;
  13. margin-right: 8px;
  14. /* height: 50px;
  15. width: 50px; */
  16. }
  17. .default-avatar {
  18. width: 50px;
  19. height: 50px;
  20. border-radius: 50%;
  21. margin-right: 8px;
  22. }
  23. .uer-nickname {
  24. flex: 1;
  25. }
  26. </style>
  27. <div id="app">
  28. <div class="table-body" style="min-width: 1000px;">
  29. <div slot="header" class="clearfix" style="height: 20px;">
  30. <span>定金预售订单</span>
  31. </div>
  32. <div slot="header" class="clearfix" style="margin-top: 20px;">
  33. <el-button :type="LoadDataType==-1?'primary':''" size="small" @click="getLoadData(-1)">全部({{statistics.all_order_number}})</el-button>
  34. <el-button :type="LoadDataType==0?'primary':''" size="small" @click="getLoadData(0)">待付定金({{statistics.not_pay_order}})</el-button>
  35. <el-button :type="LoadDataType==1?'primary':''" size="small" @click="getLoadData(1)">待付尾款({{statistics.just_pay_deposit}})</el-button>
  36. <el-button :type="LoadDataType==2?'primary':''" size="small" @click="getLoadData(2)">订购成功({{statistics.order_success}})</el-button>
  37. <el-button :type="LoadDataType==3?'primary':''" size="small" @click="getLoadData(3)">订购失败({{statistics.order_fail}})</el-button>
  38. <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
  39. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="昵称" v-model="search.nickname" clearable></el-input>
  40. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="手机号" v-model="search.mobile" clearable></el-input>
  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-button type="primary" size="small" @click="toSearchActivity">搜索</el-button>
  43. </div>
  44. </div>
  45. <template>
  46. <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
  47. <!-- <el-table-column prop="id" label="id" width="100" align="center"></el-table-column> -->
  48. <el-table-column label="会员" width="180">
  49. <template slot-scope="scope">
  50. <div class="table-info-img-text">
  51. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  52. <div slot="error" class="image-slot">
  53. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  54. </div>
  55. </el-image>
  56. <div class="table-info-text">
  57. <div>{{scope.row.user.nickname}}</div>
  58. <div>{{scope.row.user.mobile}}</div>
  59. </div>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="order_no" label="订单号" width="220" align="center"></el-table-column>
  64. <el-table-column property="user.mobile" label="手机号" width="110" align="center"></el-table-column>
  65. <!-- <el-table-column property="is_creator" label="角色" align="center">
  66. <template slot-scope="scope">
  67. <span v-html="scope.row.is_commander=='1'?'团长':'团员'"></span>
  68. </template>
  69. </el-table-column> -->
  70. <el-table-column prop="goods.name,goods.cover_pic" label="商品名称" width="210">
  71. <template slot-scope="scope">
  72. <div flex="box:first cross:top cross:center">
  73. <div style="padding-right: 10px;">
  74. <com-image mode="aspectFill" :src="scope.row.pic_url"></com-image>
  75. </div>
  76. <div>
  77. {{scope.row.goods_name}}
  78. </div>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="price" label="售价" align="center"></el-table-column>
  83. <el-table-column prop="deposit_price" label="定金" align="center"></el-table-column>
  84. <el-table-column prop="deposit_presale_price" label="尾款" align="center">
  85. <template slot-scope="scope">
  86. {{(scope.row.deposit_presale_price - scope.row.deposit_price) > 0 ? (scope.row.deposit_presale_price - scope.row.deposit_price) : 0}}
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="shipping_money" label="运费" align="center"></el-table-column>
  90. <el-table-column prop="total_pay_price" label="订单金额" align="center"></el-table-column>
  91. <el-table-column prop="order_status" label="状态" align="center">
  92. <template slot-scope="scope">
  93. <el-tag effect="dark" size="small" type="info" v-if="scope.row.order_status==0">待付定金</el-tag>
  94. <el-tag effect="dark" size="small" type="" v-if="scope.row.order_status==1">待付尾款</el-tag>
  95. <el-tag effect="dark" size="small" type="success" v-if="scope.row.order_status==2">订购成功</el-tag>
  96. <el-tag effect="dark" size="small" type="warning" v-if="scope.row.order_status==3">订购失败</el-tag>
  97. <el-tag effect="dark" size="small" type="danger" v-if="scope.row.order_status==4">已关闭</el-tag>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="支付时间" width="150" align="center">
  101. <template slot-scope="scope">
  102. <span> {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="下单时间" width="150" align="center">
  106. <template slot-scope="scope">
  107. <span> {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="支付尾款时间" width="150" align="center">
  111. <template slot-scope="scope">
  112. <span> {{scope.row.final_payment_time|dateTimeFormat('Y-m-d H:i:s')}}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="操作" align="center">
  116. <template slot-scope="scope">
  117. <el-button v-if="scope.row.depositPresaleActive.is_virtual==1&&scope.row.order_status==1" @click="finish(scope.row)" type="text" size="small">结束定金预售</el-button>
  118. <el-button @click="toOrderDetail(scope.row.order_id)" type="text" size="small">订单详情</el-button>
  119. <!-- <el-button v-if="scope.row.order_status==3" @click="queryRefund(scope.row)" type="primary" size="small">查询退款</el-button> -->
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <div flex="main:right cross:center" style="margin-top: 20px;">
  124. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize" style="display: inline-block;float: right;" background @current-change="pageChange" layout="prev, pager, next" :total="pagination.totalCount">
  125. </el-pagination>
  126. </div>
  127. </template>
  128. </div>
  129. </div>
  130. <script>
  131. const app = new Vue({
  132. el: '#app',
  133. data() {
  134. return {
  135. listLoading: false,
  136. list: [],
  137. pagination: {
  138. total: 0
  139. },
  140. loading: false,
  141. LoadDataType: -1, //默认显示全部数据
  142. dialogFormVisible: false, //默认不显示弹窗
  143. deposit_presale_attr_list: [],
  144. goodsDetail: {},
  145. order_status_map: {},
  146. dialogLoading: false,
  147. search: {
  148. nickname: '',
  149. mobile: '',
  150. order_no: '',
  151. order_status: -1,
  152. page: 1,
  153. },
  154. statistics:{
  155. all_order_number: 0,
  156. not_pay_order: 0,
  157. just_pay_deposit: 0,
  158. order_success: 0,
  159. order_fail: 0
  160. }
  161. }
  162. },
  163. methods: {
  164. //状态按钮的点击事件
  165. getLoadData(e) {
  166. this.search.order_status = e;
  167. this.loadData()
  168. this.LoadDataType = e;
  169. },
  170. toSearchActivity() {
  171. this.loadData()
  172. },
  173. pageChange(page) {
  174. this.search.page = page;
  175. this.loadData();
  176. },
  177. // 跳转到订单详情
  178. toOrderDetail(order_id) {
  179. navigateTo({
  180. r: 'deposit-presale/order/detail',
  181. id: order_id, //直接跳转到订单详情页,但是要确保获取时字段统一
  182. })
  183. },
  184. // 请求获取数据--获取定金预售商品列表
  185. loadData() {
  186. this.listLoading = true;
  187. let params = {
  188. r: 'deposit-presale/default/order-list'
  189. };
  190. params = Object.assign(params, this.search);
  191. request({
  192. params: params,
  193. method: 'get',
  194. }).then(e => {
  195. let res = e.data;
  196. this.listLoading = false;
  197. if (res.code === 0) {
  198. this.list = res.data.list;
  199. this.order_status_map = res.data.order_status_map;
  200. this.pagination = res.data.pagination; //拿到关于页码页容量的数据
  201. this.statistics = Object.assign(this.statistics, res.data.statistics);
  202. } else {
  203. this.$message.error(res.msg);
  204. }
  205. }).catch(e => {});
  206. },
  207. finish(row) {
  208. this.loading = true;
  209. request({
  210. params: {
  211. r: 'deposit-presale/default/finish',
  212. open_group_id: row.id
  213. },
  214. method: 'get',
  215. }).then(e => {
  216. let res = e.data;
  217. this.listLoading = false;
  218. if (res.code === 0) {
  219. let others = {
  220. deposit_presale_active_id: this.deposit_presale_active_id
  221. }
  222. this.loadData(this.current_page, others, this.search);
  223. this.$message.success(res.msg);
  224. } else {
  225. this.$message.error(res.msg);
  226. }
  227. }).catch(e => {});
  228. },
  229. queryRefund(row) {
  230. this.loading = true;
  231. request({
  232. params: {
  233. r: 'deposit-presale/default/query-refund',
  234. id: row.id
  235. },
  236. method: 'get',
  237. }).then(e => {
  238. let res = e.data;
  239. this.listLoading = false;
  240. if (res.code === 0) {
  241. this.$message.success(res.msg);
  242. } else {
  243. this.$message.error(res.msg);
  244. }
  245. }).catch(e => {});
  246. },
  247. },
  248. // 加载的时候获取到列表页
  249. mounted() {
  250. // 数据初始化
  251. this.LoadDataType = -1;
  252. this.loadData();
  253. }
  254. })
  255. </script>