index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="8">
  5. <div class="Pageform">
  6. <div class="formlabel">买受人</div>
  7. <div class="formvalue">
  8. <el-input v-model="search.buyerName" class="ch-input ch-input-size" placeholder="买受人" size="small" @keyup.enter.native="handleSearch()" />
  9. </div>
  10. </div>
  11. </el-col>
  12. <el-col :span="8">
  13. <div class="Pageform">
  14. <div class="formlabel">房屋</div>
  15. <div class="formvalue">
  16. <el-input v-model="search.houseName" class="ch-input ch-input-size" placeholder="房号" size="small" @keyup.enter.native="handleSearch()" />
  17. </div>
  18. </div>
  19. </el-col>
  20. <el-col :span="8">
  21. <div class="Pageform">
  22. <div class="formlabel">身份证</div>
  23. <div class="formvalue">
  24. <el-input v-model="search.buyerIdentityCard" class="ch-input ch-input-size" placeholder="身份证" size="small" @keyup.enter.native="handleSearch()" />
  25. </div>
  26. </div>
  27. </el-col>
  28. <el-col :span="8">
  29. <div class="Pageform">
  30. <div class="formlabel">批次号</div>
  31. <div class="formvalue">
  32. <el-input v-model="search.batchNumber" class="ch-input ch-input-size" placeholder="批次号" size="small" @keyup.enter.native="handleSearch()" />
  33. </div>
  34. </div>
  35. </el-col>
  36. </el-row>
  37. <el-row class="handle-box" style="margin-bottom: 10px">
  38. <el-col :span="24" style="margin-top: 20px">
  39. <el-button class="ch-button-warning" size="small" style="float: right" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  40. <el-button class="ch-button" size="small" style="float: right" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
  41. </el-col>
  42. </el-row>
  43. <el-row class="handle-box">
  44. <el-col :span="24">
  45. <el-table
  46. v-loading="loading"
  47. :data="AllData"
  48. row-class-name="g_table_row"
  49. border
  50. :header-cell-style="{background:'#f2f2f2'}"
  51. >
  52. <el-table-column type="index" width="60" />
  53. <el-table-column label="小区-分期" prop="groupDiscName" width="150" />
  54. <el-table-column label="意向金流水号" prop="serialNumber" width="150" />
  55. <el-table-column label="买受人" prop="buyerName" width="200" />
  56. <el-table-column label="意向金金额" prop="receivedAmount" width="150" />
  57. <el-table-column label="状态" prop="statusStr" width="110" />
  58. <el-table-column label="定金编号" prop="depositSerialNumber" />
  59. <el-table-column label="认购房屋" prop="houseName" />
  60. <el-table-column label="经办人" prop="createdName" />
  61. <el-table-column label="经办时间" prop="createdAt" />
  62. <el-table-column header-align="center" label="操作" width="430">
  63. <template scope="scope">
  64. <el-button :disabled="scope.row.status !== 1" size="mini" type="text" @click="handleToDeposit(scope.row)">转定金</el-button>
  65. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  66. <el-button :disabled="scope.row.status === 1" :loading="downLoadFlag" size="mini" type="text" @click="downLoad(scope.row)">意向金收据</el-button>
  67. <el-button :disabled="scope.row.status === 2" size="mini" type="text" @click="handleRefund(scope.row)">退意向金</el-button>
  68. <el-button :disabled="!(scope.row.status === 1)" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <div class="table-page">
  73. <el-pagination
  74. :current-page.sync="currentPage"
  75. :page-sizes="[10, 20, 50, 100]"
  76. :page-size="pageSize"
  77. background
  78. layout="total, sizes, prev, pager, next, jumper"
  79. :total="allpage"
  80. @size-change="handleSizeChange"
  81. @current-change="handleCurrentChange"
  82. />
  83. </div>
  84. </el-col>
  85. </el-row>
  86. <!-- 转定金 -->
  87. <el-dialog
  88. :visible.sync="dialogVisible"
  89. :close-on-click-modal="false"
  90. :close-on-press-escape="false"
  91. title=""
  92. width="90%"
  93. top="20px"
  94. class="statistic_base"
  95. :append-to-body="true"
  96. :modal-append-to-body="true"
  97. custom-class="tagdialog"
  98. @close="getData"
  99. >
  100. <to-deposit v-if="dialogVisible" ref="toDeposit" @cancel="cancel" />
  101. </el-dialog>
  102. <!-- 退意向金 -->
  103. <el-dialog
  104. :visible.sync="dialogRefundVisible"
  105. :close-on-click-modal="false"
  106. :close-on-press-escape="false"
  107. title=""
  108. width="90%"
  109. top="20px"
  110. class="statistic_base"
  111. :append-to-body="true"
  112. :modal-append-to-body="true"
  113. custom-class="tagdialog"
  114. @close="getData"
  115. >
  116. <refund-intentional-deposit v-if="dialogRefundVisible" ref="refund" @cancel="cancel" />
  117. </el-dialog>
  118. <!--意向金编辑-->
  119. <el-dialog
  120. :visible.sync="dialogIntentionalVisible"
  121. :close-on-click-modal="false"
  122. :close-on-press-escape="false"
  123. title=""
  124. width="90%"
  125. top="20px"
  126. class="statistic_base"
  127. :append-to-body="true"
  128. :modal-append-to-body="true"
  129. custom-class="tagdialog"
  130. @close="getData"
  131. >
  132. <add-intentional-deposit v-if="dialogIntentionalVisible" ref="addIntentionalDeposit" @cancel="cancel" />
  133. </el-dialog>
  134. </div>
  135. </template>
  136. <script>
  137. import Base from '@/views/base/base'
  138. import BaseData from '@/views/base/baseData'
  139. import ToDeposit from '@/views/receiveRefundsManagement/intentionalDepositManagement/toDeposit.vue'
  140. import RefundIntentionalDeposit from '@/views/receiveRefundsManagement/intentionalDepositManagement/refundIntentionalDeposit.vue'
  141. import constant from '@/static/utils/constant'
  142. import AddIntentionalDeposit from '@/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue'
  143. import axios from 'axios'
  144. export default {
  145. name: 'Index',
  146. components: { AddIntentionalDeposit, ToDeposit, RefundIntentionalDeposit },
  147. mixins: [Base, BaseData],
  148. data() {
  149. return {
  150. dc_key: ['INTENTIONAL_DEPOSIT_STATUS'],
  151. // 列表相关
  152. search: {
  153. },
  154. AllData: [],
  155. loading: false,
  156. // 弹框相关
  157. dialogVisible: false,
  158. dialogTitle: '新增',
  159. dialogRefundVisible: false,
  160. dialogIntentionalVisible: false,
  161. downLoadFlag: false
  162. }
  163. },
  164. mounted() {
  165. this.initDict(this.dc_key).then((res) => {
  166. this.getData()
  167. })
  168. },
  169. methods: {
  170. getData: function() {
  171. const _this = this
  172. _this.loading = true
  173. _this.AllData = []
  174. this.search.pageNum = this.currentPage
  175. this.search.pageSize = this.pageSize
  176. this.baseRequest('list', this.search).then((res) => {
  177. if (res.data.rows) {
  178. res.data.rows.forEach(function(item) {
  179. const json = _this.getItemJson(item)
  180. _this.AllData.push(json)
  181. })
  182. _this.allpage = res.data.total
  183. }
  184. _this.loading = false
  185. }).catch((e) => {
  186. // console.log(e)
  187. })
  188. // this.initOutData()
  189. },
  190. handleSearch: function() {
  191. this.getData()
  192. },
  193. handleReset: function() {
  194. for (const i in this.search) {
  195. if (i !== 'pageNum' && i !== 'pageSize') {
  196. this.search[i] = ''
  197. }
  198. }
  199. this.handleSearch()
  200. },
  201. getItemJson: function(item) {
  202. item.statusStr = this.dc_map.INTENTIONAL_DEPOSIT_STATUS[item.status]
  203. return item
  204. },
  205. /* 转定金*/
  206. handleToDeposit: function(val) {
  207. this.dialogVisible = true
  208. val.isView = false
  209. // 新vue时调用的方法
  210. this.$nextTick(() => {
  211. this.$refs.toDeposit.initData(val)
  212. })
  213. },
  214. handleEdit(val) {
  215. this.dialogIntentionalVisible = true
  216. const postData = {
  217. id: val.customerManagementId,
  218. intentionalDepositId: val.id
  219. }
  220. // 新vue时调用的方法
  221. this.$nextTick(() => {
  222. this.$refs.addIntentionalDeposit.initData(postData)
  223. })
  224. },
  225. handleView(val) {
  226. this.dialogVisible = true
  227. this.dialogTitle = '查看'
  228. val.isView = true
  229. // 新vue时调用的方法
  230. this.$nextTick(() => {
  231. this.$refs.toDeposit.initData(val)
  232. })
  233. },
  234. downLoad(row) {
  235. // const url = constant.BASE_URI + '/IntentionalDepositController/downLoadReceipt?id=' + row.id
  236. // window.open(url, '_blank')
  237. this.downLoadFlag = true
  238. axios({
  239. headers: {
  240. 'MVVM-Key': String(new Date().getTime()),
  241. xx: 'anything'
  242. },
  243. method: 'get',
  244. url: constant.BASE_URI + '/IntentionalDepositController/downLoadReceipt?id=' + row.id,
  245. responseType: 'blob'
  246. }).then(res => {
  247. this.previewPDF(res.data)
  248. }).catch((err) => {
  249. this.downLoadFlag = false
  250. console.log(err)
  251. })
  252. },
  253. previewPDF(blobPart, filename) {
  254. const binaryData = []
  255. binaryData.push(blobPart)
  256. // 获取blob链接
  257. let pdfUrl = ''
  258. pdfUrl = window.URL.createObjectURL(new Blob(binaryData, { type: 'application/pdf' }))
  259. window.open(pdfUrl)
  260. this.downLoadFlag = false
  261. },
  262. handleRefund(val) {
  263. this.dialogRefundVisible = true
  264. val.isView = false
  265. // 新vue时调用的方法
  266. this.$nextTick(() => {
  267. this.$refs.refund.initData(val)
  268. })
  269. },
  270. cancel: function() {
  271. this.dialogVisible = false
  272. this.dialogRefundVisible = false
  273. this.dialogIntentionalVisible = false
  274. },
  275. baseRequest(opUrl, postData) {
  276. return this.$channel.globeRequest('IntentionalDepositController', opUrl, postData, '')
  277. }
  278. }
  279. }
  280. </script>
  281. <style lang="scss">
  282. .Pageform{
  283. display: flex;
  284. align-items: center;
  285. .formlabel{
  286. width: 15%;
  287. text-align: right;
  288. font-size:14px ;
  289. }
  290. .formvalue{
  291. width: 75%;
  292. display: flex;
  293. margin-left: 2%;
  294. .ch-input{
  295. width: 100%;
  296. }
  297. .zhi{
  298. width: 60px;
  299. text-align: center;
  300. }
  301. }
  302. }
  303. </style>
  304. <style scoped>
  305. .ch-input .el-input__inner {
  306. border-color: #32323A;
  307. }
  308. .ch-input-size {
  309. width: 150px;
  310. }
  311. .ch-button {
  312. border-color: #32323A;
  313. background-color: #32323A;
  314. color: #fff;
  315. }
  316. .ch-button-warning {
  317. margin-left: 10px;
  318. border-color: #E6A23C;
  319. background-color: #E6A23C;
  320. color: #fff;
  321. }
  322. .ch-button-export {
  323. margin-left: 10px;
  324. border-color: #98CC1F;
  325. background-color: #98CC1F;
  326. color: #fff;
  327. }
  328. /deep/.el-dialog__header {
  329. padding: 10px 20px;
  330. }
  331. /deep/.el-dialog__body {
  332. padding: 10px 20px;
  333. }
  334. </style>