order.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <style>
  6. .default-avatar{
  7. width: 50px;
  8. height: 50px;
  9. border-radius: 50%;
  10. float: left;
  11. margin-right: 8px;
  12. }
  13. </style>
  14. <div id="my_customer" v-cloak>
  15. <div>
  16. <el-card class="box-card">
  17. <el-form size="small" :inline="true">
  18. <el-form-item>
  19. <el-input style="width: 200px" v-model="searchData.keyword" placeholder="商品ID/商品名称" clearable></el-input>
  20. </el-form-item>
  21. <el-form-item>
  22. <el-input style="width: 200px" v-model="searchData.order_no" placeholder="订单编号" clearable></el-input>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-date-picker size="small" v-model="searchData.date" type="datetimerange" style="float: left"
  26. value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="创建日期开始"
  27. @change="selectDateTime" end-placeholder="创建日期结束">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button type="primary" @click="searchs">搜索</el-button>
  32. </el-form-item>
  33. <el-form-item style="float: right">
  34. <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="searchData">
  35. </com-export-dialog>
  36. </el-form-item>
  37. </el-form>
  38. </el-card>
  39. <el-table :data="orderList" stripe style="width: 100%" v-loading="listLoading">
  40. <el-table-column label="序号" prop="id" align="center"></el-table-column>
  41. <el-table-column label="产品信息">
  42. <template slot-scope="scope">
  43. <div class="table-info-img-text" @click="onShowDetails(scope.row.detail)">
  44. <el-image class="table-info-img" :src="scope.row.detail[0].pic_url">
  45. <div slot="error" class="image-slot">
  46. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  47. </div>
  48. </el-image>
  49. <div class="table-info-text">
  50. <div>{{scope.row.detail[0].goods_name}}</div>
  51. <div>(商品ID:{{scope.row.detail[0].goods_id}})<el-button style="margin-left: 5px" type="primary" size="mini">更多</el-button></div>
  52. </div>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="订单编号">
  57. <template slot-scope="scope">
  58. <div>{{scope.row.order_no}}</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="订单金额" align="center">
  62. <template slot-scope="scope">
  63. <div>{{scope.row.pay_money}}</div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="创建时间" align="center">
  67. <template slot-scope="scope">
  68. <div>{{scope.row.created_at | dateTimeFormat("Y-m-d H:i:s")}}</div>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <div style="text-align: right; padding: 20px 0; background-color: #FFFFFF">
  73. <el-pagination @current-change="pagination" background layout="prev, pager, next"
  74. :page-count="pageCount" :current-page="currentPage"></el-pagination>
  75. </div>
  76. <el-dialog
  77. title="订单详情"
  78. :visible.sync="dialogVisible"
  79. width="50%">
  80. <el-table :data="details" stripe style="width: 100%">
  81. <el-table-column label="序号" prop="id" align="center"></el-table-column>
  82. <el-table-column label="产品信息">
  83. <template slot-scope="scope">
  84. <div class="table-info-img-text">
  85. <el-image class="table-info-img" :src="scope.row.pic_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>{{scope.row.goods_name}}</div>
  92. <div>(商品ID:{{scope.row.goods_id}})</div>
  93. </div>
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="购买数量">
  98. <template slot-scope="scope">
  99. <div>{{scope.row.num}}</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="商品单价" align="center">
  103. <template slot-scope="scope">
  104. <div>{{scope.row.price}}</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="商品金额" align="center">
  108. <template slot-scope="scope">
  109. <div>{{scope.row.goods_price}}</div>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. </el-dialog>
  114. </div>
  115. </div>
  116. <script>
  117. // getQuery('order_id'),
  118. const app = new Vue({
  119. el: '#my_customer',
  120. data() {
  121. return {
  122. activeName: '1',
  123. tabArr: [],
  124. orderList: [],
  125. listLoading: false,
  126. search_type: '',
  127. pageCount: 1,
  128. currentPage: 1,
  129. searchData: {
  130. keyword: '',
  131. order_no: '',
  132. start_date: '',
  133. end_date: '',
  134. user_id: '',
  135. page: 1,
  136. fields: {}
  137. },
  138. export_list: {},
  139. export_url: 'team-data/default/order',
  140. details: [],
  141. dialogVisible: false,
  142. }
  143. },
  144. mounted(){
  145. this.searchData.user_id = getQuery('user_id');
  146. this.getList();
  147. },
  148. methods: {
  149. onShowDetails(list) {
  150. this.details = list
  151. this.dialogVisible = true
  152. },
  153. selectDateTime(e) {
  154. if (e != null) {
  155. this.searchData.start_date = e[0];
  156. this.searchData.end_date = e[1];
  157. } else {
  158. this.searchData.start_date = '';
  159. this.searchData.end_date = '';
  160. }
  161. this.searchs();
  162. },
  163. getList(){
  164. this.listLoading = true;
  165. this.is_team = true;
  166. this.is_commission = false;
  167. request({
  168. params: {
  169. r: 'team-data/default/order',
  170. ...this.searchData
  171. },
  172. method: 'get',
  173. }).then(res => {
  174. this.listLoading = false;
  175. if(res.data.code == 0){
  176. this.orderList = res.data.data.list;
  177. this.export_list = res.data.data.export_list;
  178. this.searchData.fields = res.data.data.fields;
  179. this.pageCount = res.data.data.page_count;
  180. }else {
  181. this.listLoading = false;
  182. this.$message.error(res.data.msg);
  183. }
  184. }).catch(err => {
  185. this.$message.error(err.data.msg);
  186. })
  187. },
  188. handleClick(tab, event){
  189. },
  190. pagination(currentPage){
  191. this.searchData.page = currentPage;
  192. this.getList();
  193. },
  194. searchs() {
  195. this.searchData.page = 1;
  196. this.getList();
  197. }
  198. }
  199. })
  200. </script>
  201. <style>
  202. .user_info{
  203. background: #FFF;
  204. padding: 20px;
  205. margin-bottom: 10px;
  206. }
  207. .user_detail{
  208. display: flex;
  209. align-items: center;
  210. margin-bottom: 40px;
  211. }
  212. .user_detail .info{
  213. display: flex;
  214. font-size: 12px;
  215. color: #939393;
  216. }
  217. .user_detail .info .text{
  218. color: #000;
  219. margin-right: 40px;
  220. }
  221. .user_detail .user_name{
  222. font-size: 15px;
  223. margin-bottom: 10px;
  224. }
  225. .user_total{
  226. background: #F2F2F2;
  227. display: flex;
  228. padding: 20px 30px;
  229. }
  230. .user_total .module{
  231. flex: 1;
  232. color: #919191;
  233. }
  234. .module_value{
  235. font-size: 25px;
  236. color: #000;
  237. margin-top: 8px;
  238. }
  239. .tab_module{
  240. background: #FFF;
  241. padding: 10px 20px;
  242. }
  243. .tab_search{
  244. display: flex;
  245. }
  246. .search_but{
  247. display: flex;
  248. flex: 1;
  249. color: #797979;
  250. align-items: center;
  251. }
  252. .search_but div{
  253. border: 1px solid #E6E6E6;
  254. padding: 5px 20px;
  255. margin-right: 30px;
  256. border-radius: 30px;
  257. height: 30px;
  258. }
  259. .search_but div:hover{
  260. cursor:pointer
  261. }
  262. .search_but_sel{
  263. color: #FFF;
  264. background: #2E8FF4;
  265. }
  266. .search_form{
  267. display:flex;
  268. }
  269. </style>