reduce-profit.php 14 KB

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