business-apply.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <template>
  2. <div class="page-box" v-loading="loading > 0">
  3. <Header :title="title"></Header>
  4. <div class="container">
  5. <div class="content">
  6. <!-- 表格 -->
  7. <div class="filter-box">
  8. <div class="filter">
  9. <div class="filter-item">
  10. <div class="label">审核状态:</div>
  11. <el-select
  12. v-model="filter.status"
  13. size="small"
  14. class="select"
  15. placeholder="请选择"
  16. >
  17. <el-option
  18. v-for="item in statusType"
  19. :key="item.value"
  20. :label="item.name"
  21. :value="item.value"
  22. >
  23. </el-option>
  24. </el-select>
  25. </div>
  26. <div class="filter-item">
  27. <div class="label">审核状态:</div>
  28. <el-select
  29. v-model="filter.status"
  30. size="small"
  31. class="select"
  32. placeholder="请选择"
  33. >
  34. <el-option
  35. v-for="item in statusType2"
  36. :key="item.value"
  37. :label="item.name"
  38. :value="item.value"
  39. >
  40. </el-option>
  41. </el-select>
  42. </div>
  43. </div>
  44. <div class="btn-box">
  45. <button class="search" @click="search">筛选</button>
  46. <button class="reset" @click="reset">重置</button>
  47. </div>
  48. </div>
  49. <el-table
  50. :data="list"
  51. class="table no-border-table"
  52. ref="table"
  53. :header-cell-style="{
  54. border: 'none',
  55. color: '#333',
  56. background: '#f6f6f6',
  57. borderBottom: '1px solid #E8E8E8',
  58. height: '54px',
  59. }"
  60. :row-style="{
  61. height: '54px',
  62. }"
  63. >
  64. <el-table-column prop="shopIcon" align="center" label="商家图片">
  65. <div slot-scope="scope">
  66. <img class="table-img" :src="scope.row.shopIcon" alt="" />
  67. </div>
  68. </el-table-column>
  69. <el-table-column
  70. prop="uid"
  71. align="center"
  72. label="用户ID"
  73. ></el-table-column>
  74. <el-table-column
  75. prop="shopName"
  76. align="center"
  77. label="店铺名称"
  78. ></el-table-column>
  79. <el-table-column
  80. prop="shopPhone"
  81. align="center"
  82. label="联系电话"
  83. ></el-table-column>
  84. <el-table-column prop="created" align="center" label="详细地址">
  85. <div slot-scope="scope">
  86. {{ scope.row.shopAddress + scope.row.house }}
  87. </div>
  88. </el-table-column>
  89. <el-table-column prop="amount" align="center" label="商家状态">
  90. <div slot-scope="scope">
  91. {{ statusMap[scope.row.status] }}
  92. </div>
  93. </el-table-column>
  94. <el-table-column prop="amount" align="center" label="线上售货">
  95. <div slot-scope="scope">
  96. {{ statusMap2[scope.row.status] }}
  97. </div>
  98. </el-table-column>
  99. <el-table-column
  100. prop="created"
  101. align="center"
  102. label="审核操作时间"
  103. ></el-table-column>
  104. <el-table-column label="操作" align="center" width="180">
  105. <div
  106. slot-scope="scope"
  107. style="display: flex; justify-content: center"
  108. >
  109. <button
  110. size="mini"
  111. class="table-btn"
  112. v-if="scope.row.status === 1"
  113. @click="handleResolve(scope.row.id)"
  114. >
  115. 通过
  116. </button>
  117. <button
  118. size="mini"
  119. class="table-btn"
  120. v-if="scope.row.status === 1"
  121. @click="handleReject(scope.row.id)"
  122. >
  123. 驳回
  124. </button>
  125. <button
  126. size="mini"
  127. class="table-btn"
  128. @click="toDetail(scope.row.id)"
  129. >
  130. 详情
  131. </button>
  132. </div>
  133. </el-table-column>
  134. </el-table>
  135. </div>
  136. <!-- 分页按钮 -->
  137. <div class="footer">
  138. <el-pagination
  139. @current-change="handleCurrentChange"
  140. :current-page.sync="currentPage"
  141. background
  142. layout="total, prev, pager, next, jumper"
  143. :page-size="size"
  144. :total="total"
  145. ></el-pagination>
  146. </div>
  147. </div>
  148. <el-dialog
  149. title="确认驳回该订单吗?"
  150. width="450px"
  151. :visible.sync="rejectVisible"
  152. >
  153. <div class="reject-title"><span>*</span>请填写驳回理由</div>
  154. <div style="padding: 0 16px">
  155. <div class="remark-box">
  156. <textarea
  157. rows="8"
  158. class="remark"
  159. v-model="remark"
  160. placeholder="驳回理由"
  161. ></textarea>
  162. </div>
  163. </div>
  164. <div slot="footer" class="dialog-footer">
  165. <!-- <el-button @click.native="reject()" class="cancel-btn">驳 回</el-button> -->
  166. <el-button @click.native="rejectVisible = false" class="cancel-btn btn"
  167. >取 消</el-button
  168. >
  169. <el-button
  170. type="primary"
  171. @click.native="handleReject"
  172. class="confirm-btn btn"
  173. >确 定</el-button
  174. >
  175. </div>
  176. </el-dialog>
  177. </div>
  178. </template>
  179. <script type="text/ecmascript-6">
  180. import Header from '../../components/common/header';
  181. export default {
  182. components: {
  183. Header
  184. },
  185. name: 'balanceExamine',
  186. data() {
  187. return {
  188. currentPage: 1, // 当前页码
  189. size: 20, // 每页条数
  190. total: 0, // 总页数
  191. loading: 0, // 加载中
  192. title: {
  193. // 页面标题
  194. firstTitile: '用户管理',
  195. secondTitle: '商家申请管理'
  196. },
  197. filter: {
  198. status: 0
  199. },
  200. statusType: [
  201. {
  202. name: '全部',
  203. value: 0
  204. },
  205. {
  206. name: '待审核',
  207. value: 1
  208. },
  209. {
  210. name: '审核通过',
  211. value: 2
  212. },
  213. {
  214. name: '审核拒绝',
  215. value: 3
  216. }
  217. ],
  218. statusType2: [
  219. {
  220. name: '全部',
  221. value: 0
  222. },
  223. {
  224. name: '未开通',
  225. value: 1
  226. },
  227. {
  228. name: '待审核',
  229. value: 2
  230. },
  231. {
  232. name: '已开通',
  233. value: 3
  234. }
  235. ],
  236. statusMap: {
  237. 1: '待审核',
  238. 2: '审核通过',
  239. 3: '审核拒绝'
  240. },
  241. statusMap2: {
  242. 1: '未开通',
  243. 2: '待审核',
  244. 3: '已开通'
  245. },
  246. roleMap: {
  247. 0: '消费者',
  248. 1: 'VIP',
  249. 2: '区级代理',
  250. 3: '市级代理',
  251. 4: '省级代理',
  252. 5: '运营中心',
  253. 6: '分公司'
  254. },
  255. list: [], // 用户列表
  256. id: null,
  257. rejectVisible: false,
  258. remark: ''
  259. };
  260. },
  261. mounted() {
  262. // 获取列表
  263. this.getList();
  264. },
  265. computed: {},
  266. methods: {
  267. // 切换页码
  268. handleCurrentChange(page) {
  269. this.currentPage = page;
  270. this.getList();
  271. },
  272. // 获取列表
  273. getList() {
  274. this.loading++;
  275. this.httpGet(this.$root.getBusinessApplyList, {
  276. page: this.currentPage,
  277. size: this.size,
  278. ...this.filter
  279. }).then(
  280. (res) => {
  281. this.loading--;
  282. this.list = res.list;
  283. this.total = res.total;
  284. },
  285. (res) => {
  286. this.loading--;
  287. this.$message.error(res);
  288. }
  289. );
  290. },
  291. // 过滤
  292. search() {
  293. this.currentPage = 1;
  294. this.getList();
  295. },
  296. // 重置过滤
  297. reset() {
  298. this.filter = {
  299. status: 0
  300. };
  301. this.getList();
  302. },
  303. handleResolve(id) {
  304. this.$confirm(
  305. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要通过该审核吗?</p>`,
  306. {
  307. confirmButtonText: '确定',
  308. cancelButtonText: '取消',
  309. cancelButtonClass: 'cancel-btn',
  310. confirmButtonClass: 'confirm-btn',
  311. customClass: 'confirm-box',
  312. dangerouslyUseHTMLString: true,
  313. showClose: false,
  314. type: 'none'
  315. }
  316. ).then(() => {
  317. this.loading++;
  318. this.httpPut(this.$root.businessApplyResolve, {
  319. id
  320. }).then(
  321. (res) => {
  322. this.$message({
  323. message: '操作成功',
  324. type: 'success'
  325. });
  326. this.loading--;
  327. this.getList();
  328. },
  329. (res) => {
  330. this.loading--;
  331. this.$message.error(res);
  332. }
  333. );
  334. });
  335. },
  336. handleReject(id) {
  337. this.$confirm(
  338. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要驳回该审核吗?</p>`,
  339. {
  340. confirmButtonText: '确定',
  341. cancelButtonText: '取消',
  342. cancelButtonClass: 'cancel-btn',
  343. confirmButtonClass: 'confirm-btn',
  344. customClass: 'confirm-box',
  345. dangerouslyUseHTMLString: true,
  346. showClose: false,
  347. type: 'none'
  348. }
  349. ).then(() => {
  350. this.loading++;
  351. this.httpPut(this.$root.businessApplyReject, {
  352. id
  353. }).then(
  354. (res) => {
  355. this.$message({
  356. message: '操作成功',
  357. type: 'success'
  358. });
  359. this.loading--;
  360. this.getList();
  361. },
  362. (res) => {
  363. this.loading--;
  364. this.$message.error(res);
  365. }
  366. );
  367. });
  368. },
  369. // rejectModal(id) {
  370. // this.id = id;
  371. // this.rejectVisible = true;
  372. // },
  373. // handleReject() {
  374. // this.loading++;
  375. // this.httpPut(this.$root.yyzxReject, {
  376. // id: this.id,
  377. // remark: this.remark
  378. // }).then(
  379. // (res) => {
  380. // this.$message({
  381. // message: '操作成功',
  382. // type: 'success'
  383. // });
  384. // this.loading--;
  385. // this.rejectVisible = false;
  386. // this.getList();
  387. // },
  388. // (res) => {
  389. // this.loading--;
  390. // this.$message.error(res);
  391. // }
  392. // );
  393. // },
  394. toDetail(id) {
  395. this.$router.push({
  396. name: 'applyDetail',
  397. query: {
  398. id
  399. }
  400. });
  401. }
  402. }
  403. };
  404. </script>
  405. <style lang="stylus" rel="stylesheet/stylus">
  406. @import '~assets/public.styl';
  407. </style>
  408. <style lang="stylus" rel="stylesheet/stylus" scoped>
  409. @import '~assets/main.styl';
  410. .page-box {
  411. height: 100%;
  412. width: 100%;
  413. flex-y(flex-start, flex-start);
  414. overflow-y: hidden;
  415. background: bg-color;
  416. .container {
  417. box-sizing: border-box;
  418. height: 100%;
  419. width: 100%;
  420. overflow-y: auto;
  421. flex-y(flex-start, flex-start);
  422. padding: 10px;
  423. // content 表格
  424. .content {
  425. flex: 1;
  426. width: 100%;
  427. font-size: 14px;
  428. background: white;
  429. box-sizing: border-box;
  430. padding: 24px 32px;
  431. border-radius: 2px;
  432. // 按钮
  433. .btn {
  434. width: 100px;
  435. height: 32px;
  436. line-height: 32px;
  437. confirm-btn();
  438. font-size: 14px;
  439. margin: 16px 0;
  440. }
  441. // 表格按钮
  442. .table-btn {
  443. // width: 65px;
  444. height: 24px;
  445. line-height: 24px;
  446. color: gray3;
  447. font-size: 12px;
  448. margin-right: 8px;
  449. cancel-btn();
  450. padding: 0 8px;
  451. }
  452. .filter-item {
  453. margin-right: 12px;
  454. }
  455. .select, .input {
  456. width: 150px;
  457. }
  458. .date-input {
  459. width: 360px;
  460. }
  461. .btn-box {
  462. margin: 0;
  463. }
  464. .table {
  465. margin-top: 24px !important;
  466. }
  467. .table-img {
  468. height: 32px;
  469. width: 32px;
  470. border-radius: 4px;
  471. object-fit: fill;
  472. }
  473. }
  474. }
  475. .footer {
  476. width: 100%;
  477. padding: 24px;
  478. box-sizing: border-box;
  479. flex-x(flex-end);
  480. background: white;
  481. }
  482. .dialog-content {
  483. flex-y();
  484. }
  485. .form {
  486. width: 100%;
  487. flex-center();
  488. margin: 8px 0;
  489. }
  490. .reject-title {
  491. border-top: 1px solid #eee;
  492. padding: 12px 13px 0;
  493. word(14px, #666);
  494. span {
  495. color: #FD4545;
  496. display: inline-block;
  497. width: 15px;
  498. }
  499. }
  500. .remark-box {
  501. width: 100%;
  502. padding-left: 15px;
  503. box-sizing: border-box;
  504. }
  505. .remark {
  506. border: 1px solid #f1f1f1;
  507. width: 100%;
  508. margin: 12px 0;
  509. padding: 12px;
  510. box-sizing: border-box;
  511. }
  512. }
  513. </style>