index.php 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2020
  5. * Created by PhpStorm
  6. * Author: ganxiaohao
  7. * Date: 2020-05-08
  8. * Time: 16:11
  9. */
  10. //Yii::$app->loadPluginComponentView('stock-goods-edit');
  11. use common\helpers\ComponentHelper;
  12. $diyPath = dirname(__DIR__) . '/components';
  13. ComponentHelper::loadComponentView('price-difference-gift-package-list', $diyPath);
  14. ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
  15. ?>
  16. <div id="app" v-cloak>
  17. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
  18. <div slot="header" class="title">
  19. <span>订单列表</span>
  20. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData"></com-export-dialog>
  21. </div>
  22. <div class="table-body">
  23. <el-tabs v-model="activeName" @tab-click="handleClick" type="card">
  24. <el-tab-pane label="会员买货订单列表" name="first">
  25. <div class="head" style="display: flex;">
  26. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text" @keyup.enter.native="searchFun1" v-model="search1.keyword" placeholder="请输入会员昵称/id"></el-input>
  27. <el-input clearable style="width: 125px;margin-right: 20px;" size="small" type="text" @keyup.enter.native="searchFun1" v-model="search1.id" placeholder="请输入订单id"></el-input>
  28. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text" @keyup.enter.native="searchFun1" v-model="search1.goods_name" placeholder="请输入商品名称"></el-input>
  29. <el-date-picker
  30. style="margin-right: 20px;"
  31. size="small"
  32. v-model="search1.selectDate"
  33. type="datetimerange"
  34. value-format="yyyy-MM-dd HH:mm:ss"
  35. range-separator="至"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期"
  38. :default-time="['00:00:00', '23:59:59']"
  39. :picker-options="pickerOptions">
  40. </el-date-picker>
  41. <el-select v-model="search1.payment_type" placeholder="请选择" style="width: 200px;margin-right: 20px;" size="small">
  42. <el-option v-for="(val, key) in payment_type_arr" :key="key" :label="val" :value="key">
  43. </el-option>
  44. </el-select>
  45. <el-button type="primary" icon="el-icon-search" style="padding: 0 10px !important;" @click="searchFun1">搜索</el-button>
  46. </div>
  47. <el-table
  48. size="small"
  49. :data="list"
  50. style="width: 100%"
  51. v-loading="listLoading">
  52. <el-table-column label="会员" width="200">
  53. <template slot-scope="scope">
  54. <div class="table-info-img-text">
  55. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  56. <div slot="error" class="image-slot">
  57. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  58. </div>
  59. </el-image>
  60. <div class="table-info-text">
  61. <div style="color:#000;">ID:{{scope.row.user_id}}</div>
  62. <div style="color:#000;">昵称:{{scope.row.user.nickname}}</div>
  63. </div>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column
  68. prop="id"
  69. label="订单id"
  70. align="center"
  71. min-width="70"
  72. >
  73. </el-table-column>
  74. <el-table-column
  75. prop="order_no"
  76. label="订单编号"
  77. align="center"
  78. min-width="200"
  79. >
  80. <template slot-scope="scope">
  81. <el-tooltip class="item" effect="dark" content="点击查看订单详情" placement="top">
  82. <el-button @click="goOrder(scope.row.order.id)" size="mini" type="primary" effect="dark">{{scope.row.order && scope.row.order.order_no}}</el-button>
  83. </el-tooltip>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. prop="name"
  88. label="商品名称"
  89. min-width="200"
  90. >
  91. <template slot-scope="scope">
  92. <div style="display: flex;align-items: center;">
  93. <div style="margin-right:10px;" ><img :src="scope.row.goods.cover_pic" style="width: 40px;height: 40px;display: block;" /></div>
  94. <div>
  95. <div style="text-align: left;line-height: 16px;">{{scope.row.goods && scope.row.goods.goods_name}}</div>
  96. </div>
  97. </div>
  98. </template>
  99. </el-table-column>
  100. </el-table-column>
  101. <el-table-column
  102. prop="num"
  103. label="商品数量"
  104. align="center"
  105. min-width="80"
  106. >
  107. </el-table-column>
  108. <el-table-column
  109. label="补货上级"
  110. min-width="200"
  111. >
  112. <template slot-scope="scope">
  113. <div class="table-info-img-text"
  114. v-if="scope.row.from_user && scope.row.from_user.length > 0"
  115. v-for="item in scope.row.from_user">
  116. <el-image class="default-avatar" :src="item.avatar_url"
  117. style="width: 50px;height: 50px;">
  118. <div slot="error" class="image-slot">
  119. <com-image src="resources/img/mall/default_avatar_url.png"
  120. style="width: 50px;height: 50px;"></com-image>
  121. </div>
  122. </el-image>
  123. <div class="table-info-text" style="width: 100px;">
  124. <div style="color:#000;">ID:{{item.id}}</div>
  125. <div style="color:#000;">昵称:{{item.nickname}}</div>
  126. </div>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column
  131. prop="created_at"
  132. label="订单创建时间"
  133. align="center"
  134. min-width="150"
  135. >
  136. <template slot-scope="scope">
  137. {{formatTime(scope.row.created_at)}}
  138. </template>
  139. </el-table-column>
  140. <!-- <el-button size="small" type="text" @click="handle('detail',item)">详情</el-button>-->
  141. <el-table-column
  142. prop="total_price"
  143. label="实际支付金额(元)(未扣分佣前)"
  144. align="center"
  145. min-width="100"
  146. >
  147. <template slot-scope="scope">
  148. <div>
  149. <div style="text-align: left;line-height: 16px;">{{scope.row.order && scope.row.order.pay_money}}</div>
  150. </div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column
  154. prop="after_distribution_price"
  155. label="货款金额(元)"
  156. align="center"
  157. min-width="100"
  158. >
  159. </el-table-column>
  160. <el-table-column
  161. prop="payment_type"
  162. align="center"
  163. min-width="100"
  164. label="支付方式"
  165. >
  166. <template slot-scope="scope">
  167. <el-tag size="small" type="warning">{{scope.row.order && payment_type_list[scope.row.order.payment_type]}}</el-tag>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. prop="id"
  172. align="center"
  173. min-width="100"
  174. label="订单状态">
  175. <template slot-scope="scope">
  176. <!-- 订单状态;1已完成;2未完成;3已退款 -->
  177. <el-tag v-if="scope.row.order && scope.row.order.order_status == 0" type="success">{{computedType(scope.row.order && scope.row.order.order_status)}}</el-tag>
  178. <el-tag v-if="scope.row.order && scope.row.order.order_status == 1" type="success">{{computedType(scope.row.order && scope.row.order.order_status)}}</el-tag>
  179. <el-tag v-if="scope.row.order && scope.row.order.order_status == 2" type="danger">{{computedType(scope.row.order && scope.row.order.order_status)}}</el-tag>
  180. <el-tag v-if="scope.row.order && scope.row.order.order_status == 3" type="warning">{{computedType(scope.row.order && scope.row.order.order_status)}}</el-tag>
  181. <el-tag v-if="scope.row.order && scope.row.order.order_status == 4" type="warning">{{computedType(scope.row.order && scope.row.order.order_status)}}</el-tag>
  182. </template>
  183. </el-table-column>
  184. <!-- <el-table-column
  185. align="center"
  186. label="操作"
  187. min-width="150">
  188. <template slot-scope="scope">
  189. <el-button type="primary" size="mini" @click="seeDetail">查看详情</el-button>
  190. </template>
  191. </el-table-column> -->
  192. </el-table>
  193. <!-- 代理库存页面 end -->
  194. <div style="text-align: right;margin: 20px 0;">
  195. <el-pagination
  196. @current-change="pagination1"
  197. background
  198. layout="prev, pager, next"
  199. :page-count="pageCount1">
  200. </el-pagination>
  201. </div>
  202. </el-tab-pane>
  203. <el-tab-pane label="代理商补货列表" name="second">
  204. <div class="head" style="display: flex;margin-bottom: 20px;">
  205. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text" v-model="search2.keyword" @keyup.enter.native="searchFun2" placeholder="请输入会员昵称/id/手机号"></el-input>
  206. <el-input clearable style="width: 130px;margin-right: 20px;" size="small" type="text" v-model="search2.id" @keyup.enter.native="searchFun2" placeholder="请输入订单id"></el-input>
  207. <el-date-picker
  208. style="margin-right: 20px;"
  209. size="small"
  210. v-model="search2.selectDate"
  211. type="datetimerange"
  212. value-format="yyyy-MM-dd HH:mm:ss"
  213. range-separator="至"
  214. start-placeholder="开始日期"
  215. end-placeholder="结束日期"
  216. :default-time="['00:00:00', '23:59:59']"
  217. :picker-options="pickerOptions">
  218. </el-date-picker>
  219. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text" v-model="search2.goods_name" @keyup.enter.native="searchFun2" placeholder="请输入商品名称"></el-input>
  220. <el-select v-model="search2.payment_type" placeholder="请选择" style="width: 200px;margin-right: 20px;" size="small">
  221. <el-option v-for="(val, key) in payment_type_arr" :key="key" :label="val" :value="key">
  222. </el-option>
  223. </el-select>
  224. <el-select v-model="search2.is_pay" clearable placeholder="是否支付" style="width: 200px;margin-right: 20px;" size="small">
  225. <el-option v-for="(val, key) in is_pay_option" :key="key" :label="val" :value="key">
  226. </el-option>
  227. </el-select>
  228. <el-button type="primary" icon="el-icon-search" style="padding: 0 10px !important;" @click="searchFun2">搜索</el-button>
  229. </div>
  230. <el-table
  231. size="small"
  232. :data="list"
  233. style="width: 100%"
  234. v-loading="listLoading">
  235. <el-table-column label="代理商" width="200">
  236. <template slot-scope="scope">
  237. <div class="table-info-img-text">
  238. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  239. <div slot="error" class="image-slot">
  240. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  241. </div>
  242. </el-image>
  243. <div class="table-info-text">
  244. <div style="color:#000;">ID:{{scope.row.user_id}}</div>
  245. <div style="color:#000;">昵称:{{scope.row.user.nickname}}</div>
  246. </div>
  247. </div>
  248. </template>
  249. </el-table-column>
  250. <el-table-column
  251. prop="id"
  252. label="订单id"
  253. align="center"
  254. min-width="70"
  255. >
  256. </el-table-column>
  257. <el-table-column prop="order_no" label="订单编号/支付流水号" align="center" min-width="250" >
  258. <template slot-scope="scope">
  259. <div class="no-box">
  260. <el-link type="primary" :underline="false">{{ scope.row.order_no }}</el-link>
  261. <span class="trade-no">{{ scope.row.trade_no ? scope.row.trade_no : '--' }}</span>
  262. </div>
  263. </template>
  264. </el-table-column>
  265. <el-table-column
  266. prop="name"
  267. label="商品名称"
  268. min-width="200"
  269. >
  270. <template slot-scope="scope">
  271. <div style="display: flex;align-items: center;">
  272. <div style="margin-right:10px;" ><img :src="scope.row.goods.cover_pic" style="width: 40px;height: 40px;display: block;" /></div>
  273. <div>
  274. <div style="text-align: left;line-height: 16px;">{{scope.row.goods.goods_name}}</div>
  275. </div>
  276. </div>
  277. </template>
  278. </el-table-column>
  279. </el-table-column>
  280. <el-table-column
  281. prop="num"
  282. label="补货数量"
  283. align="center"
  284. min-width="120"
  285. >
  286. </el-table-column>
  287. <el-table-column
  288. label="补货上级"
  289. min-width="200"
  290. >
  291. <template slot-scope="scope">
  292. <div class="table-info-img-text"
  293. v-if="scope.row.from_user && scope.row.from_user.length > 0"
  294. v-for="item in scope.row.from_user">
  295. <el-image class="default-avatar" :src="item.avatar_url"
  296. style="width: 50px;height: 50px;">
  297. <div slot="error" class="image-slot">
  298. <com-image src="resources/img/mall/default_avatar_url.png"
  299. style="width: 50px;height: 50px;"></com-image>
  300. </div>
  301. </el-image>
  302. <div class="table-info-text" style="width: 100px;">
  303. <div style="color:#000;">ID:{{item.id}}</div>
  304. <div style="color:#000;">昵称:{{item.nickname}}</div>
  305. </div>
  306. </div>
  307. </template>
  308. </el-table-column>
  309. <el-table-column
  310. prop="created_at"
  311. label="订单创建时间"
  312. align="center"
  313. min-width="200"
  314. >
  315. <template slot-scope="scope">
  316. {{formatTime(scope.row.created_at)}}
  317. </template>
  318. </el-table-column>
  319. <el-table-column
  320. prop="pay_money"
  321. label="实际支付金额(元)"
  322. align="center"
  323. min-width="100"
  324. >
  325. </el-table-column>
  326. <el-table-column
  327. prop="payment_type"
  328. align="center"
  329. min-width="100"
  330. label="支付方式"
  331. >
  332. <template slot-scope="scope">
  333. <el-tag size="small" type="warning" v-if="scope.row.is_pay == 1">{{payment_type_list[scope.row.payment_type]}}</el-tag>
  334. </template>
  335. </el-table-column>
  336. <el-table-column
  337. prop="rand_fee"
  338. label="随机减金额(元)"
  339. align="center"
  340. min-width="100"
  341. >
  342. </el-table-column>
  343. <el-table-column
  344. prop="pay_money"
  345. label="是否支付"
  346. align="center"
  347. min-width="100"
  348. >
  349. <template slot-scope="scope">
  350. <el-tag v-if="scope.row.is_pay == 1" type="success">已支付</el-tag>
  351. <el-tag v-if="scope.row.is_pay == 0" type="danger">未支付</el-tag>
  352. </template>
  353. </el-table-column>
  354. <!-- <el-table-column
  355. align="center"
  356. label="操作"
  357. min-width="150">
  358. <template slot-scope="scope">
  359. <el-button type="primary" size="mini" @click="seeDetail">查看详情</el-button>
  360. </template>
  361. </el-table-column> -->
  362. </el-table>
  363. <!-- 代理库存页面 end -->
  364. <div style="text-align: right;margin: 20px 0;">
  365. <el-pagination
  366. @current-change="pagination1"
  367. background
  368. layout="prev, pager, next"
  369. :page-count="pageCount1">
  370. </el-pagination>
  371. </div>
  372. </el-tab-pane>
  373. <el-tab-pane label="价差礼包列表" name="third">
  374. <price-difference-gift-package-list ref="price_difference_gift_package_list" @change-export-list="changeExportList"></price-difference-gift-package-list>
  375. </el-tab-pane>
  376. <el-tab-pane label="代理商配货列表" name="five">
  377. <div class="head" style="display: flex;">
  378. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text"
  379. @keyup.enter.native="searchFun1" v-model="search4.goods_name"
  380. placeholder="请输入商品名称"></el-input>
  381. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text"
  382. @keyup.enter.native="searchFun1" v-model="search4.order_no"
  383. placeholder="请输入订单编号"></el-input>
  384. <el-input clearable style="width: 200px;margin-right: 20px;" size="small" type="text"
  385. @keyup.enter.native="searchFun1" v-model="search4.keyword"
  386. placeholder="请输入代理商ID/昵称"></el-input>
  387. <el-select v-model="search4.type" placeholder="请选择配货类型"
  388. style="width: 200px;margin-right: 20px;" size="small">
  389. <el-option v-for="(val, key) in type_arr" :key="key" :label="val" :value="key">
  390. </el-option>
  391. </el-select>
  392. <el-date-picker
  393. style="margin-right: 20px;"
  394. size="small"
  395. v-model="search4.selectDate"
  396. type="datetimerange"
  397. value-format="yyyy-MM-dd HH:mm:ss"
  398. range-separator="至"
  399. start-placeholder="开始日期"
  400. end-placeholder="结束日期"
  401. :default-time="['00:00:00', '23:59:59']"
  402. :picker-options="pickerOptions">
  403. </el-date-picker>
  404. <el-button type="primary" icon="el-icon-search" style="padding: 0 10px !important;"
  405. @click="searchFun4">搜索
  406. </el-button>
  407. </div>
  408. <el-table
  409. size="small"
  410. :data="list"
  411. style="width: 100%"
  412. v-loading="listLoading">
  413. <el-table-column label="代理商" width="200">
  414. <template slot-scope="scope">
  415. <div class="table-info-img-text">
  416. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  417. <div slot="error" class="image-slot">
  418. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  419. </div>
  420. </el-image>
  421. <div class="table-info-text">
  422. <div style="color:#000;">ID:{{scope.row.user.id}}</div>
  423. <div style="color:#000;">昵称:{{scope.row.user.nickname}}</div>
  424. </div>
  425. </div>
  426. </template>
  427. </el-table-column>
  428. <el-table-column prop="order_no" label="订单编号" align="center" min-width="200">
  429. </el-table-column>
  430. <el-table-column
  431. prop="name"
  432. label="商品信息"
  433. min-width="200"
  434. >
  435. <template slot-scope="scope">
  436. <div style="display: flex;align-items: center;">
  437. <div style="margin-right:10px;"><img :src="scope.row.goods.cover_pic"
  438. style="width: 40px;height: 40px;display: block;"/>
  439. </div>
  440. <div>
  441. <div style="text-align: left;line-height: 16px;">
  442. {{scope.row.goods.goods_name}}
  443. </div>
  444. </div>
  445. </div>
  446. </template>
  447. </el-table-column>
  448. <el-table-column prop="num" label="商品数量" align="center" min-width="80"></el-table-column>
  449. <el-table-column prop="money" label="配货商品金额" align="center"
  450. min-width="150"></el-table-column>
  451. <el-table-column label="配货下级" min-width="200">
  452. <template slot-scope="scope">
  453. <div class="table-info-img-text"
  454. v-if="scope.row.from_user && scope.row.from_user.length > 0"
  455. v-for="item in scope.row.from_user">
  456. <el-image class="default-avatar" :src="item.avatar_url"
  457. style="width: 50px;height: 50px;">
  458. <div slot="error" class="image-slot">
  459. <com-image src="resources/img/mall/default_avatar_url.png"
  460. style="width: 50px;height: 50px;"></com-image>
  461. </div>
  462. </el-image>
  463. <div class="table-info-text" style="width: 100px;">
  464. <div style="color:#000;">ID:{{item.id}}</div>
  465. <div style="color:#000;">昵称:{{item.nickname}}</div>
  466. </div>
  467. </div>
  468. </template>
  469. </el-table-column>
  470. <el-table-column prop="type_text" label="配货类型" align="center"
  471. min-width="80"></el-table-column>
  472. <el-table-column
  473. prop="created_at"
  474. label="订单创建时间"
  475. align="center"
  476. min-width="150"
  477. >
  478. <template slot-scope="scope">
  479. {{formatTime(scope.row.created_at)}}
  480. </template>
  481. </el-table-column>
  482. <el-table-column
  483. align="center"
  484. label="操作"
  485. min-width="150">
  486. <template slot-scope="scope">
  487. <el-button type="primary" size="mini" @click="seeCommissionDetail(scope.row.id)">
  488. 分润明细
  489. </el-button>
  490. </template>
  491. </el-table-column>
  492. </el-table>
  493. <div style="text-align: right;margin: 20px 0;">
  494. <el-pagination
  495. @current-change="pagination1"
  496. background
  497. layout="prev, pager, next"
  498. :page-count="pageCount1">
  499. </el-pagination>
  500. </div>
  501. </el-tab-pane>
  502. </el-tabs>
  503. </div>
  504. </el-card>
  505. <el-dialog
  506. center
  507. title="库存详情"
  508. :visible.sync="dialogVisible"
  509. width="50%"
  510. >
  511. <el-table
  512. size="small"
  513. :data="tableData2"
  514. style="width: 100%;padding-bottom: 30px;">
  515. <el-table-column
  516. label="商品名称"
  517. >
  518. <template slot-scope="scope">
  519. <div style="display: flex;align-items: center;">
  520. <img :src="scope.row.huiyuan.img" style="width: 35px;height: 35px;display: block;margin-right: 5px;" />
  521. <div>{{scope.row.huiyuan.name}}</div>
  522. </div>
  523. </template>
  524. </el-table-column>
  525. <el-table-column
  526. align="center"
  527. label="拿货价"
  528. >
  529. <template slot-scope="scope">
  530. ¥{{scope.row.id}}
  531. </template>
  532. </el-table-column>
  533. <el-table-column
  534. prop="id"
  535. align="center"
  536. label="库存">
  537. </el-table-column>
  538. </el-table>
  539. </el-dialog>
  540. <el-dialog :close-on-click-modal="false" class="fenRunData" title="分润明细"
  541. :visible.sync="dialogTableVisible_fenRun">
  542. <el-table :data="fenRunData">
  543. <el-table-column label="用户">
  544. <template slot-scope="scope">
  545. <div class="table-info-img-text">
  546. <el-image class="table-info-img circle" :src="scope.row.avatar_url">
  547. <div slot="error" class="image-slot">
  548. <el-image class="table-info-img"
  549. src="/resources/img/common/default-avatar.png"></el-image>
  550. </div>
  551. </el-image>
  552. <div class="table-info-text">
  553. <div>{{scope.row.nickname}}</div>
  554. <div>{{scope.row.mobile}}</div>
  555. </div>
  556. </div>
  557. </template>
  558. </el-table-column>
  559. <el-table-column property="change_num" label="佣金">
  560. <template slot-scope="scope">
  561. <span v-if="scope.row.change_type=='add'"
  562. style="color:green;">+{{scope.row.change_num}}</span>
  563. <span v-else style="color:red;">-{{scope.row.change_num}}</span>
  564. </template>
  565. </el-table-column>
  566. <el-table-column property="is_frozen" label="状态"></el-table-column>
  567. <el-table-column property="desc" label="类型">
  568. <template slot-scope="scope">
  569. {{scope.row.capital_type_text}} : {{scope.row.desc}}
  570. </template>
  571. </el-table-column>
  572. </el-table>
  573. </el-dialog>
  574. </div>
  575. <script>
  576. const app = new Vue({
  577. el: '#app',
  578. data() {
  579. return {
  580. edit:{
  581. show:false,
  582. id:0,
  583. },
  584. list: [],
  585. keyword: '',
  586. listLoading: false,
  587. page: 1,
  588. level:1,
  589. pageCount1: 0,
  590. condition_type_list: {
  591. 1: '下线用户数',
  592. 2: '累计佣金',
  593. 3: '已提现佣金'
  594. },
  595. price_type_list: {
  596. 1: '%',
  597. 2: '元'
  598. },
  599. dialogVisible:false,
  600. activeName: 'first',
  601. selectData:'',
  602. search1:{
  603. keyword:'',
  604. goods_name:'',
  605. start:'',
  606. end:'',
  607. selectDate:'',
  608. id:'',
  609. payment_type:'',
  610. },
  611. search2:{
  612. keyword:'',
  613. goods_name:'',
  614. start:'',
  615. end:'',
  616. id:'',
  617. selectDate:'',
  618. payment_type:'',
  619. is_pay:undefined,
  620. },
  621. search4: {
  622. keyword: '',
  623. goods_name: '',
  624. start: '',
  625. end: '',
  626. order_no: '',
  627. selectDate: '',
  628. type: '',
  629. },
  630. jiaJianKuncun: [
  631. {
  632. name: '减库存',
  633. level: 1
  634. }, {
  635. name: '加库存',
  636. level: 2
  637. }],
  638. jiaJianKuncunValue: '',
  639. tableData2: [],
  640. agentLevelList: [],
  641. exportList: {},
  642. export_url: 'cloud-stock/order/index',
  643. searchData:{},
  644. payment_type_list:{},
  645. payment_type_arr: {
  646. '0': "请选择",
  647. '1': "微信",
  648. '2': "支付宝",
  649. '3': "银联卡",
  650. '5': "余额支付",
  651. '7': "汇聚支付",
  652. '8': "汇聚快捷支付",
  653. '12': "积分支付",
  654. '15': "银典支付",
  655. '16': "通联支付",
  656. },
  657. type_arr: {
  658. '0': "请选择",
  659. '1': "上级配货",
  660. '2': "平台充值",
  661. },
  662. is_pay_option: {
  663. '0': "未支付",
  664. '1': "已支付",
  665. },
  666. pickerOptions: {
  667. shortcuts: [{
  668. text: '今日',
  669. onClick(picker) {
  670. const end = new Date();
  671. const start = new Date();
  672. start.setHours(0, 0, 0, 0);
  673. end.setHours(23, 59, 59, 999);
  674. picker.$emit('pick', [start, end]);
  675. }
  676. }, {
  677. text: '本月',
  678. onClick(picker) {
  679. const today = new Date();
  680. const start = new Date(today.getFullYear(), today.getMonth(), 1);
  681. const end = new Date(today.getFullYear(), today.getMonth() + 1, 0, 23, 59, 59);
  682. picker.$emit('pick', [start, end]);
  683. }
  684. }, {
  685. text: '近七天',
  686. onClick(picker) {
  687. const end = new Date();
  688. const start = new Date();
  689. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  690. picker.$emit('pick', [start, end]);
  691. }
  692. }, {
  693. text: '近一个月',
  694. onClick(picker) {
  695. const end = new Date();
  696. const start = new Date();
  697. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  698. picker.$emit('pick', [start, end]);
  699. }
  700. }]
  701. },
  702. dialogTableVisible_fenRun: false,
  703. fenRunData: [],
  704. };
  705. },
  706. mounted: function () {
  707. if (getQuery('list_type') == 'dispense_order') {
  708. this.activeName = 'five'
  709. this.search4.keyword = getQuery('keyword');
  710. this.search4.start = getQuery('start');
  711. this.search4.end = getQuery('end');
  712. this.getList4();
  713. } else {
  714. this.getList();
  715. }
  716. },
  717. methods: {
  718. changeExportList(Object){
  719. this.exportList = Object.export_list
  720. this.searchData={...Object.search_data,list_type:'diff_order',}
  721. },
  722. goOrder(id){
  723. let params = {
  724. r: 'mall/order/detail'
  725. };
  726. if (id) params = Object.assign(params, {
  727. id: id
  728. });
  729. navigateTo(params);
  730. },
  731. searchFun1(){
  732. if(this.search1.selectDate && this.search1.selectDate[0]){
  733. this.search1.start = this.search1.selectDate[0];
  734. this.search1.end = this.search1.selectDate[1];
  735. }else{
  736. this.search1.start = '';
  737. this.search1.end = '';
  738. }
  739. this.page = 1;
  740. this.getList();
  741. },
  742. searchFun2(){
  743. if(this.search2.selectDate && this.search2.selectDate[0]){
  744. this.search2.start = this.search2.selectDate[0];
  745. this.search2.end = this.search2.selectDate[1];
  746. }else{
  747. this.search2.start = '';
  748. this.search2.end = '';
  749. }
  750. this.page = 1;
  751. this.getList2();
  752. },
  753. computedType(type) {//订单状态;1已完成;2未完成;3已退款
  754. if (type == 0) {
  755. return "待支付"
  756. } else if (type == 1) {
  757. return "待发货(已付款)"
  758. } else if (type == 2) {
  759. return "已发货"
  760. } else if (type == 3) {
  761. return "已收货"
  762. } else if (type == 4) {
  763. return "已完成"
  764. }
  765. },
  766. handleClick(tab, event) {
  767. // console.log(tab)
  768. //console.log("event="+event)
  769. // console.log('activeName='+this.activeName)
  770. if(this.activeName == 'first'){
  771. this.page = 1;
  772. this.pageCount1 = 0;
  773. this.getList();
  774. }else if(this.activeName == 'second'){
  775. this.page = 1;
  776. this.pageCount1 = 0;
  777. this.getList2();
  778. }else if(this.activeName == 'third'){
  779. this.page = 1;
  780. this.$refs.price_difference_gift_package_list.getlist(this.page);
  781. } else if (this.activeName == 'five') {
  782. this.page = 1;
  783. this.pageCount1 = 0;
  784. this.getList4();
  785. }
  786. },
  787. search() {
  788. this.page = 1;
  789. this.getList();
  790. },
  791. pagination1(currentPage) {
  792. /* let self = this; */
  793. this.page = currentPage;
  794. if(this.activeName == 'first'){
  795. this.getList();
  796. } else if (this.activeName == 'second') {
  797. this.getList2();
  798. } else if (this.activeName == 'third') {
  799. this.getList3();
  800. } else if (this.activeName == 'fourth') {
  801. this.$refs.price_difference_gift_package_list.getlist(this.page);
  802. } else if (this.activeName == 'five') {
  803. this.getList4();
  804. }
  805. },
  806. getList() {
  807. let self = this;
  808. self.listLoading = true;
  809. // console.log('会员买货订单列表page='+self.page)
  810. // console.log('会员买货订单列表search1='+JSON.stringify(this.search1))
  811. this.searchData = {
  812. list_type:'order',
  813. goods_name:this.search1.goods_name,
  814. keyword:this.search1.keyword,
  815. start:this.search1.start,
  816. end:this.search1.end,
  817. id:this.search1.id,
  818. payment_type:this.search1.payment_type,
  819. }
  820. request({
  821. params: {
  822. r: 'cloud-stock/order/index',//会员买货订单列表
  823. page:self.page,
  824. limit: 10,
  825. ...this.searchData
  826. },
  827. method: 'get',
  828. }).then(e => {
  829. //console.log('会员买货订单列表=',e)
  830. self.listLoading = false;
  831. if(e.data.code == 0){
  832. self.list = e.data.data.list;
  833. self.payment_type_list = e.data.data.payment_type_list;
  834. self.pageCount1 = e.data.data.page_count;
  835. self.exportList = e.data.data.export_list;
  836. }
  837. }).catch(e => {
  838. console.log(e);
  839. });
  840. },
  841. getList2(){
  842. this.listLoading = true;
  843. // console.log('补货订单列表page='+this.page)
  844. // console.log('补货订单列表this.search2='+JSON.stringify(this.search2))
  845. this.searchData = {
  846. list_type:'fill_order',
  847. goods_name:this.search2.goods_name,
  848. keyword:this.search2.keyword,
  849. start:this.search2.start,
  850. end:this.search2.end,
  851. id:this.search2.id,
  852. payment_type:this.search2.payment_type,
  853. is_pay:this.search2.is_pay
  854. };
  855. request({
  856. params: {
  857. r: 'cloud-stock/order/index',//plugin/cloud_stock/mall/fill-order/get-list补货订单列表
  858. page:this.page,
  859. limit: 10,
  860. ...this.searchData
  861. },
  862. method: 'get',
  863. }).then(e => {
  864. //console.log('补货订单列表='+JSON.stringify(e))
  865. this.listLoading = false;
  866. if(e.data.code == 0){
  867. this.list = e.data.data.list;
  868. this.pageCount1 = e.data.data.page_count;
  869. this.exportList = e.data.data.export_list;
  870. }
  871. }).catch(e => {
  872. console.log(e);
  873. });
  874. },
  875. switchStatus(row) {
  876. let self = this;
  877. self.listLoading = true;
  878. request({
  879. params: {
  880. r: 'cloud-stock/level/switch-status',
  881. },
  882. method: 'post',
  883. data: {
  884. id: row.id,
  885. }
  886. }).then(e => {
  887. self.listLoading = false;
  888. if (e.data.code === 0) {
  889. self.$message.success(e.data.msg);
  890. } else {
  891. self.$message.error(e.data.msg);
  892. }
  893. self.getList();
  894. }).catch(e => {
  895. console.log(e);
  896. });
  897. },
  898. editClick(id){
  899. if (id){
  900. this.edit.id=id;
  901. this.edit.show=true;
  902. this.edit.title="编辑商品"
  903. }else {
  904. this.edit.show=true;
  905. this.edit.title="添加商品"
  906. }
  907. },
  908. levelDelete(row, index) {
  909. let self = this;
  910. self.$confirm('删除该库存商品, 是否继续?', '提示', {
  911. confirmButtonText: '确定',
  912. cancelButtonText: '取消',
  913. type: 'warning'
  914. }).then(() => {
  915. self.listLoading = true;
  916. request({
  917. params: {
  918. r: 'cloud-stock/goods/delete',
  919. },
  920. method: 'post',
  921. data: {
  922. id: row.id,
  923. }
  924. }).then(e => {
  925. self.listLoading = false;
  926. if (e.data.code === 0) {
  927. self.$message.success(e.data.msg);
  928. self.list.splice(index, 1);
  929. } else {
  930. self.$message.error(e.data.msg);
  931. }
  932. }).catch(e => {
  933. console.log(e);
  934. });
  935. }).catch(() => {
  936. self.$message.info('已取消删除')
  937. });
  938. },
  939. seeCommissionDetail(id) {
  940. this.dialogTableVisible_fenRun = true
  941. this.getCapitalLog(id);
  942. },
  943. formatTime(timeStamp) {
  944. var date = new Date();
  945. date.setTime(timeStamp * 1000);
  946. var y = date.getFullYear();
  947. var m = date.getMonth() + 1;
  948. m = m < 10 ? ('0' + m) : m;
  949. var d = date.getDate();
  950. d = d < 10 ? ('0' + d) : d;
  951. var h = date.getHours();
  952. h = h < 10 ? ('0' + h) : h;
  953. var minute = date.getMinutes();
  954. var second = date.getSeconds();
  955. minute = minute < 10 ? ('0' + minute) : minute;
  956. second = second < 10 ? ('0' + second) : second;
  957. return y + '-' + m + '-' + d +' '+ h + ':' + minute + ':' + second;
  958. },
  959. getList4() {
  960. this.listLoading = true;
  961. this.searchData = {
  962. list_type: 'dispense_order',
  963. goods_name: this.search4.goods_name,
  964. keyword: this.search4.keyword,
  965. start: this.search4.start,
  966. end: this.search4.end,
  967. order_no: this.search4.order_no,
  968. type: this.search4.type
  969. };
  970. request({
  971. params: {
  972. r: 'cloud-stock/order/index',//plugin/cloud_stock/mall/fill-order/get-list补货订单列表
  973. page: this.page,
  974. limit: 10,
  975. ...this.searchData
  976. },
  977. method: 'get',
  978. }).then(e => {
  979. //console.log('补货订单列表='+JSON.stringify(e))
  980. this.listLoading = false;
  981. if (e.data.code == 0) {
  982. this.list = e.data.data.list;
  983. console.log('===', this.list);
  984. this.pageCount1 = e.data.data.page_count;
  985. this.exportList = e.data.data.export_list;
  986. }
  987. }).catch(e => {
  988. console.log(e);
  989. });
  990. },
  991. searchFun4() {
  992. if (this.search4.selectDate && this.search4.selectDate[0]) {
  993. this.search4.start = this.search4.selectDate[0];
  994. this.search4.end = this.search4.selectDate[1];
  995. } else {
  996. this.search4.start = '';
  997. this.search4.end = '';
  998. }
  999. this.page = 1;
  1000. this.getList4();
  1001. },
  1002. getCapitalLog(orderId) {
  1003. request({
  1004. params: {
  1005. r: 'cloud-stock/dispense-order/commission-list',
  1006. order_id: orderId
  1007. },
  1008. method: 'get',
  1009. }).then(e => {
  1010. if (e.data.code == 0) {
  1011. this.fenRunData = e.data.data.list;
  1012. } else {
  1013. self.$message.error(e.data.msg);
  1014. }
  1015. }).catch(e => {
  1016. console.log(e);
  1017. });
  1018. },
  1019. }
  1020. });
  1021. </script>
  1022. <style>
  1023. .table-body {
  1024. padding: 20px;
  1025. background-color: #fff;
  1026. }
  1027. .input-item {
  1028. display: inline-block;
  1029. width: 250px;
  1030. margin: 0 0 20px;
  1031. }
  1032. .input-item .el-input__inner {
  1033. border-right: 0;
  1034. }
  1035. .input-item .el-input__inner:hover {
  1036. border: 1px solid #dcdfe6;
  1037. border-right: 0;
  1038. outline: 0;
  1039. }
  1040. .input-item .el-input__inner:focus {
  1041. border: 1px solid #dcdfe6;
  1042. border-right: 0;
  1043. outline: 0;
  1044. }
  1045. .input-item .el-input-group__append {
  1046. background-color: #fff;
  1047. border-left: 0;
  1048. width: 10%;
  1049. padding: 0;
  1050. }
  1051. .input-item .el-input-group__append .el-button {
  1052. padding: 0;
  1053. }
  1054. .input-item .el-input-group__append .el-button {
  1055. margin: 0;
  1056. }
  1057. /* .table-body .el-button {
  1058. padding: 0 !important;
  1059. border: 0;
  1060. margin: 0 5px;
  1061. } */
  1062. .el-table thead{
  1063. font-size: 14px;
  1064. color: #333;
  1065. }
  1066. .el-table__footer-wrapper, .el-table__header-wrapper{
  1067. border-bottom: 1.4px solid #D6D6D6;
  1068. }
  1069. .el-date-editor .el-range-separator{/* 设置选择日期框的中间的 ‘至’ 的宽度 */
  1070. width: 8%;
  1071. }
  1072. .title{
  1073. font-size: 18px;
  1074. font-weight: bold;
  1075. display: flex;
  1076. align-items: center;
  1077. height: 40px;
  1078. display: flex;
  1079. justify-content: space-between;
  1080. }
  1081. .no-box {
  1082. display: flex;
  1083. flex-direction: column;
  1084. }
  1085. .no-box span.trade-no {
  1086. font-size: 12px;
  1087. color: #bdbdbd;
  1088. }
  1089. </style>