index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-share-pop');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <!-- <div slot="header">
  8. <span>商户列表</span>
  9. <el-button type="primary" size="small" style="padding: 9px 15px !important; float: right; position: relative; bottom: 8px;" @click="addStore">添加商户</el-button>
  10. </div> -->
  11. <div class="table-body">
  12. <div style="padding-bottom: 20px;">
  13. <div class="flex">
  14. <div class="flex" style="margin-right: 20px;">
  15. <div class="input-title" style="flex-shrink: 0;">商户名称</div>
  16. <el-input size="small" style="width: 130px;" placeholder="请输入商户名称" v-model="searchData.store_name"> </el-input>
  17. </div>
  18. <div class="flex" style="margin-right: 20px;">
  19. <div class="input-title" style="flex-shrink: 0;">店长</div>
  20. <el-input size="small" style="width: 130px;" placeholder="请输入店长姓名" v-model="searchData.storeowner">
  21. </el-input>
  22. </div>
  23. <div class="flex" style="margin-right: 20px;">
  24. <div class="input-title" style="flex-shrink: 0;">绑定会员</div>
  25. <el-input size="small" style="width: 130px;" placeholder="请输入会员名称" v-model="searchData.nickname">
  26. </el-input>
  27. </div>
  28. <div class="item-box" flex="dir:left cross:center">
  29. <div class="label">商户分类</div>
  30. <el-select v-model="searchData.cate_id" @change='searchs' class="select" size="small" style="width: 130px;">
  31. <el-option :key="0" label="所有分类" :value="0"></el-option>
  32. <el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in categorys"></el-option>
  33. </el-select>
  34. </div>
  35. <!-- <div class="item-box" flex="dir:left cross:center">
  36. <div class="label">审核状态</div>
  37. <el-select v-model="searchData.status" @change='searchs' class="select" size="small" style="width: 130px;">
  38. <el-option :key="0" label="全部" :value="0"></el-option>
  39. <el-option :key="1" label="待审核" :value="1"></el-option>
  40. <el-option :key="2" label="未通过" :value="2"></el-option>
  41. </el-select>
  42. </div> -->
  43. <el-button style="padding: 9px 15px !important;" size="small" type="primary" @click="searchs">搜索</el-button>
  44. <el-button type="warning" @click="clereSearch" v-if="searchData.store_name || searchData.storeowner || searchData.nickname || searchData.cate_id || searchData.status" style="padding: 9px 15px !important;">清除搜索条件</el-button>
  45. </div>
  46. </div>
  47. <el-tabs type="card" v-model="activityTab" @tab-click="handleTabClick">
  48. <el-tab-pane label="待审核" name="waiting-audit"> </el-tab-pane>
  49. <el-tab-pane label="未通过" name="reject"> </el-tab-pane>
  50. </el-tabs>
  51. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px; width: 100%">
  52. <el-table-column label="商户名称" width="200" prop="store_name">
  53. <template slot-scope="scope">
  54. <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.logo_img"></com-image>
  55. <div>{{scope.row.store_name}}</div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="商户分类" prop="category" width="100" align="center">
  59. <template slot-scope="scope">
  60. <div>{{scope.row.category}}</div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="商户地址" prop="store_address" width="280" align="center">
  64. <template slot-scope="scope">
  65. <div>{{scope.row.store_address}}</div>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="会员" width="150" align="center">
  69. <template slot-scope="scope">
  70. <com-image style="float: left;margin-right: 5px;" mode="aspectFill" :src="scope.row.avatar_url"></com-image>
  71. <div>{{scope.row.nickname}}</div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="店长姓名" prop="shop_owner" width="150" align="center">
  75. <template slot-scope="scope">
  76. <div>{{scope.row.shop_owner}}</div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="营业执照" prop="license_img" width="150" align="center" v-if="upload_license_image==1">
  80. <template slot-scope="scope">
  81. <el-popover placement="right" trigger="hover">
  82. <div class="from_img2">
  83. <img style="width: 100%;" :src="scope.row.license_img" alt="">
  84. </div>
  85. <div class="preview_img" slot="reference">
  86. <img style="width: 100%;" :src="scope.row.license_img" alt="">
  87. </div>
  88. </el-popover>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="审核状态" prop="check_status" width="100" align="center">
  92. <template slot-scope="scope">
  93. <div>
  94. <span>{{auditStatus[scope.row.check_status]}}</span>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="创建时间" prop="user_count" width="200" align="center">
  99. <template slot-scope="scope">
  100. <div>
  101. {{scope.row.created_at | dateTimeFormat('Y-m-d H:i:s')}}
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="操作" style="width: 180px;" fixed="right" align="center">
  106. <template slot-scope="scope">
  107. <template v-if="scope.row.check_status==1">
  108. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'adopt')">通过</el-button>
  109. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'reject')">不通过</el-button>
  110. </template>
  111. <template v-if="scope.row.check_status==2">
  112. <el-button type="text" size="small" @click="switchStatus(scope.$index, 'adopt')">通过</el-button>
  113. </template>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <div style="text-align: right;margin: 20px 0;">
  118. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  119. </div>
  120. </div>
  121. </el-card>
  122. </div>
  123. <script>
  124. const app = new Vue({
  125. el: '#app',
  126. data: {
  127. searchData: {
  128. cate_id: 0,
  129. nickname: '',
  130. storeowner: '',
  131. store_name: '',
  132. // status: 0,
  133. },
  134. activityTab: 'waiting-audit',
  135. currPage: 1,
  136. pageCount: 0,
  137. loading: false,
  138. list: [],
  139. dialogLoading: false,
  140. // exportList: [],
  141. categorys: [],
  142. auditStatus: {
  143. 1: '待审核',
  144. 2: '未通过',
  145. },
  146. store_login_url: '', // 商户登录 url
  147. shareData: {
  148. url: "", //链接
  149. img: "", //二维码
  150. qrcode_filename: '', // 二维码文件名
  151. },
  152. upload_license_image:<?= $upload_license_image ?>
  153. },
  154. mounted() {
  155. this.loadData();
  156. },
  157. methods: {
  158. searchs() {
  159. this.currPage = 1;
  160. this.loadData();
  161. },
  162. clereSearch() {
  163. this.searchData.cate_id = 0;
  164. this.searchData.nickname = '';
  165. this.searchData.storeowner = '';
  166. this.searchData.store_name = '';
  167. // this.searchData.status = 0;
  168. this.currPage = 1;
  169. this.loadData();
  170. },
  171. // 标签页切换
  172. handleTabClick(e) {
  173. this.loadData();
  174. },
  175. loadData() {
  176. this.loading = true;
  177. request({
  178. params: {
  179. r: 'mch/store-audit/index',
  180. page: this.currPage,
  181. tabname: this.activityTab,
  182. ...this.searchData,
  183. },
  184. method: 'get',
  185. }).then(e => {
  186. this.loading = false;
  187. if (e.data.code == 0) {
  188. this.list = e.data.data.list;
  189. this.pageCount = e.data.data.page_count;
  190. // this.exportList = e.data.data.export_list;
  191. // this.edit_status = e.data.data.edit_status;
  192. this.categorys = e.data.data.cate_list;
  193. } else {
  194. this.$message.error(e.data.msg);
  195. }
  196. }).catch(e => {
  197. this.loading = false;
  198. });
  199. },
  200. pagination(currentPage) {
  201. let self = this;
  202. self.currPage = currentPage;
  203. self.loadData();
  204. },
  205. // 操作
  206. switchStatus(index, action) {
  207. let self = this;
  208. self.loading = true;
  209. if ('adopt' == action) {
  210. let params = {
  211. id: self.list[index].id,
  212. action: action,
  213. };
  214. this.switchRequest(index, params);
  215. } else {
  216. self.$prompt('不通过原因', '审核', {
  217. confirmButtonText: '确定',
  218. cancelButtonText: '取消',
  219. }).then(({
  220. value
  221. }) => {
  222. if (!value) {
  223. self.loading = false;
  224. self.$message.error('驳回原因不能为空');
  225. return false;
  226. }
  227. let params = {
  228. id: self.list[index].id,
  229. action: action,
  230. check_remark: value,
  231. };
  232. this.switchRequest(index, params);
  233. }).catch(() => {
  234. self.loading = false;
  235. console.log('取消驳回审核');
  236. });
  237. }
  238. },
  239. switchRequest(index, params) {
  240. let self = this;
  241. request({
  242. params: {
  243. r: 'mch/store-audit/audit'
  244. },
  245. method: 'post',
  246. data: params,
  247. }).then(e => {
  248. self.loading = false;
  249. if (e.data.code == 0) {
  250. self.list.splice(index, 1);
  251. } else {
  252. self.$message.error(e.data.msg);
  253. return false;
  254. }
  255. }).catch(e => {
  256. self.loading = false;
  257. console.log(e);
  258. self.$message.error('网络错误');
  259. });
  260. },
  261. }
  262. });
  263. </script>
  264. <style>
  265. .el-tabs__header {
  266. font-size: 16px;
  267. }
  268. .table-body {
  269. padding: 20px;
  270. background-color: #fff;
  271. }
  272. .input-item {
  273. width: 250px;
  274. margin-right: 40px;
  275. }
  276. .input-item .el-input__inner {
  277. border-right: 0;
  278. }
  279. .input-item .el-input__inner:hover {
  280. border: 1px solid #dcdfe6;
  281. border-right: 0;
  282. outline: 0;
  283. }
  284. .input-item .el-input__inner:focus {
  285. border: 1px solid #dcdfe6;
  286. border-right: 0;
  287. outline: 0;
  288. }
  289. .input-item .el-input-group__append {
  290. background-color: #fff;
  291. border-left: 0;
  292. width: 10%;
  293. padding: 0;
  294. }
  295. .input-item .el-input-group__append .el-button {
  296. padding: 0;
  297. }
  298. .input-item .el-input-group__append .el-button {
  299. margin: 0;
  300. }
  301. .table-body {
  302. padding: 20px;
  303. background-color: #fff;
  304. }
  305. .table-body .el-button {
  306. padding: 0 !important;
  307. border: 0;
  308. margin: 0 5px;
  309. }
  310. .input-item {
  311. width: 250px;
  312. margin: 0 0 20px;
  313. display: inline-block;
  314. }
  315. .input-item .el-input__inner {
  316. border-right: 0;
  317. }
  318. .input-item .el-input__inner:hover {
  319. border: 1px solid #dcdfe6;
  320. border-right: 0;
  321. outline: 0;
  322. }
  323. .input-item .el-input__inner:focus {
  324. border: 1px solid #dcdfe6;
  325. border-right: 0;
  326. outline: 0;
  327. }
  328. .input-item .el-input-group__append {
  329. background-color: #fff;
  330. border-left: 0;
  331. width: 10%;
  332. padding: 0;
  333. }
  334. .input-item .el-input-group__append .el-button {
  335. padding: 0;
  336. }
  337. .input-item .el-input-group__append .el-button {
  338. margin: 0;
  339. }
  340. .batch {
  341. margin: 0 0 20px;
  342. display: inline-block;
  343. }
  344. .batch .el-button {
  345. padding: 9px 15px !important;
  346. }
  347. .el-table th>.cell {
  348. color: #333;
  349. font-weight: bold;
  350. font-size: 14px;
  351. }
  352. .el-table__footer-wrapper,
  353. .el-table__header-wrapper {
  354. border-bottom: 1.4px solid #D6D6D6;
  355. }
  356. .el-table .el-button {
  357. padding: 0 !important;
  358. border: 0;
  359. margin: 0 5px;
  360. }
  361. #app .copy .el-input-group__append {
  362. background-color: #409EFF;
  363. border-color: #409EFF;
  364. padding: 0 10px;
  365. }
  366. #app .table-body .copybtn {
  367. color: #fff;
  368. padding: 0 30px;
  369. }
  370. .el-alert {
  371. padding: 0;
  372. padding-left: 5px;
  373. padding-bottom: 5px;
  374. }
  375. .el-alert--info .el-alert__description {
  376. color: #606266;
  377. }
  378. .el-alert .el-button {
  379. margin-left: 20px;
  380. }
  381. .el-alert__content {
  382. display: flex;
  383. align-items: center;
  384. }
  385. .table-body .el-alert__title {
  386. margin-top: 5px;
  387. font-weight: 400;
  388. }
  389. .el-table th>.cell {
  390. color: #333;
  391. font-weight: bold;
  392. font-size: 14px;
  393. }
  394. .el-table__footer-wrapper,
  395. .el-table__header-wrapper {
  396. border-bottom: 1.4px solid #D6D6D6;
  397. }
  398. .item-box {
  399. margin-right: 20px;
  400. }
  401. .flex {
  402. display: flex;
  403. align-items: center;
  404. }
  405. .input-title {
  406. margin-right: 15px;
  407. }
  408. .item-box .label {
  409. margin-right: 8px;
  410. }
  411. .com-share-pop {
  412. display: inline-block;
  413. }
  414. </style>