Commit 6a007ed2 by 张立顺

feat 功能开发

1 parent 37b5bcbc
import request from "./request"
const path = "dj.api.smartcarlife."
// 分页查询预付款管理记录
export function advancePaymentPage(data) {
data.method = `${path}advancePayment.page`
return request(data)
}
// 分页查询门店预付款明细记录
export function advancePaymentShopDetailPage(data) {
data.method = `${path}advancePayment.shopDetailPage`
return request(data)
}
// 分页查询收付款管理记录
// export function advancePaymentTradePage(data) {
// data.method = `${path}advancePayment.tradePage`
// return request(data)
// }
// 分页查询预付款管理商户信息
export function advancePaymentMerchantPage(data) {
data.method = "dj.api.smartcarlife.advancePayment.merchantPage"
return request(data, "post")
}
// 查询商户月份付款信息
export function getMerchantMonthPayInfo(data) {
data.method = "dj.api.smartcarlife.advancePayment.getMerchantMonthPayInfo"
return request(data)
}
// 分页查询商户月份付款信息
export function getMerchantPage(data) {
data.method = "dj.api.smartcarlife.advancePayment.merchantPage"
return request(data)
}
// 分页查询预付款管理记录
export function advancePaymentPageExportAsync(data) {
data.method = "dj.api.smartcarlife.advancePayment.page.export.async"
return request(data, "post")
}
// /router/dj.api.smartcarlife.advancePayment.page.export.async/1.0.0
// 导出预付款管理记录列表(异步)
// /router/dj.api.smartcarlife.advancePayment.shopDetailPage.export.async/1.0.0
// 导出门店预付款明细列表(异步)
// 新增收付款管理记录
export function advancePaymentTradeAdd(data) {
data.method = "dj.api.smartcarlife.advancePayment.trade.add"
return request(data, "post")
}
// /router/dj.api.smartcarlife.advancePayment.tradePage.export.async/1.0.0
// 导出收付款管理列表(异步)
// 分页查询收付款管理记录
export function advancePaymentTradePage(data) {
data.method = "dj.api.smartcarlife.advancePayment.tradePage"
return request(data, "post")
}
// /router/dj.api.smartcarlife.advancePayment.tradePage.export.async/1.0.0
// 导出收付款管理列表(异步)
// /router/dj.api.smartcarlife.advancePayment.traffic.add/1.0.0
// 新增流量费/我司收益管理记录
export function trafficAdd(data) {
data.method = "dj.api.smartcarlife.advancePayment.traffic.add"
return request(data, "post")
}
// /router/dj.api.smartcarlife.advancePayment.trafficPage/1.0.0
// 分页查询流量费/我司收益管理记录
export function trafficPage(data) {
data.method = "dj.api.smartcarlife.advancePayment.trafficPage"
return request(data, "post")
}
// /router/dj.api.smartcarlife.advancePayment.trafficPage.export.async/1.0.0
// 导出流量费/我司收益管理列表(异步)
...@@ -56,3 +56,23 @@ export const taskOrderStatusList = [ ...@@ -56,3 +56,23 @@ export const taskOrderStatusList = [
label: "成功" label: "成功"
} }
] ]
export const tradeTypeList = [
// 1:银行转账(对公),2:银行承兑,3:银行转账,4:银盛收款
{
id: "1",
label: "银行转账(对公)"
},
{
id: "2",
label: "银行承兑"
},
{
id: "3",
label: "银行转账"
},
{
id: "4",
label: "银盛收款"
}
]
// 交易类型(1:银行转账(对公),2:银行承兑,3:银行转账,4:银盛收款)
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
</el-select> </el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" <el-date-picker v-model="searchSelectObj[item.selectName].value"
:style="{ width: 'calc(100% - ' + (typeof item.selectWidth === 'number' ? item.selectWidth + 'px' : (item.selectWidth || '130px')) + ')' }" :style="{ width: 'calc(100% - ' + (typeof item.selectWidth === 'number' ? item.selectWidth + 'px' : (item.selectWidth || '130px')) + ')' }"
:type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" :type="item.diffType ? searchSelectObj[item.selectName].attr : (item.dateType || 'daterange')"
start-placeholder="开始日期" end-placeholder="结束日期" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options="item.pickerOptions ? pickerOption[item.pickerOptions] : undefined" /> :picker-options="item.pickerOptions ? pickerOption[item.pickerOptions] : undefined" />
</template> </template>
<!-- 双选择框 --> <!-- 双选择框 -->
......
...@@ -660,7 +660,7 @@ export const routerName = { ...@@ -660,7 +660,7 @@ export const routerName = {
parentId: "90514", parentId: "90514",
label: "回单", label: "回单",
handle: "handleReceipt" handle: "handleReceipt"
}, }
], ],
component: _import("financeManage/usedCarPaymentManage/index") component: _import("financeManage/usedCarPaymentManage/index")
}, },
...@@ -695,8 +695,126 @@ export const routerName = { ...@@ -695,8 +695,126 @@ export const routerName = {
parentId: "90515", parentId: "90515",
label: "详情", label: "详情",
handle: "handleDetail" handle: "handleDetail"
}, }
], ],
component: _import("financeManage/usedCarFundWarning/index") component: _import("financeManage/usedCarFundWarning/index")
},
90516: {
path: "/prepaymentManage",
name: "prepaymentManage",
meta: {
title: "预付款管理",
authId: "90516",
parentId: "905",
cache: false
},
auth: [
{
authId: "9051601",
parentId: "90516",
label: "管理收款",
category: "Button",
type: "primary",
handle: "handleManageReceipt"
},
{
authId: "9051602",
parentId: "90516",
label: "管理付款",
category: "Button",
type: "primary",
handle: "handleManagePayment"
},
{
authId: "9051603",
parentId: "90516",
label: "流量费/我司收益",
category: "Button",
type: "primary",
handle: "handleTrafficFee"
},
{
authId: "9051604",
parentId: "90516",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9051606",
parentId: "90516",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9051607",
parentId: "90516",
label: "新增",
category: "Button",
type: "primary",
handle: "handleAddReceipt"
},
{
authId: "9051608",
parentId: "90516",
label: "管理付款导出",
category: "Button",
type: "primary",
handle: "handleExportPayment"
},
{
authId: "9051609",
parentId: "90516",
label: "管理付款新增",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9051610",
parentId: "90516",
label: "流量费/我司收益导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9051611",
parentId: "90516",
label: "流量费/我司收益新增",
category: "Button",
type: "primary",
handle: "handleAddTrafficFee"
},
{
authId: "9051605",
parentId: "90516",
label: "详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "905160501",
name: "详情",
parentId: "90516"
}
]
}
],
component: _import("financeManage/prepaymentManage/index")
},
905160501: {
path: "/prepaymentManage/detail",
name: "prepaymentDetail",
meta: {
title: "预付款详情",
authId: "905160501",
parentId: "90516",
cache: false
},
component: _import("financeManage/prepaymentManage/detail")
} }
} }
<template>
<baseDialog :title="title" :config="config" :dialog-config="dialogConfig" :is-show.sync="visibility" width="50%"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
class="selectGoods">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button type="primary" @click="handleReset" size="small">重置</el-button>
<!-- <el-button type="primary"></el-button> -->
</div>
<d2-table-header>
<div class="btns flex">
<span data-event-code="prepaymentManage_TrafficFee">
<auth-button category="Button" :show-btn-ids="['9051606']" />
</span>
<span data-event-code="prepaymentManage_Export">
<auth-button category="Button" :show-btn-ids="['9051607']" />
</span>
</div>
</d2-table-header>
<d2-table ref="groundingIndexTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
</d2-table>
<addDialog v-if="addVisible" :addVisible.sync="addVisible" @addDialogClose="addDialogClose"
@addDialogSuccess="addDialogSuccess" />
</baseDialog>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { advancePaymentTradePage } from "@api/prepaymentManage"
import { tradeTypeList } from "@/common/constant/vehicle"
import dayjs from "dayjs"
import addDialog from "./addDialog.vue"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
name: 'ManageReceiptDailog',
mixins: [reportTrackPageMixin],
props: {
title: {
type: String,
default: "管理收款"
},
manageReceiptDialogVisible: {
type: Boolean,
default: false
}
},
components: {
addDialog
},
data() {
return {
addVisible: false,
dialogConfig: {
title: "管理收款",
width: "900px",
hideConfirmBtn: true,
cancel_name: "关闭"
},
config: {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
hideConfirmBtn: true,
cancel_name: "关闭"
},
tradeTypeList,
getListApi: advancePaymentTradePage,
showFormData: [{
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: 50,
isClear: true
},
{
type: 'datePicker',
label: '收款日期',
name: 'paymentDate',
width: '260px'
}
],
searchForm: {
merchantName: '',
paymentDate: '',
managerType: 1
},
tempGoodsType: [],
baseData: {
productTypeList: [],
productList: []
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
// {
// label: '序号',
// prop: 'ownSerialNum',
// type: 'ownSerialNum',
// width: '60'
// },
{
label: '金额',
prop: 'tradeAmount',
width: 110,
// formatter: (cellValue) => {
// return cellValue.upgradeGoodsName || '-'
// }
}, {
label: '收款类型',
prop: 'tradeType',
// width: 120,
// width: 180,
formatter: (cellValue) => {
return tradeTypeList.find(v => v.id == cellValue.tradeType)?.label || '-'
}
}, {
label: '收款日期',
prop: 'tradeTime',
width: 170,
formatter: (cellValue) => {
return cellValue?.tradeTime ? dayjs(cellValue.tradeTime).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}, {
label: '门店',
prop: 'merchantName',
width: 140,
// formatter: (cellValue) => {
// return cellValue?.thirdPartyCode || '-'
// }
},
{
label: '操作人',
prop: 'createdBy',
// formatter: (cellValue) => {
// return cellValue?.goodsInfo?.goodsName || '-'
// },
width: 100
}, {
label: '操作日期',
prop: 'createdDate',
width: 170,
formatter: (cellValue) => {
return cellValue?.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}]
}
}
},
computed: {
visibility: {
get() {
return this.manageReceiptDialogVisible
},
set(value) {
this.$emit('update:manageReceiptDialogVisible', value)
}
},
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
handleExport() {
const params = {
method: "dj.api.smartcarlife.advancePayment.tradePage.export.async",
...this.getParams()
}
Object.keys(params).forEach((key) => {
if (params[key] == null || params[key] == "") {
delete params[key]
}
})
const list = [
...this.dowloadList,
{
name: "收款管理记录列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
getParams() {
if (this.searchForm.paymentDate?.length > 0) {
const [start, end] = this.searchForm.paymentDate
this.searchForm.startTradeTime = dayjs(start).format('YYYY-MM-DD') + ' 00:00:00'
this.searchForm.endTradeTime = dayjs(end).format('YYYY-MM-DD') + ' 23:59:59'
}
return {
...this.searchForm
}
},
handleAddReceipt() {
this.addVisible = true
},
addDialogClose() {
this.addVisible = false
},
addDialogSuccess() {
// this.addVisible = false
// 重新查询
this.$refs.groundingIndexTable.refreshTable(false, true)
},
// resetSearchForm() {
// this.searchForm = this.$options.data.call(this).searchForm
// this.$refs.showSearch.resetForm()
// },
setTableFinishFun(data) {
this.tableData = data
},
beforeSearchFn() {
return new Promise(resolve => {
this.getParams()
resolve()
})
},
handleSelectGoodsConfirm() {
// const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
// if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData)
},
handleSelectGoodsClose() {
this.$emit('handleSelectGoodsClose')
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
// 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true)
}
}
}
</script>
<style lang="scss" scoped>
.selectGoods {
::v-deep .el-dialog__body {
// padding: 0;
border-bottom: 1px solid #e4e7ed;
}
}
// .show-search {
// // height: 32px;
// }
.up-btns {
padding-top: 0;
}
.flex {
display: flex;
align-items: center;
}
.btns {
padding-right: 20px;
margin-left: auto;
gap: 10px;
}
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
.table {
border-bottom: 1px solid #e4e7ed;
}
</style>
<!-- 新增提现弹窗 -->
<template>
<baseDialog :config="config" :dialog-config="dialogConfig" :is-show.sync="visible" class="accountDailog"
@handleClick="handleCashConfirm">
<el-form ref="formRef" :model="infoForm" :rules="cashRules" label-width="120px">
<el-form-item label="门店名称:" prop="merchantId">
<el-select v-model="infoForm.merchant" value-key="merchantId" filterable style="width: 310px"
placeholder="请选择门店">
<el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="item.merchantName"
:value="item" />
</el-select>
<!-- <p>银盛账户余额:{{ balance || balance === 0 ? balance : "-" }}</p> -->
</el-form-item>
<el-form-item label="金额:" prop="tradeAmount">
<!-- :disabled="totalAmountDisabled" -->
<el-input v-model="infoForm.tradeAmount" placeholder="请输入金额" style="width: 310px" @input="handleUpgradeNum" />
</el-form-item>
<el-form-item label="收款类型:" prop="tradeType">
<el-select v-model="infoForm.tradeType" filterable style="width: 310px" placeholder="请选择收款类型">
<el-option v-for="(item, index) in baseData.tradeTypeList" :key="index" :label="item.label"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="收款日期:" prop="tradeTime">
<el-date-picker style="width: 310px" v-model="infoForm.tradeTime" type="datetime"
:picker-options="tradeTimePickerOptions" placeholder="选择日期时间">
</el-date-picker>
<!-- <el-select v-model="infoForm.administrators" filterable style="width: 310px">
<el-option v-for="(item, index) in baseData.administratorsList" :key="index"
:label="item.name + ' ' + item.phone" :value="item.phone" />
</el-select> -->
</el-form-item>
</el-form>
<!-- </d2-dialog> -->
</baseDialog>
</template>
<script>
import { deepClone } from "@/common/util"
import { sendToSmsCodeApi } from "@/api/sys.base"
import { advancePaymentMerchantPage, advancePaymentTradeAdd } from "@api/prepaymentManage"
import dayjs from "dayjs"
import { limitPrice } from "@/common/format"
export default {
// name: 'AddDialog',
data() {
return {
dialogConfig: {
title: "新增收款",
width: "600px"
},
config: {
showClose: true,
appendToBody: true, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "确 定"
},
infoForm: {
// administrators: "",
// smsCode: "",
// remark: "",
merchant: null,
merchantId: "",
// totalAmount: "",
tradeAmount: "",
tradeTime: ""
},
oldVal: {
tradeAmount: ""
},
cashRules: {
merchantId: [
{ required: true, message: "请选择门店", trigger: "change" }
],
tradeAmount: [
{
required: true,
message: "请输入金额,支持输入0~999999999的数字,支持小数点后2位",
trigger: "change"
}
],
tradeType: [
{ required: true, message: "请选择收款类型", trigger: "change" }
],
tradeTime: [
{ required: true, message: "请选择收款日期", trigger: "change" },
{ validator: (rule, value, callback) => this.validateTradeTime(rule, value, callback), trigger: "change" }
]
// smsCode: [
// { required: true, message: "请输入验证码", trigger: "change" }
// ]
},
// 验证码
showtips: false,
isSend: false,
sendMsg: "获取验证码",
time: "",
// 基本数据
baseData: {
tradeTypeList: [
// 1:银行转账(对公),2:银行承兑,3:银行转账,4:银盛收款
{
id: "1",
label: "银行转账(对公)"
}
],
// administratorsList: [],
merchantList: []
},
balance: "",
// totalAmountDisabled: true
}
},
props: {
addVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.addVisible
},
set(newVal) {
this.$emit("update:addVisible", newVal)
}
},
tradeTimePickerOptions() {
const start = this.infoForm.merchant && this.infoForm.merchant.startDate
return {
disabledDate: (date) => {
const a = dayjs(date).startOf('day').valueOf()
const min = start ? dayjs(start).startOf('day').valueOf() : -Infinity
const max = dayjs().endOf('day').valueOf()
return a < min || a > max
}
}
}
},
watch: {
'infoForm.merchant'(val) {
this.infoForm.merchantId = val ? val.merchantId : ''
this.infoForm.merchantName = val ? val.merchantName : ''
this.infoForm.tradeTime = ''
}
},
mounted() {
this.getMerchantList()
// this.getAdminList()
},
methods: {
validateTradeTime(rule, value, callback) {
const start = this.infoForm.merchant && this.infoForm.merchant.startDate
if (start && value) {
const a = dayjs(value).startOf('day').valueOf()
const min = dayjs(start).startOf('day').valueOf()
const max = dayjs().endOf('day').valueOf()
if (a < min) return callback(new Error('收款日期需不早于门店开始日期'))
if (a > max) return callback(new Error('收款日期不可晚于当前时间'))
}
callback()
},
getMerchantList() {
var params = {}
params.currentPage = 1
// params.pageSize = 1000000
params.pageSize = 100
advancePaymentMerchantPage(params).then((res) => {
this.baseData.merchantList = res.list
})
},
handleUpgradeNum(newVal) {
var maxVal = 999999999
if (this.balance) {
maxVal = this.balance
}
// else {
// newVal = ''
// }
this.infoForm.tradeAmount = limitPrice(
newVal,
this.oldVal.tradeAmount,
13,
2,
-999999999,
maxVal,
'priceReg_negative_input'
)
this.oldVal.tradeAmount = this.infoForm.tradeAmount
},
handleCashConfirm() {
this.$refs.formRef.validate((valid) => {
if (valid) {
var params = deepClone(this.infoForm)
// params.
if (params.tradeTime) {
params.tradeTime = dayjs(params.tradeTime).format("YYYY-MM-DD HH:mm:ss")
}
// params.remark = this.infoForm.remark
// params.smsCode = this.infoForm.smsCode
// params.phone = this.infoForm.administrators
// params.merchantId = this.infoForm.merchantId
// if (this.infoForm.totalAmount > 0) {
// params.totalAmount = this.infoForm.totalAmount
// } else {
// this.$message({
// message: "提现金额必须大于0",
// type: "warning",
// showClose: true
// })
// return
// }
console.log(params)
advancePaymentTradeAdd(params).then((res) => {
this.notice.okTips("新增成功")
this.visible = false
this.$emit("addDialogSuccess")
})
}
})
},
handleSend() {
if (!this.infoForm.administrators) {
this.notice.warningTips("请选择管理员")
return
}
sendToSmsCodeApi({ phone: this.infoForm.administrators }).then((res) => {
this.notice.okTips("已发送,30分钟内有效")
this.isSend = true
this.showtips = true
this.sendMsg = 60
this.msgDown()
})
},
msgDown() {
this.time = setTimeout(() => {
clearTimeout(this.time)
if (this.sendMsg > 1) {
--this.sendMsg
this.msgDown()
} else {
this.isSend = false
}
}, 1000)
}
}
}
</script>
<style scoped>
p {
margin: 0 0;
}
.cash-btn {
margin-left: 20px;
}
</style>
<template>
<baseDialog :title="title" :config="config" :dialog-config="dialogConfig" :is-show.sync="visibility" width="50%"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
class="selectGoods">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button type="primary" @click="handleReset" size="small">重置</el-button>
<!-- <el-button type="primary"></el-button> -->
</div>
<d2-table-header>
<div class="btns flex">
<span data-event-code="prepaymentManage_TrafficFee">
<auth-button category="Button" :show-btn-ids="['9051606']" />
</span>
<span data-event-code="prepaymentManage_Export">
<auth-button category="Button" :show-btn-ids="['9051607']" />
</span>
</div>
</d2-table-header>
<d2-table ref="groundingIndexTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
</d2-table>
<!-- <div class="table"></div> -->
<addDialog v-if="addVisible" :addVisible.sync="addVisible" @addDialogClose="addDialogClose"
@addDialogSuccess="addDialogSuccess" />
</baseDialog>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { advancePaymentTradePage } from "@api/prepaymentManage"
import { tradeTypeList } from "@/common/constant/vehicle"
import dayjs from "dayjs"
import addDialog from "./addDialog.vue"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
name: 'PaymentDialog',
mixins: [reportTrackPageMixin],
props: {
title: {
type: String,
default: "管理付款款"
},
paymentDialogVisible: {
type: Boolean,
default: false
}
},
components: {
addDialog
},
data() {
return {
addVisible: false,
dialogConfig: {
title: "管理收款",
width: "900px",
hideConfirmBtn: true,
cancel_name: "关闭"
},
config: {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
hideConfirmBtn: true,
cancel_name: "关闭"
},
tradeTypeList,
getListApi: advancePaymentTradePage,
showFormData: [{
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: 50,
isClear: true
},
{
type: 'datePicker',
label: '付款日期',
name: 'paymentDate',
width: '260px'
}
],
searchForm: {
merchantName: '',
paymentDate: '',
managerType: 2
},
tempGoodsType: [],
baseData: {
productTypeList: [],
productList: []
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
// {
// label: '序号',
// prop: 'ownSerialNum',
// type: 'ownSerialNum',
// width: '60'
// },
{
label: '金额',
prop: 'tradeAmount',
width: 110,
// formatter: (cellValue) => {
// return cellValue.upgradeGoodsName || '-'
// }
}, {
label: '收款类型',
prop: 'tradeType',
// width: 120,
// width: 180,
formatter: (cellValue) => {
return tradeTypeList.find(v => v.id == cellValue.tradeType)?.label || '-'
}
}, {
label: '付款日期',
prop: 'tradeTime',
width: 170,
formatter: (cellValue) => {
return cellValue?.tradeTime ? dayjs(cellValue.tradeTime).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}, {
label: '门店',
prop: 'merchantName',
width: 140,
// formatter: (cellValue) => {
// return cellValue?.thirdPartyCode || '-'
// }
},
{
label: '操作人',
prop: 'createdBy',
// formatter: (cellValue) => {
// return cellValue?.goodsInfo?.goodsName || '-'
// },
width: 100
}, {
label: '操作日期',
prop: 'createdDate',
width: 170,
formatter: (cellValue) => {
return cellValue?.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}]
}
}
},
computed: {
visibility: {
get() {
return this.paymentDialogVisible
},
set(value) {
this.$emit('update:paymentDialogVisible', value)
}
},
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
handleExport() {
const params = {
method: "dj.api.smartcarlife.advancePayment.tradePage.export.async",
...this.getParams()
}
Object.keys(params).forEach((key) => {
if (params[key] == null || params[key] == "") {
delete params[key]
}
})
const list = [
...this.dowloadList,
{
name: "付款管理记录列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
getParams() {
if (this.searchForm.paymentDate?.length > 0) {
const [start, end] = this.searchForm.paymentDate
this.searchForm.startTradeTime = dayjs(start).format('YYYY-MM-DD') + ' 00:00:00'
this.searchForm.endTradeTime = dayjs(end).format('YYYY-MM-DD') + ' 23:59:59'
}
return {
...this.searchForm
}
},
handleAddReceipt() {
this.addVisible = true
},
addDialogClose() {
this.addVisible = false
},
addDialogSuccess() {
// this.addVisible = false
// 重新查询
this.$refs.groundingIndexTable.refreshTable(false, true)
},
// resetSearchForm() {
// this.searchForm = this.$options.data.call(this).searchForm
// this.$refs.showSearch.resetForm()
// },
setTableFinishFun(data) {
this.tableData = data
},
beforeSearchFn() {
return new Promise(resolve => {
this.getParams()
resolve()
})
},
handleSelectGoodsConfirm() {
// const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
// if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData)
},
handleSelectGoodsClose() {
this.$emit('handleSelectGoodsClose')
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
// 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true)
}
}
}
</script>
<style lang="scss" scoped>
.selectGoods {
::v-deep .el-dialog__body {
// padding: 0;
border-bottom: 1px solid #e4e7ed;
}
}
// .show-search {
// // height: 32px;
// }
.up-btns {
padding-top: 0;
}
.flex {
display: flex;
align-items: center;
}
.btns {
padding-right: 20px;
margin-left: auto;
gap: 10px;
}
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
.table {
border-bottom: 1px solid #e4e7ed;
}
</style>
<!-- 新增提现弹窗 -->
<template>
<baseDialog :config="config" :dialog-config="dialogConfig" :is-show.sync="visible" class="accountDailog"
@handleClick="handleCashConfirm">
<el-form ref="formRef" :model="infoForm" :rules="cashRules" label-width="120px">
<el-form-item label="门店名称:" prop="merchantId">
<el-select v-model="infoForm.merchant" value-key="merchantId" filterable style="width: 310px"
placeholder="请选择门店">
<el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="item.merchantName"
:value="item" />
</el-select>
<!-- <p>银盛账户余额:{{ balance || balance === 0 ? balance : "-" }}</p> -->
</el-form-item>
<el-form-item label="金额:" prop="tradeAmount">
<!-- :disabled="totalAmountDisabled" -->
<el-input v-model="infoForm.tradeAmount" placeholder="请输入金额" style="width: 310px" @input="handleUpgradeNum" />
</el-form-item>
<el-form-item label="收款类型:" prop="tradeType">
<el-select v-model="infoForm.tradeType" filterable style="width: 310px" placeholder="请选择收款类型">
<el-option v-for="(item, index) in baseData.tradeTypeList" :key="index" :label="item.label"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="收款日期:" prop="tradeTime">
<el-date-picker style="width: 310px" v-model="infoForm.tradeTime" type="datetime"
:picker-options="tradeTimePickerOptions" placeholder="选择日期时间">
</el-date-picker>
<!-- <el-select v-model="infoForm.administrators" filterable style="width: 310px">
<el-option v-for="(item, index) in baseData.administratorsList" :key="index"
:label="item.name + ' ' + item.phone" :value="item.phone" />
</el-select> -->
</el-form-item>
</el-form>
<!-- </d2-dialog> -->
</baseDialog>
</template>
<script>
import { deepClone } from "@/common/util"
import { advancePaymentMerchantPage, advancePaymentTradeAdd } from "@api/prepaymentManage"
import dayjs from "dayjs"
import { limitPrice } from "@/common/format"
export default {
// name: 'AddDialog',
data() {
return {
dialogConfig: {
title: "新增付款",
width: "600px"
},
config: {
showClose: true,
appendToBody: true, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "确 定"
},
infoForm: {
// administrators: "",
// smsCode: "",
// remark: "",
merchant: null,
merchantId: "",
// totalAmount: "",
tradeAmount: ""
},
oldVal: {
tradeAmount: ""
},
cashRules: {
merchantId: [
{ required: true, message: "请选择门店", trigger: "change" }
],
tradeAmount: [
{
required: true,
message: "请输入金额,支持输入0~999999999的数字,支持小数点后2位",
trigger: "change"
}
],
tradeType: [
{ required: true, message: "请选择收款类型", trigger: "change" }
],
tradeTime: [
{ required: true, message: "请选择收款日期", trigger: "change" },
{ validator: (rule, value, callback) => this.validateTradeTime(rule, value, callback), trigger: "change" }
]
// smsCode: [
// { required: true, message: "请输入验证码", trigger: "change" }
// ]
},
// 验证码
showtips: false,
isSend: false,
sendMsg: "获取验证码",
time: "",
// 基本数据
baseData: {
tradeTypeList: [
// 1:银行转账(对公),2:银行承兑,3:银行转账,4:银盛收款
{
id: "2",
label: "银行承兑"
},
{
id: "3",
label: "银行转账"
}
],
// administratorsList: [],
merchantList: []
},
balance: "",
// totalAmountDisabled: true
}
},
props: {
addVisible: {
type: Boolean,
default: false
}
},
computed: {
visible: {
get() {
return this.addVisible
},
set(newVal) {
this.$emit("update:addVisible", newVal)
}
},
tradeTimePickerOptions() {
const start = this.infoForm.merchant && this.infoForm.merchant.startDate
return {
disabledDate: (date) => {
const a = dayjs(date).startOf('day').valueOf()
const min = start ? dayjs(start).startOf('day').valueOf() : -Infinity
const max = dayjs().endOf('day').valueOf()
return a < min || a > max
}
}
}
},
watch: {
'infoForm.merchant'(val) {
this.infoForm.merchantId = val ? val.merchantId : ''
this.infoForm.merchantName = val ? val.merchantName : ''
this.infoForm.tradeTime = ''
}
},
mounted() {
this.getMerchantList()
// this.getAdminList()
},
methods: {
validateTradeTime(rule, value, callback) {
const start = this.infoForm.merchant && this.infoForm.merchant.startDate
if (start && value) {
const a = dayjs(value).valueOf()
const b = dayjs(start).startOf('day').valueOf()
if (a < b) return callback(new Error('收款日期需不早于门店开始日期'))
}
callback()
},
getMerchantList() {
var params = {}
params.currentPage = 1
// params.pageSize = 1000000
params.pageSize = 100
advancePaymentMerchantPage(params).then((res) => {
this.baseData.merchantList = res.list
})
},
handleUpgradeNum(newVal) {
var maxVal = 999999999
if (this.balance) {
maxVal = this.balance
}
// else {
// newVal = ''
// }
this.infoForm.tradeAmount = limitPrice(
newVal,
this.oldVal.tradeAmount,
13,
2,
-999999999,
maxVal,
'priceReg_negative_input'
)
this.oldVal.tradeAmount = this.infoForm.tradeAmount
},
handleCashConfirm() {
this.$refs.formRef.validate((valid) => {
if (valid) {
var params = deepClone(this.infoForm)
// params.
if (params.tradeTime) {
params.tradeTime = dayjs(params.tradeTime).format("YYYY-MM-DD HH:mm:ss")
}
// params.remark = this.infoForm.remark
// params.smsCode = this.infoForm.smsCode
// params.phone = this.infoForm.administrators
// params.merchantId = this.infoForm.merchantId
// if (this.infoForm.totalAmount > 0) {
// params.totalAmount = this.infoForm.totalAmount
// } else {
// this.$message({
// message: "提现金额必须大于0",
// type: "warning",
// showClose: true
// })
// return
// }
console.log(params)
advancePaymentTradeAdd(params).then((res) => {
this.notice.okTips("新增成功")
this.visible = false
this.$emit("addDialogSuccess")
})
}
})
},
handleSend() {
if (!this.infoForm.administrators) {
this.notice.warningTips("请选择管理员")
return
}
sendToSmsCodeApi({ phone: this.infoForm.administrators }).then((res) => {
this.notice.okTips("已发送,30分钟内有效")
this.isSend = true
this.showtips = true
this.sendMsg = 60
this.msgDown()
})
},
msgDown() {
this.time = setTimeout(() => {
clearTimeout(this.time)
if (this.sendMsg > 1) {
--this.sendMsg
this.msgDown()
} else {
this.isSend = false
}
}, 1000)
}
}
}
</script>
<style scoped>
p {
margin: 0 0;
}
.cash-btn {
margin-left: 20px;
}
</style>
<template>
<baseDialog :title="title" :config="config" :dialog-config="dialogConfig" :is-show.sync="visibility" width="50%"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
class="selectGoods">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'"
:form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button type="primary" @click="handleReset" size="small">重置</el-button>
<!-- <el-button type="primary"></el-button> -->
</div>
<d2-table-header>
<div class="btns flex">
<span data-event-code="prepaymentManage_TrafficFee">
<auth-button category="Button" :show-btn-ids="['9051606']" />
</span>
<span data-event-code="prepaymentManage_Export">
<auth-button category="Button" :show-btn-ids="['9051607']" />
</span>
</div>
</d2-table-header>
<d2-table ref="groundingIndexTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
</d2-table>
<!-- <div class="table"></div> -->
<addDialog v-if="addVisible" :addVisible.sync="addVisible" @addDialogClose="addDialogClose"
@addDialogSuccess="addDialogSuccess" />
</baseDialog>
</template>
<script>
import { mapActions, mapState } from "vuex"
import { trafficPage } from "@api/prepaymentManage"
import { tradeTypeList } from "@/common/constant/vehicle"
import dayjs from "dayjs"
import addDialog from "./addDialog.vue"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
name: 'TrafficFeeDialog',
mixins: [reportTrackPageMixin],
props: {
title: {
type: String,
default: "管理收款"
},
trafficFeeDialogVisible: {
type: Boolean,
default: false
}
},
components: {
addDialog
},
data() {
return {
addVisible: false,
dialogConfig: {
title: "管理流量费/我司收益",
width: "900px",
hideConfirmBtn: true,
cancel_name: "关闭"
},
config: {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
hideConfirmBtn: true,
cancel_name: "关闭"
},
tradeTypeList,
getListApi: trafficPage,
showFormData: [{
label: '商户名称',
name: 'merchantName',
type: 'input',
maxlength: 50,
isClear: true
},
{
type: 'datePicker',
dateType: 'monthrange',
label: '月份',
name: 'monthrange',
width: '260px'
}
],
searchForm: {
merchantName: '',
monthrange: '',
managerType: 1
},
tempGoodsType: [],
baseData: {
productTypeList: [],
productList: []
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
// {
// label: '序号',
// prop: 'ownSerialNum',
// type: 'ownSerialNum',
// width: '60'
// },
{
label: '日期',
prop: 'month',
// width: 110,
// formatter: (cellValue) => {
// return cellValue.upgradeGoodsName || '-'
// }
}, {
label: '摘要',
prop: 'summary',
}, {
label: '门店',
prop: 'merchantName',
width: 140,
// formatter: (cellValue) => {
// return cellValue?.tradeTime ? dayjs(cellValue.tradeTime).format('YYYY-MM-DD HH:mm:ss') : '-'
// }
}, {
label: '收款金额',
prop: 'receiveAmount',
// width: 140,
// formatter: (cellValue) => {
// return cellValue?.thirdPartyCode || '-'
// }
},
{
label: '流量费',
prop: 'trafficFee',
// width: 140,
// formatter: (cellValue) => {
// return cellValue?.thirdPartyCode || '-'
// }
},
{
label: '我司收益',
prop: 'ourRevenue',
// width: 140,
// formatter: (cellValue) => {
// return cellValue?.thirdPartyCode || '-'
// }
},
{
label: '可抵收益月份',
prop: 'deductibleMonth'
},
{
label: '备注',
prop: 'remark'
},
{
label: '操作人',
prop: 'createdBy',
width: 100
}, {
label: '操作日期',
prop: 'createdDate',
width: 170,
formatter: (cellValue) => {
return cellValue?.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}]
}
}
},
computed: {
visibility: {
get() {
return this.trafficFeeDialogVisible
},
set(value) {
this.$emit('update:trafficFeeDialogVisible', value)
}
},
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
handleExport() {
const params = {
method: "dj.api.smartcarlife.advancePayment.trafficPage.export.async",
...this.getParams()
}
Object.keys(params).forEach((key) => {
if (params[key] == null || params[key] == "") {
delete params[key]
}
})
const list = [
...this.dowloadList,
{
name: "流量费/我司收益管理记录列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
handleAddReceipt() {
this.addVisible = true
},
addDialogClose() {
this.addVisible = false
},
addDialogSuccess() {
// this.addVisible = false
// 重新查询
this.$refs.groundingIndexTable.refreshTable(false, true)
},
// resetSearchForm() {
// this.searchForm = this.$options.data.call(this).searchForm
// this.$refs.showSearch.resetForm()
// },
setTableFinishFun(data) {
this.tableData = data
},
beforeSearchFn() {
return new Promise(resolve => {
this.getParams()
resolve()
})
},
getParams() {
if (this.searchForm.monthrange?.length > 0) {
const [start, end] = this.searchForm.monthrange
this.searchForm.startMonth = dayjs(start).format('YYYY-MM')
this.searchForm.endMonth = dayjs(end).format('YYYY-MM')
}
return {
...this.searchForm
}
},
handleSelectGoodsConfirm() {
// const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
// if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData)
},
handleSelectGoodsClose() {
this.$emit('handleSelectGoodsClose')
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
// 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true)
}
}
}
</script>
<style lang="scss" scoped>
.selectGoods {
::v-deep .el-dialog__body {
// padding: 0;
border-bottom: 1px solid #e4e7ed;
}
}
// .show-search {
// // height: 32px;
// }
.up-btns {
padding-top: 0;
}
.flex {
display: flex;
align-items: center;
}
.btns {
padding-right: 20px;
margin-left: auto;
gap: 10px;
}
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
.table {
border-bottom: 1px solid #e4e7ed;
}
</style>
<!-- 门店预付款明细 -->
<template>
<d2-container class="container">
<div class="d2-container-content">
<d2-table-header>
<template #left>
<div class="account-info flex">
门店名称:
<div class="price">{{ routerInfo.merchantName }}</div>
</div>
</template>
<div class="btns flex">
<span data-event-code="prepaymentManage_detail_export">
<auth-button category="Button" :show-btn-ids="['9051604']" />
</span>
</div>
</d2-table-header>
<d2-table ref="usedCarFundWarningManageTable" :search-form="searchFormSearch" :table-params="tableParams"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<div slot="postScriptHtml" slot-scope="scope">
<span>
<el-tooltip class="item" effect="dark" :content="scope.scope.remark" placement="right">
<span>
{{ scope.scope.remark ? (scope.scope.remark.length > 15 ? (scope.scope.remark.slice(0, 15) + '...') :
scope.scope.remark) : '' }}
</span>
</el-tooltip>
</span>
</div>
</d2-table>
</div>
</d2-container>
</template>
<script>
import { deepClone } from "@/common/util"
import { advancePaymentShopDetailPage } from "@api/prepaymentManage"
import { mapActions, mapState } from "vuex"
import dayjs from "dayjs"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
export default {
name: "usedCarPaymentManage",
mixins: [reportTrackPageMixin],
components: {
},
data() {
return {
getListApi: advancePaymentShopDetailPage,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
// mutiSelectUniqueKey: "id",
// mutiSelectName: "contentIndex",
tableOption: false,
tableColumns: [
{
label: "业务日期",
prop: "monthName",
minWidth: 160
},
{
label: "摘要",
prop: "summary",
minWidth: 130
},
{
label: "广联付款",
prop: "payAmount",
minWidth: 110
},
{
label: "广联收款",
prop: "receiveAmount",
minWidth: 110,
},
{
label: "应抵流量费",
prop: "trafficFee",
minWidth: 110,
},
{
label: "我司收益",
prop: "ourRevenue",
minWidth: 110,
},
{
label: "可抵扣我司收益",
prop: "deductibleOurRevenue",
minWidth: 110,
},
{
label: "应抵流量预付余额",
prop: "trafficFeeBalance",
minWidth: 90,
},
{
label: "可抵收益预付余额",
prop: "deductibleRevenueBalance",
minWidth: 90,
},
{
label: "备注",
prop: "remark",
minWidth: 120,
addHtml: 'postScriptHtml'
}
]
},
track_event_code: "prepaymentManage_detail",
detailInfo: {}
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
}),
routerInfo() {
return this.$route.query
}
},
provide() {
return {
userInfo: this.$store.state.d2admin.user.info
}
},
mounted() {
// this.getAccountBalance()
// this.onPageShow()
this.searchFormSearch = {
...this.routerInfo
}
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close"
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
beforeSearchFn() {
return new Promise((resolve) => {
// this.searchFormSearch = this.getParams()
resolve()
})
},
getParams() {
// let params = deepClone(this.searchForm)
// if (params.operationTime) {
// let [srart, end] = params.operationTime
// params.operationStartTime = dayjs(srart).format("YYYY-MM-DD HH:mm:ss")
// params.operationEndTime = dayjs(end).format("YYYY-MM-DD HH:mm:ss")
// }
// if (params.amtList.length) {
// params.minUsageLimit = params.amtList[0]
// params.maxUsageLimit = params.amtList[1]
// }
// delete params.amtList
// delete params.operationTime
// console.log(JSON.parse(JSON.stringify(params)))
// return params
},
handleAddUsedQuota() {
this.authPhoneDialogVisible = true
},
handleDetail(row) {
this.detailVisible = true
this.detailInfo = row
},
handleExport() {
let params = {
method: "dj.smartcarlife.api.fund.usage.limit.export.async",
...this.getParams()
}
Object.keys(params).forEach((key) => {
if (params[key] == null || params[key] == "") {
delete params[key]
}
})
const list = [
...this.dowloadList,
{
name: "预付款管理记录列表详情",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
// async getAccountBalance() {
// const data = await getAccountBalance()
// data.queryTime = dayjs(data.updatedDate).format("YYYY-MM-DD HH:mm:ss")
// this.accountInfo = data
// },
addZero(num) {
let numStr = parseFloat(num).toFixed(2)
return numStr
},
}
}
</script>
<style scoped lang="scss">
.flex {
display: flex;
align-items: center;
}
.btns {
margin-left: auto;
gap: 10px;
}
.account-info {
font-size: 14px;
color: #666666;
.price {
color: #333333;
}
}
</style>
...@@ -160,10 +160,10 @@ export default { ...@@ -160,10 +160,10 @@ export default {
notUpgradeRejectionReason: [{ required: true, message: "请输入战败订单拒升理由", trigger: "change" }], notUpgradeRejectionReason: [{ required: true, message: "请输入战败订单拒升理由", trigger: "change" }],
}, },
formList: [ formList: [
// { {
// name: "选择车型:", name: "选择车型:",
// prop: "carBrand" prop: "carBrand"
// }, },
{ {
name: "车架号(VIN)码:", name: "车架号(VIN)码:",
prop: "carNo" prop: "carNo"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!