BusHotelList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <a-card :bordered='false'>
  3. <!-- 查询区域 -->
  4. <div class='table-page-search-wrapper'>
  5. <a-form layout='inline' @keyup.enter.native='searchQuery'>
  6. <a-row :gutter='24'>
  7. <a-col :md="6" :sm="12">
  8. <a-form-item label="名称">
  9. <j-input placeholder="输入名称模糊查询" v-model="queryParam.name"></j-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="联系人">
  14. <j-input placeholder="请输入联系人模糊查询" v-model="queryParam.linkName"></j-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="8">
  18. <a-form-item label="联系电话">
  19. <j-input placeholder="请输入联系电话模糊查询" v-model="queryParam.linkTel"></j-input>
  20. </a-form-item>
  21. </a-col>
  22. <template v-if="toggleSearchStatus">
  23. <a-col :md="6" :sm="8">
  24. <a-form-item label="酒店电话">
  25. <j-input placeholder="请输入酒店电话模糊查询" v-model="queryParam.tel"></j-input>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="8">
  29. <a-form-item label="酒店地址">
  30. <j-input placeholder="请输入酒店地址模糊查询" v-model="queryParam.address"></j-input>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :md="6" :sm="8">
  34. <a-form-item label="审核状态">
  35. <a-select v-model="queryParam.checkStatus" placeholder="请选择">
  36. <a-select-option value="">请选择</a-select-option>
  37. <a-select-option value="0">待审核</a-select-option>
  38. <a-select-option value="1">审核通过</a-select-option>
  39. <a-select-option value="2">审核未通过</a-select-option>
  40. </a-select>
  41. </a-form-item>
  42. </a-col>
  43. </template>
  44. <a-col :md="6" :sm="8">
  45. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  46. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  47. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  48. <a @click="handleToggleSearch" style="margin-left: 8px">
  49. {{ toggleSearchStatus ? '收起' : '展开' }}
  50. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  51. </a>
  52. </span>
  53. </a-col>
  54. </a-row>
  55. </a-form>
  56. </div>
  57. <!-- 查询区域-END -->
  58. <!-- 操作按钮区域 -->
  59. <div class='table-operator'>
  60. <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
  61. <!-- handleExportXls-->
  62. <!-- <a-button type='primary' icon='download' @click="handleHotelExportXls('酒店信息')">导出</a-button>-->
  63. <!-- <a-upload-->
  64. <!-- name='file'-->
  65. <!-- :showUploadList='false'-->
  66. <!-- :multiple='false'-->
  67. <!-- :headers='tokenHeader'-->
  68. <!-- :action='importExcelUrl'-->
  69. <!-- @change='handleHotelImportExcel'>-->
  70. <!-- <a-button type='primary' icon='import'>导入</a-button>-->
  71. <!-- </a-upload>-->
  72. <!-- 高级查询区域 -->
  73. <!-- <j-super-query :fieldList='superFieldList' ref='superQueryModal' @handleSuperQuery='handleSuperQuery'></j-super-query>-->
  74. <a-dropdown v-if='selectedRowKeys.length > 0'>
  75. <a-menu slot='overlay'>
  76. <a-menu-item key='1' @click='batchDel'><a-icon type='delete'/>删除</a-menu-item>
  77. </a-menu>
  78. <a-button style='margin-left: 8px'> 批量操作 <a-icon type='down' /></a-button>
  79. </a-dropdown>
  80. </div>
  81. <!-- table区域-begin -->
  82. <div>
  83. <div class='ant-alert ant-alert-info' style='margin-bottom: 16px'>
  84. <i class='anticon anticon-info-circle ant-alert-icon'></i> 已选择 <a style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
  85. <a style='margin-left: 24px' @click='onClearSelected'>清空</a>
  86. </div>
  87. <a-table
  88. ref='table'
  89. size='middle'
  90. :scroll='{x:true}'
  91. bordered
  92. rowKey='id'
  93. :columns='columns'
  94. :dataSource='dataSource'
  95. :pagination='ipagination'
  96. :loading='loading'
  97. :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
  98. class='j-table-force-nowrap'
  99. @change='handleTableChange'>
  100. <template slot='htmlSlot' slot-scope='text'>
  101. <div v-html='text'></div>
  102. </template>
  103. <template slot='imgSlot' slot-scope='text, record'>
  104. <span v-if='!text' style='font-size: 12px;font-style: italic'>无图片</span>
  105. <img
  106. v-else
  107. :src='getImgView(text)'
  108. :preview='record.id'
  109. height='25px'
  110. alt=''
  111. style='max-width:80px;font-size: 12px;font-style: italic'/>
  112. </template>
  113. <template slot='fileSlot' slot-scope='text'>
  114. <span v-if='!text' style='font-size: 12px;font-style: italic'>无文件</span>
  115. <a-button
  116. v-else
  117. :ghost='true'
  118. type='primary'
  119. icon='download'
  120. size='small'
  121. @click='downloadFile(text)'>
  122. 下载
  123. </a-button>
  124. </template>
  125. <span slot='action' slot-scope='text, record'>
  126. <a @click='handleEdit(record)'>编辑</a>
  127. <a-divider v-if="record.checkStatus == 0" type='vertical' />
  128. <a v-if="record.checkStatus == 0" class="padding_left_8" @click='handleCheck(record)'>审核</a>
  129. <a-divider type='vertical' />
  130. <a-dropdown>
  131. <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
  132. <a-menu slot='overlay'>
  133. <a-menu-item>
  134. <a @click='handleDetail(record)'>详情</a>
  135. </a-menu-item>
  136. <!-- <a-menu-item>-->
  137. <!-- <a v-if="record.checkStatus == 0" @click='handleCheck(record)'>审核</a>-->
  138. <!-- </a-menu-item>-->
  139. <a-menu-item>
  140. <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
  141. <a>删除</a>
  142. </a-popconfirm>
  143. </a-menu-item>
  144. </a-menu>
  145. </a-dropdown>
  146. </span>
  147. </a-table>
  148. </div>
  149. <bus-hotel-modal ref='modalForm' @ok='modalFormOk'></bus-hotel-modal>
  150. </a-card>
  151. </template>
  152. <script>
  153. import { deleteAction, getAction, downFile, getFileAccessHttpUrl } from '@/api/manage'
  154. import '@/assets/less/TableExpand.less'
  155. import { mixinDevice } from '@/utils/mixin'
  156. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  157. import BusHotelModal from './modules/BusHotelModal'
  158. export default {
  159. name: 'BusHotelList',
  160. mixins:[JeecgListMixin, mixinDevice],
  161. components: {
  162. BusHotelModal
  163. },
  164. data () {
  165. return {
  166. description: 'bus_hotel管理页面',
  167. // 表头
  168. columns: [
  169. // {
  170. // title: '#',
  171. // dataIndex: '',
  172. // key: 'rowIndex',
  173. // width: 60,
  174. // align: 'center',
  175. // customRender: function (t, r, index) {
  176. // return parseInt(index) + 1
  177. // }
  178. // },
  179. {
  180. title: '关联租户',
  181. align: 'center',
  182. fixed: 'left',
  183. width: 120,
  184. ellipsis: true,
  185. dataIndex: 'tenantName'
  186. },
  187. {
  188. title: '酒店名称',
  189. align: 'center',
  190. fixed: 'left',
  191. width: 120,
  192. ellipsis: true,
  193. dataIndex: 'name'
  194. },
  195. {
  196. title: '联系人',
  197. align: 'center',
  198. width: 80,
  199. dataIndex: 'linkName'
  200. },
  201. {
  202. title: '联系电话',
  203. align: 'center',
  204. width: 80,
  205. dataIndex: 'linkTel'
  206. },
  207. {
  208. title: '酒店电话',
  209. align: 'center',
  210. width: 80,
  211. dataIndex: 'tel'
  212. },
  213. {
  214. title: '酒店地址',
  215. align: 'center',
  216. dataIndex: 'address'
  217. },
  218. {
  219. title: '备注',
  220. align: 'center',
  221. dataIndex: 'remarks'
  222. },
  223. {
  224. title: '状态',
  225. align: "center",
  226. dataIndex: 'checkStatus_dictText'
  227. },
  228. {
  229. title: '审核信息',
  230. align: 'center',
  231. dataIndex: 'checkRemarks'
  232. },
  233. // {
  234. // title: '星级',
  235. // align: 'center',
  236. // dataIndex: 'star'
  237. // },
  238. // {
  239. // title: '经度',
  240. // align: 'center',
  241. // dataIndex: 'lng'
  242. // },
  243. // {
  244. // title: '纬度',
  245. // align: 'center',
  246. // dataIndex: 'lat'
  247. // },
  248. // {
  249. // title: '客房总数',
  250. // align: 'center',
  251. // dataIndex: 'roomCount'
  252. // },
  253. // {
  254. // title: '开业时间',
  255. // align: 'center',
  256. // dataIndex: 'openTime',
  257. // customRender: function (text) {
  258. // return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
  259. // }
  260. // },
  261. // {
  262. // title: '装修时间',
  263. // align: 'center',
  264. // dataIndex: 'renovationTime',
  265. // customRender: function (text) {
  266. // return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
  267. // }
  268. // },
  269. // {
  270. // title: '酒店主题',
  271. // align: 'center',
  272. // dataIndex: 'topic'
  273. // },
  274. // {
  275. // title: '酒店政策',
  276. // align: 'center',
  277. // dataIndex: 'policy'
  278. // },
  279. // {
  280. // title: '酒店介绍',
  281. // align: 'center',
  282. // dataIndex: 'introduction'
  283. // },
  284. // {
  285. // title: '预订提醒',
  286. // align: 'center',
  287. // dataIndex: 'reserveRemind'
  288. // },
  289. // {
  290. // title: '交通和周边',
  291. // align: 'center',
  292. // dataIndex: 'traffic'
  293. // },
  294. // {
  295. // title: '门头照',
  296. // align: 'center',
  297. // dataIndex: 'ewmLogo'
  298. // },
  299. // {
  300. // title: '酒店图片',
  301. // align: 'center',
  302. // dataIndex: 'imgs'
  303. // },
  304. // {
  305. // title: '营业执照',
  306. // align: 'center',
  307. // dataIndex: 'yyImg'
  308. // },
  309. // {
  310. // title: '特种行业许可证',
  311. // align: 'center',
  312. // dataIndex: 'tzhyImg'
  313. // },
  314. // {
  315. // title: '企业法人',
  316. // align: 'center',
  317. // dataIndex: 'legalPerson'
  318. // },
  319. // {
  320. // title: '经营场所',
  321. // align: 'center',
  322. // dataIndex: 'registeredAddress'
  323. // },
  324. // {
  325. // title: '注册号',
  326. // align: 'center',
  327. // dataIndex: 'unifiedCode'
  328. // },
  329. // {
  330. // title: '有效期',
  331. // align: 'center',
  332. // dataIndex: 'businessTerm',
  333. // customRender: function (text) {
  334. // return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
  335. // }
  336. // },
  337. // {
  338. // title: '身份证正面照',
  339. // align: 'center',
  340. // dataIndex: 'sfzImg1'
  341. // },
  342. // {
  343. // title: '身份证反面照',
  344. // align: 'center',
  345. // dataIndex: 'sfzImg2'
  346. // },
  347. // {
  348. // title: '身份证手持照',
  349. // align: 'center',
  350. // dataIndex: 'sfzImg3'
  351. // },
  352. // {
  353. // title: '身份证姓名',
  354. // align: 'center',
  355. // dataIndex: 'sfzName'
  356. // },
  357. // {
  358. // title: '身份证号',
  359. // align: 'center',
  360. // dataIndex: 'idCard'
  361. // },
  362. // {
  363. // title: '服务商',
  364. // align: 'center',
  365. // dataIndex: 'sellerName'
  366. // },
  367. // {
  368. // title: '邀请码',
  369. // align: 'center',
  370. // dataIndex: 'invitationCode'
  371. // },
  372. // {
  373. // title: '总店',
  374. // align: 'center',
  375. // dataIndex: 'superiorSellerId'
  376. // },
  377. // {
  378. // title: '银联支付',
  379. // align: 'center',
  380. // dataIndex: 'unionpay'
  381. // },
  382. // {
  383. // title: '到店支付',
  384. // align: 'center',
  385. // dataIndex: 'ddOpen'
  386. // },
  387. // {
  388. // title: '微信支付',
  389. // align: 'center',
  390. // dataIndex: 'wxOpen'
  391. // },
  392. // {
  393. // title: '余额支付',
  394. // align: 'center',
  395. // dataIndex: 'yeOpen'
  396. // },
  397. {
  398. title: '操作',
  399. dataIndex: 'action',
  400. align: 'center',
  401. fixed: 'right',
  402. width: 147,
  403. scopedSlots: { customRender: 'action' }
  404. }
  405. ],
  406. url: {
  407. list: '/business/busHotel/list',
  408. delete: '/business/busHotel/delete',
  409. deleteBatch: '/business/busHotel/deleteBatch',
  410. exportXlsUrl: '/business/busHotel/exportXls',
  411. importExcelUrl: '/business/busHotel/importExcel'
  412. },
  413. dictOptions: {},
  414. superFieldList: []
  415. }
  416. },
  417. created() {
  418. this.getSuperFieldList()
  419. },
  420. computed: {
  421. importExcelUrl: function() {
  422. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  423. }
  424. },
  425. methods: {
  426. initDictConfig() {
  427. },
  428. getSuperFieldList() {
  429. let fieldList = []
  430. fieldList.push({
  431. type: 'string', value: 'tenantId', text: '关联租户'
  432. })
  433. fieldList.push({
  434. type: 'string', value: 'name', text: '酒店名称'
  435. })
  436. fieldList.push({
  437. type: 'string', value: 'linkName', text: '联系人'
  438. })
  439. fieldList.push({
  440. type: 'string', value: 'linkTel', text: '联系电话'
  441. })
  442. fieldList.push({
  443. type: 'string', value: 'tel', text: '酒店电话'
  444. })
  445. fieldList.push({
  446. type: 'string', value: 'address', text: '酒店地址'
  447. })
  448. fieldList.push({
  449. type: 'string', value: 'star', text: '星级'
  450. })
  451. fieldList.push({
  452. type: 'number', value: 'lng', text: '经度'
  453. })
  454. fieldList.push({
  455. type: 'number', value: 'lat', text: '纬度'
  456. })
  457. fieldList.push({
  458. type: 'int', value: 'roomCount', text: '客房总数'
  459. })
  460. fieldList.push({
  461. type: 'date', value: 'openTime', text: '开业时间'
  462. })
  463. fieldList.push({
  464. type: 'date', value: 'renovationTime', text: '装修时间'
  465. })
  466. fieldList.push({
  467. type: 'string', value: 'topic', text: '酒店主题'
  468. })
  469. fieldList.push({
  470. type: 'string', value: 'policy', text: '酒店政策'
  471. })
  472. fieldList.push({
  473. type: 'string', value: 'introduction', text: '酒店介绍'
  474. })
  475. fieldList.push({
  476. type: 'string', value: 'reserveRemind', text: '预订提醒'
  477. })
  478. fieldList.push({
  479. type: 'string', value: 'traffic', text: '交通和周边'
  480. })
  481. fieldList.push({
  482. type: 'string', value: 'ewmLogo', text: '门头照'
  483. })
  484. fieldList.push({
  485. type: 'string', value: 'imgs', text: '酒店图片'
  486. })
  487. fieldList.push({
  488. type: 'string', value: 'yyImg', text: '营业执照'
  489. })
  490. fieldList.push({
  491. type: 'string', value: 'tzhyImg', text: '特种行业许可证'
  492. })
  493. fieldList.push({
  494. type: 'string', value: 'legalPerson', text: '企业法人'
  495. })
  496. fieldList.push({
  497. type: 'string', value: 'registeredAddress', text: '经营场所'
  498. })
  499. fieldList.push({
  500. type: 'string', value: 'unifiedCode', text: '注册号'
  501. })
  502. fieldList.push({
  503. type: 'date', value: 'businessTerm', text: '有效期'
  504. })
  505. fieldList.push({
  506. type: 'string', value: 'sfzImg1', text: '身份证正面照'
  507. })
  508. fieldList.push({
  509. type: 'string', value: 'sfzImg2', text: '身份证反面照'
  510. })
  511. fieldList.push({
  512. type: 'string', value: 'sfzImg3', text: '身份证手持照'
  513. })
  514. fieldList.push({
  515. type: 'string', value: 'sfzName', text: '身份证姓名'
  516. })
  517. fieldList.push({
  518. type: 'string', value: 'idCard', text: '身份证号'
  519. })
  520. fieldList.push({
  521. type: 'string', value: 'sellerName', text: '服务商'
  522. })
  523. fieldList.push({
  524. type: 'string', value: 'invitationCode', text: '邀请码'
  525. })
  526. fieldList.push({
  527. type: 'string', value: 'superiorSellerId', text: '总店'
  528. })
  529. fieldList.push({
  530. type: 'string', value: 'unionpay', text: '银联支付'
  531. })
  532. fieldList.push({
  533. type: 'string', value: 'ddOpen', text: '到店支付'
  534. })
  535. fieldList.push({
  536. type: 'string', value: 'wxOpen', text: '微信支付'
  537. })
  538. fieldList.push({
  539. type: 'string', value: 'yeOpen', text: '余额支付'
  540. })
  541. this.superFieldList = fieldList
  542. },
  543. handleHotelExportXls(fileName) {
  544. if (!fileName || typeof fileName !== 'string') {
  545. fileName = '导出文件'
  546. }
  547. let param = this.getQueryParams()
  548. if(this.selectedRowKeys && this.selectedRowKeys.length > 0 ) {
  549. param['selections'] = this.selectedRowKeys.join(',')
  550. }
  551. console.log('导出参数', param)
  552. downFile(this.url.exportXlsUrl, param).then((data) => {
  553. if (!data) {
  554. this.$message.warning('文件下载失败')
  555. return
  556. }
  557. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  558. window.navigator.msSaveBlob(new Blob([data], {
  559. type: 'application/vnd.ms-excel'
  560. }), fileName + '.xls')
  561. } else {
  562. let url = window.URL.createObjectURL(new Blob([data], {
  563. type: 'application/vnd.ms-excel'
  564. }))
  565. let link = document.createElement('a')
  566. link.style.display = 'none'
  567. link.href = url
  568. link.setAttribute('download', fileName + '.xls')
  569. document.body.appendChild(link)
  570. link.click()
  571. document.body.removeChild(link) // 下载完成移除元素
  572. window.URL.revokeObjectURL(url) // 释放掉blob对象
  573. }
  574. })
  575. },
  576. handleHotelImportExcel() {
  577. console.log(444)
  578. },
  579. handleCheck: function(record) {
  580. console.log(this.$refs)
  581. this.$refs.modalForm.check(record)
  582. this.$refs.modalForm.title = '审核'
  583. this.$refs.modalForm.disableSubmit = false
  584. }
  585. }
  586. }
  587. </script>
  588. <style scoped>
  589. @import '~@assets/less/common.less'
  590. .padding_left_8{
  591. padding-left: 8px;
  592. }
  593. </style>