invite.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * Created by PhpStorm
  6. * Author: ganxiaohao
  7. * Date: 2020-05-08
  8. * Time: 15:48
  9. */
  10. use common\helpers\ComponentHelper;
  11. //Yii::$app->loadPluginComponentView('agent-order-edit');
  12. $diyPath = dirname(__DIR__) . '/components';
  13. ComponentHelper::loadComponentView('agent-order-edit', $diyPath);
  14. ?>
  15. <div id="app" v-cloak>
  16. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  17. <div slot="header">
  18. <span>自提订单</span>
  19. </div>
  20. <div class="table-body">
  21. <div style="display: flex;align-items: center;">
  22. <el-input style="width: 260px;margin-right: 20px;" @keyup.enter.native="loadData" size="small" placeholder="请输入代理商昵称/手机号" v-model="search.keyword"
  23. clearable @clear="toSearch">
  24. <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
  25. </el-input>
  26. <el-select size="small" v-model="search.status" @change='toSearch' class="select" style="width:130px;margin-right: 20px;">
  27. <el-option label="全部订单状态" value="" ></el-option>
  28. <el-option label="待发货" :value="0" ></el-option>
  29. <el-option label="已发货" :value="1" ></el-option>
  30. <el-option label="已完成" :value="2" ></el-option>
  31. <!-- 0待发货;1已发货;2已完成 -->
  32. </el-select>
  33. </div>
  34. <el-tabs v-model="activeName" @tab-click="handleClick">
  35. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" class="myTable">
  36. <el-table-column prop="id" min-width="80" label="ID" align="center"></el-table-column>
  37. <el-table-column label="代理商昵称" width="200">
  38. <template slot-scope="scope">
  39. <div class="table-info-img-text">
  40. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  41. <div slot="error" class="image-slot">
  42. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  43. </div>
  44. </el-image>
  45. <div class="table-info-text">
  46. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  47. </div>
  48. </div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="手机号" prop="user_mobile" min-width="120" align="center">
  52. <template slot-scope="scope">
  53. <div style="display: flex;align-items: center;">
  54. <div>{{scope.row.user.mobile}}</div>
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="自提时间" prop="created_at" min-width="120" align="center">
  59. <template slot-scope="scope">
  60. {{formatTime(scope.row.created_at)}}
  61. </template>
  62. </el-table-column>
  63. <el-table-column
  64. label="商品"
  65. min-width="150">
  66. <template slot-scope="scope">
  67. <div style="display: flex;align-items: center;">
  68. <img :src="scope.row.goods.cover_pic" style="width: 40px;height: 40px;display: block;margin-right: 5px;" />
  69. <div>{{scope.row.goods.goods_name}}</div>
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="商品数量" prop="num" min-width="80" align="center"></el-table-column>
  74. <el-table-column label="收货地址" prop="address" min-width="150" align="center">
  75. <template slot-scope="scope">
  76. <div>收货人:{{scope.row.name}} {{scope.row.mobile}} </div>
  77. <div>地址:{{scope.row.address}}</div>
  78. </template>
  79. </el-table-column>
  80. <!-- <el-table-column label="收货信息">
  81. <template slot-scope="scope">
  82. <div>收货地址: {{scope.row.address}}</div>
  83. <div>收货人: {{scope.row.name}} {{scope.row.mobile}}</div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="发货信息">
  87. <template slot-scope="scope">
  88. <div>快递名称: {{scope.row.express_name}}</div>
  89. <div>快递单号: {{scope.row.express_no}}</div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="created_at" label="提交时间"></el-table-column> -->
  93. <el-table-column label="操作" min-width="100" align="center">
  94. <template slot-scope="scope">
  95. <!-- <el-button type="text" @click="editClick(scope.row.id)" v-if="scope.row.status==0">发货</el-button>
  96. <el-button type="text" v-if="scope.row.status==1">已发货</el-button>
  97. <el-button type="text" v-if="scope.row.status==2">已收货</el-button> -->
  98. <!-- 0待发货;1已发货;2已完成 -->
  99. <el-button type="primary" @click="editClick(scope.row)" v-if="scope.row.send_status==0" size="small">待发货</el-button>
  100. <el-button type="info" v-if="scope.row.send_status==1" size="small">已发货</el-button>
  101. <el-button type="success" v-if="scope.row.send_status==2" size="small">已完成</el-button>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. </el-tabs>
  106. <div flex="box:last cross:center">
  107. <div></div>
  108. <div>
  109. <el-pagination
  110. @current-change="pageChange"
  111. background
  112. layout="prev, pager, next"
  113. :page-count="page_count">
  114. </el-pagination>
  115. </div>
  116. </div>
  117. </div>
  118. </el-card>
  119. <agent-order-edit v-model="edit.show" :edit_row="edit" @success="loadData"></agent-order-edit>
  120. </div>
  121. <script>
  122. const app = new Vue({
  123. el: '#app',
  124. data: {
  125. edit: {
  126. show: false,
  127. id: 0,
  128. data:{}
  129. },
  130. loading: false,
  131. activeName: '-1',
  132. list: [],
  133. pagination: null,
  134. agent_level_list: [],
  135. search: {
  136. page: 1,
  137. keyword:'',
  138. status:''
  139. },
  140. page_count:0
  141. },
  142. mounted() {
  143. this.loadData();
  144. },
  145. methods: {
  146. editClick(row) {
  147. //console.log('row='+JSON.stringify(row))
  148. //if (id) {
  149. /* this.edit.id = id; */
  150. this.edit.show = true;
  151. this.edit.data = row;
  152. //} else {
  153. //this.edit.show = true;
  154. //}
  155. },formatTime(timeStamp) {
  156. var date = new Date();
  157. date.setTime(timeStamp * 1000);
  158. var y = date.getFullYear();
  159. var m = date.getMonth() + 1;
  160. m = m < 10 ? ('0' + m) : m;
  161. var d = date.getDate();
  162. d = d < 10 ? ('0' + d) : d;
  163. var h = date.getHours();
  164. h = h < 10 ? ('0' + h) : h;
  165. var minute = date.getMinutes();
  166. var second = date.getSeconds();
  167. minute = minute < 10 ? ('0' + minute) : minute;
  168. second = second < 10 ? ('0' + second) : second;
  169. return y + '-' + m + '-' + d +' '+ h + ':' + minute + ':' + second;
  170. },
  171. loadData() {
  172. this.loading = true;
  173. let params = {
  174. r: 'cloud-stock-two/order/invite',//plugin/cloud_stock/mall/pick-up/get-list自取订单列表
  175. limit:10
  176. };
  177. params = Object.assign(params, this.search);
  178. //console.log('请求前的params='+JSON.stringify(params))
  179. request({
  180. params: params,
  181. method: 'get',
  182. }).then(e => {
  183. //console.log('自取订单列表='+JSON.stringify(e))
  184. this.loading = false;
  185. if (e.data.code == 0) {
  186. this.list = e.data.data.list;
  187. this.page_count = e.data.data.page_count;
  188. } else {
  189. this.$message.error(e.data.msg);
  190. }
  191. }).catch(e => {
  192. this.loading = false;
  193. });
  194. },
  195. pageChange(page) {
  196. this.search.page = page;
  197. this.loadData();
  198. },
  199. handleClick(tab, event) {
  200. this.search.page = 1;
  201. this.search.status = this.activeName;
  202. this.loadData()
  203. },
  204. toSearch() {
  205. this.search.page = 1;
  206. this.loadData();
  207. },
  208. }
  209. });
  210. </script>
  211. <style>
  212. .el-tabs__header {
  213. font-size: 16px;
  214. }
  215. .table-body {
  216. padding: 20px;
  217. background-color: #fff;
  218. }
  219. /* .table-body .el-button {
  220. padding: 0 !important;
  221. border: 0;
  222. margin: 0 5px;
  223. } */
  224. .input-item {
  225. width: 250px;
  226. margin: 0 0 20px;
  227. display: flex;
  228. align-items: center;
  229. }
  230. .input-item .el-input__inner {
  231. border-right: 0;
  232. }
  233. .input-item .el-input__inner:hover {
  234. border: 1px solid #dcdfe6;
  235. border-right: 0;
  236. outline: 0;
  237. }
  238. .input-item .el-input__inner:focus {
  239. border: 1px solid #dcdfe6;
  240. border-right: 0;
  241. outline: 0;
  242. }
  243. .input-item .el-input-group__append {
  244. background-color: #fff;
  245. border-left: 0;
  246. width: 10%;
  247. padding: 0;
  248. }
  249. .input-item .el-input-group__append .el-button {
  250. padding: 0;
  251. }
  252. .input-item .el-input-group__append .el-button {
  253. margin: 0;
  254. }
  255. .batch {
  256. margin: 0 0 20px;
  257. display: inline-block;
  258. }
  259. /* .batch .el-button {
  260. padding: 9px 15px !important;
  261. } */
  262. .el-table th>.cell{
  263. color: #333;
  264. font-weight: bold;
  265. font-size: 14px;
  266. }
  267. .myTable .el-table__footer-wrapper,.myTable .el-table__header-wrapper{
  268. border-bottom: 1.4px solid #D6D6D6;
  269. }
  270. </style>