You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
8.6 KiB

  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. <a-input placeholder="请输入用户编号" v-model="queryParam.userId"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="12">
  13. <a-form-item label="交易类型">
  14. <j-dict-select-tag dict-code="balance_type" placeholder="请选择交易类型" v-model="queryParam.type"></j-dict-select-tag>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="12">
  18. <a-form-item label="状态">
  19. <j-dict-select-tag dict-code="balance_status" placeholder="请选择状态" v-model="queryParam.status"></j-dict-select-tag>
  20. </a-form-item>
  21. </a-col>
  22. </a-row>
  23. </a-form>
  24. </div>
  25. <!-- 查询区域-END -->
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <!-- <a-button type="primary" icon="download" @click="handleExportXls('hotel_balance_log')">导出</a-button>-->
  30. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  31. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  32. <!-- </a-upload>-->
  33. <!-- 高级查询区域 -->
  34. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  35. <a-dropdown v-if="selectedRowKeys.length > 0">
  36. <a-menu slot="overlay">
  37. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  38. </a-menu>
  39. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  40. </a-dropdown>
  41. </div>
  42. <!-- table区域-begin -->
  43. <div>
  44. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  45. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
  46. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  47. </div>
  48. <a-table
  49. ref="table"
  50. size="middle"
  51. :scroll="{x:true}"
  52. bordered
  53. rowKey="id"
  54. :columns="columns"
  55. :dataSource="dataSource"
  56. :pagination="ipagination"
  57. :loading="loading"
  58. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  59. class="j-table-force-nowrap"
  60. @change="handleTableChange">
  61. <template slot="htmlSlot" slot-scope="text">
  62. <div v-html="text"></div>
  63. </template>
  64. <template slot="imgSlot" slot-scope="text,record">
  65. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  66. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  67. </template>
  68. <template slot="fileSlot" slot-scope="text">
  69. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  70. <a-button
  71. v-else
  72. :ghost="true"
  73. type="primary"
  74. icon="download"
  75. size="small"
  76. @click="downloadFile(text)">
  77. 下载
  78. </a-button>
  79. </template>
  80. <span slot="action" slot-scope="text, record">
  81. <!-- <a @click="handleEdit(record)">编辑</a>-->
  82. <div v-if="record.status === 0">
  83. <a @click="handleAudit(record,0)">审核通过</a>
  84. <a-divider type="vertical" />
  85. <a @click="handleAudit(record,1)">审核不通过</a>
  86. </div>
  87. <div v-if="record.status === 1">
  88. <a @click="handleWithdrawal(record)">打款</a>
  89. </div>
  90. <a-dropdown>
  91. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  92. <a-menu slot="overlay">
  93. <a-menu-item>
  94. <a @click="handleDetail(record)">详情</a>
  95. </a-menu-item>
  96. <!-- <a-menu-item>-->
  97. <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
  98. <!-- <a>删除</a>-->
  99. <!-- </a-popconfirm>-->
  100. <!-- </a-menu-item>-->
  101. </a-menu>
  102. </a-dropdown>
  103. </span>
  104. </a-table>
  105. </div>
  106. <hotel-balance-log-modal ref="modalForm" @ok="modalFormOk"></hotel-balance-log-modal>
  107. </a-card>
  108. </template>
  109. <script>
  110. import '@/assets/less/TableExpand.less'
  111. import { mixinDevice } from '@/utils/mixin'
  112. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  113. import HotelBalanceLogModal from './modules/HotelBalanceLogModal'
  114. import { httpAction, getAction } from '@/api/manage'
  115. export default {
  116. name: 'HotelBalanceLogList',
  117. mixins:[JeecgListMixin, mixinDevice],
  118. components: {
  119. HotelBalanceLogModal
  120. },
  121. data () {
  122. return {
  123. description: 'hotel_balance_log管理页面',
  124. // 表头
  125. columns: [
  126. {
  127. title: '#',
  128. dataIndex: '',
  129. key:'rowIndex',
  130. width:60,
  131. align:"center",
  132. customRender:function (t,r,index) {
  133. return parseInt(index)+1;
  134. }
  135. },
  136. {
  137. title:'用户编号',
  138. align:"center",
  139. dataIndex: 'userId'
  140. },
  141. {
  142. title:'余额',
  143. align:"center",
  144. dataIndex: 'balance'
  145. },
  146. {
  147. title:'用户余额',
  148. align:"center",
  149. dataIndex: 'userBalance'
  150. },
  151. {
  152. title:'类型',
  153. align:"center",
  154. dataIndex: 'type_dictText'
  155. },
  156. {
  157. title:'状态',
  158. align:"center",
  159. dataIndex: 'status_dictText'
  160. },
  161. {
  162. title:'是否删除',
  163. align:"center",
  164. dataIndex: 'delFlag_dictText'
  165. },
  166. {
  167. title: '操作',
  168. dataIndex: 'action',
  169. align:"center",
  170. fixed:"right",
  171. width:147,
  172. scopedSlots: { customRender: 'action' }
  173. }
  174. ],
  175. url: {
  176. list: "/hotelbalancelog/hotelBalanceLog/list2",
  177. delete: "/hotelbalancelog/hotelBalanceLog/delete",
  178. deleteBatch: "/hotelbalancelog/hotelBalanceLog/deleteBatch",
  179. exportXlsUrl: "/hotelbalancelog/hotelBalanceLog/exportXls",
  180. importExcelUrl: "hotelbalancelog/hotelBalanceLog/importExcel",
  181. auditUrl: "/hotelbalancelog/hotelBalanceLog/audit",
  182. withdrawalUrl: "/hotelbalancelog/hotelBalanceLog/withdrawal"
  183. },
  184. dictOptions:{},
  185. superFieldList:[],
  186. }
  187. },
  188. created() {
  189. this.getSuperFieldList();
  190. },
  191. computed: {
  192. importExcelUrl: function(){
  193. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  194. },
  195. },
  196. methods: {
  197. initDictConfig(){
  198. },
  199. getSuperFieldList(){
  200. let fieldList=[];
  201. fieldList.push({type:'string',value:'userId',text:'用户id',dictCode:''})
  202. fieldList.push({type:'BigDecimal',value:'balance',text:'余额',dictCode:''})
  203. // fieldList.push({type:'BigDecimal',value:'userBalance',text:'用户余额',dictCode:''})
  204. // fieldList.push({type:'int',value:'type',text:'类型 0交易 1提现',dictCode:''})
  205. // fieldList.push({type:'int',value:'status',text:'状态 0未审核 1已审核未打款 2已打款 3审核未通过',dictCode:''})
  206. // fieldList.push({type:'int',value:'delFlag',text:'是否删除 0否 1是',dictCode:''})
  207. this.superFieldList = fieldList
  208. },
  209. handleAudit(obj,e){
  210. let param = {
  211. id: obj.id,
  212. audit: e
  213. }
  214. httpAction(this.url.auditUrl,param,'POST').then((res)=>{
  215. if(res.success){
  216. this.$message.success(res.message);
  217. this.loadData();
  218. }else{
  219. this.$message.warning(res.message);
  220. }
  221. })
  222. },
  223. handleWithdrawal(obj){
  224. let param = {
  225. id: obj.id
  226. }
  227. httpAction(this.url.withdrawalUrl,param,"POST").then((res)=>{
  228. if(res.success){
  229. this.$message.success(res.message);
  230. this.loadData();
  231. }else{
  232. this.$message.warning(res.message);
  233. }
  234. })
  235. }
  236. }
  237. }
  238. </script>
  239. <style scoped>
  240. @import '~@assets/less/common.less';
  241. </style>