index.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <style>
  2. .item-box .label{
  3. margin-right:5px;
  4. width:100px;
  5. }
  6. .item-box{
  7. width:30%;
  8. margin-top:10px;
  9. }
  10. .el-form{
  11. display:flex;
  12. flex-wrap:wrap;
  13. }
  14. .item-box .search-btn{
  15. margin-left:5px;
  16. }
  17. .goods-images{
  18. width:50px;
  19. height:50px;
  20. border-radius:10px;
  21. }
  22. .credit-info{
  23. margin:8px 0;
  24. display: flex;
  25. /*justify-content: space-around;*/
  26. }
  27. .credit-info .goods_name{
  28. margin-left:5px;
  29. }
  30. .uer-nickname{
  31. margin-left: 5px;
  32. }
  33. </style>
  34. <div id="app" v-cloak>
  35. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  36. <div slot="header">
  37. <div>
  38. <span>赊账记录</span>
  39. </div>
  40. </template>
  41. </div>
  42. <div class="table-body el-input--small">
  43. <el-form size="small" flex="dir:left cross:center" style="margin-bottom: 12px;">
  44. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  45. <div class="label">订单号</div>
  46. <el-input style="width: 250px" v-model="search.order_no" placeholder="订单号"></el-input>
  47. </div>
  48. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  49. <div class="label">商品名称</div>
  50. <el-input style="width: 250px" v-model="search.goods_name" placeholder="商品名称"></el-input>
  51. </div>
  52. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  53. <div class="label">赊账人ID</div>
  54. <el-input style="width: 250px" v-model="search.user_id" placeholder="赊账人ID"></el-input>
  55. </div>
  56. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  57. <div class="label">赊账人手机号</div>
  58. <el-input style="width: 250px" v-model="search.mobile" placeholder="赊账人手机号"></el-input>
  59. </div>
  60. <!--<div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  61. <div class="label">还款状态</div>
  62. <el-select size="small" v-model="edit.level" class="select">
  63. <el-option label="未还款" value="0" ></el-option>
  64. <el-option label="已还款" value="1" ></el-option>
  65. </el-select>
  66. </div>-->
  67. <div class="item-box" flex="dir:left cross:center">
  68. <div class="label">日期</div>
  69. <el-date-picker
  70. v-model="time"
  71. type="datetimerange"
  72. value-format="yyyy-MM-dd HH:mm:ss"
  73. range-separator="至"
  74. start-placeholder="开始日期"
  75. end-placeholder="结束日期">
  76. </el-date-picker>
  77. </div>
  78. <div class="item-box" flex="dir:left cross:center">
  79. <el-button type="primary" class="search-btn" style="padding: 12px 34px !important;" @click="searchs">搜索
  80. </el-button>
  81. </div>
  82. </el-form>
  83. <el-table v-loading="listLoading" :data="creditList" stripe style="width: 100%">
  84. <el-table-column prop="order_no" label="商品信息" align="center" width="230px">
  85. <template slot-scope="scope">
  86. <div class="credit-info" flex="cross:center" v-for="(item,index ) in scope.row.detail">
  87. <el-image class="goods-images" :src="item.pic_url" ></el-image>
  88. <div class="uer-nickname over1" >{{item.goods_name}}</div>
  89. </div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="order_no" label="订单编号" align="center" width="230px"></el-table-column>
  93. <el-table-column prop="pay_money" label="订单金额" align="center">
  94. <template slot-scope="scope">
  95. <div>¥{{scope.row.pay_money}}</div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="赊账人信息" align="center">
  99. <template slot-scope="scope">
  100. <span>{{scope.row.nickname}}</span>
  101. <span> ID:{{scope.row.user_id}}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column prop="mobile" label="赊账人手机号" align="center"></el-table-column>
  105. <el-table-column label="赊账金额" align="center">
  106. <template slot-scope="scope">
  107. <span>¥{{scope.row.credit_money}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column prop="is_repayment_text" label="还款状态" align="center"></el-table-column>
  111. <el-table-column prop="scope" width="160" label="赊账时间">
  112. <template slot-scope="scope">
  113. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <div style="text-align: right;margin: 20px 0;">
  118. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  119. style="display: inline-block;float: right;" background @current-change="pageChange"
  120. layout="prev, pager, next" :total="pagination.total_count">
  121. </el-pagination>
  122. </div>
  123. </div>
  124. </el-card>
  125. </div>
  126. <script>
  127. const app = new Vue({
  128. el: '#app',
  129. data: {
  130. search:{
  131. user_id:'',
  132. goods_name:'',
  133. order_no:'',
  134. mobile:'',
  135. start:'',
  136. end:''
  137. },
  138. page:1,
  139. limit:20,
  140. creditList:[],
  141. listLoading: false,
  142. pagination:null,
  143. time:[]
  144. },
  145. mounted() {
  146. this.search.user_id = getQuery('user_id');
  147. this.getList()
  148. },
  149. methods: {
  150. searchs(){
  151. this.page = 1;
  152. this.getList();
  153. },
  154. toOrderDetail(order_no){
  155. this.$navigate({
  156. r: 'seed/index/change-log',
  157. order_no: order_no
  158. })
  159. },
  160. getList() {
  161. let self = this;
  162. self.listLoading = true;
  163. if(this.time){
  164. this.search.start = this.time[0];
  165. this.search.end = this.time[1];
  166. }else{
  167. this.search.start ='';
  168. this.search.end = '';
  169. }
  170. request({
  171. method: 'get',
  172. params: {
  173. r: '/store/client/credit/index',
  174. page: self.page,
  175. limit:self.limit,
  176. order_no: self.search.order_no,//订单号
  177. user_id: self.search.user_id,
  178. start: self.search.start,
  179. end: self.search.end,
  180. goods_name:self.search.goods_name,
  181. mobile:self.search.mobile
  182. },
  183. data: {},
  184. }).then(e => {
  185. self.listLoading = false;
  186. self.creditList = e.data.data.list;
  187. self.pagination = e.data.data.pagination;
  188. self.pagination.pageSize = e.data.data.page_size;
  189. self.pagination.total_count = e.data.data.count;
  190. }).catch(e => {
  191. console.log(e);
  192. });
  193. },
  194. pageChange(currentPage) {
  195. let self = this;
  196. self.page = currentPage;
  197. self.getList();
  198. },
  199. }
  200. });
  201. </script>