index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <?php
  2. $activity_id = Yii::$app->request->getQueryParam('activity_id');
  3. $activity_id = $activity_id ? $activity_id : 0;
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <div>
  9. <span>拼团订单</span>
  10. <div style="float: right; margin: -5px 0">
  11. </div>
  12. </div>
  13. </div>
  14. <div class="table-body">
  15. <el-row :gutter="20">
  16. <el-col :span="4">
  17. 会员ID:
  18. <div class="input-item">
  19. <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
  20. </div>
  21. </el-col>
  22. <el-col :span="4">
  23. 会员昵称:
  24. <div class="input-item">
  25. <el-input @keyup.enter.native="search" size="small" placeholder="用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
  26. </div>
  27. </el-col>
  28. <el-col :span="4">
  29. 订单编号:
  30. <div class="input-item">
  31. <el-input @keyup.enter.native="search" size="small" placeholder="订单编号" v-model="searchData.order_no" clearable @clear="search"></el-input>
  32. </div>
  33. </el-col>
  34. <el-col :span="4">
  35. 拼单状态:
  36. <el-select size="small" v-model="searchData.group_status" @change='search' class="select" style="float:none;width: 140px;">
  37. <el-option key="0" label="请选择拼单状态" value="0"></el-option>
  38. <el-option key="1" label="参团中" value="1"></el-option>
  39. <el-option key="2" label="拼团成功" value="2"></el-option>
  40. <el-option key="3" label="拼团失败" value="3"></el-option>
  41. <el-option key="-1" label="已取消" value="-1"></el-option>
  42. </el-select>
  43. </el-col>
  44. <el-col :span="4">
  45. 拼团方式:
  46. <el-select size="small" v-model="searchData.attend_type" @change='search' class="select" style="float:none;width: 140px;">
  47. <el-option key="0" label="请选择拼单状态" value="0"></el-option>
  48. <el-option key="1" label="手动拼团" value="1"></el-option>
  49. <el-option key="2" label="自动拼团" value="2"></el-option>
  50. </el-select>
  51. </el-col>
  52. <el-col :span="4">
  53. 商品名称
  54. <div class="input-item">
  55. <el-input @keyup.enter.native="search" size="small" placeholder="请输入商品名称" v-model="searchData.goods_name" clearable></el-input>
  56. </div>
  57. </el-col>
  58. </el-row>
  59. <el-row :gutter="20">
  60. <el-col :span="8">
  61. 参团时间:
  62. <el-date-picker
  63. class="item-box"
  64. size="small"
  65. @change="changeTime"
  66. v-model="searchData.time"
  67. type="datetimerange"
  68. value-format="yyyy-MM-dd HH:mm:ss"
  69. range-separator="至"
  70. start-placeholder="开始日期"
  71. end-placeholder="结束日期">
  72. </el-date-picker>
  73. </el-col>
  74. <el-col :span="8">
  75. 拼中时间:
  76. <el-date-picker
  77. class="item-box"
  78. size="small"
  79. @change="win_changeTime"
  80. v-model="searchData.win_time"
  81. type="datetimerange"
  82. value-format="yyyy-MM-dd HH:mm:ss"
  83. range-separator="至"
  84. start-placeholder="开始日期"
  85. end-placeholder="结束日期">
  86. </el-date-picker>
  87. </el-col>
  88. <el-col :span="4">
  89. 订单id:
  90. <div class="input-item">
  91. <el-input @keyup.enter.native="search" size="small" placeholder="订单id" v-model="searchData.id" clearable @clear="search"></el-input>
  92. </div>
  93. </el-col>
  94. <el-col :span="4">
  95. <div style="display: inline-block;margin-left: 10px;">
  96. <el-button type="primary" size="small" @click="search">查询</el-button>
  97. <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
  98. </div>
  99. </el-col>
  100. </el-row>
  101. <el-table class="table-info" :data="form" stripe style="width: 100%" v-loading="listLoading">
  102. <el-table-column prop="id" label="ID" width="60" align="center"></el-table-column>
  103. <el-table-column label="昵称" width="200">
  104. <template slot-scope="scope">
  105. <div class="table-info-img-text">
  106. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  107. <div slot="error" class="image-slot">
  108. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  109. </div>
  110. </el-image>
  111. <div class="table-info-text">
  112. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  113. <div v-else>{{scope.row.username}}</div>
  114. <div>用户id:{{scope.row.user_id}}</div>
  115. </div>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="order_sn" label="拼团订单编号" align="center">
  120. <template slot-scope="scope">
  121. <span class="orderno-status" v-if="scope.row.group_status==2" @click="jumpToMallOrderList(scope.row.mall_order_id)">{{scope.row.order_no ? scope.row.order_no :'--'}}</span>
  122. <!-- <el-button type="text" v-if="scope.row.group_status==2" @click="jumpToMallOrderList(scope.row.mall_order_id)">{{scope.row.order_no ? scope.row.order_no :'--'}}</el-button> -->
  123. <span v-else>{{scope.row.order_no ? scope.row.order_no :'--'}}</span>
  124. <i class="el-icon-document-copy copy_btn" @click="copyLink(scope.row.order_no)"></i>
  125. </template>
  126. </el-table-column>
  127. <el-table-column prop="status" label="拼团状态" width="100" align="center">
  128. <template slot-scope="scope">{{group_status_map[scope.row.group_status]? group_status_map[scope.row.group_status] :'--'}}</template>
  129. </el-table-column>
  130. <el-table-column prop="attend_type" label="拼团方式" align="center">
  131. <template slot-scope="scope">{{attendTypeArr[scope.row.attend_type]? attendTypeArr[scope.row.attend_type] :'--'}}</template>
  132. </el-table-column>
  133. <el-table-column prop="total_pay_price" label="订单金额" align="center"></el-table-column>
  134. <el-table-column prop="activity_title" label="活动名称" align="center"></el-table-column>
  135. <el-table-column prop="goods_id" label="商品id" align="center"></el-table-column>
  136. <el-table-column prop="goods_name" label="活动商品" align="center"></el-table-column>
  137. <el-table-column prop="buy_nums" label="购买数量" align="center"></el-table-column>
  138. <el-table-column prop="win_nums" label="中奖数量" align="center"></el-table-column>
  139. <el-table-column prop="win_time" label="拼中时间" width="160px" align="center">
  140. <template slot-scope="scope">
  141. {{scope.row.win_time|dateTimeFormat('Y-m-d H:i:s')}}
  142. </template>
  143. </el-table-column>
  144. <el-table-column prop="created_at" label="参团时间" width="160px" align="center">
  145. <template slot-scope="scope">
  146. {{scope.row.pay_at|dateTimeFormat('Y-m-d H:i:s')}}
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <div style="text-align: right;margin: 20px 0;">
  151. <el-pagination @current-change="pagination" background layout="prev, pager, next" :current-page="page" :page-count="pageCount"></el-pagination>
  152. </div>
  153. </div>
  154. </el-card>
  155. </div>
  156. <script>
  157. var activity_id = <?php echo $activity_id?>;
  158. const app = new Vue({
  159. el: '#app',
  160. data() {
  161. return {
  162. searchData: {
  163. user_id:'',
  164. nickname:'',
  165. order_no:'',
  166. id:'',
  167. group_status:'',
  168. attend_type:'',
  169. date_start:'',
  170. date_end:'',
  171. win_date_start:'',
  172. win_date_end:'',
  173. goods_name: '',
  174. },
  175. status: '0',
  176. form: [],
  177. member: [],
  178. pageCount: 0,
  179. page: 1,
  180. member_page: 1,
  181. currentPage: null,
  182. listLoading: false,
  183. btnLoading: false,
  184. group_status_map:[],
  185. attendTypeArr:[],
  186. // 导出
  187. exportList: [],
  188. };
  189. },
  190. methods: {
  191. copyLink(data) { //复制链接
  192. var clipboard = new ClipboardJS('.copy_btn', {
  193. text: function() {
  194. return data;
  195. }
  196. });
  197. clipboard.on('success', (e) => {
  198. this.$message.success('复制成功!');
  199. clipboard.destroy()
  200. });
  201. clipboard.on('error', (e) => {
  202. this.$message.error('复制失败!');
  203. this.clipboard.destroy()
  204. });
  205. },
  206. openId(index) {
  207. let item = this.form;
  208. item[index].is_open_id = !item[index].is_open_id;
  209. this.form = JSON.parse(JSON.stringify(this.form));
  210. },
  211. changeTime() {
  212. if (this.searchData.time) {
  213. this.searchData.date_start = this.searchData.time[0];
  214. this.searchData.date_end = this.searchData.time[1];
  215. }
  216. },
  217. win_changeTime() {
  218. if (this.searchData.win_time) {
  219. this.searchData.win_date_start = this.searchData.win_time[0];
  220. this.searchData.win_date_end = this.searchData.win_time[1];
  221. }
  222. console.log( this.searchData);
  223. },
  224. //搜索
  225. search() {
  226. this.page = 1;
  227. this.getList();
  228. },
  229. pagination(currentPage) {
  230. this.page = currentPage;
  231. this.getList();
  232. },
  233. getList() {
  234. this.listLoading = true;
  235. request({
  236. params: {
  237. r: 'lucky-group/group-order/index',
  238. page: this.page,
  239. user_id:this.searchData.user_id,
  240. nickname:this.searchData.nickname,
  241. order_no:this.searchData.order_no,
  242. id:this.searchData.id,
  243. group_status:this.searchData.group_status,
  244. attend_type:this.searchData.attend_type,
  245. date_start:this.searchData.date_start,
  246. date_end:this.searchData.date_end,
  247. win_date_start:this.searchData.win_date_start,
  248. win_date_end:this.searchData.win_date_end,
  249. goods_name:this.searchData.goods_name,
  250. pagesize:10
  251. },
  252. }).then(e => {
  253. if (e.data.code === 0) {
  254. this.form = e.data.data.list;
  255. this.pageCount = e.data.data.page_count;
  256. this.group_status_map = e.data.data.group_status_map;
  257. this.attendTypeArr = e.data.data.attend_type_map;
  258. } else {
  259. this.$message.error(e.data.msg);
  260. }
  261. this.listLoading = false;
  262. }).catch(e => {
  263. this.listLoading = false;
  264. });
  265. },
  266. //重置
  267. resetForm() {
  268. this.searchData.user_id = '';
  269. this.searchData.nickname = '';
  270. this.searchData.order_no = '';
  271. this.searchData.id = '';
  272. this.searchData.group_status = '';
  273. this.searchData.attend_type = '';
  274. this.searchData.date_start = '';
  275. this.searchData.date_end = '';
  276. this.searchData.win_date_start = '';
  277. this.searchData.win_date_end = '';
  278. this.searchData.time = '';
  279. this.searchData.win_time = '';
  280. this.searchData.goods_name = '';
  281. this.getList();
  282. },
  283. // 跳转商城主订单列表
  284. jumpToMallOrderList(order_id) {
  285. navigateTo({
  286. r: 'mall/order/index',
  287. order_id: order_id,
  288. });
  289. },
  290. },
  291. mounted: function() {
  292. this.page = getQuery('page') ? getQuery('page') : 1;
  293. this.getList();
  294. }
  295. });
  296. </script>
  297. <style>
  298. .table-body {
  299. padding: 20px;
  300. background-color: #fff;
  301. }
  302. /* .table-info .el-button {
  303. padding: 0 !important;
  304. border: 0;
  305. margin: 0 5px;
  306. } */
  307. .input-item {
  308. display: inline-block;
  309. width: 150px;
  310. margin: 0 0 20px;
  311. }
  312. .input-item .el-input__inner {
  313. border-right: 1px solid #dcdfe6;
  314. }
  315. .input-item .el-input__inner:hover {
  316. border: 1px solid #dcdfe6;
  317. border-right: 0;
  318. outline: 0;
  319. }
  320. .input-item .el-input__inner:focus {
  321. border: 1px solid #dcdfe6;
  322. border-right: 0;
  323. outline: 0;
  324. }
  325. .input-item .el-input-group__append {
  326. background-color: #fff;
  327. border-left: 0;
  328. width: 10%;
  329. padding: 0;
  330. }
  331. .input-item .el-input-group__append .el-button {
  332. padding: 0;
  333. }
  334. .input-item .el-input-group__append .el-button {
  335. margin: 0;
  336. }
  337. .select {
  338. float: left;
  339. width: 100px;
  340. margin-right: 10px;
  341. }
  342. .el-table th>.cell {
  343. color: #333;
  344. font-weight: bold;
  345. font-size: 14px;
  346. }
  347. .el-table__footer-wrapper,
  348. .el-table__header-wrapper {
  349. border-bottom: 1.4px solid #D6D6D6;
  350. }
  351. .table-info-img{
  352. min-width: 50px;
  353. min-height: 50px;
  354. }
  355. .orderno-status {
  356. color: #409EFF;
  357. cursor: pointer;
  358. }
  359. </style>