index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <style>
  2. .table-body {
  3. padding: 20px;
  4. background-color: #fff;
  5. }
  6. .input-item {
  7. display: inline-block;
  8. width: 250px;
  9. margin: 0 0 20px;
  10. }
  11. .input-item .el-input__inner {
  12. border-right: 0;
  13. }
  14. .input-item .el-input__inner:hover {
  15. border: 1px solid #dcdfe6;
  16. border-right: 0;
  17. outline: 0;
  18. }
  19. .input-item .el-input__inner:focus {
  20. border: 1px solid #dcdfe6;
  21. border-right: 0;
  22. outline: 0;
  23. }
  24. .input-item .el-input-group__append {
  25. background-color: #fff;
  26. border-left: 0;
  27. width: 10%;
  28. padding: 0;
  29. }
  30. .input-item .el-input-group__append .el-button {
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. margin: 0;
  35. }
  36. .table-body .el-button {
  37. padding: 0 !important;
  38. border: 0;
  39. margin: 0 5px;
  40. }
  41. .el-table th > .cell {
  42. color: #333;
  43. font-weight: bold;
  44. font-size: 14px;
  45. }
  46. .el-table__footer-wrapper, .el-table__header-wrapper {
  47. border-bottom: 1.4px solid #D6D6D6;
  48. }
  49. .label {
  50. margin-right: 10px;
  51. }
  52. .default-goods{
  53. max-width: 50px;
  54. max-height: 50px;
  55. }
  56. .flex-x-between {
  57. display: -webkit-box;
  58. display: -webkit-flex;
  59. display: flex;
  60. -webkit-box-pack: space-between;
  61. -webkit-justify-content: space-between;
  62. -ms-flex-pack: space-between;
  63. justify-content: space-between;
  64. }
  65. .cont-title {
  66. font-size: 15px;
  67. padding-top: 20px;
  68. padding-bottom: 10px;
  69. font-weight: 700;
  70. }
  71. .cont-num {
  72. font-size: 14px;
  73. font-weight: 700;
  74. padding-bottom: 10px;
  75. }
  76. .center {
  77. text-align: center;
  78. }
  79. .el-dialog__header .el-dialog__title{
  80. font-size: 18px;
  81. }
  82. .el-dialog__wrapper .el-dialog__body{
  83. padding: 3px 20px;
  84. }
  85. /*头像样式 start*/
  86. .default-avatar{
  87. width: 50px;
  88. height: 50px;
  89. border-radius: 50%;
  90. }
  91. .user_img{
  92. position: relative;
  93. margin-right: 8px;
  94. height: 50px;
  95. width: 50px;
  96. }
  97. .el-table_1_column_2 .cell { /*-2 表示在第二行*/
  98. display: flex;
  99. }
  100. /*头像样式 end*/
  101. .num-info {
  102. display: flex;
  103. width: 100%;
  104. height: 60px;
  105. font-size: 28px;
  106. color: #303133;
  107. }
  108. .num-info .num-info-item {
  109. text-align: center;
  110. width: 25%;
  111. border-left: 1px dashed #EFF1F7;
  112. }
  113. .num-info .num-info-item:first-of-type {
  114. border-left: 0;
  115. }
  116. .info-item-name {
  117. font-size: 16px;
  118. color: #92959B;
  119. }
  120. .tab-pay {
  121. position: absolute;
  122. bottom: 0;
  123. right: 50px;
  124. }
  125. .tab-pay .el-tabs__item {
  126. height: 56px;
  127. line-height: 56px;
  128. }
  129. .pay-info {
  130. padding: 40px 0;
  131. display: flex;
  132. background-color: #fff;
  133. }
  134. .pay-info .pay-info-item {
  135. padding-top: 20px;
  136. width: 22%;
  137. margin: 0 0.5%;
  138. text-align: center;
  139. font-size: 26px;
  140. border: 1px solid #c8cacf;
  141. border-radius: 10px;
  142. height: 113px;
  143. position: relative;
  144. cursor: pointer;
  145. }
  146. .pay-info .pay-info-item.active {
  147. border: 1px solid #3399FF;
  148. }
  149. .pay-info .pay-info-item img {
  150. display: none;
  151. }
  152. .pay-info .pay-info-item.active img {
  153. position: absolute;
  154. top: 0;
  155. left: 0;
  156. display: block;
  157. }
  158. .line{
  159. width: 100%;
  160. height: 5px;
  161. clear: both;
  162. background-color: #f3f3f3;
  163. }
  164. </style>
  165. <div id="app" v-cloak>
  166. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  167. <div slot="header">
  168. <div>
  169. <span>全部订单</span>
  170. </div>
  171. </template>
  172. </div>
  173. <!-- 选择框 -->
  174. <div class="pay-info">
  175. <div class="pay-info-item" >
  176. <img src="statics/img/mall/statistic/active.png" alt="">
  177. <div>{{statistics['order_num']}}</div>
  178. <div class="info-item-name">全部订单</div>
  179. </div>
  180. <div class="pay-info-item">
  181. <img src="statics/img/mall/statistic/active.png" alt="">
  182. <div>{{statistics['pay_num']}}</div>
  183. <div class="info-item-name">已完成</div>
  184. </div>
  185. <div class="pay-info-item" >
  186. <img src="statics/img/mall/statistic/active.png" alt="">
  187. <div>{{statistics['cancel_order_num']}}</div>
  188. <div class="info-item-name">已关闭</div>
  189. </div>
  190. </div>
  191. <div class="table-body el-input--small">
  192. <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  193. <div class="item-box" flex="dir:left cross:center">
  194. <div class="label">创建时间</div>
  195. <el-date-picker
  196. v-model="time"
  197. type="datetimerange"
  198. value-format="yyyy-MM-dd HH:mm:ss"
  199. range-separator="至"
  200. start-placeholder="开始日期"
  201. end-placeholder="结束日期">
  202. </el-date-picker>
  203. </div>
  204. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  205. <div class="label">购买名称</div>
  206. <el-input style="width: 150px" v-model="search.consumer_name" placeholder="购买名称"></el-input>
  207. </div>
  208. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  209. <div class="label">标题</div>
  210. <el-input style="width: 150px" v-model="search.title" placeholder="标题"></el-input>
  211. </div>
  212. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  213. <div class="label">支付状态</div>
  214. <el-select size="small" v-model="search.order_status" class="select">
  215. <el-option label="待支付" value="0"></el-option>
  216. <el-option label="已完成" value="4"></el-option>
  217. <el-option label="已关闭" value="-4"></el-option>
  218. </el-select>
  219. </div>
  220. <div class="item-box" flex="dir:left cross:center">
  221. <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
  222. </el-button>
  223. </div>
  224. </el-form>
  225. </div>
  226. <div class="line"></div>
  227. <div class="table-body el-input--small">
  228. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  229. <el-table-column label="标题" min-width="80" align="center">
  230. <template slot-scope="scope">
  231. <div style="font-size: 13px;" >{{scope.row.title}}</div>
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="订单编号" min-width="80" align="center">
  235. <template slot-scope="scope">
  236. <div style="font-size: 13px;" >{{scope.row.order_no}}</div>
  237. </template>
  238. </el-table-column>
  239. <el-table-column label="类型" min-width="80" align="center">
  240. <template slot-scope="scope">
  241. {{consumer_type[scope.row.consumer_type]}}
  242. </template>
  243. </el-table-column>
  244. <el-table-column label="购买名称" min-width="80" align="center">
  245. <template slot-scope="scope">
  246. <div style="font-size: 13px;" >{{scope.row.consumer_name}}</div>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="支付金额" min-width="80" align="center">
  250. <template slot-scope="scope">
  251. <div style="font-size: 13px;" >{{scope.row.pay_money}}</div>
  252. </template>
  253. </el-table-column>
  254. <el-table-column prop="scope" width="160" label="支付时间">
  255. <template slot-scope="scope">
  256. <div v-if="scope.row.order_status == 4">{{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}</div>
  257. <div v-else>未支付</div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="scope" width="160" label="订单状态">
  261. <template slot-scope="scope">
  262. <div v-if="scope.row.order_status == 0">待支付</div>
  263. <div v-if="scope.row.order_status == 4">已完成</div>
  264. <div v-if="scope.row.order_status == -4">已关闭</div>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="结算状态" min-width="80" align="center">
  268. <template slot-scope="scope">
  269. <div v-if="scope.row.settlement_status == 0">未结算</div>
  270. <div v-if="scope.row.settlement_status == 1">已结算</div>
  271. </template>
  272. </el-table-column>
  273. </el-table>
  274. <div style="text-align: right;margin: 20px 0;">
  275. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  276. style="display: inline-block;float: right;" background @current-change="pageChange"
  277. layout="prev, pager, next" :total="pagination.total_count">
  278. </el-pagination>
  279. </div>
  280. </div>
  281. </el-card>
  282. </div>
  283. <script>
  284. const app = new Vue({
  285. el: '#app',
  286. data() {
  287. return {
  288. listLoading: false,
  289. page: 1,
  290. order: true,
  291. pageCount: 0,
  292. statistics:{'order_num':0,'pay_num':0,'cancel_order_num':0},
  293. //基础数据
  294. editBasisData: {
  295. materialTypeList: [],
  296. },
  297. //本地存时间,请求时不发送
  298. time: [],
  299. search: {
  300. consumer_name: '',
  301. title: '',
  302. order_status: null,
  303. date_start: null,
  304. date_end: null,
  305. },
  306. from_type:'',
  307. list: [],
  308. consumer_type:[],
  309. pagination:null,
  310. };
  311. },
  312. methods: {
  313. searchs() {
  314. this.page = 1;
  315. this.getList();
  316. },
  317. pageChange(currentPage) {
  318. let self = this;
  319. self.page = currentPage;
  320. self.getList();
  321. },
  322. getList() {
  323. let self = this;
  324. self.listLoading = true;
  325. // 检查是否选择了搜索时间
  326. if (!self.time) {
  327. self.search.date_start = '';
  328. self.search.date_end = '';
  329. } else {
  330. self.search.date_start = self.time[0];
  331. self.search.date_end = self.time[1];
  332. }
  333. request({
  334. method: 'post',
  335. params: {
  336. r: 'admin/platform-order/index',
  337. },
  338. data: {
  339. page: self.page,
  340. consumer_name: self.search.consumer_name,
  341. order_status: self.search.order_status,
  342. date_start: self.search.date_start,
  343. date_end: self.search.date_end,
  344. title: self.search.title,
  345. },
  346. }).then(e => {
  347. self.listLoading = false;
  348. self.list = e.data.data.list;
  349. this.consumer_type = e.data.data.consumer_type;
  350. this.statistics = e.data.data.statistics;
  351. this.from_type = e.data.data.from_type;
  352. this.pagination = e.data.data.pagination;
  353. this.pagination.pageSize = e.data.data.page_size;
  354. this.pagination.total_count = e.data.data.count;
  355. }).catch(e => {
  356. console.log(e);
  357. });
  358. },
  359. },
  360. mounted: function () {
  361. this.getList();
  362. }
  363. });
  364. </script>