message-publish.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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 v-model="filter.way" size="small" class="select" placeholder="请选择">
  12. <el-option v-for="item in statusList" :key="item.value" :label="item.name" :value="item.value">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. </div>
  17. <div class="btn-box">
  18. <button class="search" @click="search">筛选</button>
  19. <button class="reset" @click="reset">重置</button>
  20. </div>
  21. </div>
  22. <el-table :data="list" class="table no-border-table" ref="table" :header-cell-style="{
  23. border: 'none',
  24. color: '#333',
  25. background: '#f6f6f6',
  26. borderBottom: '1px solid #E8E8E8',
  27. height: '54px',
  28. }" :row-style="{
  29. height: '54px',
  30. }">
  31. <el-table-column prop="uid" align="center" label="发布人ID"></el-table-column>
  32. <el-table-column prop="subject" align="center" label="主题"></el-table-column>
  33. <el-table-column prop="phone" align="center" label="联系电话"></el-table-column>
  34. <el-table-column prop="status" align="center" label="状态">
  35. <div slot-scope="scope">
  36. {{ statusMap[scope.row.way]}}
  37. </div>
  38. </el-table-column>
  39. <el-table-column label="操作" align="center" width="180">
  40. <div slot-scope="scope" style="display: flex; justify-content: center">
  41. <button size="mini" class="table-btn" @click="handleDelete(scope.row.id)" v-if="scope.row.way !== 1">
  42. 删除
  43. </button>
  44. <button size="mini" class="table-btn" @click="handlePass(scope.row.id)" v-if="scope.row.way === 1">
  45. 通过
  46. </button>
  47. <button size="mini" class="table-btn" @click="rejectModal(scope.row.id)" v-if="scope.row.way === 1">
  48. 驳回
  49. </button>
  50. <button size="mini" class="table-btn" @click="toDetail(scope.row.id)">
  51. 详情
  52. </button>
  53. </div>
  54. </el-table-column>
  55. </el-table>
  56. </div>
  57. <!-- 分页按钮 -->
  58. <div class="footer">
  59. <el-pagination @current-change="handleCurrentChange" :current-page.sync="currentPage" background
  60. layout="total, prev, pager, next, jumper" :page-size="size" :total="total"></el-pagination>
  61. </div>
  62. <el-dialog title="确认驳回该订单吗?" width="450px" :visible.sync="rejectVisible">
  63. <div class="reject-title"><span>*</span>请填写驳回理由</div>
  64. <div style="padding: 0 16px">
  65. <div class="remark-box">
  66. <textarea rows="8" class="remark" v-model="remark" placeholder="驳回理由"></textarea>
  67. </div>
  68. </div>
  69. <div slot="footer" class="dialog-footer">
  70. <!-- <el-button @click.native="reject()" class="cancel-btn">驳 回</el-button> -->
  71. <el-button @click.native="rejectVisible = false" class="cancel-btn btn">取 消</el-button>
  72. <el-button type="primary" @click.native="handleReject" class="confirm-btn btn">确 定</el-button>
  73. </div>
  74. </el-dialog>
  75. </div>
  76. </div>
  77. </template>
  78. <script type="text/ecmascript-6">
  79. import Header from '../../components/common/header';
  80. export default {
  81. components: {
  82. Header
  83. },
  84. name: 'balanceExamine',
  85. data() {
  86. return {
  87. currentPage: 1, // 当前页码
  88. size: 20, // 每页条数
  89. total: 0, // 总页数
  90. loading: 0, // 加载中
  91. title: {
  92. // 页面标题
  93. firstTitile: '消息管理',
  94. secondTitle: '消息管理'
  95. },
  96. filter: {
  97. way: -1
  98. },
  99. statusList: [
  100. {
  101. name: '全部',
  102. value: -1
  103. },
  104. {
  105. name: '审核中',
  106. value: 1
  107. },
  108. {
  109. name: '已通过',
  110. value: 2
  111. }
  112. ],
  113. statusMap: {
  114. 1: '审核中',
  115. 2: '已通过'
  116. },
  117. list: [], // 用户列表
  118. rejectVisible: false,
  119. id: null,
  120. remark: ''
  121. };
  122. },
  123. mounted() {
  124. // 获取列表
  125. this.getList();
  126. },
  127. computed: {},
  128. methods: {
  129. // 切换页码
  130. handleCurrentChange(page) {
  131. this.currentPage = page;
  132. this.getList();
  133. },
  134. // 获取列表
  135. getList() {
  136. this.loading++;
  137. this.httpGet(this.$root.getMessageList, {
  138. page: this.currentPage,
  139. size: this.size,
  140. ...this.filter
  141. }).then(
  142. (res) => {
  143. this.loading--;
  144. this.list = res.list;
  145. this.total = res.total;
  146. },
  147. (res) => {
  148. this.loading--;
  149. this.$message.error(res);
  150. }
  151. );
  152. },
  153. // 过滤
  154. search() {
  155. this.currentPage = 1;
  156. this.getList();
  157. },
  158. // 重置过滤
  159. reset() {
  160. this.filter = {
  161. way: -1
  162. };
  163. this.getList();
  164. },
  165. handleDelete(id) {
  166. this.$confirm(
  167. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要删除吗?</p>`,
  168. {
  169. confirmButtonText: '确定',
  170. cancelButtonText: '取消',
  171. cancelButtonClass: 'cancel-btn',
  172. confirmButtonClass: 'confirm-btn',
  173. customClass: 'confirm-box',
  174. dangerouslyUseHTMLString: true,
  175. showClose: false,
  176. type: 'none'
  177. }
  178. ).then(() => {
  179. this.loading++;
  180. this.httpDelete(this.$root.deleteMessage, {
  181. id
  182. }).then(
  183. (res) => {
  184. this.$message({
  185. message: '操作成功',
  186. type: 'success'
  187. });
  188. this.loading--;
  189. this.getList();
  190. },
  191. (res) => {
  192. this.loading--;
  193. this.$message.error(res);
  194. }
  195. );
  196. });
  197. },
  198. handlePass(id) {
  199. this.$confirm(
  200. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要通过吗?</p>`,
  201. {
  202. confirmButtonText: '确定',
  203. cancelButtonText: '取消',
  204. cancelButtonClass: 'cancel-btn',
  205. confirmButtonClass: 'confirm-btn',
  206. customClass: 'confirm-box',
  207. dangerouslyUseHTMLString: true,
  208. showClose: false,
  209. type: 'none'
  210. }
  211. ).then(() => {
  212. this.loading++;
  213. this.httpPut(this.$root.passMessage, {
  214. id
  215. }).then(
  216. (res) => {
  217. this.$message({
  218. message: '操作成功',
  219. type: 'success'
  220. });
  221. this.loading--;
  222. this.getList();
  223. },
  224. (res) => {
  225. this.loading--;
  226. this.$message.error(res);
  227. }
  228. );
  229. });
  230. },
  231. rejectModal(id) {
  232. this.rejectVisible = true;
  233. this.id = id;
  234. },
  235. handleReject() {
  236. this.loading++;
  237. this.httpPut(this.$root.refuseMessage, {
  238. id: this.id,
  239. remark: this.remark
  240. }).then(
  241. (res) => {
  242. this.rejectVisible = false;
  243. this.$message({
  244. message: '操作成功',
  245. type: 'success'
  246. });
  247. this.loading--;
  248. this.getList();
  249. },
  250. (res) => {
  251. this.loading--;
  252. this.$message.error(res);
  253. }
  254. );
  255. },
  256. toDetail(id) {
  257. this.$router.push({
  258. name: 'messageDetail',
  259. query: {
  260. id
  261. }
  262. });
  263. }
  264. }
  265. };
  266. </script>
  267. <style lang="stylus" rel="stylesheet/stylus">
  268. @import '~assets/public.styl';
  269. </style>
  270. <style lang="stylus" rel="stylesheet/stylus" scoped>
  271. @import '~assets/main.styl';
  272. .page-box {
  273. height: 100%;
  274. width: 100%;
  275. flex-y(flex-start, flex-start);
  276. overflow-y: hidden;
  277. background: bg-color;
  278. .container {
  279. box-sizing: border-box;
  280. height: 100%;
  281. width: 100%;
  282. overflow-y: auto;
  283. flex-y(flex-start, flex-start);
  284. padding: 10px;
  285. // content 表格
  286. .content {
  287. flex: 1;
  288. width: 100%;
  289. font-size: 14px;
  290. background: white;
  291. box-sizing: border-box;
  292. padding: 24px 32px;
  293. border-radius: 2px;
  294. // 按钮
  295. .btn {
  296. width: 100px;
  297. height: 32px;
  298. line-height: 32px;
  299. confirm-btn();
  300. font-size: 14px;
  301. margin: 16px 0;
  302. }
  303. // 表格按钮
  304. .table-btn {
  305. // width: 65px;
  306. height: 24px;
  307. line-height: 24px;
  308. color: gray3;
  309. font-size: 12px;
  310. margin-right: 8px;
  311. cancel-btn();
  312. padding: 0 8px;
  313. }
  314. .filter-item {
  315. margin-right: 12px;
  316. }
  317. .select, .input {
  318. width: 125px;
  319. }
  320. .date-input {
  321. width: 360px;
  322. }
  323. .btn-box {
  324. margin: 0;
  325. }
  326. .table {
  327. margin-top: 24px !important;
  328. }
  329. .table-img {
  330. height: 32px;
  331. width: 32px;
  332. border-radius: 4px;
  333. object-fit: fill;
  334. }
  335. }
  336. }
  337. .footer {
  338. width: 100%;
  339. padding: 24px;
  340. box-sizing: border-box;
  341. flex-x(flex-end);
  342. background: white;
  343. }
  344. .dialog-content {
  345. flex-y();
  346. }
  347. .form {
  348. width: 100%;
  349. flex-center();
  350. margin: 8px 0;
  351. }
  352. .reject-title {
  353. border-top: 1px solid #eee;
  354. padding: 12px 13px 0;
  355. word(14px, #666);
  356. span {
  357. color: #FD4545;
  358. display: inline-block;
  359. width: 15px;
  360. }
  361. }
  362. .remark-box {
  363. width: 100%;
  364. padding-left: 15px;
  365. box-sizing: border-box;
  366. }
  367. .remark {
  368. border: 1px solid #f1f1f1;
  369. width: 100%;
  370. margin: 12px 0;
  371. padding: 12px;
  372. box-sizing: border-box;
  373. }
  374. }
  375. </style>