index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <style>
  2. .link_url {
  3. text-align: left;
  4. font-size: 14px;
  5. }
  6. .showqr .el-dialog__body {
  7. text-align: center;
  8. padding-bottom: 10px;
  9. }
  10. .el-dialog {
  11. min-width: 400px;
  12. }
  13. </style>
  14. <div id="app" v-cloak>
  15. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  16. <div slot="header">
  17. <span>申请成为招商员列表</span>
  18. </div>
  19. <div class="search-box">
  20. <!-- 搜索 -->
  21. <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
  22. <el-form-item label="会员ID">
  23. <el-input placeholder="会员ID" v-model="searchForm.user_id"></el-input>
  24. </el-form-item>
  25. <el-form-item label="会员昵称">
  26. <el-input placeholder="昵称/手机号" v-model="searchForm.nickname"></el-input>
  27. </el-form-item>
  28. <el-form-item label="等级">
  29. <el-select v-model="searchForm.business_bonus_level" placeholder="请选择等级">
  30. <el-option v-for="(item, index) in level_list" :label="item.level_name" :value="item.level" :key="index"></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label="申请时间">
  34. <el-date-picker
  35. size="small"
  36. v-model="searchForm.apply_time"
  37. type="datetimerange"
  38. value-format="yyyy-MM-dd HH:mm:ss"
  39. range-separator="至"
  40. start-placeholder="开始日期"
  41. end-placeholder="结束日期">
  42. </el-date-picker>
  43. </el-form-item>
  44. <el-form-item label="审核状态">
  45. <el-select v-model="searchForm.audit_status" placeholder="请选择状态">
  46. <el-option v-for="(item, index) in status_option" :label="item.name" :value="item.index" :key="index"></el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-button type="primary" @click="search">搜索</el-button>
  51. <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  52. </el-form-item>
  53. </el-form>
  54. </div>
  55. <div class="table-body">
  56. <el-tabs>
  57. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  58. <el-table-column prop="id" label="序号" align="center"></el-table-column>
  59. <el-table-column
  60. label="会员"
  61. min-width="120">
  62. <template slot-scope="scope" v-if="scope.row.user">
  63. <div style="display: flex;align-items: center;">
  64. <el-image fit="cover" :src="scope.row.user.avatar_url ? scope.row.user.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  65. <div>
  66. <div>{{scope.row.user.nickname}}</div>
  67. <div>ID {{scope.row.user.id}}</div>
  68. </div>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="手机号码" align="center">
  73. <template slot-scope="scope">
  74. {{scope.row.user.mobile}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="level_info.level_name" label="招商员等级" align="center"></el-table-column>
  78. <el-table-column label="分红比例" align="center">
  79. <template slot-scope="scope">
  80. {{ scope.row.level_info.bonus_rate}}%
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="申请状态" align="center">
  84. <template slot-scope="scope">
  85. <span v-if="scope.row.audit_status == 0">
  86. 待审核
  87. </span>
  88. <span v-else-if="scope.row.audit_status == 1">
  89. 审核通过
  90. </span>
  91. <span v-else-if="scope.row.audit_status == 2">
  92. 驳回审核
  93. </span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="审核人" prop="audit_admin" align="center"></el-table-column>
  97. <el-table-column label="备注" prop="faid_reason" align="center"></el-table-column>
  98. <el-table-column label="审核时间" min-width="105" align="center">
  99. <template slot-scope="scope">
  100. {{ scope.row.audit_time | dateTimeFormat('Y-m-d H:i') }}
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="申请时间" min-width="105" align="center">
  104. <template slot-scope="scope">
  105. {{ scope.row.apply_time | dateTimeFormat('Y-m-d H:i') }}
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="操作" align="center" fixed="right" >
  109. <template slot-scope="scope">
  110. <el-button type="text" @click="auditAction(scope.row)" v-if="scope.row.audit_status != 1" >审核</el-button>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <div style="text-align: right;margin: 20px 0;">
  115. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  116. </div>
  117. </el-tabs>
  118. </div>
  119. </el-card>
  120. <el-dialog
  121. :title="`审核操作: 序号` + audit_form.id"
  122. :visible.sync="dialogVisible"
  123. width="30%"
  124. >
  125. <div>
  126. <el-select v-model="audit_form.audit_status" placeholder="请选择审核结果">
  127. <el-option label="审核通过" :value="1" :key="1"></el-option>
  128. <el-option label="驳回审核" :value="2" :key="2"></el-option>
  129. </el-select>
  130. <el-input type="textarea" v-model="audit_form.faid_reason" :placeholder="audit_holder" style="margin-top: 20px"></el-input>
  131. </div>
  132. <span slot="footer" class="dialog-footer">
  133. <el-button @click="dialogVisible = false">取 消</el-button>
  134. <el-button type="primary" @click="subAudit">{{audit_btn}}</el-button>
  135. </span>
  136. </el-dialog>
  137. </div>
  138. <script>
  139. const app = new Vue({
  140. el: '#app',
  141. data: {
  142. loading: false,
  143. page: 1,
  144. pageCount: 0,
  145. list: [],
  146. searchForm:{
  147. user_id: null,
  148. nickname: null,
  149. business_bonus_level: null,
  150. apply_time: null,
  151. audit_status: null,
  152. },
  153. level_list: [], // 等级列表
  154. status_option: [
  155. {index: 0, name: '待审核'},
  156. {index: 1, name: '审核通过'},
  157. {index: 2, name: '驳回审核'},
  158. ],
  159. dialogVisible: false,
  160. dialogLoading: false,
  161. audit_form: {
  162. id: 0,
  163. audit_status: 1,
  164. faid_reason: ''
  165. }
  166. },
  167. mounted() {
  168. this.getList();
  169. this.getBusinessBonusLevel();
  170. },
  171. computed: {
  172. show_clear_search_btn: function() {
  173. return this.searchForm.business_bonus_level != null ||
  174. this.searchForm.user_id != null ||
  175. this.searchForm.apply_time != null ||
  176. this.searchForm.audit_status != null ||
  177. this.searchForm.nickname != null;
  178. },
  179. audit_holder() {
  180. return this.audit_form.audit_status == 1 ? '请输入通过理由' :'请输入驳回理由';
  181. },
  182. audit_btn() {
  183. return this.dialogLoading == true ? '正在提交...' : '提 交';
  184. }
  185. },
  186. methods: {
  187. auditAction(item) {
  188. this.audit_form.id = item.id;
  189. this.audit_form.audit_status = 1;
  190. this.audit_form.faid_reason = '';
  191. this.dialogVisible = true;
  192. },
  193. subAudit() {
  194. if (this.audit_form.audit_status == 2 && !this.audit_form.faid_reason) {
  195. this.$message.error('请输入驳回理由');
  196. return false;
  197. }
  198. this.dialogLoading = true;
  199. let url = 'business-bonus/apply/audit';
  200. let params = this.audit_form;
  201. let self = this;
  202. request({
  203. params: {
  204. r: url,
  205. },
  206. method: 'post',
  207. data: params
  208. }).then(e => {
  209. self.dialogLoading = false;
  210. if (e.data.code == 0) {
  211. self.$message.success(e.data.msg);
  212. self.getList();
  213. self.dialogVisible = false;
  214. } else {
  215. self.$message.error(e.data.msg);
  216. }
  217. }).catch(e => {
  218. self.dialogLoading = false;
  219. console.log(e);
  220. });
  221. },
  222. pagination(currentPage) {
  223. let self = this;
  224. self.page = currentPage;
  225. self.getList(this.searchForm);
  226. },
  227. search() {// 清空查询条件
  228. this.page = 1;
  229. this.getList(this.searchForm);
  230. },
  231. resetSearch() {// 清空查询条件
  232. this.searchForm = {
  233. user_id: null,
  234. nickname: null,
  235. business_bonus_level: null,
  236. audit_status: null,
  237. apply_time: null
  238. };
  239. this.page = 1;
  240. this.getList();
  241. },
  242. switchFun(val, id, field) {
  243. if (field == 'status') {
  244. let param = {id: id, status: val};
  245. this.send('business-bonus/default/handle',param)
  246. }
  247. },
  248. handle(type, data = null) {
  249. let id = data ? parseInt(data.id) : '';
  250. switch (type) {
  251. case 'edit':
  252. let params = {
  253. r: 'business-bonus/default/edit'
  254. };
  255. if (id) params = Object.assign(params, {
  256. id: id
  257. });
  258. navigateTo(params);
  259. break;
  260. case 'destroy':
  261. param = {id: data.id,status: -1};
  262. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send('business-bonus/default/handle',param)})
  263. break;
  264. }
  265. },
  266. send(url, params, callback = null) {
  267. let self = this;
  268. request({
  269. params: {
  270. r: url,
  271. },
  272. method: 'post',
  273. data: params
  274. }).then(e => {
  275. if (e.data.code == 0) {
  276. self.$message.success(e.data.msg);
  277. self.getList();
  278. } else {
  279. self.$message.error(e.data.msg);
  280. }
  281. }).catch(e => {
  282. console.log(e);
  283. });
  284. if(callback) return e.data;
  285. },
  286. getList(search = {}) {
  287. let self = this;
  288. self.loading = true;
  289. let basic_params = {
  290. page: self.page,
  291. };
  292. let params = Object.assign(basic_params, search);
  293. request({
  294. params: {
  295. r: 'business-bonus/apply/index'
  296. },
  297. method: 'post',
  298. data: params
  299. }).then(e => {
  300. self.loading = false;
  301. if (e.data.code == 0) {
  302. self.list = e.data.data.page_data.list;
  303. self.pageCount = e.data.data.page_data.page_count;
  304. } else {
  305. self.$message.error(e.data.msg);
  306. }
  307. }).catch(e => {
  308. self.loading = false;
  309. });
  310. },
  311. getBusinessBonusLevel()
  312. {
  313. let self = this;
  314. request({
  315. params: {
  316. r: 'business-bonus/default/business-bonus-level'
  317. },
  318. method: 'post',
  319. data: {}
  320. }).then(e => {
  321. if (e.data.code == 0) {
  322. self.level_list = e.data.data.level_list;
  323. console.log(e)
  324. } else {
  325. self.$message.error(e.data.msg);
  326. }
  327. }).catch(e => {
  328. });
  329. }
  330. }
  331. });
  332. </script>
  333. <style>
  334. .el-tabs__header {
  335. font-size: 16px;
  336. }
  337. .table-body {
  338. padding: 20px;
  339. background-color: #fff;
  340. }
  341. .table-body .el-button {
  342. padding: 0 !important;
  343. border: 0;
  344. margin: 0 5px;
  345. }
  346. .input-item {
  347. width: 250px;
  348. margin: 0 0 20px;
  349. display: inline-block;
  350. }
  351. .input-item .el-input__inner {
  352. border-right: 0;
  353. }
  354. .input-item .el-input__inner:hover {
  355. border: 1px solid #dcdfe6;
  356. border-right: 0;
  357. outline: 0;
  358. }
  359. .input-item .el-input__inner:focus {
  360. border: 1px solid #dcdfe6;
  361. border-right: 0;
  362. outline: 0;
  363. }
  364. .input-item .el-input-group__append {
  365. background-color: #fff;
  366. border-left: 0;
  367. width: 10%;
  368. padding: 0;
  369. }
  370. .input-item .el-input-group__append .el-button {
  371. padding: 0;
  372. }
  373. .input-item .el-input-group__append .el-button {
  374. margin: 0;
  375. }
  376. .batch {
  377. margin: 0 0 20px;
  378. display: inline-block;
  379. }
  380. .batch .el-button {
  381. padding: 9px 15px !important;
  382. }
  383. .el-table th>.cell{
  384. color: #333;
  385. font-weight: bold;
  386. font-size: 14px;
  387. }
  388. .el-table__footer-wrapper, .el-table__header-wrapper{
  389. border-bottom: 1.4px solid #D6D6D6;
  390. }
  391. .search-box {
  392. padding: 10px 0 0 10px;
  393. background-color: #fff;
  394. margin-bottom: 10px;
  395. }
  396. </style>