paySettings.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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="8">
  8. <a-form-item>
  9. <a-select
  10. :maxTagCount="1"
  11. mode="multiple"
  12. v-model="queryParam.hotelId"
  13. placeholder="请选择"
  14. :allowClear="true"
  15. >
  16. <a-select-option :value="item.id" v-for="(item,index) in hotelList" :key="index">{{ item.name }}</a-select-option>
  17. </a-select>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="4" :sm="6">
  21. <a-form-item>
  22. <j-input placeholder="名称查询" v-model="queryParam.name"></j-input>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="4" :sm="6">
  26. <a-form-item>
  27. <j-dict-select-tag v-model="queryParam.status" placeholder="请选择状态" dictCode="pay_status"
  28. @change="e=>handleChangePayStatus(e)" />
  29. </a-form-item>
  30. </a-col>
  31. <a-col :md="4" :sm="6">
  32. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  33. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  34. </span>
  35. </a-col>
  36. </a-row>
  37. </a-form>
  38. </div>
  39. <!-- 查询区域-END -->
  40. <!-- 操作按钮区域 -->
  41. <div class="table-operator">
  42. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  43. <!-- <a-button type="primary" icon="download" @click="handleExportXls('支付方式')">导出</a-button>-->
  44. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  45. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  46. <!-- </a-upload>-->
  47. <!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  48. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  49. <a-dropdown v-if="selectedRowKeys.length > 0">
  50. <!-- <a-menu slot="overlay">-->
  51. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  52. <!-- </a-menu>-->
  53. <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  54. <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
  55. </a-dropdown>
  56. </div>
  57. <!-- table区域-begin -->
  58. <div>
  59. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  60. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  61. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  62. </div>
  63. <a-table
  64. ref="table"
  65. size="middle"
  66. :scroll="{x:true}"
  67. bordered
  68. rowKey="id"
  69. :columns="columns"
  70. :dataSource="dataSource"
  71. :pagination="ipagination"
  72. :loading="loading"
  73. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  74. class="j-table-force-nowrap"
  75. @change="handleTableChange">
  76. <template slot="htmlSlot" slot-scope="text">
  77. <div v-html="text"></div>
  78. </template>
  79. <span slot="status" slot-scope="text,record">
  80. <a-tag v-if="text == 1" color="green">已启用</a-tag>
  81. <a-tag v-else color="red">已禁用</a-tag>
  82. </span>
  83. <span slot="deposit" slot-scope="text,record">
  84. <a-icon v-if="text == true" type="check" style="color: #129617"/>
  85. <a-icon v-else type="close" style="color: #bb3726"/>
  86. </span>
  87. <span slot="closing" slot-scope="text,record">
  88. <a-icon v-if="text == true" type="check" style="color: #129617"/>
  89. <a-icon v-else type="close" style="color: #bb3726"/>
  90. </span>
  91. <template slot="imgSlot" slot-scope="text,record">
  92. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  93. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  94. </template>
  95. <template slot="fileSlot" slot-scope="text">
  96. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  97. <a-button
  98. v-else
  99. :ghost="true"
  100. type="primary"
  101. icon="download"
  102. size="small"
  103. @click="downloadFile(text)">
  104. 下载
  105. </a-button>
  106. </template>
  107. <span slot="action" slot-scope="text, record">
  108. <a @click="handleEdit(record)">编辑</a>
  109. <a-divider type="vertical" />
  110. <a-dropdown>
  111. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  112. <a-menu slot="overlay">
  113. <a-menu-item>
  114. <a @click="handleDetail(record)">详情</a>
  115. </a-menu-item>
  116. <a-menu-item>
  117. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  118. <a>删除</a>
  119. </a-popconfirm>
  120. </a-menu-item>
  121. </a-menu>
  122. </a-dropdown>
  123. </span>
  124. </a-table>
  125. </div>
  126. <room-pay-type-modal ref="modalForm" @ok="modalFormOk"></room-pay-type-modal>
  127. </a-card>
  128. </template>
  129. <script>
  130. import '@/assets/less/TableExpand.less'
  131. import { mixinDevice } from '@/utils/mixin'
  132. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  133. import roomPayTypeModal from './modules/roomPayTypeModal'
  134. import {hotelQueryList} from "../../../api/hotel";
  135. export default {
  136. name: 'paySettings',
  137. mixins:[JeecgListMixin, mixinDevice],
  138. components: {
  139. roomPayTypeModal
  140. },
  141. data () {
  142. return {
  143. description: '支付方式管理页面',
  144. // 表头
  145. columns: [
  146. // {
  147. // title: '#',
  148. // dataIndex: '',
  149. // key:'rowIndex',
  150. // width:60,
  151. // align:"center",
  152. // customRender:function (t,r,index) {
  153. // return parseInt(index)+1;
  154. // }
  155. // },
  156. // {
  157. // title:'关联租户',
  158. // align:"center",
  159. // dataIndex: 'tenantId'
  160. // },
  161. {
  162. title:'商家',
  163. align:"center",
  164. dataIndex: 'hotelName'
  165. },
  166. {
  167. title:'名称',
  168. align:"center",
  169. dataIndex: 'name'
  170. },
  171. {
  172. title:'是否用于押金付款',
  173. align:"center",
  174. dataIndex: 'isDeposit',
  175. scopedSlots: { customRender: 'deposit' },
  176. },
  177. {
  178. title:'是否用于结账付款',
  179. align:"center",
  180. dataIndex: 'isClosing',
  181. scopedSlots: { customRender: 'closing' },
  182. },
  183. {
  184. title:'排序',
  185. align:"center",
  186. dataIndex: 'orderBy'
  187. },
  188. {
  189. title:'状态',
  190. align:"center",
  191. dataIndex: 'status',
  192. scopedSlots: { customRender: 'status' },
  193. },
  194. {
  195. title: '操作',
  196. dataIndex: 'action',
  197. align:"center",
  198. fixed:"right",
  199. width:147,
  200. scopedSlots: { customRender: 'action' }
  201. }
  202. ],
  203. url: {
  204. list: "/business/busRoomPayType/list",
  205. delete: "/business/busRoomPayType/delete",
  206. deleteBatch: "/business/busRoomPayType/deleteBatch",
  207. exportXlsUrl: "/business/busRoomPayType/exportXls",
  208. importExcelUrl: "business/busRoomPayType/importExcel",
  209. },
  210. dictOptions:{},
  211. superFieldList:[],
  212. hotelList:[],
  213. }
  214. },
  215. created() {
  216. this.getSuperFieldList();
  217. this.initData();
  218. },
  219. computed: {
  220. importExcelUrl: function(){
  221. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  222. },
  223. },
  224. methods: {
  225. initDictConfig(){
  226. },
  227. initData(){
  228. hotelQueryList({
  229. key: ''
  230. }).then(res => {
  231. console.log(res)
  232. if (res.code == 200 && res.result) {
  233. this.hotelList = res.result;
  234. }
  235. })
  236. },
  237. getSuperFieldList(){
  238. let fieldList=[];
  239. fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
  240. fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
  241. fieldList.push({type:'string',value:'name',text:'支付方式名称'})
  242. fieldList.push({type:'string',value:'isDeposit',text:'是否用于押金付款'})
  243. fieldList.push({type:'string',value:'isClosing',text:'是否用于结账付款'})
  244. fieldList.push({type:'int',value:'orderBy',text:'排序'})
  245. fieldList.push({type:'int',value:'status',text:'状态(0-禁用;1-启用)'})
  246. fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
  247. this.superFieldList = fieldList
  248. },
  249. handleChangePayStatus(value){
  250. console.log(value)
  251. this.loadData(1)
  252. }
  253. }
  254. }
  255. </script>
  256. <style scoped>
  257. @import '~@assets/less/common.less';
  258. </style>