index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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.applicant" 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-col :span="8">
  37. <div class="Pageform">
  38. <div class="formlabel">退款日期</div>
  39. <div class="formvalue">
  40. <el-date-picker
  41. v-model="search.refundDateFrom"
  42. value-format="yyyy-MM-dd"
  43. format="yyyy-MM-dd"
  44. size="small"
  45. type="date"
  46. placeholder="开始日期"
  47. />
  48. <div class="zhi">至</div>
  49. <el-date-picker
  50. v-model="search.refundDateTo"
  51. value-format="yyyy-MM-dd"
  52. format="yyyy-MM-dd"
  53. size="small"
  54. type="date"
  55. placeholder="终止日期"
  56. />
  57. </div>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. <el-row class="handle-box" style="margin-bottom: 10px">
  62. <el-col :span="24" style="margin-top: 20px">
  63. <el-button v-if="$has('refundExport')" :loading="excelFlag" size="small" class="ch-button-export" style="float: right;" @click="handleExcel"><i class="el-icon-menu" />&nbsp;导出EXCEL</el-button>
  64. <el-button class="ch-button-warning" size="small" style="float: right" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  65. <el-button class="ch-button" size="small" style="float: right" @click="handleSearch()"><i class="el-icon-search" />&nbsp;查询</el-button>
  66. <el-button class="ch-button-add" size="small" style="float: right;" @click="handleAdd()"><i class="el-icon-menu" />&nbsp;新增</el-button>
  67. </el-col>
  68. </el-row>
  69. <el-row class="handle-box">
  70. <el-col :span="24">
  71. <el-table
  72. v-loading="loading"
  73. :data="AllData"
  74. row-class-name="g_table_row"
  75. border
  76. :header-cell-style="{background:'#f2f2f2'}"
  77. >
  78. <el-table-column type="index" width="60" />
  79. <el-table-column label="合同编号" prop="contractNumber" width="200" />
  80. <el-table-column label="申请人" prop="applicant" width="200" />
  81. <el-table-column label="买受人" prop="buyerName" width="200" />
  82. <el-table-column label="房屋" prop="houseName" width="200" />
  83. <el-table-column label="退房原因" prop="reasonStr" width="110" />
  84. <el-table-column label="应退(元)" prop="refundAmount" />
  85. <el-table-column label="实退(元)" prop="actualRefundAmount" />
  86. <el-table-column label="扣除" prop="deductible" />
  87. <el-table-column label="关联审批单号" prop="approvalNumber" />
  88. <el-table-column header-align="center" label="操作" width="200">
  89. <template scope="scope">
  90. <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
  91. <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <div class="table-page">
  96. <el-pagination
  97. :current-page.sync="currentPage"
  98. :page-sizes="[10, 20, 50, 100]"
  99. :page-size="pageSize"
  100. background
  101. layout="total, sizes, prev, pager, next, jumper"
  102. :total="allpage"
  103. @size-change="handleSizeChange"
  104. @current-change="handleCurrentChange"
  105. />
  106. </div>
  107. </el-col>
  108. </el-row>
  109. <!-- 预收款登记 -->
  110. <el-dialog
  111. :visible.sync="dialogVisible"
  112. :close-on-click-modal="false"
  113. :close-on-press-escape="false"
  114. title=""
  115. width="90%"
  116. top="20px"
  117. class="statistic_base"
  118. :append-to-body="true"
  119. :modal-append-to-body="true"
  120. custom-class="tagdialog"
  121. @close="getData"
  122. >
  123. <add-refund v-if="dialogVisible" ref="addRefund" @cancel="cancel" />
  124. </el-dialog>
  125. </div>
  126. </template>
  127. <script>
  128. import Base from '@/views/base/base'
  129. import BaseData from '@/views/base/baseData'
  130. import AddRefund from '@/views/receiveRefundsManagement/refundManagement/addRefund.vue'
  131. export default {
  132. name: 'RefundManagementIndex',
  133. components: { AddRefund },
  134. mixins: [Base, BaseData],
  135. data() {
  136. return {
  137. dc_key: ['CHECK_OUT_REASON'],
  138. // 列表相关
  139. search: {
  140. },
  141. AllData: [],
  142. loading: false,
  143. // 弹框相关
  144. dialogVisible: false,
  145. dialogTitle: '新增',
  146. excelFlag: false
  147. }
  148. },
  149. mounted() {
  150. this.initDict(this.dc_key).then((res) => {
  151. this.getData()
  152. })
  153. },
  154. methods: {
  155. getData: function() {
  156. const _this = this
  157. _this.loading = true
  158. _this.AllData = []
  159. this.search.pageNum = this.currentPage
  160. this.search.pageSize = this.pageSize
  161. this.search.payType = 1
  162. this.baseRequest('list', this.search).then((res) => {
  163. if (res.data.rows) {
  164. res.data.rows.forEach(function(item) {
  165. const json = _this.getItemJson(item)
  166. _this.AllData.push(json)
  167. })
  168. _this.allpage = res.data.total
  169. }
  170. _this.loading = false
  171. }).catch((e) => {
  172. })
  173. },
  174. handleSearch: function() {
  175. this.getData()
  176. },
  177. handleReset: function() {
  178. for (const i in this.search) {
  179. if (i !== 'pageNum' && i !== 'pageSize') {
  180. this.search[i] = ''
  181. }
  182. }
  183. this.handleSearch()
  184. },
  185. getItemJson: function(item) {
  186. item.reasonStr = this.dc_map.CHECK_OUT_REASON[item.reason]
  187. return item
  188. },
  189. handleAdd: function() {
  190. this.dialogVisible = true
  191. const val = {
  192. isView: false
  193. }
  194. // 新vue时调用的方法
  195. this.$nextTick(() => {
  196. this.$refs.addRefund.initData(val)
  197. })
  198. },
  199. /* 编辑*/
  200. handleEdit: function(val) {
  201. this.dialogVisible = true
  202. val.isView = false
  203. // 新vue时调用的方法
  204. this.$nextTick(() => {
  205. this.$refs.addRefund.initData(val)
  206. })
  207. },
  208. handleView(val) {
  209. this.dialogVisible = true
  210. val.isView = true
  211. // 新vue时调用的方法
  212. this.$nextTick(() => {
  213. this.$refs.addRefund.initData(val)
  214. })
  215. },
  216. cancel: function() {
  217. this.dialogVisible = false
  218. },
  219. // 导出
  220. handleExcel: function() {
  221. const _this = this
  222. _this.excelFlag = true
  223. this.search.pageNum = this.currentPage
  224. this.search.pageSize = this.pageSize
  225. this.OutData = []
  226. const title = ['关联审批单号', '申请人', '身份证号', '退房原因', '所退房屋', '买受人', '款项', '已收(元)', '扣除',
  227. '实退(元)', '应退金额(元)', '扣除金额(元)', '实退金额(元)', '收款账号', '备注'
  228. ]
  229. this.OutData.push(title)
  230. const temp = []
  231. this.baseRequest('excelList', _this.search).then(res => {
  232. const data = res.data
  233. data.data.forEach(function(item) {
  234. const json = _this.getItemJson(item)
  235. temp.push(json)
  236. })
  237. temp.forEach(function(item) {
  238. const jsonArray = []
  239. jsonArray.push(item.approvalNumber)
  240. jsonArray.push(item.applicant)
  241. jsonArray.push(item.identityCard)
  242. jsonArray.push(item.reasonStr)
  243. jsonArray.push(item.houseName)
  244. jsonArray.push(item.buyerName)
  245. jsonArray.push(item.contentTypeStr)
  246. jsonArray.push(item.receivedAmountInfo)
  247. jsonArray.push(item.deductibleInfo)
  248. jsonArray.push(item.actualRefundAmountInfo)
  249. jsonArray.push(item.refundAmount)
  250. jsonArray.push(item.deductible)
  251. jsonArray.push(item.actualRefundAmount)
  252. jsonArray.push(item.bankNumber)
  253. jsonArray.push(item.remark)
  254. _this.OutData.push(jsonArray)
  255. })
  256. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
  257. const fileName = '退款导出 ' + new Date().Format('yyyyMMddhhmm')
  258. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  259. _this.excelFlag = false
  260. })
  261. },
  262. baseRequest(opUrl, postData) {
  263. return this.$channel.globeRequest('RefundManageController', opUrl, postData, 'project')
  264. }
  265. }
  266. }
  267. </script>
  268. <style scoped>
  269. .ch-input .el-input__inner {
  270. border-color: #32323A;
  271. }
  272. .ch-input-size {
  273. width: 150px;
  274. }
  275. .ch-button {
  276. border-color: #32323A;
  277. background-color: #32323A;
  278. color: #fff;
  279. }
  280. .ch-button-warning {
  281. margin-left: 10px;
  282. border-color: #E6A23C;
  283. background-color: #E6A23C;
  284. color: #fff;
  285. }
  286. .ch-button-export {
  287. margin-left: 10px;
  288. border-color: #98CC1F;
  289. background-color: #98CC1F;
  290. color: #fff;
  291. }
  292. /deep/.el-dialog__header {
  293. padding: 10px 20px;
  294. }
  295. /deep/.el-dialog__body {
  296. padding: 10px 20px;
  297. }
  298. </style>