index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * 名片
  6. * Author: james
  7. * Date: 2020-07-10
  8. * Time: 15:48
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>订单管理</span>
  15. <div style="float: right; margin: -5px 0">
  16. <el-button type="primary" size="small" @click="onEdit()">代客下单</el-button>
  17. </div>
  18. </div>
  19. <el-row :gutter="10" style="margin-bottom: 10px;">
  20. <el-col :span="12">
  21. <el-card shadow="never">
  22. <template #header>
  23. <strong>
  24. 订单总数量(笔)
  25. </strong>
  26. </template>
  27. <template>
  28. <div>
  29. <strong class="text-danger" style="font-size: 32px">{{pagination.totalCount}}</strong><span class="text-info" style="font-size: 12px; margin-left: 5px">笔</span>
  30. </div>
  31. </template>
  32. </el-card>
  33. </el-col>
  34. <el-col :span="12">
  35. <el-card shadow="never">
  36. <template #header>
  37. <strong>
  38. 订单总金额(元)
  39. </strong>
  40. </template>
  41. <template>
  42. <div>
  43. <span class="text-info" style="font-size: 12px;">¥</span><strong class="text-danger" style="font-size: 32px">{{totalAmount | amount}}</strong><span class="text-info" style="font-size: 12px; margin-left: 5px">元</span>
  44. </div>
  45. </template>
  46. </el-card>
  47. </el-col>
  48. </el-row>
  49. <div class="table-body">
  50. <el-form size="small" :inline="true">
  51. <el-form-item>
  52. <el-date-picker size="small" v-model="searchForm.date" type="datetimerange"
  53. value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
  54. @change="selectDateTime" end-placeholder="结束日期">
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-input placeholder="请输入下单用户ID进行搜索" v-model="searchForm.buy_user_id" clearable></el-input>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-input placeholder="请输入下单用户昵称/手机号码进行搜索" v-model="searchForm.buy_user" clearable></el-input>
  62. </el-form-item>
  63. <el-form-item>
  64. <el-input placeholder="请输入被下单用户ID进行搜索" v-model="searchForm.user_id" clearable></el-input>
  65. </el-form-item>
  66. <el-form-item>
  67. <el-input placeholder="请输入被下单用户昵称/手机号码进行搜索" v-model="searchForm.user" clearable></el-input>
  68. </el-form-item>
  69. <el-form-item>
  70. <el-input placeholder="请输入商品名称进行搜索" v-model="searchForm.goods_name" clearable></el-input>
  71. </el-form-item>
  72. <el-form-item>
  73. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="onSearch">搜索</el-button>
  74. </el-form-item>
  75. <el-form-item>
  76. <el-button size="small" type="danger" style="padding: 9px 15px !important;" @click="onResetSearch">重置</el-button>
  77. </el-form-item>
  78. </el-form>
  79. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  80. @selection-change="handleSelectionChange">
  81. <el-table-column label="下单人ID" prop="buy_user_id" width="120" align="center"></el-table-column>
  82. <el-table-column label="下单人信息" width="200" align="center">
  83. <template slot-scope="scope">
  84. <div class="table-info-img-text" style="text-align: left">
  85. <el-image class="table-info-img circle" :src="scope.row.buyUser.avatar_url">
  86. <div slot="error" class="image-slot">
  87. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  88. </div>
  89. </el-image>
  90. <div class="table-info-text">
  91. <div style="color:#000;">{{scope.row.buyUser.nickname}}</div>
  92. <div style="font-size: 12px;">{{scope.row.buyUser.mobile}}</div>
  93. </div>
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="被下单人ID" prop="user_id" width="120" align="center"></el-table-column>
  98. <el-table-column label="被下单人信息" width="200" align="center">
  99. <template slot-scope="scope">
  100. <div class="table-info-img-text" style="text-align: left">
  101. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  102. <div slot="error" class="image-slot">
  103. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  104. </div>
  105. </el-image>
  106. <div class="table-info-text">
  107. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  108. <div style="font-size: 12px;">{{scope.row.user.mobile}}</div>
  109. </div>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="订单编号" prop="order_no" align="center">
  114. <template slot-scope="scope">
  115. <el-tooltip class="item" effect="dark" content="查看订单详情" placement="top">
  116. <a @click="goOrderDetail(scope.row)" href="javascript:;" style="color: #333333">{{scope.row.order_no}}</a>
  117. </el-tooltip>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="商品信息" align="center">
  121. <template slot-scope="scope">
  122. <div class="table-info-img-text" style="text-align: left">
  123. <el-image class="table-info-img circle" :src="scope.row.order.detail[0].pic_url">
  124. <div slot="error" class="image-slot">
  125. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  126. </div>
  127. </el-image>
  128. <div class="table-info-text">
  129. <div style="color:#000;">{{scope.row.order.detail[0].goods_name}}</div>
  130. <div style="font-size: 12px;">规格:{{scope.row.order.detail[0].goods_attr_name ? scope.row.order.detail[0].goods_attr_name : '-'}}</div>
  131. </div>
  132. </div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="订单金额" prop="award_money" width="120" align="center">
  136. <template slot-scope="scope">
  137. <div>¥<strong class="text-danger">{{scope.row.order_amount | amount}}</strong></div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="下单时间" prop="award_money" width="150" align="center">
  141. <template slot-scope="scope">
  142. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <!-- 分页器 -->
  147. <div flex="box:last cross:center">
  148. <div></div>
  149. <div>
  150. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  151. style="display: inline-block;float: right;" background @current-change="pageChange"
  152. layout="prev, pager, next" :total="pagination.totalCount">
  153. </el-pagination>
  154. </div>
  155. </div>
  156. </div>
  157. <!-- 这个是复制用的容器,已隐藏 -->
  158. <textarea id="inputs" style="opacity: 0;width: 0;height: 0;">这是幕后黑手</textarea>
  159. </el-card>
  160. </div>
  161. <script>
  162. new Vue({
  163. el: '#app',
  164. data: {
  165. page:1,
  166. avatar: '',
  167. nickname: '',
  168. time:[], //本地存时间,请求时不发送
  169. searchForm: {
  170. user_id: '',
  171. start_date: '',
  172. end_date: '',
  173. buy_user_id: '',
  174. buy_user: '',
  175. user: '',
  176. goods_name: ''
  177. },
  178. loading: false,
  179. activeName: '-1',
  180. list: [], //列表数据
  181. sum: {
  182. award_money:0,
  183. award_user:0,
  184. grant_num:0,
  185. },
  186. pagination: {
  187. totalCount: 0
  188. },
  189. totalAmount: 0
  190. },
  191. mounted() {
  192. // 获取列表首页数据
  193. this.loadData(1); //获取列表数据
  194. },
  195. filters: {
  196. amount: function(val) {
  197. return parseFloat(val / 100).toFixed(2)
  198. }
  199. },
  200. methods: {
  201. selectDateTime(e) {
  202. if (e != null) {
  203. this.searchForm.start_date = e[0];
  204. this.searchForm.end_date = e[1];
  205. } else {
  206. this.searchForm.start_date = '';
  207. this.searchForm.end_date = '';
  208. }
  209. },
  210. // 1.0 获取视频列表
  211. loadData(page) {
  212. this.loading = true;
  213. request({
  214. params: {
  215. r: 'valet-order/default/index',
  216. page: page,
  217. ...this.searchForm
  218. },
  219. }).then(e => {
  220. this.loading = false;
  221. if (e.data.code === 0) {
  222. this.list = e.data.data.list ? e.data.data.list : [];
  223. if (this.list.length > 0) {
  224. this.pagination = e.data.data.pagination;
  225. this.totalAmount = e.data.data.total_amount
  226. }
  227. } else {
  228. this.$message.error(e.data.msg);
  229. }
  230. }).catch(e => {});
  231. },
  232. pageChange(page) {
  233. this.loadData(page);
  234. },
  235. handleSelectionChange(val) {
  236. let self = this;
  237. self.choose_list = [];
  238. val.forEach(function (item) {
  239. self.choose_list.push(item.id);
  240. })
  241. },
  242. onSearch() {
  243. this.loadData(1);
  244. },
  245. onResetSearch() {
  246. this.searchForm = {
  247. user_id: '',
  248. nickname: '',
  249. phone: ''
  250. }
  251. },
  252. goOrderDetail(item) {
  253. let params = {
  254. r: 'mall/order/detail',
  255. id: item.order_id
  256. };
  257. navigateTo(params);
  258. },
  259. onEdit() {
  260. let params = {
  261. r: 'valet-order/default/create',
  262. };
  263. navigateTo(params);
  264. }
  265. }
  266. });
  267. </script>
  268. <style>
  269. .el-tabs__header {
  270. font-size: 16px;
  271. }
  272. .table-body {
  273. padding: 20px;
  274. background-color: #fff;
  275. }
  276. .table-body .el-button {
  277. padding: 0 !important;
  278. border: 0;
  279. margin: 0 5px;
  280. }
  281. .input-item {
  282. width: 250px;
  283. margin: 0 0 20px;
  284. display: inline-block;
  285. }
  286. .input-item .el-input__inner {
  287. border-right: 0;
  288. }
  289. .input-item .el-input__inner:hover {
  290. border: 1px solid #dcdfe6;
  291. border-right: 0;
  292. outline: 0;
  293. }
  294. .input-item .el-input__inner:focus {
  295. border: 1px solid #dcdfe6;
  296. border-right: 0;
  297. outline: 0;
  298. }
  299. .input-item .el-input-group__append {
  300. background-color: #fff;
  301. border-left: 0;
  302. width: 10%;
  303. padding: 0;
  304. }
  305. .input-item .el-input-group__append .el-button {
  306. padding: 0;
  307. }
  308. .input-item .el-input-group__append .el-button {
  309. margin: 0;
  310. }
  311. .batch {
  312. margin: 0 0 20px;
  313. display: inline-block;
  314. }
  315. .batch .el-button {
  316. padding: 9px 15px !important;
  317. }
  318. .item-box{
  319. margin-right: 20px;
  320. }
  321. .item-box .label{
  322. margin-right: 8px;
  323. }
  324. .item-box .symbol{
  325. margin: 0 6px;
  326. }
  327. .form-nickname{
  328. width: 180px;
  329. white-space:nowrap;
  330. overflow:hidden;
  331. text-overflow:ellipsis;
  332. }
  333. .index-video-url{
  334. width: 300px;
  335. }
  336. .index-video-url video{
  337. width: 100%;
  338. }
  339. .index-related-info{
  340. width: 500px;
  341. }
  342. .video-top{
  343. width: 100%;
  344. display: flex;
  345. align-items: flex-start;
  346. box-sizing: border-box;
  347. padding: 20px;
  348. /* opacity: .5; */
  349. background-color: #FFFFFF;
  350. }
  351. .video-top .top-right{
  352. line-height: 26px;
  353. }
  354. .video-top .top-right .top-title{
  355. font-size: 18px;
  356. white-space:nowrap;
  357. overflow:hidden;
  358. text-overflow:ellipsis;
  359. width: 360px;
  360. }
  361. .video-top .top-right .wrapper{
  362. display: flex;
  363. /* align-items: flex-start; */
  364. }
  365. .video-top .top-right .wrapper .to-copy{
  366. /* color: #03C5FF; */
  367. margin-left: 20px;
  368. }
  369. .video-top .top-right .detail-price{
  370. color: #BC0100;
  371. font-size: 18px;
  372. font-family: Microsoft YaHei;
  373. font-weight: bold;
  374. }
  375. /* .atooltip {
  376. background: #FFFFFF !important;
  377. border: none !important;
  378. } */
  379. .el-table th>.cell{
  380. color: #333;
  381. font-weight: bold;
  382. font-size: 14px;
  383. }
  384. .el-table__footer-wrapper, .el-table__header-wrapper{
  385. border-bottom: 1.4px solid #D6D6D6;
  386. }
  387. .price_col{
  388. color: #FF5D05;
  389. }
  390. .text-danger {
  391. color: #F56C6C;
  392. }
  393. .text-info {
  394. color: #909399;
  395. }
  396. </style>