supplier-order.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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-button @click="oldDataGenerate" type="primary" size="small" v-if="is_generate_old_data==0">生成旧数据</el-button>
  16. </el-form-item>
  17. </el-form>
  18. </div>
  19. <div class="table-body">
  20. <div class="input-item">
  21. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入会员订单号" v-model="search.order_no"
  22. clearable @clear="toSearch">
  23. </el-input>
  24. </div>
  25. <div class="input-item">
  26. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入买家ID/昵称/手机号" v-model="search.keyword" clearable @clear="toSearch">
  27. </el-input>
  28. </div>
  29. <div class="input-item">
  30. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入卖家ID/昵称/手机号" v-model="search.seller_keyword" clearable @clear="toSearch">
  31. </el-input>
  32. </div>
  33. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  34. <el-tabs v-model="activeName" @tab-click="handleClick">
  35. <el-table :data="list" v-loading="loading" size="small" style="margin-bottom: 15px;">
  36. <el-table-column label="买家" width="220">
  37. <template slot-scope="scope">
  38. <div class="user_img" flex="cross:center">
  39. <el-image class="default-avatar" :src="scope.row.avatar_url">
  40. <div slot="error" class="image-slot">
  41. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  42. </div>
  43. </el-image>
  44. <div class="table-info-text">
  45. <div style="color:#000;">ID:{{scope.row.buy_user_id}}</div>
  46. <div style="color:#000;">昵称:{{scope.row.nickname}}</div>
  47. </div>
  48. </div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="身份" prop="buy_level" align="center" width="100">
  52. <template slot-scope="scope">
  53. <el-tag size="small" type="info" v-if="scope.row.buy_level == 0">普通会员</el-tag>
  54. <el-tag size="small" v-else>{{levelList[scope.row.buy_level]}}</el-tag>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="卖家" width="220">
  58. <template slot-scope="scope">
  59. <div class="user_img" flex="cross:center">
  60. <el-image class="default-avatar" :src="scope.row.seller_avatar_url">
  61. <div slot="error" class="image-slot">
  62. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  63. </div>
  64. </el-image>
  65. <div class="table-info-text">
  66. <div style="color:#000;">ID:{{scope.row.seller_user_id}}</div>
  67. <div style="color:#000;">昵称:{{scope.row.seller_nickname}}</div>
  68. </div>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="身份" prop="seller_level" align="center">
  73. <template slot-scope="scope">
  74. <el-tag size="small" type="info" v-if="scope.row.seller_level == 0">普通会员</el-tag>
  75. <el-tag size="small" v-else>{{levelList[scope.row.seller_level]}}</el-tag>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="利润" prop="stock_nums" align="center" width="100" >
  79. <template slot-scope="scope">
  80. <div>¥{{scope.row.profit}}</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="会员订单号" prop="order_no" align="center" width="220" >
  84. <template slot-scope="scope">
  85. <div>{{scope.row.order_no}}</div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="供应商订单号" prop="supplier_order_no" align="center" width="220" >
  89. <template slot-scope="scope">
  90. <div>{{scope.row.supplier_order_no}}</div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="商品数量" prop="supplier_order_no" align="center" >
  94. <template slot-scope="scope">
  95. <div>{{scope.row.goods_nums}}</div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="库存加减" prop="stock_nums" align="center" >
  99. <template slot-scope="scope">
  100. <div v-if="scope.row.buy_level == 0">/</div>
  101. <div v-else>-{{scope.row.stock_nums}}</div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="发货状态" prop="stock_nums" align="center">
  105. <template slot-scope="scope">
  106. <el-tag size="small">{{ order_status_list[scope.row.order_status] }}</el-tag>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="货款金额" prop="stock_nums" align="center" width="100">
  110. <template slot-scope="scope">
  111. <div>¥{{scope.row.payment_amount}}</div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="订单时间" align="center" width="200" >
  115. <template slot-scope="scope">
  116. {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
  117. </template>
  118. </el-table-column>
  119. </el-table-column>
  120. </el-table>
  121. </el-tabs>
  122. <div flex="box:last cross:center">
  123. <div></div>
  124. <div>
  125. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  126. style="display: inline-block;" background @current-change="pageChange"
  127. layout="prev, pager, next" :total="pagination.totalCount">
  128. </el-pagination>
  129. </div>
  130. </div>
  131. </div>
  132. </el-card>
  133. </div>
  134. <script>
  135. const app = new Vue({
  136. el: '#app',
  137. data: {
  138. qrimg: '',
  139. showqr: false,
  140. avatar: '',
  141. nickname: '',
  142. search: {
  143. order_no: '',
  144. keyword: '',
  145. seller_keyword: '',
  146. page: 1,
  147. },
  148. loading: false,
  149. activeName: '-1',
  150. list: [],
  151. pagination: null,
  152. dialogChild: false,
  153. dialogLoading: false,
  154. childList: [],
  155. share_name: {
  156. first: '一级',
  157. second: '二级',
  158. third: '三级'
  159. },
  160. select: {
  161. nickname: '',
  162. status: 'first',
  163. },
  164. dialogContent: false,
  165. remarksForm: {
  166. remarks: '',
  167. user_id: '',
  168. id: '',
  169. },
  170. remarksLoading: false,
  171. exportList: {},
  172. edit: {
  173. show: false,
  174. },
  175. level: {
  176. show: false,
  177. agent: null,
  178. },
  179. commission_arr: {},
  180. agentLevelList: [],
  181. levelList: {},
  182. is_generate_old_data: 0,
  183. choose_list: [],
  184. export_url: 'agent/default/supplier-order', // 导出路径
  185. order_status_list: {
  186. '0': "待付款",
  187. '1': "待发货",
  188. '2': "已发货",
  189. '3': "已收货",
  190. '4': "已完成",
  191. '-4': "已关闭",
  192. '-2': "退款中",
  193. '-1': "售后申请"
  194. },
  195. },
  196. mounted() {
  197. this.loadData();
  198. },
  199. methods: {
  200. loadData() {
  201. this.loading = true;
  202. let params = {
  203. r: 'agent/default/supplier-order'
  204. };
  205. params = Object.assign(params, this.search);
  206. request({
  207. params: params,
  208. method: 'get',
  209. }).then(e => {
  210. this.loading = false;
  211. if (e.data.code == 0) {
  212. this.list = e.data.data.list;
  213. this.pagination = e.data.data.pagination;
  214. this.exportList = e.data.data.export_list;
  215. this.agentLevelList = e.data.data.agentLevelList;
  216. this.commission_arr = e.data.data.commission_arr;
  217. this.is_generate_old_data = e.data.data.is_generate_old_data;
  218. for (i in this.agentLevelList) {
  219. this.levelList[this.agentLevelList[i]['level']] = this.agentLevelList[i]['name'];
  220. }
  221. } else {
  222. this.$message.error(e.data.msg);
  223. }
  224. }).catch(e => {
  225. this.loading = false;
  226. });
  227. },
  228. pageChange(page) {
  229. this.search.page = page;
  230. this.loadData();
  231. },
  232. handleClick(tab, event) {
  233. this.search.page = 1;
  234. this.search.status = this.activeName;
  235. this.loadData()
  236. },
  237. toSearch() {
  238. this.search.page = 1;
  239. this.loadData();
  240. },
  241. confirmSubmit() {
  242. console.log(this.activeName)
  243. this.search.status = this.activeName
  244. },
  245. oldDataGenerate(){
  246. let self = this;
  247. self.$confirm('请在业务不繁忙的时间段执行该操作, 是否继续?', '提示', {
  248. confirmButtonText: '确定',
  249. cancelButtonText: '取消',
  250. type: 'warning'
  251. }).then(() => {
  252. let params = {
  253. r: 'agent/default/old-data-generate'
  254. };
  255. request({
  256. params: params,
  257. method: 'get',
  258. }).then(e => {
  259. if (e.data.code == 0) {
  260. this.$message.success('请求已发送,请耐心等待后台生成数据');
  261. } else {
  262. this.$message.error(e.data.msg);
  263. }
  264. }).catch(e => {
  265. });
  266. }).catch(() => {
  267. self.$message.info('已取消')
  268. });
  269. },
  270. }
  271. });
  272. </script>
  273. <style>
  274. .el-tabs__header {
  275. font-size: 16px;
  276. }
  277. .table-body {
  278. padding: 20px;
  279. background-color: #fff;
  280. }
  281. .table-body .el-button {
  282. padding: 0 !important;
  283. border: 0;
  284. margin: 0 5px;
  285. }
  286. .input-item {
  287. width: 250px;
  288. margin: 0 0 20px;
  289. display: inline-block;
  290. }
  291. /*.input-item .el-input__inner {*/
  292. /* border-right: 0;*/
  293. /*}*/
  294. .input-item .el-input__inner:hover {
  295. border: 1px solid #dcdfe6;
  296. /*border-right: 0;*/
  297. outline: 0;
  298. }
  299. .input-item .el-input__inner:focus {
  300. border: 1px solid #dcdfe6;
  301. /*border-right: 0;*/
  302. outline: 0;
  303. }
  304. .input-item .el-input-group__append {
  305. background-color: #fff;
  306. border-left: 0;
  307. width: 10%;
  308. padding: 0;
  309. }
  310. .input-item .el-input-group__append .el-button {
  311. padding: 0;
  312. }
  313. .input-item .el-input-group__append .el-button {
  314. margin: 0;
  315. }
  316. .batch {
  317. margin: 0 0 20px;
  318. display: inline-block;
  319. }
  320. .batch .el-button {
  321. padding: 9px 15px !important;
  322. }
  323. .el-table th>.cell{
  324. color: #333;
  325. font-weight: bold;
  326. font-size: 14px;
  327. }
  328. .el-table__footer-wrapper, .el-table__header-wrapper{
  329. border-bottom: 1.4px solid #D6D6D6;
  330. }
  331. .el-table th>.cell {
  332. color: #333;
  333. font-weight: bold;
  334. font-size: 14px;
  335. }
  336. .table1 .el-table__footer-wrapper,
  337. .table1 .el-table__header-wrapper {
  338. border-bottom: 1.4px solid #D6D6D6;
  339. }
  340. .user_img{
  341. position: relative;
  342. margin-right: 8px;
  343. /* height: 50px;
  344. width: 50px; */
  345. }
  346. .default-avatar{
  347. width: 50px;
  348. height: 50px;
  349. border-radius: 50%;
  350. margin-right: 8px;
  351. }
  352. .uer-nickname {
  353. flex: 1;
  354. }
  355. </style>