Commit 373b47ff by 前端

1月份版本功能代码提交

1 parent c1dbf112
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife."
// 分页查询记录
export function dfBalanceMonthStatPage(data) {
data.method = `${path}dfBalanceMonthStat.page`
return request(data, RequestMethods.POST)
}
// 商户年份明细查询
export function dfBalanceMonthStatListStatYear(data) {
data.method = `${path}dfBalanceMonthStat.listStatYear`
return request(data, RequestMethods.POST)
}
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife."
// 分页查询记录
export function transferQuotaMonitorConfigPage(data) {
data.method = `${path}transferQuotaMonitorConfig.page`
return request(data, RequestMethods.POST)
}
// 编辑
export function transferQuotaMonitorConfigUpdate(data) {
data.method = `${path}transferQuotaMonitorConfig.update`
return request(data, RequestMethods.POST)
}
...@@ -15,7 +15,8 @@ export function limitPrice( ...@@ -15,7 +15,8 @@ export function limitPrice(
) { ) {
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/ numReg: /^[1-9]\d*$/,
priceReg_negative: /^-?\d[\d\.]*$/ // 允许负数的正则表达式
} }
regRule = regRule || "priceReg" regRule = regRule || "priceReg"
if ( if (
...@@ -48,6 +49,35 @@ export function limitPrice( ...@@ -48,6 +49,35 @@ export function limitPrice(
} }
} }
//允许输入负数的输入框限制
export function limitPriceForNegative(newValue) {
//用来检索整数且不超过七位数
const limitDigit = /[0-9]{1,7}/
// 用来检索小数且小数点后不超过两位数
const limitDigitdot = /[0-9]{1,7}.[\d]{0,2}/
if (newValue) {
newValue = newValue + ""
let nn = ""
// 正负判断
if (newValue.match("-")) {
nn = newValue.match("-")[0]
}
// 小数判断
if (newValue.indexOf(".") != -1) {
if (newValue.match(limitDigitdot)) {
nn = nn + newValue.match(limitDigitdot)[0] || ""
}
} else {
if (newValue.match(limitDigit)) {
nn = nn + newValue.match(limitDigit)[0] || ""
}
}
// 限制数字最大为100
// if (parseFloat(nn) > 100) nn = 9999999;
return nn
}
}
/** /**
* 时间控件-限制月份 * 时间控件-限制月份
*/ */
......
...@@ -223,5 +223,59 @@ export const routerName = { ...@@ -223,5 +223,59 @@ export const routerName = {
} }
], ],
component: _import("financeManage/withdrawalManage/index") component: _import("financeManage/withdrawalManage/index")
},
90507: {
path: "/limitMonitor",
name: "limitMonitor",
meta: {
title: "额度监控",
authId: "90507",
parentId: "905",
cache: false
},
auth: [
{
authId: "9050701",
parentId: "90507",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9050702",
parentId: "90507",
label: "编辑",
handle: "handleEdit"
}
],
component: _import("financeManage/limitMonitor/index")
},
90508: {
path: "/balanceStatistics",
name: "balanceStatistics",
meta: {
title: "余额统计",
authId: "90508",
parentId: "905",
cache: false
},
auth: [
{
authId: "9050801",
parentId: "90508",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9050802",
parentId: "90508",
label: "明细",
handle: "handleDetail"
}
],
component: _import("financeManage/balanceStatistics/index")
} }
} }
<!-- 月度库存结算单弹窗 -->
<template>
<d2-dialog title="查看明细"
:is-visible="detailVisible"
class="stockMonthDailog"
width="70%"
:no-cancel="true"
btn-ok-label="关闭"
@closeDialog="handleClose"
@confirmDialog="handleClose">
<div class="merchantInfo">
<span class="merchantName">{{recordInfo.merchantName}}</span><span
class="merchantId">{{recordInfo.merchantId}}</span>
</div>
<div>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData">
<div slot="yearChoose"
slot-scope="scope">
<el-date-picker v-model="searchForm.statYear"
type="year"
placeholder="选择年"
value-format="yyyy"
format="yyyy"
:clearable="false"
:picker-options="pickerOption"
@change="chooseYear">
</el-date-picker>
</div>
</d2-search>
</div>
<div class="d2-container-content">
<d2-table ref="recordTable"
:table-data="tableData"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:has-page="false"
:has-num="false">
</d2-table>
</div>
</div>
</d2-dialog>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { dfBalanceMonthStatListStatYear } from '@api/balanceStatistics'
import { rangePickerOptions_year_2023 } from '@/common/format'
export default {
name: 'DetailDialog',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
pickerOption: rangePickerOptions_year_2023,
countObj: {},
searchForm: {
statYear: '',
merchantId: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [{
label: '年度',
addHtml: 'yearChoose'
}],
// getListApi: getReportByGoods,
tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [{
label: '月份',
prop: 'statYearMonth',
width: '100px'
}, {
label: '可代付金额',
prop: 'canDfQuota',
formatter: (cellValue) => {
return (cellValue.canDfQuota || cellValue.canDfQuota == 0) ? cellValue.canDfQuota.toFixed(2) : '-'
}
}, {
label: '已代付金额',
prop: 'usedDfQuota',
formatter: (cellValue) => {
return (cellValue.usedDfQuota || cellValue.usedDfQuota == 0) ? cellValue.usedDfQuota.toFixed(2) : '-'
}
}, {
label: '余额',
prop: 'remnantQuota',
formatter: (cellValue) => {
return (cellValue.remnantQuota || cellValue.remnantQuota == 0) ? cellValue.remnantQuota.toFixed(2) : '-'
}
}
]
},
baseData: {
},
}
},
props: {
detailVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
}
},
computed: {
},
mounted() {
const nowDate = new Date()
this.searchForm.statYear = nowDate.getFullYear().toString()
if (this.recordInfo) {
this.searchForm.merchantId = this.recordInfo.merchantId
}
this.getList()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
chooseYear() {
this.getList()
},
getList() {
var params = deepClone(this.searchForm)
dfBalanceMonthStatListStatYear(params).then(res => {
this.tableData = res
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style lang="scss" scoped>
.merchantInfo {
margin-left: 20px;
.merchantName {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 15px;
color: #333333;
}
.merchantId {
margin-left: 10px;
}
}
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.stockMonthDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
.stockMonthDailog .btn-tips img {
width: 18px;
height: 15px;
margin-right: 9px;
vertical-align: bottom;
}
.stockMonthDailog .btn-tips {
display: inline-block;
font-size: 12px;
height: 14px;
line-height: 14px;
background-color: #fff2e5;
color: #999999;
margin-right: 24px;
padding: 6.5px 10px;
}
.show-search {
margin-left: -65px;
}
</style>
<!-- 余额统计 - 列表 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:labelWidth="labelWidth"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
<!-- 明细 -->
<detail-dialog :detailVisible="detailVisible"
v-if="detailVisible"
:recordInfo="recordInfo"
@dialogClose="editDialogClose" />
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { dfBalanceMonthStatPage } from '@api/balanceStatistics'
import detailDialog from './components/detailDialog'
export default {
name: 'LimitMonitorList',
components: {
detailDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '110px',
searchForm: {
merchantName: '',
matchMerchantId: ''
},
searchFormSearch: {},
showFormData: [{
label: '平台方名称',
name: 'merchantName',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '平台方商户号',
name: 'matchMerchantId',
type: 'input',
inputType: 'number',
maxlength: '20',
isClear: true
}],
getListApi: dfBalanceMonthStatPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// mutiSelectUniqueKey: 'id',
// mutiSelectName: 'transferAccounts',
tableOption: { width: '100px' },
tableColumns: [{
label: '平台方名称',
prop: 'merchantName'
}, {
label: '平台方商户号',
prop: 'merchantId',
width: '120px'
}, {
label: '累计可代付金额',
prop: 'totalCanDfQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.totalCanDfQuota || cellValue.totalCanDfQuota == 0) ? parseFloat(cellValue.totalCanDfQuota).toFixed(2) : '-'
}
}, {
label: '累计已代付金额',
prop: 'totalUsedDfQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.totalUsedDfQuota || cellValue.totalUsedDfQuota == 0) ? parseFloat(cellValue.totalUsedDfQuota).toFixed(2) : '-'
}
}, {
label: '累计余额',
prop: 'totalRemnantQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.totalRemnantQuota || cellValue.totalRemnantQuota == 0) ? parseFloat(cellValue.totalRemnantQuota).toFixed(2) : '-'
}
}, {
label: '上月可代付金额',
prop: 'lastMonthCanDfQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.lastMonthCanDfQuota || cellValue.lastMonthCanDfQuota == 0) ? parseFloat(cellValue.lastMonthCanDfQuota).toFixed(2) : '-'
}
}, {
label: '上月已代付金额',
prop: 'lastMonthUsedDfQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.lastMonthUsedDfQuota || cellValue.lastMonthUsedDfQuota == 0) ? parseFloat(cellValue.lastMonthUsedDfQuota).toFixed(2) : '-'
}
}, {
label: '上月余额',
prop: 'lastMonthRemnantQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.lastMonthRemnantQuota || cellValue.lastMonthRemnantQuota == 0) ? parseFloat(cellValue.lastMonthRemnantQuota).toFixed(2) : '-'
}
}
]
},
baseData: {
},
recordInfo: null,
detailVisible: false
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
console.log('this.baseData[item.optionsName]', item.optionsName)
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable(false, true)
},
handleReset() {
this.searchForm = {
merchantName: '',
matchMerchantId: ''
}
this.$refs.recordTable.refreshTable(false, true)
},
handleDetail(row) {
this.recordInfo = row
this.detailVisible = !this.detailVisible
},
editDialogClose(obj) {
this.detailVisible = !this.detailVisible
},
handleExport() {
var params = this.searchFormSearch
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.api.smartcarlife.dfBalanceMonthStat.exportAsync'
const list = [
...this.dowloadList,
{
name: '余额统计',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>
<!-- 编辑额度 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="merchantInfo">
<span class="merchantName">{{paramsObj.merchantName}}</span><span
class="merchantId">{{paramsObj.merchantId}}</span>
</div>
<div class="add-dialog">
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="150px"
default-width="400px"
:form-ref="editChildRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules">
<div slot="dayQuotaHtml"
slot-scope="scope">
<el-input placeholder="请输入日额度"
v-model="infoForm.dayQuota"
style="width:400px"
clearable
@input="handleInput($event, 'dayQuota')">
</el-input>
</div>
<div slot="monthQuotaHtml"
slot-scope="scope">
<el-input placeholder="请输入月额度"
v-model="infoForm.monthQuota"
style="width:400px"
clearable
@input="handleInput($event, 'monthQuota')">
</el-input>
</div>
<div slot="yearQuotaHtml"
slot-scope="scope">
<el-input placeholder="请输入年额度"
v-model="infoForm.yearQuota"
style="width:400px"
clearable
@input="handleInput($event, 'yearQuota')">
</el-input>
</div>
<div slot="unDfQuotaHtml"
slot-scope="scope">
<el-input placeholder="请输入非代付已用额度"
v-model="infoForm.unDfQuota"
style="width:400px"
clearable
@input="handleUpgradeNum_unDfQuota">
</el-input>
</div>
</glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import { transferQuotaMonitorConfigUpdate } from '@api/limitMonitor'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { limitPrice, limitPriceForNegative } from '@/common/format'
import BigNumber from 'bignumber.js'
export default {
name: 'EditDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
merchantId: '',
statYear: '',
dayQuota: '',
monthQuota: '',
yearQuota: '',
dfQuota: '',
unDfQuota: '',
usedYearQuota: ''
},
oldVal: {
dayQuota: '',
monthQuota: '',
yearQuota: '',
unDfQuota: ''
},
dialogConfig: {
title: '额度设置',
width: '860px'
},
editChildRef: 'editChildRef',
formRules: {
platformMerchantId: [{ required: true, message: '请选择平台方', trigger: 'change' }],
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
transferType: [{ required: true, message: '请选择转账类型', trigger: 'change' }],
partnerMerchantId: [{ required: true, message: '请选择对账服务商', trigger: 'change' }],
// yqMerchantId: [{ required: true, message: '请选择对账园区店', trigger: 'change' }],
// shopMerchantId: [{ required: true, message: '请选择对账流量方', trigger: 'change' }],
reconciliationDate: [{ required: true, message: '请选择对账周期', trigger: 'change' }],
// expenseType: [{ required: true, message: '请选择费用类型', trigger: 'change' }],
transferInMerchantId: [{ required: true, message: '请选择转入方', trigger: 'change' }]
},
editFormData: [{
label: '所属年度',
name: 'statYear',
type: 'input',
isDisabled: true
}, {
label: '日额度/元',
name: 'dayQuota',
addHtml: 'dayQuotaHtml',
rules: [{ required: true, message: '请输入金额,支持输入0~9999999的数字,支持小数点后2位', trigger: 'change' }]
}, {
label: '月额度/元',
name: 'monthQuota',
addHtml: 'monthQuotaHtml',
rules: [{ required: true, message: '请输入金额,支持输入0~9999999的数字,支持小数点后2位', trigger: 'change' }]
}, {
label: '年额度/元',
name: 'yearQuota',
addHtml: 'yearQuotaHtml',
rules: [{ required: true, message: '请输入金额,支持输入0~9999999的数字,支持小数点后2位', trigger: 'change' }]
}, {
label: '已代付额度/元',
name: 'dfQuota',
type: 'input',
isDisabled: true
}, {
label: '非代付已用额度/元',
name: 'unDfQuota',
addHtml: 'unDfQuotaHtml',
rules: [{ required: true, message: '支持输入-9999999.99~9999999.99的数字,支持小数点后2位', trigger: 'change' }]
}, {
label: '已用额度/元',
name: 'usedYearQuota',
type: 'input',
isDisabled: true
}],
baseData: {
},
}
},
props: {
editVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
watch: {
},
computed: {
visible: {
get() {
return this.editVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'editVisible' })
}
},
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getDetail()
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getDetail() {
this.infoForm = deepClone(this.paramsObj)
console.log('this.infoForm', this.infoForm);
// this.infoForm.statYear = obj.statYear
// this.infoForm.usedYearQuota = obj.usedYearQuota
// this.infoForm.dfQuota = obj.dfQuota
},
handleInput(newVal, name) {
console.log(newVal)
newVal = newVal.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
this.infoForm[name] = limitPrice(newVal, this.oldVal[name], 7, 2, 0, 9999999)
this.oldVal[name] = this.infoForm[name]
},
handleUpgradeNum_unDfQuota(newVal) {
this.infoForm.unDfQuota = limitPriceForNegative(newVal)
if (this.infoForm.unDfQuota && !isNaN(this.infoForm.unDfQuota)) {
let dfQuota = new BigNumber(this.infoForm.dfQuota)
let unDfQuota = new BigNumber(this.infoForm.unDfQuota)
console.log(dfQuota);
console.log(unDfQuota);
this.infoForm.usedYearQuota = dfQuota.plus(unDfQuota).toString()
} else {
this.infoForm.usedYearQuota = deepClone(this.paramsObj.usedYearQuota)
}
},
handleAddConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var infoForm = deepClone(this.infoForm)
var params = {}
params.merchantId = infoForm.merchantId
params.statYear = infoForm.statYear
params.dayQuota = infoForm.dayQuota
params.monthQuota = infoForm.monthQuota
params.yearQuota = infoForm.yearQuota
params.unDfQuota = infoForm.unDfQuota
transferQuotaMonitorConfigUpdate(params).then(res => {
this.notice.okTips('操作成功')
this.visible = true
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.merchantInfo {
margin-left: 20px;
.merchantName {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 15px;
color: #333333;
}
.merchantId {
margin-left: 10px;
}
}
.add-dialog {
margin: 20px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
.down-cla {
width: 56px;
height: 32px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #185efe;
text-align: right;
line-height: 32px;
padding-left: 8px;
// cursor: pointer;
}
.file-box {
width: 350px;
.file-item {
margin-top: 6px;
position: relative;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
::v-deep .el-progress-bar {
width: 320px;
background: #ffffff;
border: 1px solid #f4f6fc;
border-radius: 4px;
.el-progress-bar__outer {
background: transparent;
border-radius: 4px;
.el-progress-bar__inner {
background: #f5f7fa;
border-radius: 4px;
}
}
}
::v-deep .el-image-viewer__wrapper {
width: 100vw;
height: 100vh;
}
.file-name {
position: absolute;
left: 12px;
top: 6px;
transform: translateY(-50%);
color: #333333;
font-size: 14px;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.image-file {
z-index: -1;
}
}
.file-item:first-child {
margin-top: 15px;
.file-name {
position: absolute;
left: 12px;
top: 15px;
transform: translateY(-50%);
color: #333333;
font-size: 14px;
}
}
}
}
</style>
<!-- 额度监控 - 列表 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:labelWidth="labelWidth"
:form-data="showFormData">
<div slot="yearChoose"
slot-scope="scope">
<el-date-picker v-model="searchForm.statYear"
type="year"
placeholder="选择年"
value-format="yyyy"
format="yyyy"
:clearable="false"
:picker-options="pickerOption"
:editable="false">
</el-date-picker>
</div>
</d2-search>
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
<!-- 编辑 -->
<edit-dialog :editVisible="editVisible"
v-if="editVisible"
:paramsObj="recordInfo"
@dialogClose="editDialogClose" />
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { rangePickerOptions_year_2023 } from '@/common/format'
import { transferQuotaMonitorConfigPage } from '@api/limitMonitor'
import editDialog from './components/editDialog'
export default {
name: 'LimitMonitorList',
components: {
editDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
pickerOption: rangePickerOptions_year_2023,
labelWidth: '100px',
searchForm: {
statYear: '',
merchantName: '',
matchMerchantId: ''
},
searchFormSearch: {},
showFormData: [{
label: '年度',
addHtml: 'yearChoose'
}, {
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '商户号',
name: 'matchMerchantId',
type: 'input',
inputType: 'number',
maxlength: '20',
isClear: true
}],
getListApi: transferQuotaMonitorConfigPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// mutiSelectUniqueKey: 'id',
// mutiSelectName: 'transferAccounts',
tableOption: { width: '100px' },
tableColumns: [{
label: '区域',
prop: 'cityName',
width: '100px'
}, {
label: '商户名称',
prop: 'merchantName',
width: '200px'
}, {
label: '商户号',
prop: 'merchantId',
width: '120px'
}, {
label: '联系方式',
prop: 'phone',
width: '120px'
}, {
label: '开户行',
prop: 'openAccBankName',
width: '200px'
}, {
label: '账号',
prop: 'bankAccountNo',
width: '200px'
}, {
label: '日额度/元',
prop: 'dayQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.dayQuota || cellValue.dayQuota == 0) ? parseFloat(cellValue.dayQuota).toFixed(2) : '-'
}
}, {
label: '月额度/元',
prop: 'monthQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.monthQuota || cellValue.monthQuota == 0) ? parseFloat(cellValue.monthQuota).toFixed(2) : '-'
}
}, {
label: '年额度/元',
prop: 'yearQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.yearQuota || cellValue.yearQuota == 0) ? parseFloat(cellValue.yearQuota).toFixed(2) : '-'
}
}, {
label: '本年已用额度',
prop: 'usedYearQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.usedYearQuota || cellValue.usedYearQuota == 0) ? parseFloat(cellValue.usedYearQuota).toFixed(2) : '-'
}
}, {
label: '剩余额度',
prop: 'remnantQuota',
width: '120px',
formatter: (cellValue) => {
return (cellValue.remnantQuota || cellValue.remnantQuota == 0) ? parseFloat(cellValue.remnantQuota).toFixed(2) : '-'
}
}
]
},
baseData: {
},
recordInfo: null,
editVisible: false
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
if (!this.searchForm.statYear) {
const nowDate = new Date()
this.searchForm.statYear = nowDate.getFullYear().toString()
}
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
console.log('this.baseData[item.optionsName]', item.optionsName)
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable(false, true)
},
handleReset() {
this.searchForm = {
statYear: '',
merchantName: '',
matchMerchantId: ''
}
this.$refs.recordTable.refreshTable(false, true)
},
handleEdit(row) {
this.recordInfo = row
this.editVisible = !this.editVisible
},
editDialogClose(obj) {
this[obj.attrName] = !this[obj.attrName]
if (obj.flag) {
this.$refs.recordTable.refreshTable()
}
},
handleExport() {
var params = this.searchFormSearch
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.api.smartcarlife.transferQuotaMonitorConfig.exportAsync'
const list = [
...this.dowloadList,
{
name: '额度监控',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>
...@@ -150,12 +150,14 @@ import { mapActions, mapState } from 'vuex' ...@@ -150,12 +150,14 @@ import { mapActions, mapState } from 'vuex'
import { limitPrice } from '@/common/format' import { limitPrice } from '@/common/format'
import { uploadPDF, uploadExcel } from '@/api/sys.base' import { uploadPDF, uploadExcel } from '@/api/sys.base'
import { getServiceStore } from '@api/editCustomer' import { getServiceStore } from '@api/editCustomer'
import { getPlatformMerchantList } from '@api/index'
export default { export default {
name: 'AddDialog', name: 'AddDialog',
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
infoForm: { infoForm: {
platformMerchantId: '',
sceneType: '', sceneType: '',
transferType: 1, transferType: 1,
partnerMerchantId: '', partnerMerchantId: '',
...@@ -181,6 +183,7 @@ export default { ...@@ -181,6 +183,7 @@ export default {
}, },
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
formRules: { formRules: {
platformMerchantId: [{ required: true, message: '请选择平台方', trigger: 'change' }],
sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }], sceneType: [{ required: true, message: '请选择业务场景', trigger: 'change' }],
transferType: [{ required: true, message: '请选择转账类型', trigger: 'change' }], transferType: [{ required: true, message: '请选择转账类型', trigger: 'change' }],
partnerMerchantId: [{ required: true, message: '请选择对账服务商', trigger: 'change' }], partnerMerchantId: [{ required: true, message: '请选择对账服务商', trigger: 'change' }],
...@@ -191,10 +194,18 @@ export default { ...@@ -191,10 +194,18 @@ export default {
transferInMerchantId: [{ required: true, message: '请选择转入方', trigger: 'change' }] transferInMerchantId: [{ required: true, message: '请选择转入方', trigger: 'change' }]
}, },
editFormData: [{ editFormData: [{
label: '所属平台方',
name: 'platformMerchantId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'PlatformMerchantList'
}, {
label: '业务场景', label: '业务场景',
name: 'sceneType', name: 'sceneType',
type: 'select', type: 'select',
isClear: true,
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', optionLabel: 'confValue',
...@@ -264,7 +275,7 @@ export default { ...@@ -264,7 +275,7 @@ export default {
this.baseData.shopMerchantList = [{ merchantId: '', merchantName: '全部' }] this.baseData.shopMerchantList = [{ merchantId: '', merchantName: '全部' }]
this.infoForm.shopMerchantId = '' this.infoForm.shopMerchantId = ''
this.getOptionsList('editFormData', true, 'shopMerchantId') this.getOptionsList('editFormData', true, 'shopMerchantId')
this.baseData.yqMerchantList = targetItem.optionList.find(item => item.partnerMerchantId == value).subMerchantsInfo this.baseData.yqMerchantList = targetItem.optionList.find(item => item.partnerMerchantId == value).ymerchants
this.getOptionsList('editFormData', true, 'yqMerchantId') this.getOptionsList('editFormData', true, 'yqMerchantId')
this.getAmount() this.getAmount()
} }
...@@ -274,8 +285,8 @@ export default { ...@@ -274,8 +285,8 @@ export default {
type: 'select', type: 'select',
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: 'merchantId', optionId: 'ymerchantId',
optionLabel: 'merchantName', optionLabel: 'ymerchantName',
optionsName: 'yqMerchantList', optionsName: 'yqMerchantList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
if (value) { if (value) {
...@@ -380,8 +391,8 @@ export default { ...@@ -380,8 +391,8 @@ export default {
], ],
expenseTypes2: [ expenseTypes2: [
{ confId: 3, confValue: "流量费" } { confId: 3, confValue: "流量费" }
// { confId: 4, confValue: "流量费" }, ],
] PlatformMerchantList: [],
}, },
uploadFileList: [] uploadFileList: []
} }
...@@ -428,6 +439,7 @@ export default { ...@@ -428,6 +439,7 @@ export default {
}, },
mounted() { mounted() {
this.getPlatformMerchantList()
this.getMerchantList() this.getMerchantList()
this.getInMerchantList() this.getInMerchantList()
this.getOptionsList('editFormData', false) this.getOptionsList('editFormData', false)
...@@ -845,6 +857,7 @@ export default { ...@@ -845,6 +857,7 @@ export default {
}) })
} }
params.voucherList = infoForm.voucherList params.voucherList = infoForm.voucherList
params.platformMerchantId = infoForm.platformMerchantId
transferAccountsRecordAdd(params).then(res => { transferAccountsRecordAdd(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
...@@ -857,6 +870,18 @@ export default { ...@@ -857,6 +870,18 @@ export default {
// 找到在formList的位置,通过name来匹配 // 找到在formList的位置,通过name来匹配
findFormIdx(name) { findFormIdx(name) {
return this.editFormData.findIndex(item => item.name === name) return this.editFormData.findIndex(item => item.name === name)
},
//获取平台方数据
getPlatformMerchantList() {
getPlatformMerchantList({}).then(res => {
res.unshift({
merchantId: -1,
merchantName: '嘀加智慧云'
})
this.baseData.PlatformMerchantList = res
this.getOptionsList('editFormData', false, 'platformMerchantId')
})
} }
} }
} }
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
<el-form-item label="业务单号:"> <el-form-item label="业务单号:">
{{ detailInfo.orderCode }} {{ detailInfo.orderCode }}
</el-form-item> </el-form-item>
<el-form-item label="所属平台方:">
<span :title="detailInfo.platformMerchantName"
class="detail-txt">{{ detailInfo.platformMerchantName?detailInfo.platformMerchantName:'-' }}</span>
</el-form-item>
<el-form-item label="业务场景:"> <el-form-item label="业务场景:">
{{ sceneTypeOpts[detailInfo.sceneType] }} {{ sceneTypeOpts[detailInfo.sceneType] }}
</el-form-item> </el-form-item>
......
...@@ -113,6 +113,7 @@ import rejectDialog from './components/rejectDialog' ...@@ -113,6 +113,7 @@ import rejectDialog from './components/rejectDialog'
import financeConfirmDialog from './components/financeConfirmDialog' import financeConfirmDialog from './components/financeConfirmDialog'
import detailDialog from './components/detailDialog' import detailDialog from './components/detailDialog'
import addDialog from './components/addDialog' import addDialog from './components/addDialog'
import { getPlatformMerchantList } from '@api/index'
export default { export default {
name: 'TransferAccountsList', name: 'TransferAccountsList',
components: { components: {
...@@ -137,7 +138,8 @@ export default { ...@@ -137,7 +138,8 @@ export default {
transferTrandeNo: '', transferTrandeNo: '',
withdrawTradeNo: '', withdrawTradeNo: '',
transferAccountsDate: '', transferAccountsDate: '',
transferType: '' transferType: '',
platformMerchantId: ''
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [{ showFormData: [{
...@@ -203,6 +205,15 @@ export default { ...@@ -203,6 +205,15 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', optionLabel: 'confValue',
optionsName: 'transferTypeList' optionsName: 'transferTypeList'
}, {
label: '所属平台方',
name: 'platformMerchantId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'PlatformMerchantList'
}], }],
getListApi: transferAccountsRecordPage, getListApi: transferAccountsRecordPage,
tableParams: { tableParams: {
...@@ -216,6 +227,13 @@ export default { ...@@ -216,6 +227,13 @@ export default {
prop: 'orderCode', prop: 'orderCode',
width: '200px' width: '200px'
}, { }, {
label: '所属平台方',
prop: 'platformMerchantName',
width: '160px',
formatter: (cellValue) => {
return cellValue.platformMerchantName ? cellValue.platformMerchantName : '-'
}
}, {
label: '业务场景', label: '业务场景',
prop: 'sceneType', prop: 'sceneType',
width: '100px', width: '100px',
...@@ -371,7 +389,8 @@ export default { ...@@ -371,7 +389,8 @@ export default {
baseData: { baseData: {
statusList: deepClone(transferAccountsStatusList), statusList: deepClone(transferAccountsStatusList),
sceneTypeList: deepClone(sceneCodeList), sceneTypeList: deepClone(sceneCodeList),
transferTypeList: deepClone(transferTypeList) transferTypeList: deepClone(transferTypeList),
PlatformMerchantList: []
}, },
examineVisible: false, examineVisible: false,
...@@ -389,6 +408,7 @@ export default { ...@@ -389,6 +408,7 @@ export default {
}) })
}, },
mounted() { mounted() {
this.getPlatformMerchantList()
this.getBaseData() this.getBaseData()
}, },
...@@ -426,7 +446,6 @@ export default { ...@@ -426,7 +446,6 @@ export default {
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
console.log('this.baseData[item.optionsName]', item.optionsName)
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
...@@ -661,6 +680,18 @@ export default { ...@@ -661,6 +680,18 @@ export default {
}) })
}, },
//获取平台方数据
getPlatformMerchantList() {
getPlatformMerchantList({}).then(res => {
res.unshift({
merchantId: -1,
merchantName: '嘀加智慧云'
})
this.baseData.PlatformMerchantList = res
this.getOptionsList()
})
}
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!