credit_line.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. @extends('layouts.base')
  2. @section('title', "信用度管理")
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <style>
  6. /* 导航 */
  7. .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
  8. .el-radio-button__inner{border:0;}
  9. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  10. </style>
  11. <div class="all">
  12. <div id="app" v-cloak>
  13. <div class="vue-head">
  14. <div class="vue-main-title" style="margin-bottom:20px">
  15. <div class="vue-main-title-left"></div>
  16. <div class="vue-main-title-content">信用度管理</div>
  17. </div>
  18. <div class="vue-search">
  19. <el-form :inline="true" :model="search_form" class="demo-form-inline">
  20. <el-form-item label="">
  21. <el-input v-model="search_form.member_id" placeholder="会员ID"></el-input>
  22. </el-form-item>
  23. <el-form-item label="">
  24. <el-input v-model="search_form.member" placeholder="昵称/姓名/手机号"></el-input>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-select v-model="search_form.blacklist_status" clearable placeholder="是否进入黑名单" style="width:180px">
  28. <el-option label="是" value="1"></el-option>
  29. <el-option label="否" value="0"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="">
  33. <el-button type="primary" @click="search(1)">搜索</el-button>
  34. {{-- <el-button style="margin-bottom:10px;margin-left:0;" @click="exportAll()" @click="">--}}
  35. {{-- 导出--}}
  36. {{-- </el-button>--}}
  37. </el-form-item>
  38. </el-form>
  39. </div>
  40. </div>
  41. <div class="vue-main">
  42. <div>
  43. <div class="vue-main-title" style="margin-bottom:20px">
  44. <div class="vue-main-title-left"></div>
  45. <div class="vue-main-title-content" style="flex:0 0 120px">信用度列表</div>
  46. <div class="vue-main-title-button">
  47. </div>
  48. </div>
  49. <el-table :data="list" style="width: 100%">
  50. <el-table-column label="会员ID" width="200" align="center" prop="uid"></el-table-column>
  51. <el-table-column label="会员" width="200" align="center" prop="member_1">
  52. <template slot-scope="scope">
  53. <a v-bind:href="'{{ yzWebUrl('member.member.detail', array('id' => '')) }}'+[[scope.row.uid]]"
  54. target="_blank">
  55. <img v-bind:src="scope.row.avatar"
  56. style='width:30px;height:30px;padding:1px;border:1px solid #ccc'>
  57. <br/>[[scope.row.nickname]]
  58. </a>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="信用分" width="200" align="center" prop="order_sn">
  62. <template slot-scope="scope">
  63. <el-popover class="item" placement="top" effect="light">
  64. <div style="text-align:center;">
  65. <div style="text-align:left;margin-bottom:10px;font-weight:900">
  66. 修改信用分
  67. </div>
  68. <el-input v-model="change_line" style="width:100px" size="small"></el-input>
  69. <el-button size="small" @click="confirmChange(scope.row.uid)">确定</el-button>
  70. </div>
  71. <a v-show="is_open_blacklist == 1" slot="reference">
  72. <i class="el-icon-edit edit-i" title="点击编辑"></i>
  73. </a>
  74. </el-popover>
  75. [[scope.row.credit_score_text]]
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="是否进入黑名单" width="200" align="center">
  79. <template slot-scope="scope">
  80. [[scope.row.is_blacklist]]
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. </div>
  86. <!-- 分页 -->
  87. <div class="vue-page" v-if="total>0">
  88. <el-row>
  89. <el-col align="center">
  90. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  91. :page-size="per_page" :current-page="current_page" background
  92. ></el-pagination>
  93. </el-col>
  94. </el-row>
  95. </div>
  96. </div>
  97. </div>
  98. <script>
  99. var app = new Vue({
  100. el: "#app",
  101. delimiters: ['[[', ']]'],
  102. name: 'test',
  103. data() {
  104. return {
  105. list:[],
  106. search_form:{
  107. },
  108. current_page:1,
  109. total:1,
  110. per_page:1,
  111. change_line:'',
  112. is_open_blacklist:0,
  113. blacklist_credit_line:'',
  114. can_change:false,//true-能修改信用分
  115. }
  116. },
  117. created() {
  118. },
  119. mounted() {
  120. this.getData(1);
  121. },
  122. methods: {
  123. fetchData() {
  124. const that=this;
  125. return {
  126. async send(method,url,requestParams=null){
  127. return await that.$http[method](url,requestParams).then(res=>{
  128. return res.json();
  129. }).then(({ result, data, msg }) => {
  130. if (result == 0) {
  131. this.$message({
  132. message: msg,
  133. type: "error",
  134. });
  135. }
  136. return data;
  137. })
  138. .catch((err) => {
  139. return err;
  140. })
  141. },
  142. async get(URL,requestParams){
  143. return await this.send("get",URL,requestParams);
  144. },
  145. async post(URL,requestParams){
  146. return await this.send("post",URL,requestParams);
  147. }
  148. };
  149. },
  150. getData(page) {
  151. let json = {
  152. page:page
  153. }
  154. for(let i in this.search_form) {
  155. if(this.search_form[i]||this.search_form[i]===0) {
  156. json[i] = this.search_form[i]
  157. }
  158. }
  159. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  160. this.fetchData().post('{!! yzWebFullUrl('plugin.fight-groups.admin.controllers.credit-line.getRecordsData') !!}',json).then((response)=>{
  161. loading.close();
  162. this.list=response.pageList.data;
  163. this.is_open_blacklist=response.is_open_blacklist;
  164. this.blacklist_credit_line=response.blacklist_credit_line;
  165. this.current_page=response.pageList.current_page;
  166. this.total=response.pageList.total;
  167. this.per_page=response.pageList.per_page;
  168. }).catch(err=>{
  169. this.$message({
  170. message: err.msg,
  171. type: 'error'
  172. });
  173. })
  174. },
  175. search(val) {
  176. this.getData(val);
  177. },
  178. {{--exportAll: function () {--}}
  179. {{-- var post_data = JSON.stringify(this.search_form);--}}
  180. {{-- window.open("{!! yzWebUrl('plugin.fight-groups-operators.admin.reward.export') !!}" + '&search_form=' + post_data);--}}
  181. {{--},--}}
  182. changeScore:function (id) {
  183. let json = {
  184. member_id: id,
  185. credit_score: this.change_line
  186. };
  187. this.fetchData().post('{!! yzWebFullUrl('plugin.fight-groups.admin.controllers.credit-line.changeCreditScore') !!}',json).then((response)=>{
  188. this.$message.success('操作成功!');
  189. this.search(this.this_page);
  190. }).catch(err=>{
  191. this.$message({
  192. message: err.msg,
  193. type: 'error'
  194. });
  195. })
  196. },
  197. confirmChange:function (id){
  198. if (this.change_line < 0 || this.change_line > 100) {
  199. this.$message.error('不能输入大于100小于0的值');
  200. return;
  201. }
  202. if (Number(this.change_line) < Number(this.blacklist_credit_line)) {
  203. this.$confirm('您所编辑的信用分已达到后台设置的低于信用分,更改后会进入黑名单,进入黑名单后您将无法参与开团和拼团,是否确认更改', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  204. this.changeScore(id);
  205. }).catch(() => {
  206. this.$message({type: 'info',message: '已取消修改'});
  207. });
  208. } else {
  209. this.changeScore(id);
  210. }
  211. },
  212. },
  213. })
  214. </script>
  215. @endsection