detail.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <?php
  2. /**
  3. * @link:http://www.goodmall.com/
  4. * @copyright: Copyright (c) 2022
  5. * 名片
  6. * Author: zcx
  7. * Date: 2022-09-14
  8. * Time: 16:59
  9. */
  10. ?>
  11. <div id="app" v-cloak>
  12. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  13. <div slot="header">
  14. <span>分红详情</span>
  15. </div>
  16. <div class="table-body">
  17. <el-form size="small" :inline="true" flex="dir:left cross:center">
  18. <div class="flex-bew">
  19. <div flex>
  20. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="navTo">
  21. 返回
  22. </el-button>
  23. </div>
  24. <div flex>
  25. <div class="item-box" flex="dir:left cross:center">
  26. <div class="label">关键字:</div>
  27. <el-input size="small" style="width: 200px" v-model="search.name" placeholder="请输入关键字"></el-input>
  28. </div>
  29. <div class="item-box" flex="dir:left cross:center">
  30. <div class="label">分红状态:</div>
  31. <el-select v-model="search.status" placeholder="请选择" clearable>
  32. <el-option
  33. label="全部"
  34. value="0">
  35. </el-option>
  36. <el-option
  37. label="已发布"
  38. value="1">
  39. </el-option>
  40. <el-option
  41. label="待发放"
  42. value="2">
  43. </el-option>
  44. </el-select>
  45. </div>
  46. </div>
  47. <div class="item-box" flex="dir:left cross:center">
  48. <div class="label">选择时间:</div>
  49. <el-date-picker style="margin-top: 1px;" size="small" @change="changeTime" v-model="time" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  50. </div>
  51. <div class="item-box" flex="dir:left cross:center">
  52. <el-button size="small" type="primary" style="padding: 9px 15px !important;" @click="searchs">
  53. <i class="el-icon-search"></i>
  54. 搜索
  55. </el-button>
  56. </div>
  57. </div>
  58. </div>
  59. </el-form>
  60. <el-tabs v-model="activeName" @tab-click="handleClick">
  61. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  62. @selection-change="handleSelectionChange">
  63. <el-table-column label="订单号" prop="order_no" align="center" width="250" class-name="goods-name"></el-table-column>
  64. <el-table-column label="用户" prop="cate_name" min-width="160" align="center">
  65. <template slot-scope="scope" >
  66. <div flex>
  67. <image class="user-avatar" :src="scope.row.avatar_url" style="width:50px;height:50px;">
  68. <div class="flexcenter">{{scope.row.nickname }}(ID:{{scope.row.user_id}})</div>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="手机号" prop="mobile" min-width="160" align="center"></el-table-column>
  73. <el-table-column label="总贡献值" prop="total_contribution" min-width="130" align="center"></el-table-column>
  74. <el-table-column label="订单贡献值" prop="contribution" min-width="130" align="center"></el-table-column>
  75. <el-table-column label="订单贡献金额" prop="money" min-width="130" align="center"></el-table-column>
  76. <el-table-column label="分红" prop="total_bonus" min-width="130" align="center"></el-table-column>
  77. <el-table-column label="订单分红" prop="order_bonus" min-width="130" align="center"></el-table-column>
  78. <el-table-column label="时间" prop="created_at" min-width="160" align="center">
  79. <template slot-scope="scope">
  80. <div>{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="分红状态" prop="mobile" min-width="160" align="center">
  84. <template slot-scope="scope">
  85. <div>{{scope.row.is_settlement == 1 ? '已发放':'未发放'}}</div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="状态" prop="mobile" min-width="100" align="center">
  89. <template slot-scope="scope">
  90. <div>{{scope.row.is_feedback == 1 ? '已失效':'正常'}}</div>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. </el-tabs>
  95. <!-- 分页器 -->
  96. <div flex="box:last cross:center">
  97. <div></div>
  98. <div>
  99. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  100. style="display: inline-block;float: right;" background @current-change="pageChange"
  101. layout="prev, pager, next" :total="pagination.totalCount">
  102. </el-pagination>
  103. </div>
  104. </div>
  105. </div>
  106. </el-card>
  107. <el-dialog title="商品设置" :visible.sync="editGoodsDialog" width="500px">
  108. <div>
  109. <el-form :model="setting" size="small" label-width="150px">
  110. <el-form-item label="状态">
  111. <el-radio-group v-model="setting.contribution_percent">
  112. <el-radio :label="1">
  113. 百分比
  114. </el-radio>
  115. <el-radio :label="0">
  116. 固定值
  117. </el-radio>
  118. </el-radio-group>
  119. <el-input maxlength="20" v-model="setting.contribution" placeholder="请输入"></el-input>
  120. </el-form-item>
  121. <el-form-item label="利润值">
  122. <el-radio-group v-model="setting.profit_percent">
  123. <el-radio :label="1">
  124. 百分比
  125. </el-radio>
  126. <el-radio :label="0">
  127. 固定值
  128. </el-radio>
  129. </el-radio-group>
  130. <el-input maxlength="20" v-model="setting.profit" placeholder="请输入"></el-input>
  131. </el-form-item>
  132. <el-form-item label="分类">
  133. <el-select v-model="setting.cate_id" placeholder="请选择" clearable>
  134. <el-option
  135. v-for="(item,index) in cateList"
  136. :key="item.id"
  137. :label="item.name"
  138. :value="item.id">
  139. </el-option>
  140. </el-select>
  141. </el-form-item>
  142. </el-form>
  143. </div>
  144. <span slot="footer" class="dialog-footer">
  145. <el-button @click="bossDialog=false" type="default" size="small">取消</el-button>
  146. <el-button type="primary" :loading="loading" style="margin-bottom: 10px;" size="small" @click="editGoodsComfirm">确定</el-button>
  147. </span>
  148. </el-dialog>
  149. </div>
  150. <script>
  151. const app = new Vue({
  152. el: '#app',
  153. data: {
  154. cForm:{
  155. goods_id:[]
  156. },
  157. cateList:[],//分类列表
  158. page:1,
  159. limit:50,
  160. time:[], //本地存时间,请求时不发送
  161. search: {
  162. bonus_log_id:'',
  163. name : '',
  164. status:null,
  165. start:'',
  166. end:''
  167. },
  168. time:'',
  169. loading: false,
  170. activeName: '-1',
  171. list: [], //列表数据
  172. pagination: null,
  173. choose_list:[],
  174. cateForm:{
  175. id:0,
  176. name:'',
  177. status:0
  178. },
  179. setting:{
  180. id:0,
  181. contribution:0,
  182. contribution_percent:0,
  183. profit_percent:0,
  184. profit:0,
  185. cate_id:0
  186. },
  187. editGoodsDialog:false
  188. },
  189. created(){
  190. this.search.bonus_log_id = getQuery('id');
  191. },
  192. mounted() {
  193. // 获取列表首页数据
  194. this.loadData(this.page,this.search); //获取列表数据
  195. },
  196. methods: {
  197. navTo(){
  198. this.$navigate({
  199. r: 'blind-box/bonus-log/index',
  200. })
  201. },
  202. changeTime(e){
  203. console.log('选择时间',e)
  204. this.search.start = e[0]
  205. this.search.end = e[1]
  206. },
  207. loadData(page,others) {
  208. this.loading = true;
  209. console.log(666,this.search);
  210. request({
  211. method: 'get',
  212. params: {
  213. r: 'blind-box/bonus-log/detail',
  214. page: page,
  215. limit:this.limit,
  216. ...others, //其他搜索字段
  217. },
  218. }).then(e => {
  219. this.loading = false;
  220. if (e.data.code === 0) {
  221. this.list = e.data.data.list;
  222. console.log('this.list',this.list)
  223. this.pagination = e.data.data.pagination;
  224. } else {
  225. this.$message.error(e.data.msg);
  226. }
  227. }).catch(e => {
  228. });
  229. },
  230. pageChange(page) {
  231. this.page = page;
  232. this.loadData(this.page,this.search);
  233. },
  234. handleClick(tab, event) {
  235. this.page = 1;
  236. this.search.status = this.activeName;
  237. this.loadData(this.page,this.search)
  238. },
  239. handleSelectionChange(val,type) {
  240. console.log('val',val,type)
  241. let self = this;
  242. if(type == 'row'){
  243. self.choose_list.push(val.id)
  244. self.delGoods()
  245. }else{
  246. self.choose_list = [];
  247. val.forEach(function (item) {
  248. self.choose_list.push(item.id);
  249. })
  250. }
  251. },
  252. searchs() {
  253. this.page = 1;
  254. this.loadData(this.page,this.search);
  255. },
  256. editGoods(type,row){
  257. this.setting.contribution = row.contribution
  258. this.setting.contribution_percent = row.contribution_percent
  259. this.setting.profit_percent = row.profit_percent
  260. this.setting.profit = row.profit
  261. this.setting.cate_id = row.cate_id
  262. this.setting.id = row.id
  263. this.editGoodsDialog = true
  264. },
  265. editGoodsComfirm(row){
  266. request({
  267. method: 'post',
  268. params: {
  269. r: 'blind-box/goods/edit',
  270. },
  271. data: {
  272. id:row.id,
  273. ...this.setting
  274. }
  275. }).then(e => {
  276. this.loading = false;
  277. if (e.data.code === 0) {
  278. this.$message.success(e.data.msg);
  279. this.page = 1;
  280. this.loadData();
  281. this.editGoodsDialog = false
  282. } else {
  283. this.$message.error(e.data.msg);
  284. }
  285. }).catch(e => {
  286. });
  287. },
  288. delGoods(){ //批量删除
  289. console.log(this.choose_list)
  290. if(this.choose_list.length == 0){
  291. this.$message.error('请选择商品')
  292. }else{
  293. this.$confirm('是否确定删除商品?', '提示', {
  294. confirmButtonText: '确定',
  295. cancelButtonText: '取消',
  296. type: 'warning'
  297. }).then(() => {
  298. this.loading = true;
  299. request({
  300. params: {
  301. r: 'blind-box/goods/del',
  302. },
  303. method: 'post',
  304. data: {
  305. id: this.choose_list,
  306. }
  307. }).then(e => {
  308. let res = e.data;
  309. this.loading = false;
  310. if (res.code === 0) {
  311. this.$message.success(res.msg);
  312. this.loadData();
  313. } else {
  314. this.$message.error(res.msg);
  315. }
  316. }).catch(e => {});
  317. }).catch(() => {
  318. this.$message({
  319. type: 'info',
  320. message: '系统错误'
  321. });
  322. });
  323. }
  324. }
  325. }
  326. });
  327. </script>
  328. <style>
  329. .el-tabs__header {
  330. font-size: 16px;
  331. }
  332. .table-body {
  333. padding: 20px;
  334. background-color: #fff;
  335. }
  336. .table-body .el-button {
  337. padding: 0 !important;
  338. border: 0;
  339. margin: 0 5px;
  340. }
  341. .input-item {
  342. width: 250px;
  343. margin: 0 0 20px;
  344. display: inline-block;
  345. }
  346. .input-item .el-input__inner {
  347. border-right: 0;
  348. }
  349. .input-item .el-input__inner:hover {
  350. border: 1px solid #dcdfe6;
  351. border-right: 0;
  352. outline: 0;
  353. }
  354. .input-item .el-input__inner:focus {
  355. border: 1px solid #dcdfe6;
  356. border-right: 0;
  357. outline: 0;
  358. }
  359. .input-item .el-input-group__append {
  360. background-color: #fff;
  361. border-left: 0;
  362. width: 10%;
  363. padding: 0;
  364. }
  365. .input-item .el-input-group__append .el-button {
  366. padding: 0;
  367. }
  368. .input-item .el-input-group__append .el-button {
  369. margin: 0;
  370. }
  371. .batch {
  372. margin: 0 0 20px;
  373. display: inline-block;
  374. }
  375. .batch .el-button {
  376. padding: 9px 15px !important;
  377. }
  378. .item-box{
  379. margin-right: 20px;
  380. }
  381. .item-box .label{
  382. margin-right: 8px;
  383. }
  384. .form-nickname{
  385. width: 180px;
  386. white-space:nowrap;
  387. overflow:hidden;
  388. text-overflow:ellipsis;
  389. }
  390. .index-video-url{
  391. width: 300px;
  392. }
  393. .index-video-url video{
  394. width: 100%;
  395. }
  396. .index-related-info{
  397. width: 500px;
  398. }
  399. .video-top{
  400. width: 100%;
  401. display: flex;
  402. align-items: flex-start;
  403. box-sizing: border-box;
  404. padding: 20px;
  405. /* opacity: .5; */
  406. background-color: #FFFFFF;
  407. }
  408. .video-top .top-right{
  409. line-height: 26px;
  410. }
  411. .video-top .top-right .top-title{
  412. font-size: 18px;
  413. white-space:nowrap;
  414. overflow:hidden;
  415. text-overflow:ellipsis;
  416. width: 360px;
  417. }
  418. .video-top .top-right .wrapper{
  419. display: flex;
  420. /* align-items: flex-start; */
  421. }
  422. .video-top .top-right .wrapper .to-copy{
  423. /* color: #03C5FF; */
  424. margin-left: 20px;
  425. }
  426. .video-top .top-right .detail-price{
  427. color: #BC0100;
  428. font-size: 18px;
  429. font-family: Microsoft YaHei;
  430. font-weight: bold;
  431. }
  432. /* .atooltip {
  433. background: #FFFFFF !important;
  434. border: none !important;
  435. } */
  436. .el-table th>.cell{
  437. color: #333;
  438. font-weight: bold;
  439. font-size: 14px;
  440. }
  441. .el-table__footer-wrapper, .el-table__header-wrapper{
  442. border-bottom: 1.4px solid #D6D6D6;
  443. }
  444. .award-money{
  445. color: #BC0100;
  446. }
  447. .flex-bew{
  448. display:flex;
  449. justify-content: space-between;
  450. width:100%;
  451. }
  452. .goods-name .cell{
  453. width: 250px;
  454. word-break: break-all;
  455. text-overflow: ellipsis;
  456. display: -webkit-box;
  457. -webkit-box-orient: vertical;
  458. -webkit-line-clamp: 2; /* 这里是超出几行省略 */
  459. overflow: hidden;
  460. }
  461. .flexcenter{
  462. display: flex;
  463. justify-content: center;
  464. align-items: center;
  465. }
  466. .user-avatar{
  467. border-radius:50%;
  468. margin-right:5px;
  469. }
  470. </style>