index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="24">
  5. <span>买受人&nbsp;</span>
  6. <el-input v-model="search.buyerName" class="ch-input ch-input-size" placeholder="买受人" size="small" @keyup.enter.native="handleSearch()" />
  7. <span>房屋&nbsp;</span>
  8. <el-input v-model="search.houseName" class="ch-input ch-input-size" placeholder="" size="small" @keyup.enter.native="handleSearch()" />
  9. </el-col>
  10. </el-row>
  11. <el-row class="handle-box" style="margin-bottom: 10px">
  12. <el-col :span="24" style="margin-top: 20px">
  13. <el-button class="ch-button" size="small" style="float: right;margin-left: 10px" @click="handleAdd()">&nbsp;新增</el-button>
  14. <el-button class="ch-button-warning" size="small" style="float: right" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  15. <el-button class="ch-button" size="small" style="float: right" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
  16. </el-col>
  17. </el-row>
  18. <el-row class="handle-box">
  19. <el-col :span="24">
  20. <el-table
  21. v-loading="loading"
  22. :data="AllData"
  23. row-class-name="g_table_row"
  24. border
  25. :header-cell-style="{background:'#f2f2f2'}"
  26. >
  27. <el-table-column type="index" width="60" />
  28. <el-table-column label="增购编号" prop="serialNumber" />
  29. <el-table-column label="买受人" prop="buyerName" width="200" />
  30. <el-table-column label="房屋" prop="houseName" width="200" />
  31. <el-table-column label="转让份额" prop="transferProportionStr" />
  32. <el-table-column label="转让前份额" prop="transferProportionBeforeStr" width="200" />
  33. <el-table-column label="转让后份额" prop="transferProportionAfterStr" width="200" />
  34. <el-table-column label="转让金(元)" prop="transferMoney" width="110" />
  35. <el-table-column label="转让金单价(元/每平方)" prop="transferPrice" />
  36. <el-table-column label="登记人" prop="createdName" />
  37. <el-table-column label="登记时间" prop="createdAt" />
  38. <el-table-column header-align="center" label="操作" width="380">
  39. <template scope="scope">
  40. <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
  41. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  42. <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. <div class="table-page">
  47. <el-pagination
  48. :current-page.sync="currentPage"
  49. :page-sizes="[10, 20, 50, 100]"
  50. :page-size="pageSize"
  51. background
  52. layout="total, sizes, prev, pager, next, jumper"
  53. :total="allpage"
  54. @size-change="handleSizeChange"
  55. @current-change="handleCurrentChange"
  56. />
  57. </div>
  58. </el-col>
  59. </el-row>
  60. <!-- 增购 -->
  61. <el-dialog
  62. :visible.sync="dialogVisible"
  63. :close-on-click-modal="false"
  64. :close-on-press-escape="false"
  65. title=""
  66. width="90%"
  67. top="20px"
  68. class="statistic_base"
  69. :append-to-body="true"
  70. :modal-append-to-body="true"
  71. custom-class="tagdialog"
  72. @close="getData"
  73. >
  74. <buying-more-add v-if="dialogVisible" ref="buyingMoreAdd" @cancel="cancel" />
  75. </el-dialog>
  76. </div>
  77. </template>
  78. <script>
  79. import Base from '@/views/base/base'
  80. import BaseData from '@/views/base/baseData'
  81. import BuyingMoreAdd from '@/views/buyingMore/buyingMoreAdd.vue'
  82. export default {
  83. name: 'BuyingMoreIndex',
  84. components: { BuyingMoreAdd },
  85. mixins: [Base, BaseData],
  86. data() {
  87. return {
  88. dc_key: [''],
  89. // 列表相关
  90. search: {
  91. },
  92. AllData: [],
  93. loading: false,
  94. // 弹框相关
  95. dialogVisible: false,
  96. dialogTitle: '新增'
  97. }
  98. },
  99. mounted() {
  100. this.initDict(this.dc_key).then((res) => {
  101. this.getData()
  102. })
  103. },
  104. methods: {
  105. getData: function() {
  106. const _this = this
  107. _this.loading = true
  108. _this.AllData = []
  109. this.search.pageNum = this.currentPage
  110. this.search.pageSize = this.pageSize
  111. this.search.type = '1'
  112. this.baseRequest('list', this.search).then((res) => {
  113. if (res.data.rows) {
  114. res.data.rows.forEach(function(item) {
  115. const json = _this.getItemJson(item)
  116. _this.AllData.push(json)
  117. })
  118. _this.allpage = res.data.total
  119. }
  120. _this.loading = false
  121. }).catch((e) => {
  122. // console.log(e)
  123. })
  124. // this.initOutData()
  125. },
  126. handleSearch: function() {
  127. this.getData()
  128. },
  129. handleReset: function() {
  130. for (const i in this.search) {
  131. if (i !== 'pageNum' && i !== 'pageSize') {
  132. this.search[i] = ''
  133. }
  134. }
  135. this.handleSearch()
  136. },
  137. getItemJson: function(item) {
  138. item.transferProportionStr = item.transferProportion + '%'
  139. return item
  140. },
  141. handleAdd() {
  142. this.dialogVisible = true
  143. this.dialogTitle = '新增'
  144. const postData = {
  145. isView: false
  146. }
  147. // 新vue时调用的方法
  148. this.$nextTick(() => {
  149. this.$refs.buyingMoreAdd.initData(postData)
  150. })
  151. },
  152. handleEdit(val) {
  153. this.dialogVisible = true
  154. this.dialogTitle = '编辑'
  155. val.isView = false
  156. // 新vue时调用的方法
  157. this.$nextTick(() => {
  158. this.$refs.buyingMoreAdd.initData(val)
  159. })
  160. },
  161. handleView(val) {
  162. this.dialogVisible = true
  163. this.dialogTitle = '查看'
  164. val.isView = true
  165. // 新vue时调用的方法
  166. this.$nextTick(() => {
  167. this.$refs.buyingMoreAdd.initData(val)
  168. })
  169. },
  170. handleDelete(val) {
  171. this.$confirm('确认删除该数据,删除后将无法恢复,确认删除吗?', '提示', {
  172. confirmButtonText: '确定',
  173. cancelButtonText: '取消',
  174. type: 'warning'
  175. }).then(() => {
  176. this.baseRequest('delete', { id: val.id }).then(res => {
  177. if (res.data.code == 200) {
  178. this.getData()
  179. this.$message({
  180. type: 'success',
  181. message: '删除成功!'
  182. })
  183. } else {
  184. this.$message({
  185. type: 'error',
  186. message: res.data.msg
  187. })
  188. }
  189. }).catch((err) => {
  190. this.$message({
  191. type: 'error',
  192. message: err
  193. })
  194. })
  195. }).catch(() => {
  196. this.$message({
  197. type: 'info',
  198. message: '已取消删除'
  199. })
  200. })
  201. },
  202. cancel: function() {
  203. this.dialogVisible = false
  204. },
  205. baseRequest(opUrl, postData) {
  206. return this.$channel.globeRequest('BuyingMoreController', opUrl, postData, '')
  207. }
  208. }
  209. }
  210. </script>
  211. <style scoped>
  212. .ch-input .el-input__inner {
  213. border-color: #32323A;
  214. }
  215. .ch-input-size {
  216. width: 150px;
  217. }
  218. .ch-button {
  219. border-color: #32323A;
  220. background-color: #32323A;
  221. color: #fff;
  222. }
  223. .ch-button-warning {
  224. margin-left: 10px;
  225. border-color: #E6A23C;
  226. background-color: #E6A23C;
  227. color: #fff;
  228. }
  229. .ch-button-export {
  230. margin-left: 10px;
  231. border-color: #98CC1F;
  232. background-color: #98CC1F;
  233. color: #fff;
  234. }
  235. /deep/.el-dialog__header {
  236. padding: 10px 20px;
  237. }
  238. /deep/.el-dialog__body {
  239. padding: 10px 20px;
  240. }
  241. </style>