index.vue 20 KB

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