subscribeIndex.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div>
  3. <div>
  4. <el-row class="handle-box">
  5. <el-col :span="24">
  6. <span class="card_title">认购</span>
  7. </el-col>
  8. </el-row>
  9. <el-divider />
  10. <el-row class="handle-box">
  11. <el-col :span="24">
  12. <el-table
  13. ref="multipleTable"
  14. v-loading="loading"
  15. :data="AllData"
  16. stripe
  17. row-class-name="g_table_row"
  18. :header-cell-style="{textAlign: 'center'}"
  19. :cell-style="{ textAlign: 'center' }"
  20. @selection-change="handleSelectionChange"
  21. >
  22. <el-table-column
  23. type="selection"
  24. width="55"
  25. />
  26. <el-table-column type="index" label="序号" width="60" />
  27. <el-table-column label="单元/楼栋号" prop="buildName" width="180" />
  28. <el-table-column label="户室号" prop="roomNo" />
  29. <el-table-column label="认购金金额(元)" prop="receivableMoney" />
  30. <el-table-column label="收取状态" prop="statusStr" />
  31. <el-table-column label="收据流水号" prop="serialNumber" />
  32. <el-table-column label="经办人" prop="createdId" />
  33. <el-table-column label="经办时间" prop="collectionTime" />
  34. <el-table-column label="操作" width="180">
  35. <template scope="scope">
  36. <el-button
  37. size="mini"
  38. type="text"
  39. @click="handleAdd(scope.row)"
  40. >登记
  41. </el-button>
  42. <el-button
  43. size="mini"
  44. type="text"
  45. @click="handleEdit(scope.row)"
  46. > 修改
  47. </el-button>
  48. <el-button
  49. size="mini"
  50. type="text"
  51. @click="downLoad(scope.row)"
  52. > 定金收据
  53. </el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. </el-col>
  58. </el-row>
  59. </div>
  60. <div style="text-align: right;margin-top: 50px">
  61. <el-button @click="cancel">取 消</el-button>
  62. <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
  63. </div>
  64. <!--认购金登记-->
  65. <el-dialog
  66. :visible.sync="dialogAddVisible"
  67. :close-on-click-modal="false"
  68. :close-on-press-escape="false"
  69. title=""
  70. width="90%"
  71. top="20px"
  72. class="statistic_base"
  73. :append-to-body="true"
  74. :modal-append-to-body="true"
  75. custom-class="tagdialog"
  76. @close="getData"
  77. >
  78. <add-subscribe v-if="dialogAddVisible" ref="addSubscribe" @cancel="cancel" />
  79. </el-dialog>
  80. </div>
  81. </template>
  82. <script>
  83. import Base from '@/views/base/base.vue'
  84. import BaseData from '@/views/base/baseData.vue'
  85. import AddSubscribe from '@/views/customerManagement/subscribe/addSubscribe.vue'
  86. export default {
  87. name: 'AddHouse',
  88. components: { AddSubscribe },
  89. mixins: [Base, BaseData],
  90. data() {
  91. return {
  92. dc_key: ['DECORATION_SITUATION'],
  93. loading: false,
  94. AllData: [],
  95. customerManagementId: '',
  96. dataStr: '',
  97. username: '',
  98. dialogAddVisible: false
  99. }
  100. },
  101. mounted() {
  102. const myDate = new Date()
  103. const dateStr = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate()
  104. const username = this.$common.currUser().username
  105. this.dataStr = dateStr
  106. this.username = username
  107. },
  108. methods: {
  109. initData(data) {
  110. this.initDict(this.dc_key).then(res => {
  111. this.customerManagementId = data.id
  112. this.getData(data.id)
  113. })
  114. },
  115. handleAdd() {
  116. this.dialogAddVisible = true
  117. // 新vue时调用的方法
  118. this.$nextTick(() => {
  119. this.$refs.addSubscribe.initData()
  120. })
  121. },
  122. handleEdit() {
  123. },
  124. getData: function(val) {
  125. const _this = this
  126. _this.loading = true
  127. _this.AllData = []
  128. const data = {
  129. customerManagementId: val
  130. }
  131. this.baseRequest('listAll', data).then((res) => {
  132. if (res.data) {
  133. res.data.forEach(function(item) {
  134. const json = _this.getItemJson(item)
  135. _this.AllData.push(json)
  136. })
  137. }
  138. _this.loading = false
  139. }).catch(() => {
  140. })
  141. },
  142. getItemJson: function(item) {
  143. item.statusStr = item.status === 1 ? '未收取' : '已收取'
  144. return item
  145. },
  146. confirmSubmit: function() {
  147. if (!this.AllData || this.AllData.length === 0) {
  148. this.$message({
  149. message: '请选择房间',
  150. type: 'warning'
  151. })
  152. }
  153. const data = {
  154. houseIds: this.AllData.map(obj => { return obj.id }).join(','),
  155. customerManagementId: this.customerManagementId
  156. }
  157. this.baseRequest('submit', data).then(res => {
  158. if (res.data.code === 200) {
  159. this.$message({
  160. message: '提交成功',
  161. type: 'success'
  162. })
  163. this.cancel()
  164. }
  165. }).catch((err) => {
  166. this.$message({
  167. message: err,
  168. type: 'error'
  169. })
  170. })
  171. },
  172. cancel() {
  173. this.$emit('cancel')
  174. },
  175. downLoad() {
  176. },
  177. baseRequest(opUrl, postData) {
  178. return this.$channel.globeRequest('RoomSelectionInfoController', opUrl, postData, 'project')
  179. },
  180. baseInfoRequest: function(opUrl, postData) {
  181. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
  182. }
  183. }
  184. }
  185. </script>
  186. <style scoped>
  187. </style>