index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div class="container">
  3. <div class="card">
  4. <searchForm :keys="['state']" ref="searchForm"
  5. @on-search="handleSearch">
  6. <el-button type="primary" icon="el-icon-plus" plain size="small" @click="addVoteActivity" >新增</el-button>
  7. </searchForm>
  8. <RxTable
  9. ref="rxTable"
  10. @sizeChange="changePageSize"
  11. @pageChange="changePage"
  12. :currentPage="pageInfo.page"
  13. :pageSize="pageInfo.pageSize"
  14. :page-count="listData.pageQuantity"
  15. :data="listData.list"
  16. :blank-col="true"
  17. :loading="loading"
  18. >
  19. <el-table-column
  20. :align="item.align || 'left'"
  21. :prop="item.prop"
  22. :label="item.label"
  23. :key="item.id"
  24. v-for="(item) in tableHeader"
  25. :show-overflow-tooltip="true"
  26. :width="item.width"
  27. :min-width="item.minWidth"
  28. >
  29. <template slot-scope="scope">
  30. <div v-if="item.prop == 'certificateUrl'">
  31. <el-image fit="fill" :src="scope.row[item.prop]" style="height: 36px;width: 80px;"></el-image>
  32. </div>
  33. <div v-else-if="item.prop == 'state'">
  34. <span style="color:red" v-if="scope.row.state == 2">审核 </span>
  35. <span style="color:green" v-if="scope.row.state == 1">审核通过 </span>
  36. </div>
  37. <span v-else>{{ scope.row[item.prop] || scope.row[item.prop] == 0 ? scope.row[item.prop] : '-' }} </span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="操作" fixed="right" align="left" width="200">
  41. <template slot-scope="scope">
  42. <el-button type="text" class="btn_text_edit" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.state == 2">审核 </el-button>
  43. </template>
  44. </el-table-column>
  45. </RxTable>
  46. </div>
  47. <el-dialog
  48. title="审核"
  49. :visible.sync="dialogVisible"
  50. width="800px"
  51. :lock-scroll="false">
  52. <verify ref="verify"></verify>
  53. <span slot="footer" class="dialog-footer">
  54. <el-button type="success" icon="el-icon-check" @click="handleAduit(1)">通过</el-button>
  55. <el-button type="danger" icon="el-icon-close" @click="handleAduit(2)">不通过</el-button>
  56. </span>
  57. </el-dialog>
  58. </div>
  59. </template>
  60. <script>
  61. import searchForm from "@/components/searchForm";
  62. import RxTable from "@/components/RxTable";
  63. import verify from "./verify";
  64. export default {
  65. name: "index",
  66. components: {
  67. searchForm,
  68. RxTable,
  69. verify
  70. },
  71. data() {
  72. return {
  73. searchParams: {},
  74. loading: false,
  75. dialogVisible: false,
  76. tableHeader: [
  77. {
  78. prop: "certificateNo",
  79. label: "房产证编号",
  80. width: "300"
  81. },
  82. {
  83. prop: "realName",
  84. label: "名称",
  85. width: "300"
  86. },
  87. {
  88. prop: "certificateUrl",
  89. label: "图片",
  90. width: "120"
  91. },
  92. {
  93. prop: "state",
  94. label: "状态",
  95. width: "120"
  96. },
  97. ],
  98. listData: {
  99. list: [],
  100. pageQuantity:0,
  101. },
  102. pageInfo: {
  103. pageNum: 1,
  104. pageCapacity: 10,
  105. },
  106. addVisible: false,
  107. dialogVisibleUpdate: false,
  108. }
  109. },
  110. methods: {
  111. handleAduit(state){
  112. let {passportId,houseId} = this.$refs.verify.form;
  113. let params = {
  114. passportId,
  115. houseId,
  116. state
  117. }
  118. this.$api.verifyHouseRelation(params).then(res => {
  119. console.log(res)
  120. this.$message.success("处理成功!");
  121. this.dialogVisible = false;
  122. this.handleSearch()
  123. })
  124. },
  125. addVoteActivity(){
  126. this.dialogVisible = true;
  127. },
  128. handleInfo(row){
  129. console.log(row)
  130. // this.$router_({
  131. // name:"voteActivityInfo",
  132. // title:"活动详情",
  133. // canClose:true,
  134. // params:{
  135. // ...row
  136. // }
  137. // })
  138. // this.$router.push({
  139. // name:"voteActivityInfo",
  140. // params:{
  141. // activityId:row.activityId
  142. // }
  143. // })
  144. },
  145. handleEdit(row) {
  146. console.log(row)
  147. this.dialogVisible = true;
  148. this.$nextTick(() => {
  149. this.$refs.verify.form = JSON.parse(JSON.stringify(row))
  150. })
  151. // this.$router_({
  152. // name:"audio",
  153. // title:"审核",
  154. // canClose:true,
  155. // params:{
  156. // ...row
  157. // }
  158. // })
  159. },
  160. handleDelete(row){
  161. this.$confirm('确认刪除, 是否继续?', '提示', {
  162. confirmButtonText: '确定',
  163. cancelButtonText: '取消',
  164. type: 'warning'
  165. }).then(() => {
  166. })
  167. },
  168. onSubmit(type="add") {
  169. let form = this.$refs.activityForm.form;
  170. console.log(type)
  171. if(type =="add"){
  172. this.$api.addVoteActivity(form).then(res => {
  173. this.$message.success("新增成功!");
  174. this.dialogVisible = false;
  175. this.handleSearch();
  176. })
  177. }else{
  178. this.$api.editVoteActivity(form).then(res => {
  179. this.$message.success("编辑成功!");
  180. this.dialogVisibleUpdate = false;
  181. this.handleSearch();
  182. })
  183. }
  184. },
  185. goDeleteSelect() {
  186. },
  187. //搜索
  188. handleSearch() {
  189. this.pageInfo.pageNum = 1
  190. this.getHouseRelations()
  191. },
  192. //国家list
  193. getHouseRelations() {
  194. let state = this.$refs.searchForm.form.state;
  195. this.searchParams = {
  196. ...this.pageInfo,
  197. state
  198. }
  199. this.loading = true;
  200. this.$api.getHouseRelations(this.searchParams).then(res => {
  201. this.loading = false;
  202. console.log(res)
  203. this.listData.list = res.content.list;
  204. this.listData.pageQuantity = res.content.pageQuantity;
  205. })
  206. },
  207. changePageSize() {
  208. },
  209. changePage(page) {
  210. this.pageInfo.pageNum = page
  211. this.voteList()
  212. },
  213. },
  214. mounted() {
  215. this.handleSearch()
  216. }
  217. }
  218. </script>
  219. <style lang="less" scoped>
  220. .container {
  221. /*position: relative;*/
  222. .btnBox {
  223. margin-left: 20px;
  224. }
  225. }
  226. </style>