apply.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. @extends('layouts.base')
  2. @section('title', '资格申请')
  3. @section('content')
  4. <link href="{{static_url('yunshop/css/total.css')}}" media="all" rel="stylesheet" type="text/css" />
  5. <style scoped>
  6. .form-item-w {
  7. /* border: 1px solid red; */
  8. width: 100%;
  9. margin-top: 20px;
  10. padding-left: 15px;
  11. }
  12. .input-w {
  13. width: 22%;
  14. margin-right: 20px;
  15. margin-bottom: 20px;
  16. }
  17. .el-input__inner {
  18. /* height: 35px; */
  19. border: 1px solid #ccc;
  20. }
  21. /* 选项下拉 输入框 按钮 */
  22. .select-box {
  23. margin-right: 12px;
  24. display: flex;
  25. }
  26. .el-date-editor .el-range-separator {
  27. /* width: 13%; */
  28. line-height: 38px;
  29. }
  30. .select-w {
  31. margin-top: 20px;
  32. width: 150px;
  33. }
  34. .el-input--suffix .el-input__inner {
  35. /* border-radius: 9px; */
  36. /* height: 30px; */
  37. }
  38. .el-date-editor--daterange.el-input__inner {
  39. width: 252px;
  40. /* height: 35px; */
  41. }
  42. .el-date-editor--timerange.el-input__inner {
  43. width: 252px;
  44. /* height: 35px; */
  45. }
  46. .el-range-editor.el-input__inner {
  47. padding: 1px 10px;
  48. }
  49. .el-date-editor.el-input {
  50. width: 120px;
  51. }
  52. .el-button {
  53. /* height: 35px; */
  54. /* line-height: 0; */
  55. }
  56. .button_box {
  57. margin-left: 20px;
  58. }
  59. /* 申请列表 */
  60. .vue-title-content span {
  61. opacity: .6;
  62. margin-left: 14px;
  63. }
  64. .el-table .cell {
  65. color: #333;
  66. font-family: inherit;
  67. }
  68. .el-table td div {
  69. font-family: "微软雅黑";
  70. font-weight: 400;
  71. }
  72. /* 无数据显示 */
  73. .not {
  74. width: 40px;
  75. height: 22px;
  76. color: #fff;
  77. line-height: 22px;
  78. text-align: center;
  79. margin: 22px auto;
  80. cursor: default;
  81. font-weight: 600;
  82. font-family: "微软雅黑";
  83. background-color: #999999;
  84. }
  85. .marTop {
  86. margin-top: 20px;
  87. line-height: 0px;
  88. }
  89. .marTop>img {
  90. margin-bottom: 15px;
  91. }
  92. /* 分页 */
  93. .pagination-right {
  94. margin: 50px auto;
  95. text-align: center;
  96. }
  97. [v-cloak] {
  98. display: none;
  99. }
  100. .keep {
  101. width: 75px;
  102. color: white;
  103. font-weight: bold;
  104. margin: 0 auto;
  105. background: #ff9800;
  106. }
  107. .keep_0 {
  108. background: #9c27b0;
  109. }
  110. /* 搜索 */
  111. .search_box {
  112. width: 102px;
  113. }
  114. /* 导出 */
  115. .export_box {
  116. width: 102px;
  117. color: #29ba9c;
  118. border: solid 1px #29ba9c;
  119. }
  120. </style>
  121. <div class="all">
  122. <div id="app" v-cloak>
  123. <!-- 资格申请 -->
  124. <div class="total-head">
  125. <el-form>
  126. <div class="vue-title">
  127. <div class="vue-title-left"></div>
  128. <div class="vue-title-content">申请资格</div>
  129. </div>
  130. <el-form-item class="form-item-w">
  131. <el-input clearable class="input-w" v-model="quali.member_id" placeholder="会员id"></el-input>
  132. <el-input clearable class="input-w" v-model="quali.member_pet" placeholder="会员昵称/姓名/手机号"></el-input>
  133. <el-select clearable class="input-w" v-model="quali.member_referrer" placeholder="请选择邀请人">
  134. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  135. </el-option>
  136. </el-select>
  137. <el-input clearable class="input-w" v-model="quali.referrer_name" placeholder="推荐人昵称/姓名/手机号"></el-input>
  138. <div class="select-box">
  139. <!-- 日期和时间 -->
  140. <el-date-picker value-format="timestamp" style="margin-right:5px;"  type="datetimerange" v-model="quali.date" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
  141. </el-date-picker>
  142. <div class="button_box">
  143. <el-button class="input_btn search_box" @click="searchEvent" @keyup.enter="searchEvent" type="primary">搜索</el-button>
  144. <el-button class="input_btn export_box" @click="deriveEvent">导出</el-button>
  145. </div>
  146. </div>
  147. </el-form-item>
  148. </el-form>
  149. </div>
  150. <!-- 申请列表 -->
  151. <div class="total-floo" style="padding-bottom:1px">
  152. <div class="vue-title">
  153. <div class="vue-title-left"></div>
  154. <div class="vue-title-content">申请列表<span>总数:&nbsp;[[total]]</span></div>
  155. </div>
  156. <!-- 列表+分页查询 -->
  157. <el-table v-loading="loading" style="width: 100%;" :data="apalyList" :header-cell-style='{"text-align":"center"}' :cell-style='{"text-align":"center"}'>
  158. <el-table-column label="ID">
  159. <template slot-scope="scope">
  160. <p>[[scope.row.uid]]</p>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="推荐人">
  164. <template slot-scope="scope">
  165. <div class="marTop" v-if="scope.row.yz_member.parent_id!==null && scope.row.yz_member.parent_id">
  166. <div v-if="scope.row.yz_member.agent!==null && scope.row.yz_member.agent">
  167. <img v-if="scope.row.yz_member.agent.avater" width="30" height="30" :src="scope.row.yz_member.agent.avater">
  168. <p v-if="scope.row.yz_member.agent.nickname">[[scope.row.yz_member.agent.nickname]]</p>
  169. <p v-else>未更新</p>
  170. </div>
  171. </div>
  172. <div v-else>
  173. <div class="keep keep_0" v-if="scope.row.yz_member.is_agent==1">总店</div>
  174. <div class="not" v-else>暂无</div>
  175. </div>
  176. </template>
  177. </el-table-column>
  178. <el-table-column label="粉丝">
  179. <template slot-scope="scope">
  180. <div class="marTop" v-if="scope.row.avatar!==null && scope.row.avatar">
  181. <img width="30" height="30" :src="scope.row.avatar">
  182. <p v-if="scope.row.fans_item">[[scope.row.fans_item]]</p>
  183. <p v-else>未更新</p>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="姓名">
  188. <template slot-scope="scope">
  189. <p>[[scope.row.realname]]</p>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="手机号">
  193. <template slot-scope="scope">
  194. <p v-if="scope.row.mobile">[[scope.row.mobile]]</p>
  195. <!-- <p v-else>无</p> -->
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="申请时间">
  199. <template slot-scope="scope">
  200. <p v-if="typeof scope.row.yz_member !== 'undefined'">[[scope.row.yz_member.apply_time | timeDates]]</p>
  201. <!-- <p v-else>无</p> -->
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="详情">
  205. <template slot-scope="scope">
  206. <el-link type="primary" :underline="false" style="font-size: 12px; font-weight: normal" @click="detailsLink(scope.row.uid)">
  207. <i class="el-icon-view" style="font-size:18px;color: #333;"></i>
  208. </el-link>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="操作">
  212. <template slot-scope="scope">
  213. <el-button @click="pass(scope.row.uid)">通过</el-button>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. </div>
  218. <!-- 分页 -->
  219. <div v-if="apalyList.length!==0" class="fixed total-floo">
  220. <div class="fixed_box">
  221. <el-pagination background style="text-align: right;" @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pagesize" layout="prev, pager, next, jumper" :total="total">
  222. </el-pagination>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. <script>
  228. var vm = new Vue({
  229. el: '#app',
  230. // 防止后端冲突,修改ma语法符号
  231. delimiters: ['[[', ']]'],
  232. data() {
  233. return {
  234. quali: {
  235. member_id: "",
  236. member_pet: "",
  237. member_referrer: "1",
  238. referrer_name: "",
  239. search_time: [],
  240. date: [],
  241. },
  242. options: [{
  243. value: '1',
  244. label: '推荐人'
  245. }, {
  246. value: '0',
  247. label: '总店'
  248. }],
  249. pickerOptions: {
  250. shortcuts: [{
  251. text: '最近一周',
  252. onClick(picker) {
  253. const end = new Date();
  254. const start = new Date();
  255. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  256. picker.$emit('pick', [start, end]);
  257. }
  258. }, {
  259. text: '最近一个月',
  260. onClick(picker) {
  261. const end = new Date();
  262. const start = new Date();
  263. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  264. picker.$emit('pick', [start, end]);
  265. }
  266. }, {
  267. text: '最近三个月',
  268. onClick(picker) {
  269. const end = new Date();
  270. const start = new Date();
  271. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  272. picker.$emit('pick', [start, end]);
  273. }
  274. }]
  275. },
  276. //总人数
  277. apalyListSum: 0,
  278. //申请列表
  279. apalyList: [],
  280. currentPage: 1, //当前的页码
  281. pagesize: 4, //每页显示的行数
  282. total: 1, //总数
  283. isCount: 0,
  284. loading: true
  285. }
  286. },
  287. created() {
  288. g = this
  289. //优化在不同设备固定定位挡住的现象设置父元素的内边距
  290. window.onload = function() {
  291. let all = document.querySelector(".all");
  292. let h = window.innerHeight * 0.04;
  293. all.style.paddingBottom = h + "px";
  294. }
  295. //获取当前数据总数
  296. this.apalyListSum = this.apalyList.length
  297. //请求当前网络数据
  298. this.postRelation(1)
  299. //全局监听 enter事件
  300. document.onkeydown = (e) => {
  301. let key = window.event.keyCode;
  302. if (key == 13) {
  303. g.searchEvent();
  304. }
  305. }
  306. },
  307. //定义全局的方法
  308. beforeCreate() {
  309. that = this
  310. },
  311. filters: {
  312. timeDates(date) {
  313. if (date!==null && date) {
  314. return that.timeDate(date * 1000)
  315. } else {
  316. return ""
  317. }
  318. }
  319. },
  320. methods: {
  321. //申请列表
  322. postRelation(page) {
  323. this.$http.post("{!!yzWebFullUrl('member.member-relation.apply-show')!!}", {
  324. page: page,
  325. search: this.isCount >= 1 ? {
  326. uid: this.quali.member_id,
  327. member: this.quali.member_pet,
  328. referee: this.quali.member_referrer,
  329. referee_info: this.quali.referrer_name,
  330. times: this.quali.date !== null ? {
  331. start: parseInt(this.quali.date[0] / 1000),
  332. end: parseInt(this.quali.date[1] / 1000)
  333. } : {
  334. start: "",
  335. end: ""
  336. }
  337. } : ""
  338. }).then(res => {
  339. this.loading = true;
  340. if (res.data.result == 1) {
  341. setTimeout(() => {
  342. this.loading = false;
  343. }, 200)
  344. let {
  345. data: data,
  346. current_page: current,
  347. per_page: per,
  348. total: total
  349. } = res.body.data.list;
  350. console.log(res);
  351. // console.log(current, per, total, 95684465);
  352. console.log(data);
  353. //当前页码
  354. this.currentPage = current;
  355. //每页显示的行数
  356. this.pagesize = per;
  357. //总页数
  358. this.total = total;
  359. console.log(this.pagesize);
  360. if(data!==null && data.length!==0){
  361. //申请列表
  362. this.apalyList = data;
  363. }else{
  364. this.apalyList = []
  365. }
  366. //总人数
  367. // this.apalyListSum = this.apalyList.length * this.total;
  368. }
  369. })
  370. },
  371. isTypeNull(str) {
  372. // 如果对象 或者为空则返回
  373. if (str == null) {
  374. return false
  375. } else {
  376. return true;
  377. }
  378. },
  379. //页面切换的方式
  380. handleCurrentChange(page) {
  381. this.postRelation(page);
  382. },
  383. //时间的转换
  384. timeDate(date) {
  385. let d = new Date(date);
  386. let resDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();;
  387. return resDate;
  388. },
  389. //搜索
  390. searchEvent() {
  391. this.isCount++
  392. this.postRelation();
  393. },
  394. //导出
  395. deriveEvent() {
  396. let start = isNaN(parseInt(this.quali.date[0] / 1000)) ? "" : parseInt(this.quali.date[0] / 1000);
  397. let end = isNaN(parseInt(this.quali.date[1] / 1000)) ? "" : parseInt(this.quali.date[1] / 1000);
  398. let url = `{!! yzWebFullUrl('member.member-relation.export') !!}` + '&search[uid]=' + this.quali.member_id + '&search[member]=' + this.quali.member_pet + '&search[referee]=' + this.quali.member_referrer + '&search[referee_info]=' + this.quali.referrer_name + '&search[times][start]=' + start + '&search[times][end]=' + end;
  399. window.location.href = url;
  400. // console.log(url);
  401. },
  402. //详情
  403. detailsLink(id) {
  404. //传递参数跳转到会员详情
  405. let link = `{!! yzWebUrl('member.member.detail') !!}` + '&id=' + id;
  406. window.location.href = link;
  407. },
  408. //通过
  409. pass(id) {
  410. console.log(id);
  411. this.$http.post("{!!yzWebFullUrl('member.member-relation.chk-apply')!!}", {
  412. id: id
  413. }).then(res => {
  414. console.log(res);
  415. // 审核通过成功
  416. if (res.data.result == 1) {
  417. this.$message.success(res.data.msg)
  418. history.go(0);
  419. } else {
  420. this.$message.error(res.data.msg)
  421. }
  422. })
  423. }
  424. },
  425. })
  426. </script>
  427. @endsection