fix: 功能修复,账号相关,新增交易明细记录。
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
<el-table-column label="供货商" align="center" width="100" prop="manufacture" />
|
||||
<!--
|
||||
<el-table-column label="商户码" align="center" prop="merchantCode" /> -->
|
||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-for="item in operateList" :key="item.id" class="item" effect="dark" :content="item.title" placement="top">
|
||||
@@ -150,12 +150,44 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="titleSwipeRecord" v-model="openSwipeRecord" width="1200px" append-to-body destroy-on-close>
|
||||
<el-form :model="querySwipeRecordParams" ref="querySwipeRecordRef" inline>
|
||||
<el-form-item label="信用卡" style="width: 420px" prop="outAccountId">
|
||||
<el-select v-model="querySwipeRecordParams.outAccountId" placeholder="请选择信用卡" clearable>
|
||||
<el-option v-for="creditCard in creditCardList" :key="creditCard.id" :label="creditCard.nameCodeAvailableLimit" :value="creditCard.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="刷卡时间" prop="time">
|
||||
<el-date-picker v-model="querySwipeRecordParams.time" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" icon="Search" @click="handleSwipeRecordQuery">搜索</el-button>
|
||||
<el-button type="info" icon="Refresh" @click="resetSwipeRecordQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loadingSwipeRecord" :data="tableSwipeRecordData">
|
||||
<el-table-column type="index" label="序号" :index="swipeRecordIndexMethod" width="60" />
|
||||
<el-table-column label="POS机名称" align="center" prop="posName" />
|
||||
<el-table-column label="刷卡商户" align="center" prop="merchantName" />
|
||||
<el-table-column label="信用卡" align="center" prop="outAccountName" />
|
||||
<el-table-column label="刷卡时间" align="center" width="180" prop="createTime" />
|
||||
<el-table-column label="刷卡金额" align="center" prop="amount" />
|
||||
<el-table-column label="手续费" align="center" width="100" prop="commission" />
|
||||
<el-table-column label="储蓄卡" align="center" prop="inAccountName" />
|
||||
<el-table-column label="入账金额" align="center" width="120" prop="actualAmount" />
|
||||
</el-table>
|
||||
<el-pagination small background layout="total, prev, pager, next" :total="swipeRecordTotal" @current-change="handleCurrentSwipeRecordChange" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Posmachine">
|
||||
import { listPosmachine, getPosmachine, delPosmachine, addPosmachine, updatePosmachine } from '@/api/invest/posmachine'
|
||||
import { listBankcardLend } from '@/api/invest/bankcardlend'
|
||||
import { listAccounts } from '@/api/invest/accounts'
|
||||
import { listAccountsTransferRecord } from '@/api/invest/accountsTransferRecord'
|
||||
import dayjs from 'dayjs'
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
const { proxy } = getCurrentInstance()
|
||||
@@ -171,8 +203,16 @@ const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref('')
|
||||
const debitCardList = ref([])
|
||||
const creditCardList = ref([])
|
||||
const titleSwipeRecord = ref('')
|
||||
const openSwipeRecord = ref(false)
|
||||
const currentPosId = ref('')
|
||||
const loadingSwipeRecord = ref(false)
|
||||
const tableSwipeRecordData = ref([])
|
||||
const swipeRecordTotal = ref(0)
|
||||
const operateList = ref([
|
||||
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['invest:posmachine:query'] },
|
||||
{ id: 'swipeRecord', icon: 'Tickets', title: '刷卡明细', hasPermi: ['invest:accountsTransferRecord:query'] },
|
||||
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['invest:posmachine:edit'] },
|
||||
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['invest:posmachine:remove'] }
|
||||
])
|
||||
@@ -193,6 +233,12 @@ const data = reactive({
|
||||
status: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
queryCreditCardParams: {
|
||||
pageNum: 1,
|
||||
type: '2',
|
||||
status: '1',
|
||||
pageSize: 1000
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: 'pos机名称不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '账户状态不能为空', trigger: 'blur' }],
|
||||
@@ -208,12 +254,23 @@ const data = reactive({
|
||||
// merchantType: [{ required: true, message: '商户类型不能为空', trigger: 'change' }]
|
||||
}
|
||||
})
|
||||
const querySwipeRecordParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: '1',
|
||||
time: '',
|
||||
posId: null,
|
||||
outAccountId: null
|
||||
})
|
||||
|
||||
const handleOperate = (operate, row) => {
|
||||
switch (operate) {
|
||||
case 'view':
|
||||
handleView(row)
|
||||
break
|
||||
case 'swipeRecord':
|
||||
handleSwipeRecord(row)
|
||||
break
|
||||
case 'edit':
|
||||
handleUpdate(row)
|
||||
break
|
||||
@@ -225,7 +282,7 @@ const handleOperate = (operate, row) => {
|
||||
}
|
||||
}
|
||||
|
||||
const { queryParams, queryDebitCardParams, form, rules } = toRefs(data)
|
||||
const { queryParams, queryDebitCardParams, queryCreditCardParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询储蓄卡管理列表 */
|
||||
function getDebitCardList() {
|
||||
@@ -234,6 +291,13 @@ function getDebitCardList() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询信用卡管理列表 */
|
||||
function getCreditCardList() {
|
||||
listAccounts(queryCreditCardParams.value).then((response) => {
|
||||
creditCardList.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询pos机信息列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
@@ -340,6 +404,59 @@ function handleUpdate(row) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 刷卡明细按钮操作 */
|
||||
function handleSwipeRecord(row) {
|
||||
querySwipeRecordParams.value.time = ''
|
||||
querySwipeRecordParams.value.outAccountId = null
|
||||
titleSwipeRecord.value = `${row.name}${row.merchantName ? '【' + row.merchantName + '】' : ''}刷卡明细`
|
||||
currentPosId.value = row.id || ids.value
|
||||
getSwipeRecordList(1)
|
||||
openSwipeRecord.value = true
|
||||
}
|
||||
|
||||
const handleCurrentSwipeRecordChange = (num) => {
|
||||
getSwipeRecordList(num)
|
||||
}
|
||||
|
||||
const handleSwipeRecordQuery = () => {
|
||||
getSwipeRecordList(1)
|
||||
}
|
||||
|
||||
const resetSwipeRecordQuery = () => {
|
||||
proxy.resetForm('querySwipeRecordRef')
|
||||
querySwipeRecordParams.value.time = ''
|
||||
querySwipeRecordParams.value.outAccountId = null
|
||||
swipeRecordTotal.value = 0
|
||||
getSwipeRecordList(1)
|
||||
}
|
||||
|
||||
const getSwipeRecordList = (num) => {
|
||||
loadingSwipeRecord.value = true
|
||||
const timeRange = querySwipeRecordParams.value.time
|
||||
let st = ''
|
||||
let et = ''
|
||||
if (timeRange && timeRange.length === 2) {
|
||||
st = dayjs(timeRange[0]).format('YYYY-MM-DD')
|
||||
et = dayjs(timeRange[1]).format('YYYY-MM-DD')
|
||||
}
|
||||
querySwipeRecordParams.value.startTime = st
|
||||
querySwipeRecordParams.value.endTime = et
|
||||
querySwipeRecordParams.value.pageNum = num
|
||||
querySwipeRecordParams.value.posId = currentPosId.value
|
||||
querySwipeRecordParams.value.type = '1'
|
||||
listAccountsTransferRecord(querySwipeRecordParams.value).then((response) => {
|
||||
loadingSwipeRecord.value = false
|
||||
tableSwipeRecordData.value = response.rows
|
||||
swipeRecordTotal.value = response.total
|
||||
})
|
||||
}
|
||||
|
||||
const swipeRecordIndexMethod = (index) => {
|
||||
const nowPage = querySwipeRecordParams.value.pageNum
|
||||
const nowLimit = querySwipeRecordParams.value.pageSize
|
||||
return index + 1 + (nowPage - 1) * nowLimit
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs.posmachineRef.validate((valid) => {
|
||||
@@ -386,6 +503,7 @@ function handleExport() {
|
||||
`posmachine_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
}
|
||||
getCreditCardList()
|
||||
getDebitCardList()
|
||||
getList()
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user