index.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <style>
  6. .table-body {
  7. padding: 20px;
  8. background-color: #fff;
  9. }
  10. .input-item {
  11. display: inline-block;
  12. width: 250px;
  13. margin: 0 0 20px;
  14. }
  15. .input-item .el-input__inner {
  16. border-right: 0;
  17. }
  18. .input-item .el-input__inner:hover {
  19. border: 1px solid #dcdfe6;
  20. border-right: 0;
  21. outline: 0;
  22. }
  23. .input-item .el-input__inner:focus {
  24. border: 1px solid #dcdfe6;
  25. border-right: 0;
  26. outline: 0;
  27. }
  28. .input-item .el-input-group__append {
  29. background-color: #fff;
  30. border-left: 0;
  31. width: 10%;
  32. padding: 0;
  33. }
  34. .input-item .el-input-group__append .el-button {
  35. padding: 0;
  36. }
  37. .input-item .el-input-group__append .el-button {
  38. margin: 0;
  39. }
  40. /* .table-body .el-button {
  41. padding: 0 !important;
  42. border: 0;
  43. margin: 0 5px;
  44. } */
  45. .el-table th>.cell {
  46. color: #333;
  47. font-weight: bold;
  48. font-size: 14px;
  49. }
  50. .el-table__footer-wrapper,
  51. .el-table__header-wrapper {
  52. border-bottom: 1.4px solid #D6D6D6;
  53. }
  54. .el-date-editor .el-range-separator {
  55. /* 设置选择日期框的中间的 ‘至’ 的宽度 */
  56. width: 8%;
  57. }
  58. </style>
  59. <div id="app" v-cloak>
  60. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
  61. <div slot="header">
  62. <div>
  63. <span>分账记录</span>
  64. <div style="float: right; margin: -5px 0">
  65. <!-- <el-button type="primary" size="small" @click="handle('edit')">添加商品</el-button>-->
  66. <!-- <el-button type="primary" size="small">订单导出</el-button>-->
  67. <!-- <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="search">-->
  68. <!-- </com-export-dialog>-->
  69. </div>
  70. </div>
  71. </div>
  72. <div class="table-body">
  73. <div class="head" style="display: flex;flex-wrap: wrap;">
  74. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  75. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">门店信息</div>
  76. <el-input clearable size="small" type="text" v-model="search.store" placeholder="请输入门店ID/名称搜索" @keyup.enter.native="toSearch"></el-input>
  77. </div>
  78. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  79. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">会员信息</div>
  80. <el-input clearable size="small" type="text" v-model="search.member" placeholder="请输入会员昵称/手机号" @keyup.enter.native="toSearch"></el-input>
  81. </div>
  82. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  83. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">支付单号</div>
  84. <el-input clearable size="small" type="text" v-model="search.out_trade_no" placeholder="请输入支付单号" @keyup.enter.native="toSearch"></el-input>
  85. </div>
  86. <div style="display: flex;width: 350px;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  87. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">订单号</div>
  88. <el-input clearable size="small" type="text" v-model="search.order_no" placeholder="请输入订单号" @keyup.enter.native="toSearch"></el-input>
  89. </div>
  90. <div style="display: flex;margin-right: 20px;align-items: center;margin-bottom: 20px;">
  91. <div style="flex-shrink: 0;align-items: center; margin-right: 8px;">创建时间</div>
  92. <el-date-picker size="small" v-model="time" @change="datetimeChange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" align="center">
  93. </el-date-picker><!-- type="datetimerange" @change="datetimeChange" v-model="time"-->
  94. </div>
  95. <div class="item-box" flex="dir:left cross:center">
  96. <el-button size="small" type="primary" style="margin-bottom: 20px;" @click="toSearch">搜索
  97. </el-button>
  98. </div>
  99. <div class="item-box" flex="dir:left cross:center" v-if="search.order_no || search.start_time || search.end_time || search.user_id || search.user_keyword || search.out_trade_no || search.pay_type">
  100. <el-button size="small" type="warning" style="margin-bottom: 20px; margin-left: 10px;" @click="resetFun">清除搜索条件 </el-button>
  101. </div>
  102. </div>
  103. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  104. <el-table-column label="门店ID" width="100" align="center">
  105. <template slot-scope="scope">
  106. <div size="small">{{scope.row.store_id}}</div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="门店信息" min-width="120">
  110. <template slot-scope="scope">
  111. <div class="table-info-img-text" v-if="scope.row.store">
  112. <el-image class="table-info-img circle" :src="scope.row.store.logo_img"> </el-image>
  113. <div class="table-info-text">
  114. <div v-if="scope.row.store.store_name">{{scope.row.store.store_name}}</div>
  115. <div>{{scope.row.store.shop_mobile}}</div>
  116. </div>
  117. </div>
  118. <div v-else>-</div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="用户信息" min-width="120">
  122. <template slot-scope="scope">
  123. <div class="table-info-img-text">
  124. <el-image class="table-info-img circle" :src="scope.row.order.user.avatar_url"> </el-image>
  125. <div class="table-info-text">
  126. <div v-if="scope.row.order.user.nickname">{{scope.row.order.user.nickname}}</div>
  127. <div>{{scope.row.order.user.mobile}}</div>
  128. </div>
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="单号" min-width="150" align="center">
  133. <template slot-scope="scope">
  134. <div size="small">订单号:{{scope.row.order_no}}</div>
  135. <div size="small">支付单号:{{scope.row.trade_no}}</div>
  136. </template>
  137. </el-table-column>
  138. <!-- <el-table-column label="支付单号" min-width="150" align="center">-->
  139. <!-- <template slot-scope="scope">-->
  140. <!-- <div size="small">{{scope.row.trade_no}}</div>-->
  141. <!-- </template>-->
  142. <!-- </el-table-column>-->
  143. <el-table-column label="订单金额" width="100" align="center">
  144. <template slot-scope="scope">
  145. <div size="small">{{scope.row.order.pay_money}}</div>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="平台入账金额" width="120" align="center">
  149. <template slot-scope="scope">
  150. <div size="small">{{scope.row.fee}}</div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="门店入账金额" width="120" align="center">
  154. <template slot-scope="scope">
  155. <div size="small">{{scope.row.share_amount}}</div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="订单状态" width="80" align="center">
  159. <template slot-scope="scope">
  160. <!-- <div size="small">{{order_status_list[scope.row.order.order_status]}}</div>-->
  161. <el-tag size="mini" :type="scope.row.settle_status == 100 ? 'success' : 'danger'">
  162. {{scope.row.settle_status == 100 ? '已分帐' : '待分账'}}
  163. </el-tag>
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="第三方响应" min-width="150" align="center">
  167. <template slot-scope="scope">
  168. {{scope.row.response ? scope.row.response : '-'}}
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="创建时间" prop="user_id" width="120" align="center">
  172. <template slot-scope="scope">
  173. <div size="small">{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="操作" width="100" align="center">
  177. <template slot-scope="scope">
  178. <el-popconfirm v-if="scope.row.response && scope.row.settle_status == 1"
  179. @confirm="onShare(scope.row)" title="您真的要执行手动分账吗?">
  180. <el-button type="text" slot="reference" style="color: #F56C6C">手动分账</el-button>
  181. </el-popconfirm>
  182. <div v-else>-</div>
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. <div flex="box:last cross:center">
  187. <div></div>
  188. <div>
  189. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.pageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :page-count="pageCount">
  190. </el-pagination>
  191. </div>
  192. </div>
  193. </div>
  194. </el-card>
  195. </div>
  196. <script>
  197. const app = new Vue({
  198. el: '#app',
  199. data() {
  200. return {
  201. export_list: {},
  202. export_url: 'huifu-pay/default/share-record',
  203. list: [],
  204. listLoading: false,
  205. page: 1,
  206. pageCount: 0,
  207. search: {
  208. page: 1,
  209. start_time: '',
  210. end_time: '',
  211. member: '',
  212. store: '',
  213. out_trade_no: '',
  214. order_no: '',
  215. pay_type: 0,
  216. limit: 10,
  217. },
  218. time: '',
  219. pagination: null,
  220. order_status_list: {
  221. '0': "待分账",
  222. '1': "待分账",
  223. '2': "待分账",
  224. '3': "待分账",
  225. '4': "已分账",
  226. '6': "待分账",
  227. '7': "已分帐",
  228. '-4': "已关闭",
  229. '-2': "待分账",
  230. '-1': "待分账"
  231. },
  232. };
  233. },
  234. methods: {
  235. resetFun() {
  236. this.search = {
  237. page: 1,
  238. start_time: '',
  239. end_time: '',
  240. member: '',
  241. store: '',
  242. out_trade_no: '',
  243. order_no: '',
  244. pay_type: 0,
  245. limit: 10,
  246. }
  247. this.time = '';
  248. this.toSearch();
  249. },
  250. datetimeChange() {
  251. if (this.time) {
  252. this.search.start_time = this.time[0];
  253. this.search.end_time = this.time[1];
  254. } else {
  255. this.search.start_time = '';
  256. this.search.end_time = '';
  257. }
  258. this.toSearch();
  259. },
  260. toSearch() {
  261. this.search.page = 1;
  262. this.getList();
  263. },
  264. pageChange(currentPage) {
  265. let self = this;
  266. self.search.page = currentPage;
  267. self.getList();
  268. },
  269. getList() {
  270. let self = this;
  271. self.listLoading = true;
  272. let params = {
  273. r: 'huifu-pay/default/share-record',
  274. }
  275. params = Object.assign(params, this.search);
  276. request({
  277. params: params,
  278. method: 'get',
  279. }).then(e => {
  280. self.listLoading = false;
  281. if (e.data.code == 0) {
  282. self.list = e.data.data.list;
  283. // self.export_list = e.data.data.export_list;
  284. this.pagination = e.data.data.pagination;
  285. self.pageCount = e.data.data.page_count;
  286. } else {
  287. self.$message.error(e.data.msg);
  288. }
  289. }).catch(e => {
  290. console.log(e);
  291. self.$message.error(e);
  292. });
  293. },
  294. onShare(item) {
  295. let self = this;
  296. request({
  297. params: {
  298. r: 'huifu-pay/default/share-retry'
  299. },
  300. method: 'post',
  301. data: {
  302. id: item.id
  303. }
  304. }).then(e => {
  305. if (e.data.code == 0) {
  306. self.$message.success('提交成功');
  307. self.getList()
  308. } else {
  309. self.$message.error(e.data.msg);
  310. }
  311. }).catch(e => {
  312. console.log(e);
  313. self.$message.error(e);
  314. });
  315. }
  316. },
  317. mounted: function() {
  318. this.getList();
  319. }
  320. });
  321. </script>