index.vue 19 KB

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