102 changed files with 342 additions and 5094 deletions
@ -1,23 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/checkLog/page', |
||||
method: 'get', |
||||
params: { |
||||
current, |
||||
size, |
||||
...params, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/checkLog/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
@ -1,31 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/tenant/dailybill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/tenant/dailybill/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
|
||||
export const select = () => { |
||||
return request({ |
||||
url: '/api1/bd-system/tenant/select', |
||||
method: 'get', |
||||
}) |
||||
} |
@ -1,33 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/source/dailybill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/source/dailybill/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const zyfdictionary = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-system/dict/dictionary?code=source_type', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
@ -1,33 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/source/monthbill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/source/monthbill/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const zyfdictionary = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-system/dict/dictionary?code=source_type', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
@ -1,31 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/tenant/monthbill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/tenant/monthbill/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const exportexcel = (query) => { |
||||
return request({ |
||||
url: '/api1/bd-core/tenant/monthbill/export-excel', |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
@ -1,23 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/customer/api/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export const getDetail = (id) => { |
||||
return request({ |
||||
url: '/api1/bd-core/customer/api/detail', |
||||
method: 'get', |
||||
params: { |
||||
id |
||||
} |
||||
}) |
||||
} |
@ -1,13 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/customer/dailyBill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
@ -1,13 +0,0 @@
|
||||
import request from '@/router/axios'; |
||||
|
||||
export const getList = (current, size, params) => { |
||||
return request({ |
||||
url: '/api1/bd-core/customer/monthBill/page', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
} |
||||
}) |
||||
} |
@ -1,103 +0,0 @@
|
||||
<template> |
||||
<div> |
||||
<el-dialog |
||||
:title="title" |
||||
:visible.sync="visit" |
||||
:before-close="handleDetail" |
||||
center |
||||
width="50%" |
||||
append-to-body |
||||
> |
||||
<Chlist :descriptions="descarr"></Chlist> |
||||
<el-table :data="form.detail" style="width: 100%; margin-top: 10px"> |
||||
<el-table-column prop="price" label="单价(元)"> |
||||
<template slot-scope="scope"> |
||||
{{ printFn(scope.row.price / 10000) }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="totalCount" label="次数"> </el-table-column> |
||||
<el-table-column prop="totalFee" label="费用(元)"> |
||||
<template slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button type="primary" @click="handleDetail">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { boolean, string } from "mathjs"; |
||||
import Chlist from "../checklist/index.vue"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
components: { |
||||
Chlist, |
||||
}, |
||||
props: { |
||||
visit: { |
||||
type: boolean, |
||||
}, |
||||
title: { |
||||
type: string, |
||||
}, |
||||
content: { |
||||
type: Object, |
||||
default: () => {}, |
||||
}, |
||||
}, |
||||
|
||||
watch: { |
||||
content(nv, ov) { |
||||
this.form = nv; |
||||
if(this.form.sourceType){ |
||||
this.label = "资源方"; |
||||
this.name = this.form.sourceType |
||||
}else{ |
||||
this.label = "客户"; |
||||
this.name = this.form.tenantName |
||||
} |
||||
}, |
||||
}, |
||||
computed: { |
||||
descarr() { |
||||
return [ |
||||
{ |
||||
label: this.label, |
||||
value: this.name, |
||||
}, |
||||
{ |
||||
label: "账单时间", |
||||
value: this.form.date, |
||||
}, |
||||
{ |
||||
label: "合计次数", |
||||
value: this.form.totalCount, |
||||
}, |
||||
{ |
||||
label: "合计金额(元)", |
||||
value: this.printFn(this.form.totalFee / 10000), |
||||
}, |
||||
]; |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
label:"", |
||||
name:"", |
||||
}; |
||||
}, |
||||
methods: { |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
handleDetail() { |
||||
this.$emit("detail"); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
@ -1,81 +0,0 @@
|
||||
<template> |
||||
<div class="descriptions"> |
||||
<div |
||||
class="item-body" |
||||
:style="{ width: width ? width : '50%' }" |
||||
:key="label" |
||||
v-for="{ label, value, width, render } in descriptions" |
||||
> |
||||
<div class="label">{{ label }}</div> |
||||
<div class="value" v-if="label == '账单时间'"> |
||||
<span v-if="value.length == 8"> |
||||
{{value.slice(0,4)}}-{{value.slice(4,6)}}-{{value.slice(6,8)}} |
||||
</span> |
||||
<span v-if="value.length == 6"> |
||||
{{value.slice(0,4)}}-{{value.slice(4,6)}} |
||||
</span> |
||||
<Render v-if="render" :render="render" /> |
||||
</div> |
||||
<div class="value" v-else> |
||||
{{ value ? value : "-" }} |
||||
<Render v-if="render" :render="render" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Render from "@/components/Render/index.vue"; |
||||
export default { |
||||
name: "DescTablelist", |
||||
props: { |
||||
descriptions: { |
||||
type: Array, |
||||
default: () => [], |
||||
}, |
||||
}, |
||||
components: { |
||||
Render, |
||||
}, |
||||
data() { |
||||
return {}; |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.descriptions { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
border-left: 1px solid #ecedee; |
||||
border-top: 1px solid #ecedee; |
||||
|
||||
.item-body { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
.label { |
||||
color: #73777a; |
||||
width: 150px; |
||||
background-color: #fbfbfc; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
|
||||
.value { |
||||
color: #373d41; |
||||
width: 0; |
||||
flex: 1; |
||||
} |
||||
|
||||
.label, |
||||
.value { |
||||
font-size: 12px; |
||||
padding: 8px; |
||||
height: 28px; |
||||
border-right: 1px solid #ecedee; |
||||
border-bottom: 1px solid #ecedee; |
||||
line-height: 28px; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -1,333 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button |
||||
type="text" |
||||
size="mini" |
||||
icon="el-icon-view" |
||||
@click="check(row)" |
||||
> |
||||
查看 |
||||
</el-button> |
||||
</template> |
||||
<template slot="menuLeft"> |
||||
<el-button |
||||
size="small" |
||||
plain |
||||
type="warning" |
||||
icon="el-icon-download" |
||||
@click="handleExport" |
||||
>导出 |
||||
</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
<!-- 导出弹窗 --> |
||||
<el-dialog |
||||
title="导出" |
||||
:visible.sync="dialogVisible" |
||||
width="30%" |
||||
append-to-body |
||||
:before-close="handleClose" |
||||
> |
||||
<el-form ref="exp" :model="exp" label-width="80px" :rules="exps"> |
||||
<el-form-item label="租户名称" prop="tenantId"> |
||||
<el-select |
||||
v-model="exp.tenantId" |
||||
placeholder="请选择租户" |
||||
style="width: 90%" |
||||
size="mini" |
||||
> |
||||
<el-option |
||||
v-for="(item, index) in arr" |
||||
:label="item.tenantName" |
||||
:value="item.tenantId" |
||||
:key="index" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="日期" prop="yyyyMMdd"> |
||||
<el-date-picker |
||||
type="date" |
||||
placeholder="请选择日期" |
||||
v-model="exp.yyyyMMdd" |
||||
format="yyyy-MM-dd" |
||||
valueFormat="yyyyMMdd" |
||||
style="width: 90%" |
||||
size="mini" |
||||
></el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="handleClose">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
<!-- 查看弹窗 --> |
||||
<Dialog |
||||
:visit="visit" |
||||
:content="content" |
||||
:title="title" |
||||
@detail="detail" |
||||
></Dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getDetail, getList, select } from "@/api/core/bill/dailyBill"; |
||||
import { mapGetters } from "vuex"; |
||||
import Dialog from "./components/check/index.vue"; |
||||
import * as math from "mathjs"; |
||||
import website from "@/config/website"; |
||||
import { getToken } from "@/util/auth"; |
||||
export default { |
||||
components: { |
||||
Dialog, |
||||
}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
dialogVisible: false, |
||||
exp: { |
||||
tenantId: "", |
||||
yyyyMMdd: "", |
||||
}, |
||||
arr: [], |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "客户", |
||||
prop: "tenantId", |
||||
type: "radio", |
||||
search: true, |
||||
dicUrl: "/api1/bd-system/tenant/selectExceptAdmin", |
||||
props: { |
||||
label: "tenantName", |
||||
value: "tenantId", |
||||
}, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
hide: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单时间", |
||||
type: "date", |
||||
format: "yyyy-MM-dd", |
||||
valueFormat: "yyyyMMdd", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
|
||||
{ |
||||
label: "客户名称", |
||||
prop: "tenantName", |
||||
labelWidth: 100, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
|
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "优惠次数", |
||||
prop: "cacheCount", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
exps: { |
||||
tenantId: [ |
||||
{ required: true, message: "请选择租户", trigger: "change" }, |
||||
], |
||||
yyyyMMdd: [ |
||||
{ required: true, message: "请选择日期", trigger: "change" }, |
||||
], |
||||
}, |
||||
visit: false, //查看布尔值 |
||||
content: {}, //查看对象 |
||||
title: "", //查看标题 |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
created() { |
||||
this.zhlist(); |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//租户列表 |
||||
zhlist() { |
||||
select().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//导出弹窗 |
||||
handleExport() { |
||||
this.dialogVisible = true; |
||||
}, |
||||
//关闭弹窗 |
||||
handleClose() { |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
}, |
||||
//确认 |
||||
submit() { |
||||
this.$refs.exp.validate((valid) => { |
||||
if (valid) { |
||||
if (process.env.NODE_ENV === "production") { |
||||
window.open( |
||||
`http://223.99.228.240:18081/bd-core/tenant/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&tenantId=${this.exp.tenantId}&yyyyMMdd=${ |
||||
this.exp.yyyyMMdd |
||||
}` |
||||
); |
||||
} else { |
||||
window.open( |
||||
`/api1/bd-core/tenant/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&tenantId=${this.exp.tenantId}&yyyyMMdd=${ |
||||
this.exp.yyyyMMdd |
||||
}` |
||||
); |
||||
} |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
} |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
//查看 |
||||
check(row) { |
||||
this.visit = true; |
||||
this.title = row.apiName; |
||||
getDetail(row.id).then((res) => { |
||||
this.content = res.data.data; |
||||
}); |
||||
}, |
||||
//关闭详情 |
||||
detail() { |
||||
this.visit = false; |
||||
this.content = {}; |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,331 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button |
||||
type="text" |
||||
size="mini" |
||||
icon="el-icon-view" |
||||
@click="check(row)" |
||||
> |
||||
查看 |
||||
</el-button> |
||||
</template> |
||||
<template slot="menuLeft"> |
||||
<el-button |
||||
size="small" |
||||
plain |
||||
type="warning" |
||||
icon="el-icon-download" |
||||
@click="handleExport" |
||||
>导出 |
||||
</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
<el-dialog |
||||
title="导出" |
||||
:visible.sync="dialogVisible" |
||||
width="30%" |
||||
append-to-body |
||||
:before-close="handleClose" |
||||
> |
||||
<el-form ref="exp" :model="exp" label-width="80px" :rules="exps"> |
||||
<el-form-item label="租户名称" prop="tenantId"> |
||||
<el-select |
||||
v-model="exp.tenantId" |
||||
placeholder="请选择租户" |
||||
style="width: 90%" |
||||
size="mini" |
||||
> |
||||
<el-option |
||||
v-for="(item, index) in arr" |
||||
:label="item.tenantName" |
||||
:value="item.tenantId" |
||||
:key="index" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="日期" prop="yyyyMM"> |
||||
<el-date-picker |
||||
type="month" |
||||
placeholder="请选择日期" |
||||
v-model="exp.yyyyMM" |
||||
format="yyyy-MM" |
||||
valueFormat="yyyyMM" |
||||
style="width: 90%" |
||||
size="mini" |
||||
></el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="handleClose">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
<Dialog |
||||
:visit="visit" |
||||
:content="content" |
||||
:title="title" |
||||
@detail="detail" |
||||
></Dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getDetail, getList } from "@/api/core/bill/monthBill"; |
||||
import { select } from "@/api/core/bill/dailyBill"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
import website from "@/config/website"; |
||||
import { getToken } from "@/util/auth"; |
||||
import Dialog from "./components/check/index.vue"; |
||||
export default { |
||||
components: { |
||||
Dialog, |
||||
}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
exp: { |
||||
tenantId: "", |
||||
yyyyMM: "", |
||||
}, |
||||
arr: [], |
||||
loading: true, |
||||
dialogVisible: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "客户", |
||||
prop: "tenantId", |
||||
type: "radio", |
||||
search: true, |
||||
dicUrl: "/api1/bd-system/tenant/selectExceptAdmin", |
||||
props: { |
||||
label: "tenantName", |
||||
value: "tenantId", |
||||
}, |
||||
hide: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单时间", |
||||
type: "month", |
||||
format: "yyyy-MM", |
||||
valueFormat: "yyyyMM", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
|
||||
{ |
||||
label: "客户名称", |
||||
prop: "tenantName", |
||||
|
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "优惠次数", |
||||
prop: "cacheCount", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
exps: { |
||||
tenantId: [ |
||||
{ required: true, message: "请选择租户", trigger: "change" }, |
||||
], |
||||
yyyyMM: [{ required: true, message: "请选择日期", trigger: "change" }], |
||||
}, |
||||
visit: false, |
||||
content: {}, //查看对象 |
||||
title: "", |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
created() { |
||||
this.zhlist(); |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//租户列表 |
||||
zhlist() { |
||||
select().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//导出弹窗 |
||||
handleExport() { |
||||
this.dialogVisible = true; |
||||
}, |
||||
//关闭弹窗 |
||||
handleClose() { |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
}, |
||||
//确认 |
||||
submit() { |
||||
console.log(this.website.tokenHeader); |
||||
this.$refs.exp.validate((valid) => { |
||||
if (valid) { |
||||
if (process.env.NODE_ENV === "production") { |
||||
window.open( |
||||
`http://223.99.228.240:18081/bd-core/tenant/monthbill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&tenantId=${this.exp.tenantId}&yyyyMM=${ |
||||
this.exp.yyyyMM |
||||
}` |
||||
); |
||||
} else { |
||||
window.open( |
||||
`/api1/bd-core/tenant/monthbill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&tenantId=${this.exp.tenantId}&yyyyMM=${ |
||||
this.exp.yyyyMM |
||||
}` |
||||
); |
||||
} |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
} |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
//查看 |
||||
check(row) { |
||||
this.visit = true; |
||||
this.title = row.apiName; |
||||
getDetail(row.id).then((res) => { |
||||
this.content = res.data.data; |
||||
console.log(this.content, 222); |
||||
}); |
||||
}, |
||||
//关闭详情 |
||||
detail() { |
||||
this.visit = false; |
||||
this.content = {}; |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,361 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button |
||||
type="text" |
||||
size="mini" |
||||
icon="el-icon-view" |
||||
@click="check(row)" |
||||
> |
||||
查看 |
||||
</el-button> |
||||
</template> |
||||
<template slot="menuLeft"> |
||||
<el-button |
||||
size="small" |
||||
plain |
||||
type="warning" |
||||
icon="el-icon-download" |
||||
@click="handleExport" |
||||
>导出 |
||||
</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
<!-- 导出弹窗 --> |
||||
<el-dialog |
||||
title="导出" |
||||
:visible.sync="dialogVisible" |
||||
width="30%" |
||||
append-to-body |
||||
:before-close="handleClose" |
||||
> |
||||
<el-form ref="exp" :model="exp" label-width="80px" :rules="exps"> |
||||
<el-form-item label="资源方" prop="tenantId"> |
||||
<el-select |
||||
v-model="exp.tenantId" |
||||
placeholder="请选择资源方" |
||||
style="width: 90%" |
||||
size="mini" |
||||
> |
||||
<el-option |
||||
v-for="(item, index) in arr" |
||||
:label="item.dictValue" |
||||
:value="item.dictKey" |
||||
:key="index" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="日期" prop="yyyyMMdd"> |
||||
<el-date-picker |
||||
type="date" |
||||
placeholder="请选择日期" |
||||
v-model="exp.yyyyMMdd" |
||||
format="yyyy-MM-dd" |
||||
valueFormat="yyyyMMdd" |
||||
style="width: 90%" |
||||
size="mini" |
||||
></el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="handleClose">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
<!-- 查看弹窗 --> |
||||
<Dialog |
||||
:visit="visit" |
||||
:content="content" |
||||
:title="title" |
||||
:zy="zy" |
||||
@detail="detail" |
||||
></Dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getDetail, |
||||
getList, |
||||
select, |
||||
zyfdictionary, |
||||
} from "@/api/core/bill/dayresource"; |
||||
import { mapGetters } from "vuex"; |
||||
import Dialog from "./components/check/index.vue"; |
||||
import * as math from "mathjs"; |
||||
import website from "@/config/website"; |
||||
import { getToken } from "@/util/auth"; |
||||
export default { |
||||
components: { |
||||
Dialog, |
||||
}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
dialogVisible: false, |
||||
exp: { |
||||
tenantId: "", |
||||
yyyyMMdd: "", |
||||
}, |
||||
arr: [], |
||||
zy: "1", |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "资源方", |
||||
prop: "sourceType", |
||||
search: true, |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "账单时间", |
||||
type: "date", |
||||
format: "yyyy-MM-dd", |
||||
valueFormat: "yyyyMMdd", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
|
||||
{ |
||||
label: "资源方", |
||||
prop: "sourceType", |
||||
search: true, |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
search: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
|
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
exps: { |
||||
tenantId: [ |
||||
{ required: true, message: "请选择资源方", trigger: "change" }, |
||||
], |
||||
yyyyMMdd: [ |
||||
{ required: true, message: "请选择日期", trigger: "change" }, |
||||
], |
||||
}, |
||||
visit: false, //查看布尔值 |
||||
content: {}, //查看对象 |
||||
title: "", //查看标题 |
||||
zyfarr: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
created() { |
||||
// this.zhlist(); |
||||
this.zyf(); |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//租户列表 |
||||
zhlist() { |
||||
select().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//导出弹窗 |
||||
handleExport() { |
||||
this.dialogVisible = true; |
||||
}, |
||||
//关闭弹窗 |
||||
handleClose() { |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
}, |
||||
//确认 |
||||
submit() { |
||||
this.$refs.exp.validate((valid) => { |
||||
if (valid) { |
||||
if (process.env.NODE_ENV === "production") { |
||||
window.open( |
||||
`http://223.99.228.240:18081/bd-core/source/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&sourceType=${this.exp.tenantId}&yyyyMMdd=${ |
||||
this.exp.yyyyMMdd |
||||
}` |
||||
); |
||||
} else { |
||||
window.open( |
||||
`api1/bd-core/source/dailybill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&sourceType=${this.exp.tenantId}&yyyyMMdd=${ |
||||
this.exp.yyyyMMdd |
||||
}` |
||||
); |
||||
} |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
} |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
//查看 |
||||
check(row) { |
||||
this.visit = true; |
||||
this.title = row.apiName; |
||||
getDetail(row.id).then((res) => { |
||||
this.zyfarr.forEach((i) => { |
||||
if (i.dictKey == res.data.data.sourceType) { |
||||
res.data.data.sourceType = i.dictValue; |
||||
} |
||||
}); |
||||
this.content = res.data.data; |
||||
}); |
||||
}, |
||||
//资源方 |
||||
zyf() { |
||||
zyfdictionary().then((res) => { |
||||
if (res.data.code == "200") { |
||||
this.zyfarr = res.data.data; |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//关闭详情 |
||||
detail() { |
||||
this.visit = false; |
||||
this.content = {}; |
||||
this.zy = ""; |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,350 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button |
||||
type="text" |
||||
size="mini" |
||||
icon="el-icon-view" |
||||
@click="check(row)" |
||||
> |
||||
查看 |
||||
</el-button> |
||||
</template> |
||||
<template slot="menuLeft"> |
||||
<el-button |
||||
size="small" |
||||
plain |
||||
type="warning" |
||||
icon="el-icon-download" |
||||
@click="handleExport" |
||||
>导出 |
||||
</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
<el-dialog |
||||
title="导出" |
||||
:visible.sync="dialogVisible" |
||||
width="30%" |
||||
append-to-body |
||||
:before-close="handleClose" |
||||
> |
||||
<el-form ref="exp" :model="exp" label-width="80px" :rules="exps"> |
||||
<el-form-item label="资源方" prop="tenantId"> |
||||
<el-select |
||||
v-model="exp.tenantId" |
||||
placeholder="请选择资源方" |
||||
style="width: 90%" |
||||
size="mini" |
||||
> |
||||
<el-option |
||||
v-for="(item, index) in arr" |
||||
:label="item.dictValue" |
||||
:value="item.dictKey" |
||||
:key="index" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="日期" prop="yyyyMM"> |
||||
<el-date-picker |
||||
type="month" |
||||
placeholder="请选择日期" |
||||
v-model="exp.yyyyMM" |
||||
format="yyyy-MM" |
||||
valueFormat="yyyyMM" |
||||
style="width: 90%" |
||||
size="mini" |
||||
></el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="handleClose">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
<Dialog |
||||
:visit="visit" |
||||
:content="content" |
||||
:title="title" |
||||
@detail="detail" |
||||
></Dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getDetail, getList, zyfdictionary } from "@/api/core/bill/monresource"; |
||||
import { select } from "@/api/core/bill/dailyBill"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
import website from "@/config/website"; |
||||
import { getToken } from "@/util/auth"; |
||||
import Dialog from "./components/check/index.vue"; |
||||
export default { |
||||
components: { |
||||
Dialog, |
||||
}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
exp: { |
||||
tenantId: "", |
||||
yyyyMM: "", |
||||
}, |
||||
arr: [], |
||||
loading: true, |
||||
dialogVisible: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
zyfarr: [], //资源方数组 |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "资源方", |
||||
prop: "sourceType", |
||||
search: true, |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "账单时间", |
||||
type: "month", |
||||
format: "yyyy-MM", |
||||
valueFormat: "yyyyMM", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
|
||||
{ |
||||
label: "资源方", |
||||
prop: "sourceType", |
||||
search: true, |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
search: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
exps: { |
||||
tenantId: [ |
||||
{ required: true, message: "请选择资源方", trigger: "change" }, |
||||
], |
||||
yyyyMM: [{ required: true, message: "请选择日期", trigger: "change" }], |
||||
}, |
||||
visit: false, |
||||
content: {}, //查看对象 |
||||
title: "", |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
created() { |
||||
// this.zhlist(); |
||||
this.zyf(); |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//租户列表 |
||||
zhlist() { |
||||
select().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//导出弹窗 |
||||
handleExport() { |
||||
this.dialogVisible = true; |
||||
}, |
||||
//关闭弹窗 |
||||
handleClose() { |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
}, |
||||
//确认 |
||||
submit() { |
||||
console.log(this.website.tokenHeader); |
||||
this.$refs.exp.validate((valid) => { |
||||
if (valid) { |
||||
if (process.env.NODE_ENV === "production") { |
||||
window.open( |
||||
`http://223.99.228.240:18081/bd-core/source/monthbill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&sourceType=${this.exp.tenantId}&yyyyMM=${ |
||||
this.exp.yyyyMM |
||||
}` |
||||
); |
||||
} else { |
||||
window.open( |
||||
`/api1/bd-core/source/monthbill/export-excel?${ |
||||
this.website.tokenHeader |
||||
}=${getToken()}&sourceType=${this.exp.tenantId}&yyyyMM=${ |
||||
this.exp.yyyyMM |
||||
}` |
||||
); |
||||
} |
||||
this.dialogVisible = false; |
||||
this.$refs.exp.resetFields(); |
||||
} |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
//查看 |
||||
check(row) { |
||||
this.visit = true; |
||||
this.title = row.apiName; |
||||
getDetail(row.id).then((res) => { |
||||
this.zyfarr.forEach((i) => { |
||||
if (i.dictKey == res.data.data.sourceType) { |
||||
res.data.data.sourceType = i.dictValue; |
||||
} |
||||
}); |
||||
this.content = res.data.data; |
||||
}); |
||||
}, |
||||
//资源方 |
||||
zyf() { |
||||
zyfdictionary().then((res) => { |
||||
if (res.data.code == "200") { |
||||
this.zyfarr = res.data.data; |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//关闭详情 |
||||
detail() { |
||||
this.visit = false; |
||||
this.content = {}; |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,394 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="tenantApiPrice" slot-scope="scope"> |
||||
{{ printFn(scope.row.tenantApiPrice / 10000) }} |
||||
</template> |
||||
<template slot="checkSuccess" slot-scope="scope"> |
||||
<span v-if="scope.row.checkSuccess == 1">成功</span> |
||||
<span v-if="scope.row.checkSuccess == 0" style="color: red">失败</span> |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getList, getDetail } from "@/api/checklog/check"; |
||||
import { mapGetters } from "vuex"; |
||||
import { dateFormat } from "@/util/date"; |
||||
import * as math from "mathjs"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: true, |
||||
delBtn: false, |
||||
menuWidth: 100, |
||||
editBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "客户名称", |
||||
prop: "tenantName", |
||||
viewDisplay: false, |
||||
}, |
||||
{ |
||||
label: "客户名称", |
||||
prop: "tenantId", |
||||
search: true, |
||||
type: "radio", |
||||
dicUrl: "/api1/bd-system/tenant/selectExceptAdmin", |
||||
props: { |
||||
label: "tenantName", |
||||
value: "tenantId", |
||||
}, |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "请求号码", |
||||
prop: "mobile", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
viewDisplay: false, |
||||
}, |
||||
{ |
||||
label: "接口类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=api_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
prop: "apiType", |
||||
search: true, |
||||
slot: true, |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "请求序列号", |
||||
prop: "requestSn", |
||||
width:90, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
}, |
||||
{ |
||||
label: "请求时间", |
||||
prop: "createTime", |
||||
search: true, |
||||
searchSpan: 10, |
||||
type: "date", |
||||
format: "yyyy-MM-dd HH:mm:ss", |
||||
valueFormat: "yyyy-MM-dd HH:mm:ss", |
||||
searchRange: true, |
||||
searchClearable: false, |
||||
searchValue: [ |
||||
dateFormat( |
||||
new Date(new Date(new Date().toLocaleDateString()).getTime()) |
||||
), |
||||
dateFormat( |
||||
new Date( |
||||
new Date(new Date().toLocaleDateString()).getTime() + |
||||
24 * 60 * 60 * 1000 - |
||||
1 |
||||
) |
||||
), |
||||
], |
||||
pickerOptions: { |
||||
shortcuts: [ |
||||
{ |
||||
text: "一日内", |
||||
onClick(picker) { |
||||
const end = new Date(); |
||||
const start = new Date(); |
||||
start.setTime(start.getTime() - 3600 * 1000 * 24); |
||||
picker.$emit("pick", [start, end]); |
||||
}, |
||||
}, |
||||
{ |
||||
text: "七日内", |
||||
onClick(picker) { |
||||
const end = new Date(); |
||||
const start = new Date(); |
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
||||
picker.$emit("pick", [start, end]); |
||||
}, |
||||
}, |
||||
{ |
||||
text: "本月内", |
||||
onClick(picker) { |
||||
const end = new Date(); |
||||
const start = new Date(); |
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
||||
picker.$emit("pick", [start, end]); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
}, |
||||
{ |
||||
label: "运营商", |
||||
prop: "netType", |
||||
type: "select", |
||||
search: true, |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=net_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "string", |
||||
editDisplay: false, |
||||
width: 70, |
||||
}, |
||||
{ |
||||
label: "姓名", |
||||
prop: "name", |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "手机号", |
||||
prop: "mobile", |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "证件号", |
||||
prop: "idNum", |
||||
hide: true, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "productApiId", |
||||
viewDisplay: false, |
||||
search: true, |
||||
type: "select", |
||||
dicUrl: "/api1/bd-core/product/api/select", |
||||
props: { |
||||
label: "apiName", |
||||
value: "id", |
||||
}, |
||||
}, |
||||
{ |
||||
label: "API通道", |
||||
prop: "sourceApiName", |
||||
viewDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费单价(元)", |
||||
prop: "tenantApiPrice", |
||||
slot: true, |
||||
labelWidth: 100, |
||||
width: 100, |
||||
}, |
||||
{ |
||||
label: "源响应时间(ms)", |
||||
prop: "sourceTime", |
||||
width: 110, |
||||
labelWidth: 120, |
||||
}, |
||||
{ |
||||
label: "总响应时间(ms)", |
||||
prop: "totalTime", |
||||
width: 110, |
||||
labelWidth: 120, |
||||
}, |
||||
|
||||
{ |
||||
label: "处理状态", |
||||
prop: "checkSuccess", |
||||
width: 80, |
||||
slot: true, |
||||
search: true, |
||||
type: "select", |
||||
dicData: [ |
||||
{ |
||||
label: "成功", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "失败", |
||||
value: 0, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "核验详情", |
||||
prop: "sourceResult", |
||||
hide: true, |
||||
span: 24, |
||||
}, |
||||
|
||||
{ |
||||
label: "是否加密", |
||||
prop: "isEncrypt", |
||||
search: true, |
||||
viewDisplay: false, |
||||
type: "select", |
||||
dicData: [ |
||||
{ |
||||
label: "是", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "否", |
||||
value: 0, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "核验方式", |
||||
prop: "checkType", |
||||
width: 80, |
||||
search: true, |
||||
type: "select", |
||||
dicData: [ |
||||
{ |
||||
label: "上游检测", |
||||
value: 1, |
||||
}, |
||||
{ |
||||
label: "本地检测", |
||||
value: 2, |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
startTime: dateFormat( |
||||
new Date(new Date(new Date().toLocaleDateString()).getTime()) |
||||
), |
||||
endtime: dateFormat( |
||||
new Date( |
||||
new Date(new Date().toLocaleDateString()).getTime() + |
||||
24 * 60 * 60 * 1000 - |
||||
1 |
||||
) |
||||
), |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
created() { |
||||
this.onLoad(this.page); |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.tenantApiPrice = this.printFn( |
||||
res.data.data.tenantApiPrice / 10000 |
||||
); |
||||
this.form.checkSuccess = |
||||
res.data.data.checkSuccess == "1" ? "成功" : "失败"; |
||||
this.form.sourceResult = JSON.parse( |
||||
res.data.data.sourceResult.data.msg |
||||
); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.startTime = ""; |
||||
this.endtime = ""; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
let { createTime } = this.query; |
||||
let values = { |
||||
...params, |
||||
}; |
||||
if (createTime) { |
||||
values = { |
||||
...params, |
||||
queryStartTime: createTime[0], |
||||
queryEndTime: createTime[1], |
||||
...this.query, |
||||
}; |
||||
values.createTime = null; |
||||
} else { |
||||
values = { |
||||
...params, |
||||
queryStartTime: this.startTime, |
||||
queryEndTime: this.endtime, |
||||
...this.query, |
||||
}; |
||||
values.createTime = null; |
||||
} |
||||
this.loading = true; |
||||
getList(page.currentPage, page.pageSize, values).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,181 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud :option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad"> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getDetail, getList} from "@/api/core/customer/customerApi"; |
||||
import {mapGetters} from "vuex"; |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0 |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: true, |
||||
delBtn: true, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "资源方", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
dataType: "number", |
||||
prop: "sourceType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
span: 24, |
||||
labelWidth: 120, |
||||
// search: true, |
||||
// searchLabelWidth: 80, |
||||
// searchPlaceholder: "请输入配置名称", |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入配置名称", |
||||
trigger: "blur" |
||||
}], |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "接口类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=api_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
dataType: "number", |
||||
prop: "apiType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "运营商类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=net_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey" |
||||
}, |
||||
dataType: "string", |
||||
prop: "netType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "单价(单位毫)", |
||||
prop: "price", |
||||
span: 22, |
||||
labelWidth: 100, |
||||
rules: [ |
||||
{required: false, message: "请输入产品单价", trigger: "blur"}, |
||||
], |
||||
} |
||||
] |
||||
}, |
||||
data: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false) |
||||
}; |
||||
} |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then(res => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
@ -1,96 +0,0 @@
|
||||
<template> |
||||
<div> |
||||
<el-dialog |
||||
title="日志设置" |
||||
:visible.sync="visit" |
||||
width="30%" |
||||
:before-close="cancel" |
||||
append-to-body |
||||
> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
||||
<el-form-item label="是否开启"> |
||||
<el-switch |
||||
v-model="form.open" |
||||
@change="cachechange" |
||||
:active-value="1" |
||||
:inactive-value="0" |
||||
></el-switch> |
||||
</el-form-item> |
||||
<el-form-item label="日志天数" prop="day"> |
||||
<el-select |
||||
v-model="form.day" |
||||
placeholder="请选择日志天数" |
||||
size="mini" |
||||
:disabled="form.open == 0" |
||||
> |
||||
<el-option |
||||
v-for="item in days" |
||||
:label="item" |
||||
:value="item" |
||||
:key="item" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
<el-button type="primary" @click="sure">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { cache } from "@/api/system/tenant"; |
||||
export default { |
||||
props: ["visit", "id", "cacheDays", "cacheEn"], |
||||
data() { |
||||
return { |
||||
form: { |
||||
open: null, |
||||
day: null, |
||||
}, |
||||
rules: { |
||||
day: [{ required: true, message: "请选择日志天数", trigger: "change" }], |
||||
}, |
||||
days: [1, 2, 3, 4, 5, 6, 7], |
||||
}; |
||||
}, |
||||
watch: { |
||||
cacheDays(newV, oldV) { |
||||
this.form.day = newV; |
||||
}, |
||||
cacheEn(newV, oldV) { |
||||
this.form.open = newV; |
||||
}, |
||||
}, |
||||
methods: { |
||||
//确认 |
||||
sure() { |
||||
this.$refs.form.validate((valid) => { |
||||
let obj = { |
||||
enabled: this.form.open, |
||||
id: this.id, |
||||
cacheDays: this.form.day, |
||||
}; |
||||
if (valid) { |
||||
cache(obj).then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.$refs.form.resetFields(); |
||||
this.$emit("sures"); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
//取消 |
||||
cancel() { |
||||
this.$refs.form.resetFields(); |
||||
this.form.open = 0; |
||||
this.$emit("cancelca"); |
||||
}, |
||||
cachechange(e) { |
||||
this.form.open = e; |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
@ -1,137 +0,0 @@
|
||||
<template> |
||||
<div> |
||||
<el-dialog |
||||
title="价格变更记录" |
||||
:visible.sync="pchange" |
||||
v-if="pchange" |
||||
width="60%" |
||||
:before-close="close" |
||||
append-to-body |
||||
> |
||||
<el-table :data="tableData" style="width: 100%" v-loading="loading"> |
||||
<el-table-column prop="apiName" label="api名称" width="200"> </el-table-column> |
||||
<el-table-column prop="price" label="价格(元)" width="130"> |
||||
<template slot-scope="scope"> |
||||
{{ printFn(scope.row.price / 10000) }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="content" label="操作记录"> |
||||
</el-table-column> |
||||
<el-table-column prop="updateTime" label="操作时间" width="180"> |
||||
</el-table-column> |
||||
<el-table-column prop="operatorName" label="操作人" width="100"> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-pagination |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
:page-sizes="[10, 20, 30, 40]" |
||||
:page-size="10" |
||||
layout="total,sizes, prev, pager, next" |
||||
:total="total" |
||||
> |
||||
</el-pagination> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button type="primary" @click="close" size="mini">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import * as math from "mathjs"; |
||||
import { change, operator, apiprot } from "@/api/system/price.js"; |
||||
export default { |
||||
props: ["pchange", "id","pids"], |
||||
data() { |
||||
return { |
||||
formInline: { |
||||
current: 1, |
||||
size: 10, |
||||
}, |
||||
arr: [], //运营商类型 |
||||
apiarr: [], //api接口 |
||||
tableData: [], //列表 |
||||
loading: false, |
||||
total: "", |
||||
}; |
||||
}, |
||||
watch: { |
||||
pchange(nv, ov) { |
||||
if (nv == true) { |
||||
this.list(); |
||||
} |
||||
}, |
||||
}, |
||||
created() { |
||||
this.operatortype(); |
||||
this.apiprottype(); |
||||
}, |
||||
methods: { |
||||
//列表 |
||||
list() { |
||||
let params = { |
||||
tenantId: this.id, |
||||
current: this.formInline.current, |
||||
size: this.formInline.size, |
||||
productApiId:this.pids, |
||||
}; |
||||
this.loading = true; |
||||
change(params) |
||||
.then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.tableData = res.data.data.records; |
||||
this.total = res.data.data.total; |
||||
this.loading = false; |
||||
} |
||||
}) |
||||
.catch(() => { |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//运营商类型 |
||||
operatortype() { |
||||
operator().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.arr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
//接口类型 |
||||
apiprottype() { |
||||
apiprot().then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.apiarr = res.data.data; |
||||
} |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
close() { |
||||
this.formInline.current = 1; |
||||
this.formInline.size = 10; |
||||
this.$emit("priceclose"); |
||||
}, |
||||
//查询 |
||||
onSubmit() { |
||||
this.formInline.current = 1; |
||||
this.list(); |
||||
}, |
||||
//清空 |
||||
clear() { |
||||
this.formInline.current = 1; |
||||
|
||||
this.list(); |
||||
}, |
||||
handleSizeChange(val) { |
||||
this.formInline.size = val; |
||||
this.list(); |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.formInline.current = val; |
||||
this.list(); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
@ -1,90 +0,0 @@
|
||||
<template> |
||||
<div> |
||||
<el-dialog |
||||
:title="title" |
||||
:visible.sync="IPwhite" |
||||
width="30%" |
||||
:before-close="cancel" |
||||
append-to-body |
||||
> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
||||
<el-form-item :label="title" prop="name"> |
||||
<el-input |
||||
v-model="form.name" |
||||
size="mini" |
||||
style="width: 80%" |
||||
:type="type" |
||||
autosize |
||||
></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
<el-button type="primary" @click="sure">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { setIpWhiteList, charge, setCreditAmount } from "@/api/system/tenant"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
props: ["IPwhite", "id", "title", "IP", "type"], |
||||
data() { |
||||
return { |
||||
form: { |
||||
name: "", |
||||
}, |
||||
rules: { |
||||
name: [{ required: true, message: "请输入内容", trigger: "blur" }], |
||||
}, |
||||
}; |
||||
}, |
||||
watch: { |
||||
IP(newV, oldV) { |
||||
if (this.title == "IP白名单") { |
||||
this.form.name = newV; |
||||
} |
||||
}, |
||||
}, |
||||
methods: { |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
//确认 |
||||
sure() { |
||||
this.$refs.form.validate((valid) => { |
||||
let type = null; |
||||
let obj = { |
||||
id: this.id, |
||||
}; |
||||
if (this.title == "IP白名单") { |
||||
type = setIpWhiteList; |
||||
obj.ipWhiteLists = this.form.name; |
||||
} else if (this.title == "充值(元)") { |
||||
type = charge; |
||||
obj.amount = this.printFn(this.form.name * 10000); |
||||
} else if (this.title == "授信额度(元)") { |
||||
type = setCreditAmount; |
||||
obj.creditAmount = this.printFn(this.form.name * 10000); |
||||
} |
||||
if (valid) { |
||||
type(obj).then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.$refs.form.resetFields(); |
||||
this.$emit("sure"); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
//取消 |
||||
cancel() { |
||||
this.$refs.form.resetFields(); |
||||
this.form.name = this.$options.data().form.name; |
||||
this.$emit("cancel"); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
@ -1,181 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="price" slot-scope="scope"> |
||||
<span>{{ scope.row.price }}</span> |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getDetail, getList } from "@/api/core/customer/customerApi"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: true, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
menu:false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
span: 24, |
||||
labelWidth: 120, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入配置名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "接口类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=api_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
prop: "apiType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
slot: true, |
||||
}, |
||||
{ |
||||
label: "运营商类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=net_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "string", |
||||
prop: "netType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
}, |
||||
{ |
||||
label: "单价(元)", |
||||
prop: "price", |
||||
span: 22, |
||||
labelWidth: 100, |
||||
slot: true, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
data.records.forEach((item) => { |
||||
if (item.netType == "cmcc") { |
||||
item.price = this.printFn(item.priceCmcc / 10000); |
||||
} else if (item.netType == "ctcc") { |
||||
item.price = this.printFn(item.priceCtcc / 10000); |
||||
} else if (item.netType == "cucc") { |
||||
item.price = this.printFn(item.priceCucc / 10000); |
||||
} |
||||
}); |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,157 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getList } from "@/api/customerbill/daily"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
dialogVisible: false, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
menu: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "账单时间", |
||||
type: "date", |
||||
format: "yyyy-MM-dd", |
||||
valueFormat: "yyyyMMdd", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "productApiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
|
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
|
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,158 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="totalFee" slot-scope="scope"> |
||||
{{ printFn(scope.row.totalFee / 10000) }} |
||||
</template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import {getList } from "@/api/customerbill/month"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
dialogVisible: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
menu: false, |
||||
viewBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
column: [ |
||||
{ |
||||
label: "账单时间", |
||||
type: "month", |
||||
format: "yyyy-MM", |
||||
valueFormat: "yyyyMM", |
||||
prop: "date", |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "productApiName", |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "计费次数", |
||||
prop: "totalCount", |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "账单金额(元)", |
||||
prop: "totalFee", |
||||
labelWidth: 100, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
|
||||
methods: { |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form = res.data.data; |
||||
this.form.totalFee = this.printFn(res.data.data.totalFee / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
|
||||
|
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
@ -1,349 +0,0 @@
|
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:permission="permissionList" |
||||
:before-open="beforeOpen" |
||||
v-model="form" |
||||
ref="crud" |
||||
@row-update="rowUpdate" |
||||
@row-save="rowSave" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template slot="price" slot-scope="scope"> |
||||
{{ printFn(scope.row.price / 10000) }} |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button |
||||
type="text" |
||||
size="mini" |
||||
icon="el-icon-tickets" |
||||
@click.stop="handleChange(row)" |
||||
> |
||||
价格变更记录 |
||||
</el-button> |
||||
</template> |
||||
</avue-crud> |
||||
|
||||
<el-dialog |
||||
title="价格变更记录" |
||||
:visible.sync="visit" |
||||
v-if="visit" |
||||
width="60%" |
||||
:before-close="close" |
||||
append-to-body |
||||
> |
||||
<el-table :data="tableData" style="width: 100%" v-loading="loadings"> |
||||
<el-table-column prop="apiName" label="api名称" width="200"> |
||||
</el-table-column> |
||||
<el-table-column prop="price" label="价格(元)" width="130"> |
||||
<template slot-scope="scope"> |
||||
{{ printFn(scope.row.price / 10000) }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="content" label="操作记录"> </el-table-column> |
||||
<el-table-column prop="updateTime" label="操作时间" width="180"> |
||||
</el-table-column> |
||||
<el-table-column prop="operatorName" label="操作人" width="100"> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-pagination |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
:page-sizes="[10, 20, 30, 40]" |
||||
:page-size="10" |
||||
layout="total,sizes, prev, pager, next" |
||||
:total="totals" |
||||
> |
||||
</el-pagination> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button type="primary" @click="close" size="mini">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getDetail, |
||||
getList, |
||||
add, |
||||
update, |
||||
remove, |
||||
change, |
||||
} from "@/api/core/source/sourceApi"; |
||||
import { mapGetters } from "vuex"; |
||||
import * as math from "mathjs"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
loadings: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
formInline: { |
||||
current: 1, |
||||
size: 10, |
||||
}, |
||||
totals: "", |
||||
visit: false, |
||||
option: { |
||||
tip: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
border: true, |
||||
index: true, |
||||
addBtn: false, |
||||
viewBtn: true, |
||||
delBtn: false, |
||||
columnBtn: false, |
||||
selection: false, |
||||
dialogClickModal: false, |
||||
dialogWidth: "45%", |
||||
menuWidth: 300, |
||||
column: [ |
||||
{ |
||||
label: "资源方", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=source_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
prop: "sourceType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "API名称", |
||||
prop: "apiName", |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: "请输入配置名称", |
||||
trigger: "blur", |
||||
}, |
||||
], |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "接口类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=api_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "number", |
||||
prop: "apiType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "运营商类型", |
||||
type: "select", |
||||
dicUrl: "/api1/bd-system/dict/dictionary?code=net_type", |
||||
props: { |
||||
label: "dictValue", |
||||
value: "dictKey", |
||||
}, |
||||
dataType: "string", |
||||
prop: "netType", |
||||
labelWidth: 100, |
||||
search: true, |
||||
searchLabelWidth: 90, |
||||
slot: true, |
||||
editDisplay: false, |
||||
}, |
||||
{ |
||||
label: "单价(元)", |
||||
prop: "price", |
||||
slot: true, |
||||
labelWidth: 100, |
||||
rules: [ |
||||
{ required: false, message: "请输入产品单价", trigger: "blur" }, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
data: [], |
||||
tableData: [], //价格变更列表 |
||||
sourceApiId: "", //价格变更记录的id |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
viewBtn: this.vaildData(this.permission.sourceApi_view, false), |
||||
editBtn: this.vaildData(this.permission.sourceApi_edit, false), |
||||
delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
||||
}; |
||||
}, |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
add(row).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
window.console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
update({ |
||||
id: row.id, |
||||
apiName: row.apiName, |
||||
price: this.printFn(row.price * 10000), |
||||
}).then( |
||||
() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
done(); |
||||
}, |
||||
(error) => { |
||||
loading(); |
||||
console.log(error); |
||||
} |
||||
); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm("确定将选择数据删除?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}) |
||||
.then(() => { |
||||
return remove(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "操作成功!", |
||||
}); |
||||
}); |
||||
}, |
||||
beforeOpen(done, type) { |
||||
if (["edit", "view"].includes(type)) { |
||||
getDetail(this.form.id).then((res) => { |
||||
this.form.price = this.printFn(res.data.data.price / 10000); |
||||
}); |
||||
} |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList( |
||||
page.currentPage, |
||||
page.pageSize, |
||||
Object.assign(params, this.query) |
||||
).then((res) => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
//价格变更弹窗 |
||||
handleChange(row) { |
||||
this.visit = true; |
||||
|
||||
this.sourceApiId = row.id; |
||||
if (this.sourceApiId) { |
||||
this.list(); |
||||
} |
||||
}, |
||||
//价格变更列表 |
||||
list() { |
||||
let params = { |
||||
sourceApiId: this.sourceApiId, |
||||
current: this.formInline.current, |
||||
size: this.formInline.size, |
||||
}; |
||||
this.loadings = true; |
||||
change(params) |
||||
.then((res) => { |
||||
if (res.data.code == 200) { |
||||
this.tableData = res.data.data.records; |
||||
this.totals = res.data.data.total; |
||||
this.loadings = false; |
||||
} |
||||
}) |
||||
.catch(() => { |
||||
this.loadings = false; |
||||
}); |
||||
}, |
||||
handleSizeChange(val) { |
||||
this.formInline.size = val; |
||||
this.list(); |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.formInline.current = val; |
||||
this.list(); |
||||
}, |
||||
//关闭价格变更记录弹窗 |
||||
close() { |
||||
this.visit = false; |
||||
this.formInline.current = 1; |
||||
this.formInline.size = 10; |
||||
}, |
||||
printFn(value) { |
||||
const precision = 14; |
||||
return Number(math.format(value, precision)); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style></style> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue