Browse Source

chore: 优化逻辑 & 增加商户数据显示

master
kiki 2 years ago
parent
commit
d16f6ac92e
  1. 9
      src/api/merchant/merchant.js
  2. 54
      src/layout/components/Navbar.vue
  3. 4
      src/views/merchant/merchant/index.vue

9
src/api/merchant/merchant.js

@ -53,3 +53,12 @@ export function exportMerchant(query) {
params: query params: query
}) })
} }
// 商户数据
export function onLineMerchant(query) {
return request({
url: '/system/merchant/onLineMerchant',
method: 'get',
params: query
})
}

54
src/layout/components/Navbar.vue

@ -9,8 +9,17 @@
<div class="right-menu"> <div class="right-menu">
<template v-if="device !== 'mobile'"> <template v-if="device !== 'mobile'">
<!-- <el-button type="primary" icon="" size="small" style="margin-right:24px"--> <el-button
<!-- @click="dialogVisible = true">码商押金</el-button>--> v-hasPermi="['system:merchant:onLineMerchant']"
type="primary" icon="" size="small" style="margin-right:24px" @click="merchantDialogStates.visible = true">
商户余额
</el-button>
<el-button
v-hasPermi="['carddealer:carddealer:onLineCarddealer']"
type="primary" icon="" size="small" style="margin-right:24px" @click="dialogVisible = true">
码商押金
</el-button>
<el-button type="primary" icon="" size="small" style="margin-right:24px" @click="goDataView" <el-button type="primary" icon="" size="small" style="margin-right:24px" @click="goDataView"
v-hasPermi="['data-view']">数据看板</el-button> v-hasPermi="['data-view']">数据看板</el-button>
@ -59,14 +68,14 @@
<el-dialog title="码商押金" :visible.sync="dialogVisible" width="20%"> <el-dialog title="码商押金" :visible.sync="dialogVisible" width="20%">
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column :label="'名称'" align="center" prop="storeNo" min-width="150"> <el-table-column :label="'名称'" align="center" prop="username" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="color:#333">{{ scope.row.username }}</span> <span style="color:#333">{{ scope.row.username }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="'押金'" align="center" prop="storeNo" min-width="150"> <el-table-column :label="'押金'" align="center" prop="margin" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span :style="{ color: NumberDiv(scope.row.margin, 100) < 5000 ? '#FF3535' : '#30C17B' }"> <span :style="{ color: scope.row.balanceWarning === 1 ? '#FF3535' : '#30C17B' }">
{{ NumberDiv(scope.row.margin, 100) }} {{ NumberDiv(scope.row.margin, 100) }}
</span> </span>
</template> </template>
@ -74,6 +83,23 @@
</el-table> </el-table>
</el-dialog> </el-dialog>
<el-dialog title="商户余额" :visible.sync="merchantDialogStates.visible" width="20%">
<el-table :data="merchantDialogStates.data" style="width: 100%">
<el-table-column label="名称" align="center" prop="username" min-width="150">
<template slot-scope="scope">
<span style="color:#333">{{ scope.row.username }}</span>
</template>
</el-table-column>
<el-table-column label="余额" align="center" prop="balance" min-width="150">
<template slot-scope="scope">
<span :style="{ color: scope.row.balanceWarning === 1 ? '#FF3535' : '#30C17B' }">
{{ NumberDiv(scope.row.balance, 100) }}
</span>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div> </div>
</template> </template>
@ -89,6 +115,7 @@ import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc' import RuoYiDoc from '@/components/RuoYi/Doc'
import { getUserProfile } from "@/api/system/user"; import { getUserProfile } from "@/api/system/user";
import { common_api } from "@/api/form"; import { common_api } from "@/api/form";
import { onLineMerchant } from '@/api/merchant/merchant'
export default { export default {
components: { components: {
@ -109,6 +136,13 @@ export default {
dialogVisible: false, dialogVisible: false,
tableData: [], tableData: [],
timer: null, timer: null,
//
merchantDialogStates: {
//
visible: false,
//
data: [],
}
}; };
}, },
computed: { computed: {
@ -158,9 +192,13 @@ export default {
// }, 30000) // }, 30000)
}, },
getList() { getList() {
// common_api.onLineCarddealer().then((response) => { common_api.onLineCarddealer().then((response) => {
// this.tableData = response.data this.tableData = response.data
// }); });
onLineMerchant()
.then(res => {
this.merchantDialogStates.data = res.data
})
}, },
// //
onAutoRefreshChanged(value) { onAutoRefreshChanged(value) {

4
src/views/merchant/merchant/index.vue

@ -328,7 +328,7 @@
:inactive-value=false></el-switch> :inactive-value=false></el-switch>
</el-form-item> </el-form-item>
<!-- <el-form-item label="手动提单审核开关" prop="whetherReview"> <el-form-item label="手动提单审核开关" prop="whetherReview">
<el-switch v-model="form.whetherReview" active-text="" inactive-text="" active-value="Y" <el-switch v-model="form.whetherReview" active-text="" inactive-text="" active-value="Y"
inactive-value="N"></el-switch> inactive-value="N"></el-switch>
</el-form-item> </el-form-item>
@ -336,7 +336,7 @@
<el-form-item label="api提单审核开关" prop="whetherReviewApi"> <el-form-item label="api提单审核开关" prop="whetherReviewApi">
<el-switch v-model="form.whetherReviewApi" active-text="" inactive-text="" active-value="Y" <el-switch v-model="form.whetherReviewApi" active-text="" inactive-text="" active-value="Y"
inactive-value="N"></el-switch> inactive-value="N"></el-switch>
</el-form-item> --> </el-form-item>
<el-form-item label="谷歌秘钥" prop="merchantNo"> <el-form-item label="谷歌秘钥" prop="merchantNo">
<span>{{ form.googleCaptcha }}</span> <span>{{ form.googleCaptcha }}</span>

Loading…
Cancel
Save