payApiSettings.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <!--<template>-->
  2. <!-- <a-spin :spinning="confirmLoading">-->
  3. <!-- <j-form-container :disabled="formDisabled">-->
  4. <!-- <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">-->
  5. <!-- <a-form-item v-show="false"><a-input v-model="model.id"/></a-form-item>-->
  6. <!-- <a-row>-->
  7. <!-- <a-col :span="24">-->
  8. <!-- <a-form-model-item label="是否启用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">-->
  9. <!-- <a-select v-model="model.status" style="width: 100%">-->
  10. <!-- <a-select-option value="0">关闭</a-select-option>-->
  11. <!-- <a-select-option value="1">启用</a-select-option>-->
  12. <!-- &lt;!&ndash; <a-select-option v-for="(item,index) in cardinalList" style="width: 100%"&ndash;&gt;-->
  13. <!-- &lt;!&ndash; :key="index" :value="item.value">{{ item.text || item.label }}</a-select-option>&ndash;&gt;&ndash;&gt;-->
  14. <!-- </a-select>-->
  15. <!-- </a-form-model-item>-->
  16. <!-- </a-col>-->
  17. <!-- <a-col :span="24">-->
  18. <!-- <a-form-model-item label="绑定" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="payTypeId">-->
  19. <!-- <a-select-->
  20. <!-- v-model="model.payTypeId"-->
  21. <!-- placeholder="请选择支付方式"-->
  22. <!-- :allowClear="true"-->
  23. <!-- >-->
  24. <!-- <a-select-option :value="item.id" v-for="(item,index) in payTypeList" :key="index">{{ item.name }}</a-select-option>-->
  25. <!-- </a-select>-->
  26. <!-- </a-form-model-item>-->
  27. <!-- </a-col>-->
  28. <!-- <a-col :span="24">-->
  29. <!-- <a-form-model-item label="商户号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="merchantNo">-->
  30. <!-- <a-input v-model="model.merchantNo" placeholder="请输入商户号" ></a-input>-->
  31. <!-- </a-form-model-item>-->
  32. <!-- </a-col>-->
  33. <!-- <a-col :span="24">-->
  34. <!-- <a-form-model-item label="终端号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="terminalNo">-->
  35. <!-- <a-input v-model="model.terminalNo" placeholder="请输入终端号" ></a-input>-->
  36. <!-- </a-form-model-item>-->
  37. <!-- </a-col>-->
  38. <!-- <a-col :span="24">-->
  39. <!-- <a-form-model-item label="TOKEN令牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="token">-->
  40. <!-- <a-input v-model="model.token" placeholder="请输入TOKEN令牌" ></a-input>-->
  41. <!-- </a-form-model-item>-->
  42. <!-- </a-col>-->
  43. <!-- </a-row>-->
  44. <!-- <a-button type="primary" @click="submitForm">确定</a-button>-->
  45. <!-- </a-form-model>-->
  46. <!-- </j-form-container>-->
  47. <!-- </a-spin>-->
  48. <!--</template>-->
  49. <!--<script>-->
  50. <!-- import { httpAction, getAction } from '@/api/manage'-->
  51. <!-- import { validateDuplicateValue } from '@/utils/util'-->
  52. <!-- import {getPayApiConfigInfo} from "../../../api/api";-->
  53. <!-- export default {-->
  54. <!-- name: 'payApiSettings',-->
  55. <!-- components: {-->
  56. <!-- },-->
  57. <!-- props: {-->
  58. <!-- //表单禁用-->
  59. <!-- disabled: {-->
  60. <!-- type: Boolean,-->
  61. <!-- default: false,-->
  62. <!-- required: false-->
  63. <!-- }-->
  64. <!-- },-->
  65. <!-- data () {-->
  66. <!-- return {-->
  67. <!-- model:{-->
  68. <!-- },-->
  69. <!-- labelCol: {-->
  70. <!-- xs: { span: 24 },-->
  71. <!-- sm: { span: 3 },-->
  72. <!-- },-->
  73. <!-- wrapperCol: {-->
  74. <!-- xs: { span: 24 },-->
  75. <!-- sm: { span: 20 },-->
  76. <!-- },-->
  77. <!-- confirmLoading: false,-->
  78. <!-- validatorRules: {-->
  79. <!-- status: [-->
  80. <!-- { required: true, message: '请选择是否启用!'},-->
  81. <!-- ],-->
  82. <!-- payTypeId: [-->
  83. <!-- { required: true, message: '请选择关联支付方式!'},-->
  84. <!-- ],-->
  85. <!-- merchantNo: [-->
  86. <!-- { required: true, message: '请输入商户号!'},-->
  87. <!-- ],-->
  88. <!-- terminalNo: [-->
  89. <!-- { required: true, message: '请输入终端号!'},-->
  90. <!-- ],-->
  91. <!-- token: [-->
  92. <!-- { required: true, message: '请输入TOKEN令牌!'},-->
  93. <!-- ],-->
  94. <!-- },-->
  95. <!-- url: {-->
  96. <!-- add: "/business/busPayInterfaceConfig/add",-->
  97. <!-- edit: "/business/busPayInterfaceConfig/edit",-->
  98. <!-- query_payType: "/business/busRoomPayType/queryList",-->
  99. <!-- },-->
  100. <!-- payTypeList:[]-->
  101. <!-- }-->
  102. <!-- },-->
  103. <!-- computed: {-->
  104. <!-- formDisabled(){-->
  105. <!-- return this.disabled-->
  106. <!-- },-->
  107. <!-- },-->
  108. <!-- created () {-->
  109. <!-- //备份model原始值-->
  110. <!-- this.modelDefault = JSON.parse(JSON.stringify(this.model));-->
  111. <!-- var _info = JSON.parse(localStorage.getItem("storeInfo"));-->
  112. <!-- setTimeout(() => {-->
  113. <!-- getPayApiConfigInfo({-->
  114. <!-- }).then(res => {-->
  115. <!-- console.log(res)-->
  116. <!-- if (res.code == 200 && res.result ) {-->
  117. <!-- var info = res.result-->
  118. <!-- this.model = {-->
  119. <!-- id: info.id,-->
  120. <!-- status :info.status.toString(),-->
  121. <!-- payTypeId:info.payTypeId,-->
  122. <!-- merchantNo:info.merchantNo,-->
  123. <!-- terminalNo:info.terminalNo,-->
  124. <!-- token:info.token-->
  125. <!-- };-->
  126. <!-- }-->
  127. <!-- })-->
  128. <!-- }, 100)-->
  129. <!-- getAction(this.url.query_payType,{}).then((res)=>{-->
  130. <!-- if(res.success){-->
  131. <!-- this.payTypeList = res.result-->
  132. <!-- }else{-->
  133. <!-- }-->
  134. <!-- })-->
  135. <!-- },-->
  136. <!-- methods: {-->
  137. <!-- add () {-->
  138. <!-- this.edit(this.modelDefault);-->
  139. <!-- },-->
  140. <!-- edit (record) {-->
  141. <!-- this.model = Object.assign({}, record);-->
  142. <!-- this.visible = true;-->
  143. <!-- },-->
  144. <!-- submitForm () {-->
  145. <!-- const that = this;-->
  146. <!-- // 触发表单验证-->
  147. <!-- this.$refs.form.validate(valid => {-->
  148. <!-- if (valid) {-->
  149. <!-- that.confirmLoading = true;-->
  150. <!-- let httpurl = '';-->
  151. <!-- let method = '';-->
  152. <!-- if(!this.model.id){-->
  153. <!-- httpurl+=this.url.add;-->
  154. <!-- method = 'post';-->
  155. <!-- var info = JSON.parse(localStorage.getItem("storeInfo"));-->
  156. <!-- this.model.hotelId = info.id;-->
  157. <!-- }else{-->
  158. <!-- httpurl+=this.url.edit;-->
  159. <!-- method = 'put';-->
  160. <!-- }-->
  161. <!-- httpAction(httpurl,this.model,method).then((res)=>{-->
  162. <!-- if(res.success){-->
  163. <!-- that.$message.success(res.message);-->
  164. <!-- that.$emit('ok');-->
  165. <!-- that.model.id = res.result.id-->
  166. <!-- }else{-->
  167. <!-- that.$message.warning(res.message);-->
  168. <!-- }-->
  169. <!-- }).finally(() => {-->
  170. <!-- that.confirmLoading = false;-->
  171. <!-- })-->
  172. <!-- }-->
  173. <!-- })-->
  174. <!-- },-->
  175. <!-- }-->
  176. <!-- }-->
  177. <!--</script>-->
  178. <template>
  179. <a-card :bordered="false">
  180. <!-- 查询区域 -->
  181. <div class="table-page-search-wrapper">
  182. <a-form layout="inline" @keyup.enter.native="searchQuery">
  183. <a-row :gutter="24">
  184. <a-col :md="6" :sm="8">
  185. <a-form-item>
  186. <a-select
  187. v-model="queryParam.payTypeId"
  188. placeholder="请选择"
  189. :allowClear="true"
  190. >
  191. <a-select-option :value="item.id" v-for="(item,index) in payTypeList" :key="index">{{ item.name }}</a-select-option>
  192. </a-select>
  193. </a-form-item>
  194. </a-col>
  195. <a-col :md="4" :sm="6">
  196. <a-form-item>
  197. <j-input placeholder="请输入商户号" v-model="queryParam.merchantNo"></j-input>
  198. </a-form-item>
  199. </a-col>
  200. <a-col :md="4" :sm="6">
  201. <a-form-item>
  202. <j-input placeholder="请输入终端号" v-model="queryParam.terminalNo"></j-input>
  203. </a-form-item>
  204. </a-col>
  205. <a-col :md="4" :sm="6">
  206. <a-form-item>
  207. <j-input placeholder="请输入TOKEN令牌" v-model="queryParam.token"></j-input>
  208. </a-form-item>
  209. </a-col>
  210. <a-col :md="4" :sm="6">
  211. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  212. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  213. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  214. </span>
  215. </a-col>
  216. </a-row>
  217. </a-form>
  218. </div>
  219. <!-- 查询区域-END -->
  220. <!-- 操作按钮区域 -->
  221. <div class="table-operator">
  222. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  223. <!-- <a-button type="primary" icon="download" @click="handleExportXls('支付接口配置')">导出</a-button>-->
  224. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  225. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  226. <!-- </a-upload>-->
  227. <!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  228. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  229. <a-dropdown v-if="selectedRowKeys.length > 0">
  230. <!-- <a-menu slot="overlay">-->
  231. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  232. <!-- </a-menu>-->
  233. <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  234. <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
  235. </a-dropdown>
  236. </div>
  237. <!-- table区域-begin -->
  238. <div>
  239. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  240. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  241. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  242. </div>
  243. <a-table
  244. ref="table"
  245. size="middle"
  246. :scroll="{x:true}"
  247. bordered
  248. rowKey="id"
  249. :columns="columns"
  250. :dataSource="dataSource"
  251. :pagination="ipagination"
  252. :loading="loading"
  253. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  254. class="j-table-force-nowrap"
  255. @change="handleTableChange">
  256. <template slot="htmlSlot" slot-scope="text">
  257. <div v-html="text"></div>
  258. </template>
  259. <span slot="status" slot-scope="text,record">
  260. <a-tag v-if="text == 1" color="green">启用</a-tag>
  261. <a-tag v-else color="grey">关闭</a-tag>
  262. </span>
  263. <template slot="imgSlot" slot-scope="text,record">
  264. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  265. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  266. </template>
  267. <template slot="fileSlot" slot-scope="text">
  268. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  269. <a-button
  270. v-else
  271. :ghost="true"
  272. type="primary"
  273. icon="download"
  274. size="small"
  275. @click="downloadFile(text)">
  276. 下载
  277. </a-button>
  278. </template>
  279. <span slot="action" slot-scope="text, record">
  280. <a @click="handleEdit(record)">编辑</a>
  281. <a-divider type="vertical" />
  282. <a-dropdown>
  283. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  284. <a-menu slot="overlay">
  285. <a-menu-item>
  286. <a @click="handleDetail(record)">详情</a>
  287. </a-menu-item>
  288. <a-menu-item>
  289. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  290. <a>删除</a>
  291. </a-popconfirm>
  292. </a-menu-item>
  293. </a-menu>
  294. </a-dropdown>
  295. </span>
  296. </a-table>
  297. </div>
  298. <pay-interface-config-modal ref="modalForm" @ok="modalFormOk"></pay-interface-config-modal>
  299. </a-card>
  300. </template>
  301. <script>
  302. import '@/assets/less/TableExpand.less'
  303. import { mixinDevice } from '@/utils/mixin'
  304. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  305. import payInterfaceConfigModal from './modules/payInterfaceConfigModal'
  306. import { httpAction, getAction } from '@/api/manage'
  307. export default {
  308. name: 'payApiSettings',
  309. mixins:[JeecgListMixin, mixinDevice],
  310. components: {
  311. payInterfaceConfigModal
  312. },
  313. data () {
  314. return {
  315. description: '支付接口配置管理页面',
  316. // 表头
  317. columns: [
  318. {
  319. title:'支付方式',
  320. align:"center",
  321. dataIndex: 'payTypeId_dictText'
  322. },
  323. {
  324. title:'商户号',
  325. align:"center",
  326. dataIndex: 'merchantNo'
  327. },
  328. {
  329. title:'终端号',
  330. align:"center",
  331. dataIndex: 'terminalNo'
  332. },
  333. {
  334. title:'TOKEN令牌',
  335. align:"center",
  336. dataIndex: 'token'
  337. },
  338. {
  339. title:'状态',
  340. align:"center",
  341. dataIndex: 'status',
  342. scopedSlots: { customRender: 'status' },
  343. },
  344. {
  345. title: '操作',
  346. dataIndex: 'action',
  347. align:"center",
  348. fixed:"right",
  349. width:147,
  350. scopedSlots: { customRender: 'action' }
  351. }
  352. ],
  353. url: {
  354. list: "/business/busPayInterfaceConfig/list",
  355. delete: "/business/busPayInterfaceConfig/delete",
  356. deleteBatch: "/business/busPayInterfaceConfig/deleteBatch",
  357. exportXlsUrl: "/business/busPayInterfaceConfig/exportXls",
  358. importExcelUrl: "business/busPayInterfaceConfig/importExcel",
  359. query_payType: "/business/busRoomPayType/queryList",
  360. },
  361. dictOptions:{},
  362. superFieldList:[],
  363. payTypeList:[]
  364. }
  365. },
  366. created() {
  367. this.getSuperFieldList();
  368. getAction(this.url.query_payType,{}).then((res)=>{
  369. if(res.success){
  370. this.payTypeList = res.result
  371. }else{
  372. }
  373. })
  374. },
  375. computed: {
  376. importExcelUrl: function(){
  377. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  378. },
  379. },
  380. methods: {
  381. initDictConfig(){
  382. },
  383. getSuperFieldList(){
  384. let fieldList=[];
  385. fieldList.push({type:'string',value:'tenantId',text:'关联租户'})
  386. fieldList.push({type:'string',value:'hotelId',text:'关联酒店'})
  387. fieldList.push({type:'string',value:'payTypeId',text:'关联支付方式'})
  388. fieldList.push({type:'string',value:'merchantNo',text:'商户号'})
  389. fieldList.push({type:'string',value:'terminalNo',text:'终端号'})
  390. fieldList.push({type:'string',value:'token',text:'TOKEN令牌'})
  391. fieldList.push({type:'int',value:'status',text:'状态(0-关闭;1-启用)'})
  392. fieldList.push({type:'int',value:'minute',text:'预定超时时间'})
  393. fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
  394. this.superFieldList = fieldList
  395. }
  396. }
  397. }
  398. </script>
  399. <style scoped>
  400. @import '~@assets/less/common.less';
  401. </style>