subscribeIndex.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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="collectionName" />
  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. :disabled="scope.row.status === 2"
  40. @click="handleAdd(scope.row)"
  41. >登记
  42. </el-button>
  43. <el-button
  44. size="mini"
  45. type="text"
  46. @click="handleEdit(scope.row)"
  47. > 修改
  48. </el-button>
  49. <el-button
  50. size="mini"
  51. type="text"
  52. @click="downLoad(scope.row)"
  53. > 定金收据
  54. </el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. </el-col>
  59. </el-row>
  60. </div>
  61. <div style="text-align: right;margin-top: 50px">
  62. <el-button @click="cancel">取 消</el-button>
  63. <el-button type="primary" @click="cancel()">确 定</el-button>
  64. </div>
  65. <!--认购金登记-->
  66. <el-dialog
  67. :visible.sync="dialogAddVisible"
  68. :close-on-click-modal="false"
  69. :close-on-press-escape="false"
  70. title=""
  71. width="90%"
  72. top="20px"
  73. class="statistic_base"
  74. :append-to-body="true"
  75. :modal-append-to-body="true"
  76. custom-class="tagdialog"
  77. @close="getData"
  78. >
  79. <add-subscribe v-if="dialogAddVisible" ref="addSubscribe" @cancel="addSubscribeCancel" />
  80. </el-dialog>
  81. </div>
  82. </template>
  83. <script>
  84. import Base from '@/views/base/base.vue'
  85. import BaseData from '@/views/base/baseData.vue'
  86. import AddSubscribe from '@/views/customerManagement/subscribe/addSubscribe.vue'
  87. import constant from '@/static/utils/constant'
  88. export default {
  89. name: 'AddHouse',
  90. components: { AddSubscribe },
  91. mixins: [Base, BaseData],
  92. data() {
  93. return {
  94. dc_key: ['DECORATION_SITUATION'],
  95. loading: false,
  96. AllData: [],
  97. customerManagementId: '',
  98. dateStr: '',
  99. username: '',
  100. dialogAddVisible: false
  101. }
  102. },
  103. mounted() {
  104. const myDate = new Date()
  105. const dateStr = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate()
  106. const username = this.$common.currUser().username
  107. this.dateStr = dateStr
  108. this.username = username
  109. },
  110. methods: {
  111. initData(data) {
  112. this.initDict(this.dc_key).then(res => {
  113. this.customerManagementId = data.id
  114. this.getData(data.id)
  115. })
  116. },
  117. handleAdd(val) {
  118. this.dialogAddVisible = true
  119. val.isView = false
  120. // 新vue时调用的方法
  121. this.$nextTick(() => {
  122. this.$refs.addSubscribe.initData(val)
  123. })
  124. },
  125. handleEdit(val) {
  126. this.dialogAddVisible = true
  127. val.isView = false
  128. // 新vue时调用的方法
  129. this.$nextTick(() => {
  130. this.$refs.addSubscribe.initData(val)
  131. })
  132. },
  133. getData: function() {
  134. const _this = this
  135. _this.loading = true
  136. _this.AllData = []
  137. const data = {
  138. customerManagementId: this.customerManagementId
  139. }
  140. this.baseRequest('listAll', data).then((res) => {
  141. if (res.data) {
  142. res.data.forEach(function(item) {
  143. const json = _this.getItemJson(item)
  144. _this.AllData.push(json)
  145. })
  146. }
  147. _this.loading = false
  148. }).catch(() => {
  149. })
  150. },
  151. getItemJson: function(item) {
  152. item.statusStr = item.status === 1 ? '未收取' : '已收取'
  153. item.collectionName = item.collectionName == null ? this.username : item.collectionName
  154. item.collectionTime = item.collectionTime == null ? this.dateStr : item.collectionTime
  155. return item
  156. },
  157. confirmSubmit: function() {
  158. if (!this.AllData || this.AllData.length === 0) {
  159. this.$message({
  160. message: '请选择房间',
  161. type: 'warning'
  162. })
  163. }
  164. const data = {
  165. houseIds: this.AllData.map(obj => { return obj.id }).join(','),
  166. customerManagementId: this.customerManagementId
  167. }
  168. this.baseRequest('submit', data).then(res => {
  169. if (res.data.code === 200) {
  170. this.$message({
  171. message: '提交成功',
  172. type: 'success'
  173. })
  174. this.cancel()
  175. }
  176. }).catch((err) => {
  177. this.$message({
  178. message: err,
  179. type: 'error'
  180. })
  181. })
  182. },
  183. cancel() {
  184. this.$emit('cancel')
  185. },
  186. addSubscribeCancel() {
  187. this.dialogAddVisible = false
  188. },
  189. downLoad(row) {
  190. const url = constant.BASE_URI + '/RoomSelectionInfoController/downLoadReceipt?id=' + row.id
  191. window.open(url, '_blank')
  192. },
  193. baseRequest(opUrl, postData) {
  194. return this.$channel.globeRequest('RoomSelectionInfoController', opUrl, postData, 'project')
  195. },
  196. baseInfoRequest: function(opUrl, postData) {
  197. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
  198. }
  199. }
  200. }
  201. </script>
  202. <style scoped>
  203. </style>