index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="24">
  5. <span>
  6. 姓名
  7. </span>
  8. <el-input
  9. v-model="search.buyerName"
  10. style="margin-left:16px ;"
  11. size="small"
  12. placeholder="请输入"
  13. class="ch-input ch-input-size"
  14. />
  15. <el-radio-group v-model="search.status" style="margin-left:16px ;">
  16. <el-radio
  17. v-for="item in dc_data.BUYING_HOUSE_STATUS"
  18. :key="item.value"
  19. :label="item.value"
  20. >
  21. {{ item.label }}
  22. </el-radio>
  23. </el-radio-group>
  24. </el-col>
  25. <el-col :span="24">
  26. <div style="display: flex;align-items: center">
  27. <div style=" white-space: nowrap;">项目</div>
  28. <div class="listBox">
  29. <div
  30. v-for="item in groupOption"
  31. :key="item.value"
  32. class="list"
  33. :class="{ checked: groupIds.includes(item.value) }"
  34. @click="checkedBox(item.value)"
  35. >
  36. {{ item.label }}
  37. </div>
  38. </div>
  39. </div>
  40. </el-col>
  41. <el-col v-if="discOption.length > 0" :span="24">
  42. <div style="display: flex;align-items: center">
  43. <div style=" white-space: nowrap;">分期</div>
  44. <div class="listBox">
  45. <div
  46. v-for="item in discOption"
  47. :key="item.value"
  48. class="list"
  49. :class="{ checked: discIds.includes(item.value) }"
  50. @click="checkedFQBox(item.value)"
  51. >
  52. {{ item.label }}
  53. </div>
  54. </div>
  55. </div>
  56. </el-col>
  57. <el-col :span="24" style="margin-top: 20px">
  58. <el-button size="small" class="ch-button" style="float: right; margin-top: 4px" @click="downLoad"><i class="el-icon-menu" />&nbsp;选房通知单</el-button>
  59. <el-button size="small" class="ch-button-danger" style="float: right; margin-top: 4px;margin-right: 10px;" @click="handleDelete"><i class="el-icon-menu" />&nbsp;删除</el-button>
  60. <el-button size="small" class="ch-button-export" style="float: right;margin-top: 4px" @click="batchImport()"><i class="el-icon-menu" />&nbsp;批量导入</el-button>
  61. <el-button size="small" class="ch-button-add" style="float: right; margin-right: 10px; margin-top: 4px" @click="handleAdd()"><i class="el-icon-menu" />&nbsp;新增</el-button>
  62. <el-button size="small" class="ch-button" style="float: right; margin-top: 4px" @click="handleSearch()"><i class="el-icon-menu" />&nbsp;查询</el-button>
  63. <el-button size="small" class="ch-button-warning" style="float: right;margin-top: 4px" @click="handleReset()"><i class="el-icon-menu" />&nbsp;重置</el-button>
  64. </el-col>
  65. </el-row>
  66. <el-row class="handle-box">
  67. <el-col :span="24">
  68. <el-table
  69. ref="multipleTable"
  70. v-loading="loading"
  71. :data="AllData"
  72. stripe
  73. row-class-name="g_table_row"
  74. border
  75. :header-cell-style="{background:'#f2f2f2'}"
  76. :cell-style="{ textAlign: 'center' }"
  77. @selection-change="handleSelectionChange"
  78. >
  79. <el-table-column
  80. type="selection"
  81. width="55"
  82. />
  83. <el-table-column type="index" label="序号" width="60" />
  84. <el-table-column label="批次号" prop="batchNumber" />
  85. <el-table-column label="选房号" prop="roomSelectionNumber" />
  86. <el-table-column label="买受人" prop="buyerName" width="300" />
  87. <el-table-column label="选房日期" prop="roomSelectionDate" width="180" />
  88. <el-table-column label="购房状态" prop="statusStr" />
  89. <el-table-column label="意向金状态" prop="intentionalDepositStatusStr" width="130"/>
  90. <el-table-column label="小区-分期" prop="groupDiscName" width="180" />
  91. <el-table-column label="意向房屋" prop="houseName" width="180" />
  92. <el-table-column label="操作" width="600">
  93. <template scope="scope">
  94. <el-button
  95. size="mini"
  96. type="text"
  97. @click="handleEdit(scope.row)"
  98. >修改
  99. </el-button>
  100. <el-button
  101. v-if="scope.row.roomSelectionCount <= 0"
  102. size="mini"
  103. type="text"
  104. :disabled="scope.row.statusStr === '已签约' || scope.row.statusStr === '已入驻' || scope.row.statusStr === '已退房' || scope.row.statusStr === '放弃资格'"
  105. @click="handleHouse(scope.row)"
  106. >选房
  107. </el-button>
  108. <el-button
  109. size="mini"
  110. type="text"
  111. :disabled="scope.row.statusStr === '已签约' || scope.row.statusStr === '已入驻' || scope.row.statusStr === '已退房' || scope.row.statusStr === '放弃资格'"
  112. @click="handleSubscribe(scope.row)"
  113. >认购
  114. </el-button>
  115. <el-button
  116. size="mini"
  117. type="text"
  118. @click="handleGiveUp(scope.row)"
  119. >放弃资格
  120. </el-button>
  121. <el-button
  122. size="mini"
  123. type="text"
  124. :disabled="scope.row.statusStr === '已选房' || scope.row.statusStr === '已签约' || scope.row.statusStr === '已入驻' || scope.row.statusStr === '已退房' || scope.row.statusStr === '放弃资格'"
  125. @click="handleIntentionalDeposit(scope.row)"
  126. >意向金
  127. </el-button>
  128. <el-button
  129. size="mini"
  130. type="text"
  131. @click="handleView(scope.row)"
  132. >查看
  133. </el-button>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <div class="table-page">
  138. <el-pagination
  139. :current-page.sync="currentPage"
  140. :page-sizes="[10, 20, 50, 100]"
  141. :page-size="pageSize"
  142. background
  143. layout="total, sizes, prev, pager, next, jumper"
  144. :total="allpage"
  145. @size-change="handleSizeChange"
  146. @current-change="handleCurrentChange"
  147. />
  148. </div>
  149. </el-col>
  150. </el-row>
  151. <!--新增-->
  152. <el-dialog
  153. :visible.sync="dialogAddVisible"
  154. :close-on-click-modal="false"
  155. :close-on-press-escape="false"
  156. :title="dialogAddTitle"
  157. width="90%"
  158. top="20px"
  159. class="statistic_base"
  160. :append-to-body="true"
  161. :modal-append-to-body="true"
  162. custom-class="tagdialog"
  163. @close="getData"
  164. >
  165. <add-customer v-if="dialogAddVisible" ref="addCustomer" @cancel="cancel" />
  166. </el-dialog>
  167. <!--选房-->
  168. <el-dialog
  169. :visible.sync="dialogHouseVisible"
  170. :close-on-click-modal="false"
  171. :close-on-press-escape="false"
  172. title="选房"
  173. width="90%"
  174. top="20px"
  175. class="statistic_base"
  176. :append-to-body="true"
  177. :modal-append-to-body="true"
  178. custom-class="tagdialog"
  179. @close="getData"
  180. >
  181. <add-house v-if="dialogHouseVisible" ref="addHouse" @cancel="cancel" />
  182. </el-dialog>
  183. <!--认购金-->
  184. <el-dialog
  185. :visible.sync="dialogSubscribeVisible"
  186. :close-on-click-modal="false"
  187. :close-on-press-escape="false"
  188. title=""
  189. width="90%"
  190. top="20px"
  191. class="statistic_base"
  192. :append-to-body="true"
  193. :modal-append-to-body="true"
  194. custom-class="tagdialog"
  195. @close="getData"
  196. >
  197. <subscribe-index v-if="dialogSubscribeVisible" ref="subscribeIndex" @cancel="cancel" />
  198. </el-dialog>
  199. <!--意向金-->
  200. <el-dialog
  201. :visible.sync="dialogIntentionalVisible"
  202. :close-on-click-modal="false"
  203. :close-on-press-escape="false"
  204. title=""
  205. width="90%"
  206. top="20px"
  207. class="statistic_base"
  208. :append-to-body="true"
  209. :modal-append-to-body="true"
  210. custom-class="tagdialog"
  211. @close="getData"
  212. >
  213. <add-intentional-deposit v-if="dialogIntentionalVisible" ref="addIntentionalDeposit" @cancel="cancel" />
  214. </el-dialog>
  215. <!--放弃资格-->
  216. <el-dialog
  217. :visible.sync="dialogAbandonVisible"
  218. :close-on-click-modal="false"
  219. :close-on-press-escape="false"
  220. title=""
  221. width="90%"
  222. top="20px"
  223. class="statistic_base"
  224. :append-to-body="true"
  225. :modal-append-to-body="true"
  226. custom-class="tagdialog"
  227. @close="getData"
  228. >
  229. <add-abandon v-if="dialogAbandonVisible" ref="addAbandon" @cancel="cancel" />
  230. </el-dialog>
  231. <!-- 批量导入 -->
  232. <upload-cost
  233. v-if="importVisible"
  234. :dialog-visible="importVisible"
  235. :import-type="importType"
  236. :upload-title="uploadTitle"
  237. :import-title="importTitle"
  238. @cancelUpload="cancelImport"
  239. />
  240. </div>
  241. </template>
  242. <script>
  243. import Base from '@/views/base/base'
  244. import BaseData from '@/views/base/baseData'
  245. import BaseDept from '@/views/base/baseDept.vue'
  246. import AddCustomer from '@/views/customerManagement/numberManagement/addCustomer.vue'
  247. import AddHouse from '@/views/customerManagement/roomChose/addHouse.vue'
  248. import SubscribeIndex from '@/views/customerManagement/subscribe/subscribeIndex.vue'
  249. import AddIntentionalDeposit from '@/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue'
  250. import AddAbandon from '@/views/customerManagement/numberManagement/addAbandon.vue'
  251. import constant from '@/static/utils/constant'
  252. import uploadCost from '@/views/customerManagement/component/uploadCost.vue'
  253. export default {
  254. name: 'NumberManagement',
  255. components: { AddIntentionalDeposit, AddHouse, AddCustomer, SubscribeIndex, AddAbandon, uploadCost },
  256. mixins: [Base, BaseData, BaseDept],
  257. data() {
  258. return {
  259. dc_key: ['BUYING_HOUSE_STATUS', 'INTENTIONAL_DEPOSIT_STATUS'],
  260. search: {},
  261. AllData: [],
  262. loading: false,
  263. groupIds: [],
  264. discIds: [],
  265. dialogAddVisible: false,
  266. dialogHouseVisible: false,
  267. dialogSubscribeVisible: false,
  268. dialogIntentionalVisible: false,
  269. dialogAbandonVisible: false,
  270. groupOption: [],
  271. discOption: [],
  272. dialogAddTitle: '',
  273. // 批量导入
  274. importVisible: false,
  275. importType: '',
  276. importTitle: '',
  277. uploadTitle: []
  278. }
  279. },
  280. mounted() {
  281. this.getGroupList(true)
  282. // this.getDiscList()
  283. this.initDict(this.dc_key).then((res) => {
  284. this.getData()
  285. })
  286. },
  287. methods: {
  288. getData: function() {
  289. const _this = this
  290. _this.loading = true
  291. _this.AllData = []
  292. this.search.pageNum = this.currentPage
  293. this.search.pageSize = this.pageSize
  294. this.baseRequest('list', this.search).then((res) => {
  295. if (res.data.rows) {
  296. res.data.rows.forEach(function(item) {
  297. const json = _this.getItemJson(item)
  298. _this.AllData.push(json)
  299. })
  300. _this.allpage = res.data.total
  301. }
  302. _this.loading = false
  303. }).catch(() => {
  304. })
  305. },
  306. getItemJson: function(item) {
  307. item.statusStr = this.dc_map.BUYING_HOUSE_STATUS[item.status]
  308. item.intentionalDepositStatusStr = this.dc_map.INTENTIONAL_DEPOSIT_STATUS[item.intentionalDepositStatus]
  309. return item
  310. },
  311. handleSearch() {
  312. this.getData()
  313. },
  314. handleReset() {
  315. for (const i in this.search) {
  316. if (i !== 'pageNum' && i !== 'pageSize') {
  317. this.search[i] = ''
  318. }
  319. }
  320. this.groupIds = []
  321. this.discIds = []
  322. this.discOption = []
  323. this.handleSearch()
  324. },
  325. handleAdd() {
  326. this.dialogAddVisible = true
  327. this.dialogAddTitle = '新增'
  328. const data = {
  329. isView: false
  330. }
  331. // 新vue时调用的方法
  332. this.$nextTick(() => {
  333. this.$refs.addCustomer.initData(data)
  334. })
  335. },
  336. batchImport() {
  337. this.importVisible = true
  338. this.importType = 'insert'
  339. this.importTitle = '批量导入'
  340. },
  341. cancelImport(refresh) {
  342. this.importVisible = false
  343. this.importType = ''
  344. this.getData()
  345. },
  346. handleDelete() {
  347. console.log('this.multipleSelection', this.multipleSelection)
  348. if (!this.multipleSelection || this.multipleSelection.length === 0) {
  349. this.$message({
  350. type: 'warning',
  351. message: '请选择数据!'
  352. })
  353. return
  354. }
  355. const data = {
  356. ids: this.multipleSelection.map(obj => { return obj.id }).join(',')
  357. }
  358. this.$confirm('确认删除该数据,删除后将无法恢复,确认删除吗?', '提示', {
  359. confirmButtonText: '确定',
  360. cancelButtonText: '取消',
  361. type: 'warning'
  362. }).then(() => {
  363. this.baseRequest('delete', data).then(res => {
  364. if (res.data.code === 200) {
  365. this.getData()
  366. this.$message({
  367. type: 'success',
  368. message: '删除成功!'
  369. })
  370. } else {
  371. this.$message({
  372. type: 'error',
  373. message: res.data.msg
  374. })
  375. }
  376. }).catch((err) => {
  377. this.$message({
  378. type: 'error',
  379. message: err
  380. })
  381. })
  382. }).catch(() => {
  383. this.$message({
  384. type: 'info',
  385. message: '已取消删除'
  386. })
  387. })
  388. },
  389. /* 编辑*/
  390. handleEdit: function(val) {
  391. this.dialogAddVisible = true
  392. this.dialogAddTitle = '修改'
  393. val.isView = false
  394. // 新vue时调用的方法
  395. this.$nextTick(() => {
  396. this.$refs.addCustomer.initData(val)
  397. })
  398. },
  399. /* 选房*/
  400. handleHouse: function(val) {
  401. this.dialogHouseVisible = true
  402. val.customerManagementId = val.id
  403. // 新vue时调用的方法
  404. this.$nextTick(() => {
  405. this.$refs.addHouse.initData(val)
  406. })
  407. },
  408. /* 认购*/
  409. handleSubscribe: function(val) {
  410. this.dialogSubscribeVisible = true
  411. // 新vue时调用的方法
  412. this.$nextTick(() => {
  413. this.$refs.subscribeIndex.initData(val)
  414. })
  415. },
  416. /* 放弃资格*/
  417. handleGiveUp(val) {
  418. this.dialogAbandonVisible = true
  419. // 新vue时调用的方法
  420. this.$nextTick(() => {
  421. this.$refs.addAbandon.initData(val)
  422. })
  423. },
  424. // 意向金
  425. handleIntentionalDeposit(val) {
  426. this.dialogIntentionalVisible = true
  427. // 新vue时调用的方法
  428. this.$nextTick(() => {
  429. this.$refs.addIntentionalDeposit.initData(val)
  430. })
  431. },
  432. handleView(val) {
  433. val.isView = true
  434. this.dialogAddVisible = true
  435. // 新vue时调用的方法
  436. this.$nextTick(() => {
  437. this.$refs.addCustomer.initData(val)
  438. })
  439. },
  440. downLoad() {
  441. this.multipleSelection.forEach(item => {
  442. const url = constant.BASE_URI + '/CustomerManagementController/download?id=' + item.id
  443. window.open(url, '_blank')
  444. })
  445. },
  446. checkedBox(i) {
  447. if (this.groupIds.includes(i)) {
  448. // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
  449. // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
  450. this.groupIds = this.groupIds.filter(function(ele) {
  451. return ele !== i
  452. })
  453. } else {
  454. this.groupIds.push(i)
  455. }
  456. this.search.groupIds = this.groupIds.join(',')
  457. this.getDiscList()
  458. },
  459. checkedFQBox(i) {
  460. if (this.discIds.includes(i)) {
  461. // includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
  462. // filter()方法用于把Array的某些元素过滤掉,filter()把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保留还是丢弃该元素:生成新的数组
  463. this.discIds = this.discIds.filter(function(ele) {
  464. return ele !== i
  465. })
  466. } else {
  467. this.discIds.push(i)
  468. }
  469. this.search.discIds = this.discIds.join(',')
  470. },
  471. cancel() {
  472. this.dialogAddVisible = false
  473. this.dialogHouseVisible = false
  474. this.dialogSubscribeVisible = false
  475. this.dialogIntentionalVisible = false
  476. this.dialogAbandonVisible = false
  477. },
  478. getGroupList(firstLoad) {
  479. this.groupOption = []
  480. this.baseParkRequest('listAll', {}).then(res => {
  481. if (res.data) {
  482. // const idArr = res.data.map(obj => { return obj.id })
  483. this.groupOption.push({
  484. label: '全部',
  485. // value: idArr.join(',')
  486. value: ''
  487. })
  488. res.data.forEach(item => {
  489. const obj = {
  490. label: item.groupName,
  491. value: item.id
  492. }
  493. this.groupOption.push(obj)
  494. })
  495. // if (firstLoad) {
  496. // this.checkedBox(this.groupOption[1].value)
  497. // }
  498. }
  499. })
  500. },
  501. getDiscList() {
  502. this.discOption = []
  503. const data = {
  504. groupIds: this.search.groupIds
  505. }
  506. this.baseFQRequest('listAll', data).then(res => {
  507. if (res.data) {
  508. // const idArr = res.data.map(obj => { return obj.id })
  509. this.discOption.push({
  510. label: '全部',
  511. // value: idArr.join(',')
  512. value: ''
  513. })
  514. res.data.forEach(item => {
  515. const obj = {
  516. label: item.name,
  517. value: item.id
  518. }
  519. this.discOption.push(obj)
  520. })
  521. }
  522. })
  523. },
  524. baseRequest(opUrl, postData) {
  525. return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, '')
  526. },
  527. baseParkRequest: function(opUrl, postData) {
  528. return this.$channel.baseRequest('ParkInfoController', opUrl, postData, '')
  529. },
  530. baseFQRequest: function(opUrl, postData) {
  531. return this.$channel.baseRequest('ParkFloorDiscController', opUrl, postData, '')
  532. }
  533. }
  534. }
  535. </script>
  536. <style scoped>
  537. .ch-input .el-input__inner {
  538. border-color: #32323A;
  539. }
  540. .ch-input-size {
  541. width: 150px;
  542. }
  543. .ch-button {
  544. border-color: #32323A;
  545. background-color: #32323A;
  546. color: #fff;
  547. }
  548. .ch-button-warning {
  549. margin-left: 10px;
  550. border-color: #E6A23C;
  551. background-color: #E6A23C;
  552. color: #fff;
  553. }
  554. .ch-button-export {
  555. margin-left: 10px;
  556. border-color: #98CC1F;
  557. background-color: #98CC1F;
  558. color: #fff;
  559. }
  560. .listBox {
  561. margin-left: 20px;
  562. display: flex;
  563. flex-wrap: wrap;
  564. }
  565. .list {
  566. border-radius: 4px;
  567. margin-right: 20px;
  568. margin-top: 15px;
  569. cursor: pointer;
  570. margin-bottom: 15px;
  571. width: 138px;
  572. height: 28px;
  573. text-align: center;
  574. line-height: 28px;
  575. background: #EBEBEB;
  576. color: #777777;
  577. }
  578. .checked {
  579. color: #2C27D0;
  580. background: #EAEAF8;
  581. /*border: 1px solid #3377ff;*/
  582. }
  583. .ch-button-danger {
  584. margin-left: 10px;
  585. border-color: #ff4949;
  586. background-color: #ff4949;
  587. color: #fff;
  588. }
  589. </style>