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