supplier-stock.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <style>
  6. </style>
  7. <div id="app" v-cloak>
  8. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  9. <div slot="header">
  10. <span>供应商库存</span>
  11. <el-form size="small" :inline="true" :model="search" style="float: right;margin-top: -5px;">
  12. <el-form-item>
  13. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="search" @selected="confirmSubmit">
  14. </com-export-dialog>
  15. </el-form-item>
  16. </el-form>
  17. </div>
  18. <div class="table-body">
  19. <el-select size="small" v-model="search.level" @change='toSearch' class="select">
  20. <el-option key="all" label="全部等级" value=""></el-option>
  21. <el-option :key="index" :label="item.name" :value="item.level"
  22. v-for="(item, index) in agentLevelList"></el-option>
  23. </el-select>
  24. <div class="input-item">
  25. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入ID/昵称/手机号" v-model="search.keyword" clearable @clear="toSearch">
  26. </el-input>
  27. </div>
  28. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  29. <el-tabs v-model="activeName" >
  30. <el-table :data="list" v-loading="loading" size="small" style="margin-bottom: 15px;">
  31. <el-table-column prop="user_id" label="代理ID" align="center"></el-table-column>
  32. <el-table-column label="会员" >
  33. <template slot-scope="scope">
  34. <div class="user_img" flex="cross:center">
  35. <el-image class="default-avatar" :src="scope.row.avatar_url">
  36. <div slot="error" class="image-slot">
  37. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  38. </div>
  39. </el-image>
  40. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  41. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  42. </div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="手机号" prop="mobile" align="center" >
  46. <template slot-scope="scope">
  47. <div>{{scope.row.mobile}}</div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="身份" prop="level" align="center">
  51. <template slot-scope="scope">
  52. <span size="small" type="info" v-if="scope.row.level == 0">默认等级</span>
  53. <span size="small" v-else>{{levelList[scope.row.level]}}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="代理商库存" prop="level" align="center">
  57. 0
  58. </el-table-column>
  59. <el-table-column label="合作发货类型" prop="level" align="center">
  60. <el-button type="primary">平台代发</el-button>
  61. </el-table-column>
  62. <el-table-column label="累计出货" prop="counts" align="center">
  63. <template slot-scope="scope">
  64. <template>{{scope.row.counts}}件</template>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="当前收入" prop="change_num" align="center">
  68. <template slot-scope="scope">
  69. <template>¥{{scope.row.change_num}}</template>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="累计收入" prop="total_commission" align="center">
  73. <template slot-scope="scope">
  74. <template>¥{{scope.row.total_commission}}</template>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. </el-tabs>
  79. <div flex="box:last cross:center">
  80. <div></div>
  81. <div>
  82. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  83. style="display: inline-block;" background @current-change="pageChange"
  84. layout="prev, pager, next" :total="pagination.totalCount">
  85. </el-pagination>
  86. </div>
  87. </div>
  88. </div>
  89. </el-card>
  90. </div>
  91. <script>
  92. const app = new Vue({
  93. el: '#app',
  94. data: {
  95. avatar: '',
  96. nickname: '',
  97. search: {
  98. user_id: null,
  99. keyword: '',
  100. status: -1,
  101. page: 1,
  102. level: ''
  103. },
  104. loading: false,
  105. activeName: '-1',
  106. list: [],
  107. pagination: null,
  108. select: {
  109. nickname: '',
  110. status: 'first',
  111. },
  112. level: {
  113. show: false,
  114. agent: null,
  115. },
  116. agentLevelList: [],
  117. levelList: {},
  118. is_enable_province: 0,
  119. exportList: {},
  120. export_url: 'agent/default/supplier-stock', // 导出路径
  121. },
  122. mounted() {
  123. this.loadData();
  124. },
  125. methods: {
  126. loadData() {
  127. this.loading = true;
  128. let params = {
  129. r: 'agent/default/supplier-stock'
  130. };
  131. params = Object.assign(params, this.search);
  132. request({
  133. params: params,
  134. method: 'get',
  135. }).then(e => {
  136. this.loading = false;
  137. if (e.data.code == 0) {
  138. this.list = e.data.data.list;
  139. this.pagination = e.data.data.pagination;
  140. this.exportList = e.data.data.export_list;
  141. this.agentLevelList = e.data.data.agentLevelList;
  142. for (i in this.agentLevelList) {
  143. this.levelList[this.agentLevelList[i]['level']] = this.agentLevelList[i]['name'];
  144. }
  145. } else {
  146. this.$message.error(e.data.msg);
  147. }
  148. }).catch(e => {
  149. this.loading = false;
  150. });
  151. },
  152. pageChange(page) {
  153. this.search.page = page;
  154. this.loadData();
  155. },
  156. toSearch() {
  157. this.search.page = 1;
  158. this.loadData();
  159. },
  160. confirmSubmit() {
  161. console.log(this.activeName)
  162. this.search.status = this.activeName
  163. },
  164. }
  165. });
  166. </script>
  167. <style>
  168. .el-tabs__header {
  169. font-size: 16px;
  170. }
  171. .table-body {
  172. padding: 20px;
  173. background-color: #fff;
  174. }
  175. .table-body .el-button {
  176. padding: 0 !important;
  177. border: 0;
  178. margin: 0 5px;
  179. }
  180. .input-item {
  181. width: 250px;
  182. margin: 0 0 20px;
  183. display: inline-block;
  184. }
  185. /*.input-item .el-input__inner {*/
  186. /* border-right: 0;*/
  187. /*}*/
  188. .input-item .el-input__inner:hover {
  189. border: 1px solid #dcdfe6;
  190. /*border-right: 0;*/
  191. outline: 0;
  192. }
  193. .input-item .el-input__inner:focus {
  194. border: 1px solid #dcdfe6;
  195. /*border-right: 0;*/
  196. outline: 0;
  197. }
  198. .input-item .el-input-group__append {
  199. background-color: #fff;
  200. border-left: 0;
  201. width: 10%;
  202. padding: 0;
  203. }
  204. .input-item .el-input-group__append .el-button {
  205. padding: 0;
  206. }
  207. .input-item .el-input-group__append .el-button {
  208. margin: 0;
  209. }
  210. .batch {
  211. margin: 0 0 20px;
  212. display: inline-block;
  213. }
  214. .batch .el-button {
  215. padding: 9px 15px !important;
  216. }
  217. .el-table th>.cell{
  218. color: #333;
  219. font-weight: bold;
  220. font-size: 14px;
  221. }
  222. .el-table__footer-wrapper, .el-table__header-wrapper{
  223. border-bottom: 1.4px solid #D6D6D6;
  224. }
  225. .el-table th>.cell {
  226. color: #333;
  227. font-weight: bold;
  228. font-size: 14px;
  229. }
  230. .table1 .el-table__footer-wrapper,
  231. .table1 .el-table__header-wrapper {
  232. border-bottom: 1.4px solid #D6D6D6;
  233. }
  234. .user_img{
  235. position: relative;
  236. margin-right: 8px;
  237. /* height: 50px;
  238. width: 50px; */
  239. }
  240. .default-avatar{
  241. width: 50px;
  242. height: 50px;
  243. border-radius: 50%;
  244. margin-right: 8px;
  245. }
  246. .uer-nickname {
  247. flex: 1;
  248. }
  249. </style>