index.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. <?php
  2. /*
  3. * @Descripttion:
  4. * @copyright: Copyright (c) 2021 广东七件事集团
  5. * @Author: lun
  6. * @Date: 2021-12-28 23:01:04
  7. */
  8. ?>
  9. <style>
  10. .link_url {
  11. text-align: left;
  12. font-size: 14px;
  13. }
  14. .showqr .el-dialog__body {
  15. text-align: center;
  16. padding-bottom: 10px;
  17. }
  18. .el-dialog {
  19. min-width: 400px;
  20. }
  21. </style>
  22. <div id="app" v-cloak>
  23. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  24. <div slot="header">
  25. <span>订单列表</span>
  26. </div>
  27. <div class="search-box">
  28. <!-- 搜索 -->
  29. <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
  30. <el-form-item label="创建日期">
  31. <el-date-picker
  32. size="small"
  33. v-model="searchForm.create_time"
  34. type="datetimerange"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期">
  39. </el-date-picker>
  40. </el-form-item>
  41. <el-form-item label="活动名称">
  42. <el-input placeholder="请输入活动名称" v-model="searchForm.name"></el-input>
  43. </el-form-item>
  44. <el-form-item label="类型">
  45. <el-select v-model="searchForm.type" placeholder="类型">
  46. <el-option v-for="(name,index) in type_arr" :label="name" :value="index" :key="index"></el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item label="商品类型">
  50. <el-select v-model="searchForm.goods_type" placeholder="类型">
  51. <el-option v-for="(name,index) in goods_type_arr" :label="name" :value="index" :key="index"></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="核销码">
  55. <el-input placeholder="请输入核销码" v-model="searchForm.code"></el-input>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button type="primary" @click="search">搜索</el-button>
  59. <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  60. </el-form-item>
  61. </el-form>
  62. </div>
  63. <div class="table-body">
  64. <el-tabs>
  65. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  66. <el-table-column prop="id" min-width="30" label="ID" align="center"></el-table-column>
  67. <el-table-column label="会员" width="180" >
  68. <template slot-scope="scope">
  69. <div class="user_img" v-if="scope.row.user_id>0">
  70. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  71. <div slot="error" class="image-slot">
  72. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  73. </div>
  74. </el-image>
  75. </div>
  76. <div class="user_img" v-else>
  77. <el-image class="default-avatar" :src="scope.row.user_avatar_url">
  78. <div slot="error" class="image-slot">
  79. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  80. </div>
  81. </el-image>
  82. </div>
  83. <div>
  84. <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
  85. <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
  86. <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="订单金额" align="center">
  91. <template slot-scope="scope">
  92. {{ scope.row.order_money ? scope.row.order_money : 0 }}
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="佣金" min-width="40" align="center">
  96. <template slot-scope="scope">
  97. {{ scope.row.commission}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="use_time" label="基本信息" min-width="80" align="center">
  101. <template slot-scope="scope">
  102. <span @click="get_setting_data(scope.row)" style="cursor: pointer;">基本信息</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="storeOrder" label="商品信息" width="150" align="center">
  106. <template slot-scope="scope">
  107. <div v-if="scope.row.storeOrder">
  108. <div v-for="detail in scope.row.storeOrder.detail">
  109. <div class="goods-box">
  110. <div class="goods-img">
  111. <el-image style="width: 50px; height: 50px; border-radius: 5px;" :src="detail.pic_url" fit="cover"></el-image>
  112. </div>
  113. <div class="goods-info">
  114. <p>
  115. <span>名称: </span>
  116. {{ detail.goods_name }}
  117. </p>
  118. <p>
  119. <span>数量: </span>
  120. {{ detail.num }}
  121. </p>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div v-else>
  127. --
  128. </div>
  129. </template>
  130. </el-table-column>
  131. <!-- <el-table-column prop="use_time" label="发货/使用时间" min-width="80" align="center">
  132. <template slot-scope="scope">
  133. {{ scope.row.use_time | dateTimeFormat('Y-m-d H:i') }}
  134. </template>
  135. </el-table-column> -->
  136. <el-table-column prop="appointment_time" label="预约时间" min-width="80" align="center">
  137. <template slot-scope="scope">
  138. {{ scope.row.appointment_time | dateTimeFormat('Y-m-d H:i') }}
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="状态" align="center">
  142. <template slot-scope="scope">
  143. <span v-if="scope.row.type == 2">
  144. <span v-if="scope.row.check_time">已核销</span>
  145. <span v-else-if="scope.row.status === 0">已取消</span>
  146. <span v-else>未核销</span>
  147. </span>
  148. <span v-else>
  149. <span v-if="scope.row.storeOrder">
  150. <el-tag size="small" type="warning">{{order_status_list[scope.row.storeOrder.order_status]}}</el-tag>
  151. </span>
  152. <span v-else>
  153. <el-tag size="small" type="warning">{{order_status_list[scope.row.order.order_status]}}</el-tag>
  154. </span>
  155. </span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column prop="created_at" label="创建时间" min-width="80" align="center">
  159. <template slot-scope="scope">
  160. {{ scope.row.created_at | dateTimeFormat('Y-m-d H:i') }} {{scope.row.goods_type}}
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="操作" align="center">
  164. <template slot-scope="scope">
  165. <el-button v-if="scope.row.status == 1 && scope.row.store_type == 2 && scope.row.type == 2 && !scope.row.check_time" type="text" @click="handle('check',scope.row)">核销</el-button>
  166. <el-button v-else-if="scope.row.goods_type == 2 && scope.row.type == 1" type="text" @click="handle('order_detail',scope.row)">订单详情</el-button>
  167. <span v-else> -- </span>
  168. </template>
  169. </el-table-column>
  170. </el-table>
  171. <div style="text-align: right;margin: 20px 0;">
  172. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  173. </div>
  174. </el-tabs>
  175. </div>
  176. </el-card>
  177. <!-- 弹框基本信息开始-->
  178. <el-dialog title="基本信息" width="30%" :visible.sync="setting_data"
  179. @close="setting_data = false" :modal-append-to-body="false">
  180. <el-form :model="addForm" ref="addForm" :inline="true" @submit.native.prevent label-width="100px">
  181. <el-form-item label="活动名称:" >
  182. {{active_title}}
  183. </el-form-item>
  184. <br>
  185. <el-form-item label="活动类型:" >
  186. <span v-if="detail_one.type==1">预约商品</span>
  187. <span v-if="detail_one.type==2">预约服务</span>
  188. <span v-if="detail_one.goods_type==1">平台商品</span>
  189. <span v-if="detail_one.goods_type==2">门店商品</span>
  190. </el-form-item>
  191. <el-form-item label="活动时间:" prop="code">
  192. {{active_time}}
  193. </el-form-item>
  194. <el-form-item label="预约时间:" prop="code">
  195. {{subscribe_time}}
  196. </el-form-item>
  197. <el-form-item label="可使用时间:" prop="code">
  198. {{use_time}}
  199. </el-form-item>
  200. </el-form>
  201. <span slot="footer" class="dialog-footer">
  202. <el-button @click="setting_data = false">取 消</el-button>
  203. </span>
  204. </el-dialog>
  205. <!-- 弹框基本信息结束-->
  206. <!-- 弹框添加分类开始-->
  207. <el-dialog title="服务核销订单" width="30%" :visible.sync="dialogAddgsVisible"
  208. @close="dialogAddgsVisible = false" :modal-append-to-body="false">
  209. <el-form :model="addForm" ref="addForm" :inline="true" @submit.native.prevent label-width="100px">
  210. <el-form-item label="核销码" prop="code">
  211. <el-input v-model="addForm.code" placeholder="请填写核销码"></el-input>
  212. </el-form-item>
  213. </el-form>
  214. <span slot="footer" class="dialog-footer">
  215. <el-button @click="dialogAddgsVisible = false">取 消</el-button>
  216. <el-button type="primary" :loading="btnLoading" @click="handle('postcheck','addForm')">确 定</el-button>
  217. </span>
  218. </el-dialog>
  219. <!-- 弹框添加分类结束-->
  220. </div>
  221. <script>
  222. const app = new Vue({
  223. el: '#app',
  224. data: {
  225. loading: false,
  226. btnLoading:false,
  227. delLoading: false,
  228. dialogAddgsVisible:false,
  229. setting_data:false,
  230. page: 1,
  231. active_id:'',
  232. active_time:'',
  233. subscribe_time:'',
  234. use_time:'',
  235. active_title:'',
  236. detail_one:[],
  237. pageCount: 0,
  238. list: [],
  239. type_arr: {
  240. 1: '商品预约',
  241. 2: '服务预约',
  242. },
  243. goods_type_arr: {
  244. 1: '平台商品',
  245. 2: '门店商品',
  246. },
  247. store_type_arr: {
  248. 1: '全部门店',
  249. 2: '部分门店',
  250. },
  251. now_time: 0,
  252. searchForm:{
  253. name:null,
  254. type:null,
  255. goods_type:null,
  256. store_type:null,
  257. status:null,
  258. code:null,
  259. },
  260. addForm:{
  261. code:'',
  262. id:'',
  263. },
  264. order_status_list: {
  265. "0": "待付款",
  266. "1": "待发货",
  267. "2": "已发货",
  268. "3": "已收货",
  269. "4": "已完成",
  270. "6": "待自提",
  271. "7": "自提成功",
  272. "-1": "售后申请",
  273. "-2": "退款中",
  274. "-3": "售后完成",
  275. "-4": "已关闭",
  276. "-5": "撤销申请",
  277. "-6": "售后拒绝",
  278. },
  279. },
  280. mounted() {
  281. if(getQuery('active_id')) this.active_id = getQuery('active_id');
  282. this.getList();
  283. },
  284. computed: {
  285. show_clear_search_btn: function() {
  286. return this.searchForm.name != null ||
  287. this.searchForm.type != null ||
  288. this.searchForm.goods_type != null ||
  289. this.searchForm.store_type != null ||
  290. this.searchForm.create_time != null ||
  291. this.searchForm.status != null ||
  292. this.searchForm.code != null;
  293. },
  294. },
  295. methods: {
  296. get_setting_data(row){
  297. this.detail_one = row;
  298. this.active_title = row.activity.title;
  299. this.active_time = row.active.active_time;
  300. this.subscribe_time = row.active.subscribe_time;
  301. this.use_time = row.active.use_time;
  302. this.setting_data = true;
  303. },
  304. pagination(currentPage) {
  305. let self = this;
  306. self.page = currentPage;
  307. self.getList();
  308. },
  309. search() {// 清空查询条件
  310. this.page = 1;
  311. this.getList(this.searchForm);
  312. this.addForm.code = this.searchForm.code;
  313. },
  314. handle(type, data = null) {
  315. switch (type){
  316. case 'check':
  317. this.dialogAddgsVisible = true;
  318. this.addForm.id = data.id;
  319. this.addForm.user_id = data.user_id;
  320. this.addForm.store_id = data.store_id;
  321. break;
  322. case 'order_detail':
  323. navigateTo({r:"store/client/order/detail",id:data.order_id},true);
  324. break;
  325. case 'postcheck':
  326. if(!this.addForm.code){
  327. self.$message.error(this.addForm.code);
  328. return false;
  329. }
  330. var param = {id: this.addForm.id,code:this.addForm.code,user_id: this.addForm.user_id,store_id: this.addForm.store_id};
  331. this.send('store/client/subscribe/handle',param);
  332. this.dialogAddgsVisible = false;
  333. break;
  334. }
  335. },
  336. send(url, params, callback = null) {
  337. let self = this;
  338. request({
  339. params: {
  340. r: url,
  341. },
  342. method: 'post',
  343. data: params
  344. }).then(e => {
  345. if (e.data.code == 0) {
  346. self.$message.success(e.data.msg);
  347. self.getList();
  348. } else {
  349. self.$message.error(e.data.msg);
  350. }
  351. }).catch(e => {
  352. console.log(e);
  353. });
  354. if(callback) return e.data;
  355. },
  356. resetSearch() {// 清空查询条件
  357. this.searchForm = {
  358. name: null,
  359. type: null,
  360. goods_type: null,
  361. store_type: null,
  362. status: null,
  363. create_time:null,
  364. code:null,
  365. };
  366. this.page = 1;
  367. this.getList();
  368. },
  369. getList(search = {}) {
  370. let self = this;
  371. self.loading = true;
  372. let basic_params = {
  373. page: self.page,
  374. };
  375. params = Object.assign(basic_params, search);
  376. if(this.active_id) { params.active_id = this.active_id;}
  377. request({
  378. params: {
  379. r: 'store/client/subscribe/index'
  380. },
  381. method: 'post',
  382. data: params
  383. }).then(e => {
  384. this.loading = false;
  385. if (e.data.code == 0) {
  386. self.list = e.data.data.list;
  387. self.now_time = e.data.data.now_time;
  388. self.pageCount = e.data.data.page_count;
  389. } else {
  390. self.$message.error(e.data.msg);
  391. }
  392. }).catch(e => {
  393. self.loading = false;
  394. });
  395. }
  396. }
  397. });
  398. </script>
  399. <style>
  400. /*头像样式 start*/
  401. .default-avatar{
  402. width: 50px;
  403. height: 50px;
  404. border-radius: 50%;
  405. }
  406. .user_img{
  407. position: relative;
  408. margin-right: 8px;
  409. height: 50px;
  410. width: 50px;
  411. }
  412. .el-table_1_column_2 .cell { /*-2 表示在第二行*/
  413. display: flex;
  414. }
  415. /*头像样式 end*/
  416. .el-tabs__header {
  417. font-size: 16px;
  418. }
  419. .table-body {
  420. padding: 20px;
  421. background-color: #fff;
  422. }
  423. .table-body .el-button {
  424. padding: 0 !important;
  425. border: 0;
  426. margin: 0 5px;
  427. }
  428. .input-item {
  429. width: 250px;
  430. margin: 0 0 20px;
  431. display: inline-block;
  432. }
  433. .input-item .el-input__inner {
  434. border-right: 0;
  435. }
  436. .input-item .el-input__inner:hover {
  437. border: 1px solid #dcdfe6;
  438. border-right: 0;
  439. outline: 0;
  440. }
  441. .input-item .el-input__inner:focus {
  442. border: 1px solid #dcdfe6;
  443. border-right: 0;
  444. outline: 0;
  445. }
  446. .input-item .el-input-group__append {
  447. background-color: #fff;
  448. border-left: 0;
  449. width: 10%;
  450. padding: 0;
  451. }
  452. .input-item .el-input-group__append .el-button {
  453. padding: 0;
  454. }
  455. .input-item .el-input-group__append .el-button {
  456. margin: 0;
  457. }
  458. .batch {
  459. margin: 0 0 20px;
  460. display: inline-block;
  461. }
  462. .batch .el-button {
  463. padding: 9px 15px !important;
  464. }
  465. .el-table th>.cell{
  466. color: #333;
  467. font-weight: bold;
  468. font-size: 14px;
  469. }
  470. .el-table__footer-wrapper, .el-table__header-wrapper{
  471. border-bottom: 1.4px solid #D6D6D6;
  472. }
  473. .search-box {
  474. padding: 10px 0 0 10px;
  475. background-color: #fff;
  476. margin-bottom: 10px;
  477. }
  478. .goods-box {
  479. display: flex;
  480. }
  481. .goods-box .goods-info {
  482. text-align: left;
  483. margin-left: 5px;
  484. display: flex;
  485. align-items: flex-start;
  486. flex-direction: column;
  487. }
  488. .goods-info span {
  489. font-weight: 900;
  490. }
  491. </style>