Commit 12fe02e8 by cwq0219

我的分账;提现记录;线上分账;搜索组件-时间

1 parent 8f10e49f
import request from './request'
const path = 'dj.smartcarlife.api.orderdivision.'
const path2 = 'dj.api.withdraw.'
// 分账 - start
export function getListApi(data) {
data.method = `${path}page`
return request(data, 'post')
}
export function getCountApi(data) {
data.method = `${path}count`
return request(data, 'post')
}
export function exportApi(data) {
data.method = `${path}export`
return request(data, 'post')
}
// 分账 - end
// 提现 - start
export function getWithdrawList(data) {
data.method = `${path2}listWithPage`
return request(data, 'post')
}
export function gettWithdrawCountApi(data) {
data.method = `${path}count`
return request(data, 'post')
}
// 获取提现账号和提现余额
export function getBankBalanceApi(data) {
data.method = `${path2}bankBalance`
return request(data, 'post')
}
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2021-04-15 10:17:12
* @Last Modified time: 2021-04-17 14:47:03
*/
export const TYPE_NAME = 'confType'
......@@ -133,6 +133,50 @@ export const brandMerchantList = [{
confValue: '嘀嘀虎'
}]
// 分账状态
export const divisionStatusList = [{
confId: '1',
confLabel: '待分账'
}, {
confId: '2',
confLabel: '分账中'
}, {
confId: '3',
confLabel: '分账成功'
}, {
confId: '4',
confLabel: '分账失败'
}]
// 提现状态
export const withdrawStatusList = [{
confId: 1,
confLabel: '提现中'
}, {
confId: 2,
confLabel: '提现成功'
}, {
confId: 3,
confLabel: '提现失败'
}]
// 提现渠道
export const withdrawChannelList = [{
confId: 1,
confLabel: '小程序'
}, {
confId: 2,
confLabel: 'PC后台'
}]
// 获取最近n个月,默认6个月
export function getCurrentSixMonth(n = 5) {
return [
new Date(new Date().setMonth((new Date().getMonth() - n))),
new Date()
]
}
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var reg = {
......
......@@ -46,7 +46,8 @@
<el-date-picker
v-else-if="item.type === 'datePicker'"
v-model="searchForm[item.name]"
type="daterange"
:type="item.dateType || 'daterange'"
:clearable="item.isClear || false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
......
......@@ -55,17 +55,19 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">共 50 笔订单,累计分账金额 9400 元,分账成功金额 9400 元,分账中金额 0 元,分账失败金额 0 元。</span>
<span slot="left">共<span class="count-txt">{{countObj.orderCount}}</span>笔订单,累计分账金额<span class="count-txt">{{countObj.divisionMoneyCount}}</span>元,分账成功金额<span class="count-txt">{{countObj.divisionSuccessMoneyCount}}</span>元,分账中金额<span class="count-txt">{{countObj.inDivisionMoneyCount}}</span>元,分账失败金额<span class="count-txt">{{countObj.divisionFailureMoneyCount}}</span>元。</span>
<el-button
type="primary"
size="mini"
@click="handleExport"
>导出</el-button>
</d2-table-header>
<d2-table
ref="merchantTable"
:getListApi="getListApi"
:searchForm="searchForm"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
>
</d2-table>
</div>
......@@ -79,17 +81,24 @@
</template>
<script>
import { mapActions } from 'vuex'
import { Util } from '@/common/util'
import cashDialog from './cashDialog'
import { getCurrentSixMonth } from '@/common/constants.js'
import { getParkStore } from '@api/editCustomer'
import { getListApi, getCountApi, exportApi, getBankBalanceApi } from '@/api/account'
export default {
name: 'myAccount',
data() {
return {
countObj: {},
searchForm: {},
searchFormSearch: {},
showFormData: [{
label: '分账时间',
name: '',
type: 'datePicker'
name: 'divisionDate',
type: 'datePicker',
dateType: 'monthrange'
}, {
label: '园区店',
name: 'sellerMerchantId',
......@@ -105,37 +114,37 @@ export default {
addHtml: 'accountType'
}, {
label: '订单编号',
name: '',
name: 'orderCode',
type: 'input',
palcehodler: '请输入查询的订单编号'
}],
// 表格
getListApi: '',
getListApi: getListApi,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableOption: false,
tableColumns: [{
label: '序号',
prop: ''
}, {
label: '订单编号',
prop: ''
prop: 'orderCode'
}, {
label: '园区店名',
prop: ''
prop: 'yqMerchantName'
}, {
label: '分账类型',
prop: ''
}, {
label: '分账金额(元)',
prop: ''
prop: 'divisionMoney'
}, {
label: '分账状态',
prop: ''
prop: 'divisionStatus'
}, {
label: '分账时间',
prop: ''
prop: 'divisionDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.divisionDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
},
// 提现弹窗
......@@ -154,18 +163,78 @@ export default {
},
mounted() {
this.searchForm.divisionDate = getCurrentSixMonth()
this.getCount()
this.getBankBalance()
getParkStore({}).then(res => {
this.baseData.parkServiceList = res
// this.getOptionsList()
this.getOptionsList()
})
},
methods: {
...mapActions({
close: 'd2admin/page/close'
}),
getParams() {
var params = _.cloneDeep(this.searchForm)
if (params.divisionDate && params.divisionDate.length) {
params.divisionStartDate = Util.dateFormate(params.divisionDate[0], 'YYYY-MM')
params.divisionEndDate = Util.dateFormate(params.divisionDate[1], 'YYYY-MM')
delete params.divisionDate
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = this.getParams()
resolve()
})
},
getCount() {
var params = this.getParams()
getCountApi(params).then(res => {
this.countObj = res
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
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])
}
})
},
// 获取提现账号和余额
getBankBalance() {
getBankBalanceApi({}).then(res => {
console.log(res)
})
},
handleRecord() {
this.close({ tagName: '/myAccountRecord' })
this.$router.push({
name: 'myAccountRecord'
})
},
handleReset() {
this.searchForm = {
divisionDate: getCurrentSixMonth()
}
},
// 提现弹窗
handleCash() {
this.handleCashClose()
......@@ -176,6 +245,13 @@ export default {
},
handleCashConfirm() {
this.handleCashClose()
},
handleExport() {
var params = this.getParams()
exportApi(params).then(res => {
this.$open(res)
})
}
}
}
......
......@@ -30,8 +30,9 @@
<d2-table
ref="merchantTable"
:getListApi="getListApi"
:searchForm="searchForm"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
>
</d2-table>
</div>
......@@ -39,79 +40,139 @@
</template>
<script>
import { Util } from '@/common/util'
import { getWithdrawList } from '@/api/account'
import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
export default {
name: 'myAccountRecord',
data() {
return {
searchForm: {},
searchForm: {
withDrawDate: []
},
searchFormSearch: {},
showFormData: [{
label: '提现时间',
name: '',
type: 'datePicker'
name: 'withDrawDate',
type: 'datePicker',
dateType: 'monthrange'
}, {
label: '提现结果',
name: '',
name: 'status',
type: 'select',
optionList: [],
optionId: '',
optionLabel: '',
optionsName: ''
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawStatusList'
}, {
label: '提现渠道',
name: '',
name: 'withdrawSource',
type: 'select',
optionList: [],
optionId: '',
optionLabel: '',
optionsName: ''
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawChannelList'
}],
// 表格
getListApi: '',
getListApi: getWithdrawList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableOption: false,
tableColumns: [{
label: '序号',
prop: ''
}, {
label: '提现时间',
prop: ''
prop: 'createdDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
}, {
label: '登录账号',
prop: ''
prop: 'createdBy'
}, {
label: '提现金额(元)',
prop: ''
prop: 'totalAmount'
}, {
label: '到账账户名',
prop: ''
prop: 'accountName'
}, {
label: '到账银行',
prop: ''
prop: 'bankName'
}, {
label: '到账卡号',
prop: ''
prop: 'bankAccountNo'
}, {
label: '验证手机号',
prop: ''
prop: 'withdrawPhone'
}, {
label: '提现结果',
prop: ''
prop: 'status',
formatter: (cellValue) => {
return this.baseData.withdrawStatusList.find(item => item.confId === cellValue.status).confLabel
}
}, {
label: '到账金额(元)',
prop: ''
prop: '',
formatter: (cellValue) => {
return cellValue.totalAmount - cellValue.fee
}
}, {
label: '提现渠道',
prop: ''
prop: 'withdrawSource',
formatter: (cellValue) => {
return this.baseData.withdrawChannelList.find(item => item.confId === cellValue.withdrawSource).confLabel
}
}]
},
baseData: {
withdrawStatusList: withdrawStatusList,
withdrawChannelList: withdrawChannelList
}
}
},
mounted() { },
mounted() {
this.searchForm.withDrawDate = getCurrentSixMonth()
this.getOptionsList()
},
methods: {}
methods: {
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
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])
}
})
},
getParams() {
var params = _.cloneDeep(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(params.withDrawDate[0], 'YYYY-MM')
params.endDate = Util.dateFormate(params.withDrawDate[1], 'YYYY-MM')
delete params.withDrawDate
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = this.getParams()
resolve()
})
},
handleReset() {
this.searchForm = {
divisionDate: getCurrentSixMonth()
}
}
}
}
</script>
......
......@@ -125,7 +125,7 @@
<el-table-column
label="园区店"
align="center"
prop="firstOrder.sellerMerchantName"
prop="yqMerchantName"
width="170px"
></el-table-column>
<el-table-column
......@@ -238,6 +238,7 @@ export default {
label: '服务时间',
name: 'successTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
},
// {
......@@ -253,6 +254,7 @@ export default {
label: '创建时间',
name: 'createTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '创建方式',
......
......@@ -249,6 +249,7 @@ export default {
label: '录入日期',
name: 'entryTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '客户信息',
......
......@@ -341,6 +341,7 @@ export default {
label: '按时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '园区店',
......
......@@ -14,6 +14,7 @@
</d2-search>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
......@@ -27,8 +28,9 @@
<d2-table
ref="accountRecordTable"
:getListApi="getListApi"
:searchForm="searchForm"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
>
<auth-button
slot="auth-button"
......@@ -41,25 +43,31 @@
</template>
<script>
import { Util } from '@/common/util'
import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
import { BaseData, getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
import { getWithdrawList, gettWithdrawCountApi } from '@/api/account'
export default {
name: 'accountRecord',
data() {
return {
searchForm: {},
searchForm: {
withDrawDate: []
},
searchFormSearch: {},
showFormData: [{
label: '提现时间',
name: '',
type: 'datePicker'
name: 'withDrawDate',
type: 'datePicker',
dateType: 'monthrange'
}, {
label: '提现结果',
name: '',
name: 'status',
type: 'select',
optionList: [],
optionId: '',
optionLabel: '',
optionsName: ''
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawStatusList'
}, {
label: '渠道',
name: 'channelType',
......@@ -70,68 +78,86 @@ export default {
optionsName: 'channelTypeList'
}, {
label: '商户名称',
name: '',
name: 'merchantName',
type: 'input',
placeholder: '请输入4S店/服务商名称'
}, {
label: '提现渠道',
name: '',
name: 'withdrawSource',
type: 'select',
optionList: [],
optionId: '',
optionLabel: '',
optionsName: ''
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'withdrawChannelList'
}],
getListApi: '',
getListApi: getWithdrawList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableOption: false,
tableColumns: [{
label: '序号',
prop: ''
}, {
label: '提现时间',
prop: ''
prop: 'createdDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
}, {
label: '登录账户',
prop: ''
prop: 'createdBy'
}, {
label: '商户名',
prop: ''
prop: 'merchantName'
}, {
label: '提现金额(元)',
prop: ''
prop: 'totalAmount'
}, {
label: '到账账户名',
prop: ''
prop: 'accountName'
}, {
label: '到账银行',
prop: ''
prop: 'bankName'
}, {
label: '到账卡号',
prop: ''
prop: 'bankAccountNo'
}, {
label: '验证手机号',
prop: ''
prop: 'withdrawPhone'
}, {
label: '提现结果',
prop: ''
prop: 'status',
formatter: (cellValue) => {
return this.baseData.withdrawStatusList.find(item => item.confId === cellValue.status).confLabel
}
}, {
label: '到账金额(元)',
prop: ''
prop: '',
formatter: (cellValue) => {
return cellValue.totalAmount - cellValue.fee
}
}, {
label: '渠道',
prop: ''
prop: 'channelType',
formatter: (cellValue) => {
return this.baseData.channelTypeList.find(item => item.value === cellValue.channelType).name
}
}, {
label: '提现渠道',
prop: ''
prop: 'withdrawSource',
formatter: (cellValue) => {
return this.baseData.withdrawChannelList.find(item => item.confId === cellValue.withdrawSource).confLabel
}
}]
},
baseData: {
channelTypeList: [],
withdrawStatusList: withdrawStatusList,
withdrawChannelList: withdrawChannelList
}
}
},
mounted() {
this.searchForm.withDrawDate = getCurrentSixMonth()
this.getBaseData()
},
......@@ -155,6 +181,29 @@ export default {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
getParams() {
var params = _.cloneDeep(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(params.withDrawDate[0], 'YYYY-MM')
params.endDate = Util.dateFormate(params.withDrawDate[1], 'YYYY-MM')
delete params.withDrawDate
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = this.getParams()
resolve()
})
},
handleReset() {
this.searchForm = {
divisionDate: getCurrentSixMonth()
}
}
}
}
......
......@@ -16,6 +16,7 @@
<el-button
size="small"
type="primary"
@click="handleSearch"
>查询</el-button>
<el-button
size="small"
......@@ -25,28 +26,29 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">共笔订单,累计分账金额元,分账成功金额元,分账中金额元,分账失败金额元。</span>
<span slot="left">共<span class="count-txt">{{countObj.orderCount}}</span>笔订单,累计分账金额<span class="count-txt">{{countObj.divisionMoneyCount}}</span>元,分账成功金额<span class="count-txt">{{countObj.divisionSuccessMoneyCount}}</span>元,分账中金额<span class="count-txt">{{countObj.inDivisionMoneyCount}}</span>元,分账失败金额<span class="count-txt">{{countObj.divisionFailureMoneyCount}}</span>元。</span>
<auth-button category="Button"></auth-button>
</d2-table-header>
<el-table :data="tableList">
<el-table-column
label="序号"
prop=""
type='index'
:index="index=>index+(page.currentPage - 1) * page.pageSize + 1"
align="center"
></el-table-column>
<el-table-column
label="订单编号"
prop=""
prop="orderCode"
align="center"
></el-table-column>
<el-table-column
label="支付金额"
prop=""
prop="payMoney"
align="center"
></el-table-column>
<el-table-column
label="分账金额"
prop=""
prop="divisionMoney"
align="center"
></el-table-column>
<el-table-column
......@@ -55,12 +57,12 @@
>
<el-table-column
label="名称"
prop=""
prop="partnerMerchantName"
align="center"
></el-table-column>
<el-table-column
label="分账金额"
prop=""
prop="partnerDivisionMoney"
align="center"
></el-table-column>
</el-table-column>
......@@ -70,28 +72,28 @@
>
<el-table-column
label="名称"
prop=""
prop="shopMerchantName"
align="center"
></el-table-column>
<el-table-column
label="分账金额"
prop=""
prop="shopDivisionMoney"
align="center"
></el-table-column>
<el-table-column
label="渠道"
prop=""
prop="shopChannelType"
align="center"
></el-table-column>
</el-table-column>
<el-table-column
label="分账状态"
prop=""
prop="divisionStatus"
align="center"
></el-table-column>
<el-table-column
label="分账时间"
prop=""
prop="divisionDate"
align="center"
></el-table-column>
</el-table>
......@@ -110,29 +112,37 @@
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
import { BaseData, divisionStatusList, getCurrentSixMonth } from '@/common/constants.js'
import { getListApi, getCountApi, exportApi } from '@/api/account'
export default {
name: 'onlineAccountList',
data() {
return {
countObj: {},
searchForm: {},
showFormData: [{
label: '分账时间',
name: '',
type: 'datePicker'
name: 'divisionDate',
type: 'datePicker',
dateType: 'monthrange'
}, {
label: '订单编号',
name: '',
type: 'input'
name: 'orderCode',
type: 'input',
placeholder: '请输入查询的订单编号',
isClear: true,
keyFn: this.getList
}, {
label: '分账状态',
name: '',
name: 'divisionStatus',
type: 'select',
optionList: [],
optionId: '',
optionLabel: '',
optionName: ''
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'divisionStatusList'
}, {
label: '渠道',
name: 'channelType',
......@@ -144,7 +154,10 @@ export default {
}, {
label: '商户名称',
name: 'merchantName',
type: 'input'
type: 'input',
placeholder: '请输入园区店/服务商/4S店名称',
isClear: true,
keyFn: this.getList
}],
// 表格
tableList: [],
......@@ -154,17 +167,23 @@ export default {
},
total: 0,
baseData: {
channelTypeList: []
channelTypeList: [],
divisionStatusList: divisionStatusList
}
}
},
mounted() {
this.searchForm.divisionDate = getCurrentSixMonth()
this.getList()
this.getBaseData()
},
methods: {
...mapActions('d2admin/base', ['get']),
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
......@@ -185,29 +204,77 @@ export default {
})
},
handleSearch() { },
getParams() {
var params = _.cloneDeep(this.searchForm)
if (params.divisionDate && params.divisionDate.length) {
params.divisionStartDate = Util.dateFormate(params.divisionDate[0], 'YYYY-MM')
params.divisionEndDate = Util.dateFormate(params.divisionDate[1], 'YYYY-MM')
delete params.divisionDate
}
return params
},
getList() {
var params = this.getParams()
this.getCount()
getListApi({
...params,
...this.page
}).then(res => {
// console.log(res)
this.tableList = res.list
})
},
getCount() {
var params = this.getParams()
getCountApi(params).then(res => {
this.countObj = res
})
},
handleSearch() {
this.page.currentPage = 1
this.getList()
},
handleReset() {
this.searchForm = {
divisionDate: getCurrentSixMonth()
}
},
// 每页条数
handleSizeChange(value) {
this.page.pageSize = value
this.handleSearch()
this.getList()
},
// 页码
handleCurrentChange(value) {
this.page.currentPage = value
this.handleSearch()
this.getList()
},
handleRecord() {
this.close({ tagName: '/accountRecord' })
this.$router.push({
name: 'accountRecord'
})
},
handleExport() { }
handleExport() {
var params = this.getParams()
exportApi(params).then(res => {
this.$open(res)
})
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
</style>
......@@ -151,6 +151,7 @@ export default {
label: '创建时间',
name: 'createTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '商品名称',
......
......@@ -124,6 +124,7 @@ export default {
label: '创建时间',
name: 'createTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '素材名称',
......
......@@ -242,6 +242,7 @@ export default {
label: '下单日期',
name: 'orderTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}],
searchForm: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!