index.vue 20 KB

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