Commit 78e4da56 by 前端

Merge branch 'SAAS+V5.8.2-cwq' into 'SAAS+V5.8.2'

Saas+v5.8.2 cwq合并代码

See merge request !670
2 parents ddf4caef 428fc254
Showing 42 changed files with 2067 additions and 60 deletions
......@@ -7,6 +7,8 @@ node_modules
.cursorrules
.cursor
.trae
.claude
.github
.vscode/changelists.json
# 本地环境文件不上传
.env.local
......
# 项目协作规则
## 沟通方式
- 向用户汇报成果时,用简洁明了的中文说明做了什么、发生了什么。
- 避免使用术语、技术实现细节和代码行话;按“向不懂代码的聪明人解释”的方式表达。
- 汇报前尽量先检查工作,能运行或测试的先运行或测试。
## 表单规则
- 后台页面新增或重写业务表单时,优先使用 `glsx-combi-form` 组件。
- 弹窗表单也按 `glsx-combi-form` 的配置化写法组织字段、校验和自定义插槽。
- 只有在 `glsx-combi-form` 无法满足交互时,才单独使用原生 `el-form`,并说明原因。
......@@ -29,6 +29,7 @@ export default antfu({
"array-bracket-spacing": ["error", "always"],
},
rules: {
"vue/no-deprecated-slot-attribute": "off",
"vue/no-deprecated-v-on-native-modifier": "off",
"vue/no-deprecated-destroyed-lifecycle": "off",
"vue/no-deprecated-model-definition": "off",
......
import request from "./request"
import request from "./request";
const path = "dj.api.smartcarlife."
const path = "dj.api.smartcarlife.";
// 分页查询预付款管理记录
export function advancePaymentPage(data) {
data.method = `${path}advancePayment.page`
return request(data)
data.method = `${path}advancePayment.page`;
return request(data);
}
// 分页查询门店预付款明细记录
export function advancePaymentShopDetailPage(data) {
data.method = `${path}advancePayment.shopDetailPage`
return request(data)
data.method = `${path}advancePayment.shopDetailPage`;
return request(data);
}
// 分页查询收付款管理记录
// export function advancePaymentTradePage(data) {
......@@ -21,25 +21,25 @@ export function advancePaymentShopDetailPage(data) {
// 分页查询预付款管理商户信息
export function advancePaymentMerchantPage(data) {
data.method = "dj.api.smartcarlife.advancePayment.merchantPage"
return request(data, "post")
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)
data.method = "dj.api.smartcarlife.advancePayment.getMerchantMonthPayInfo";
return request(data);
}
// 分页查询商户月份付款信息
export function getMerchantPage(data) {
data.method = "dj.api.smartcarlife.advancePayment.merchantPage"
return request(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")
data.method = "dj.api.smartcarlife.advancePayment.page.export.async";
return request(data, "post");
}
// /router/dj.api.smartcarlife.advancePayment.page.export.async/1.0.0
// 导出预付款管理记录列表(异步)
......@@ -49,8 +49,8 @@ export function advancePaymentPageExportAsync(data) {
// 新增收付款管理记录
export function advancePaymentTradeAdd(data) {
data.method = "dj.api.smartcarlife.advancePayment.trade.add"
return request(data, "post")
data.method = "dj.api.smartcarlife.advancePayment.trade.add";
return request(data, "post");
}
// /router/dj.api.smartcarlife.advancePayment.tradePage.export.async/1.0.0
......@@ -58,8 +58,8 @@ export function advancePaymentTradeAdd(data) {
// 分页查询收付款管理记录
export function advancePaymentTradePage(data) {
data.method = "dj.api.smartcarlife.advancePayment.tradePage"
return request(data, "post")
data.method = "dj.api.smartcarlife.advancePayment.tradePage";
return request(data, "post");
}
// /router/dj.api.smartcarlife.advancePayment.tradePage.export.async/1.0.0
// 导出收付款管理列表(异步)
......@@ -67,15 +67,15 @@ export function advancePaymentTradePage(data) {
// /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")
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")
data.method = "dj.api.smartcarlife.advancePayment.trafficPage";
return request(data, "post");
}
// /router/dj.api.smartcarlife.advancePayment.trafficPage.export.async/1.0.0
......@@ -83,15 +83,38 @@ export function trafficPage(data) {
// 分页查询银盛线上对账单管理记录
export function onlinestatementAccountPage(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.page"
return request(data, "post")
data.method = "dj.api.smartcarlife.onlineStatementAccount.page";
return request(data, "post");
}
/**
* 查询银盛线上对账单管理统计信息
*/
export function onlineStatementAccountCountTotal(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.countTotal"
return request(data, "post")
}
\ No newline at end of file
data.method = "dj.api.smartcarlife.onlineStatementAccount.countTotal";
return request(data, "post");
}
/**
* 分页查询银盛线上对账单分账-明细记录
*/
export function onlineDivisionDetailPage(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.divisionDetailPage";
return request(data, "post");
}
/**
* 分页查询银盛线上对账单明细-收款记录
*/
export function onlinePaymentDetailPage(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.paymentDetailPage";
return request(data, "post");
}
/**
* 分页查询银盛线上对账单汇总-收款记录
*/
export function onlinePaymentMonthTotalPage(data) {
data.method = "dj.api.smartcarlife.onlineStatementAccount.paymentMonthTotalPage";
return request(data, "post");
}
<!-- 通用表单弹窗组件 -->
<template>
<div class="glsk-form-dialog">
<d2-dialog :append-to-body="appendToBody"
:btn-ok-label="dialogConfig.okText"
:noCancel="dialogConfig.hideClose"
:is-visible="selectVisible"
:title="dialogConfig.title"
:width="dialogWidth"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<glsx-combi-form ref="editFormRef"
class="edit-form-container"
:default-width="defaultWidth"
:form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth"
:nested-modal-append-to-body="nestedModalAppendToBody"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
<template v-for="name in slotArr" #[name]>
<slot :name="name"></slot>
</template>
</glsx-combi-form>
</d2-dialog>
</div>
<div class="glsk-form-dialog">
<d2-dialog :append-to-body="appendToBody"
:btn-ok-label="dialogConfig.okText"
:is-visible="selectVisible"
:no-cancel="dialogConfig.hideClose"
:title="dialogConfig.title"
:width="dialogWidth"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<glsx-combi-form ref="editFormRef"
class="edit-form-container"
:default-width="defaultWidth"
:form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules"
:form-select-obj="formSelectObj"
:is-block="isBlock"
:label-width="labelWidth"
:nested-modal-append-to-body="nestedModalAppendToBody"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
<template v-for="name in slotArr" #[name]>
<slot :name="name"></slot>
</template>
</glsx-combi-form>
</d2-dialog>
</div>
</template>
<script>
......@@ -91,6 +92,11 @@ export default {
type: Boolean,
default: false,
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
formSelectObj: {
type: Object,
default: () => {},
},
},
data() {
return {
......
......@@ -314,7 +314,7 @@ export const routerName = {
path: "/theAssetData",
name: "theAssetData",
meta: {
title: "财资数据",
title: "财资数据(广联)",
authId: "90509",
parentId: "905",
cache: false,
......@@ -537,6 +537,20 @@ export const routerName = {
label: "服务商对账单",
handle: "handleCreateServiceBill",
},
{
authId: "9051115",
parentId: "90511",
label: "导入对账单",
category: "Button",
type: "primary",
handle: "handleImportBill",
},
{
authId: "9051116",
parentId: "90511",
label: "市场费转账",
handle: "handleMarketTransfer",
},
],
component: _import("financeManage/accountStateManage/index"),
},
......@@ -854,9 +868,41 @@ export const routerName = {
type: "primary",
handle: "handleExport",
},
{
authId: "9051702",
parentId: "90517",
label: "对账单明细导出",
category: "Button",
type: "primary",
handle: "handleExportDetail",
},
{
authId: "9051703",
parentId: "90517",
label: "明细",
handle: "handleOnlineDetail",
addRoutePath: [
{
authId: "905170301",
name: "银盛线上对账单详情",
parentId: "90517",
},
],
},
],
component: _import("financeManage/ysprepaymentManage/index"),
},
905170301: {
path: "/ysprepaymentDetail/detail",
name: "ysprepaymentDetail",
meta: {
title: "银盛线上对账单详情",
authId: "905170301",
parentId: "90517",
cache: false,
},
component: _import("financeManage/ysprepaymentManage/onlineDetail"),
},
90518: {
path: "/exceptionOrderManage",
name: "exceptionOrderManage",
......@@ -918,4 +964,53 @@ export const routerName = {
},
component: _import("financeManage/exceptionOrderManage/detail"),
},
90519: {
path: "/YJTheAssetData",
name: "YJTheAssetData",
meta: {
title: "财资数据(优加)",
authId: "90519",
parentId: "905",
cache: false,
},
auth: [
{
authId: "9051901",
parentId: "90519",
label: "重取明细",
category: "Button",
type: "primary",
handle: "handleRefetchDetail",
},
{
authId: "9051902",
parentId: "90519",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
{
authId: "9051903",
parentId: "90519",
label: "详情",
handle: "handleDetail",
},
{
authId: "9051904",
parentId: "90519",
label: "回单",
handle: "handleReceipt",
},
{
authId: "9051905",
parentId: "90519",
label: "批量打印",
category: "Button",
type: "primary",
handle: "handleBatchPrint",
},
],
component: _import("financeManage/YJTheAssetData/index"),
},
};
<!-- 导入明细&回单 第三步 -->
<template>
<d2-container>
<div class="infoDiv">
<div class="imgCon">
<img src="../image/threeStep.png"
class="imgSize">
</div>
<div class="describe">
<div class="describe-title">
<div><img src="../image/info-circle-fill.png"></div>
<div class="describe-title-text">操作成功</div>
<div class="describe-title-tips">请关注企微机器人通知</div>
</div>
<div class="describe-text">
流水明细状态:{{ resultInfo.detailSuccessCount ? resultInfo.detailSuccessCount : '-' }}条</div>
<div class="describe-text">
导入回单:{{ resultInfo.receiptSuccessCount ? resultInfo.receiptSuccessCount : '-' }}条</div>
</div>
<div class="footer">
<el-button @click="submitForm"
type="primary"
:loading="$store.state.d2admin.loading.value">再导一次</el-button>
<el-button @click="routerBack">返回</el-button>
</div>
</div>
</d2-container>
</template>
<script>
import { mapActions, mapState } from 'vuex'
export default {
name: 'ImportThree',
props: {
resultInfo: {
type: Object,
default: () => { }
}
},
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info
}
},
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() {
},
routerBack() {
this.$emit('goBackListPage')
},
submitForm() {
this.$emit('importAgain')
}
}
}
</script>
<style scoped>
.infoDiv {
width: 100%;
/* height: 100%; */
background-color: #fff;
}
.imgCon {
text-align: center;
/* margin-bottom: 50px; */
}
.imgSize {
width: 1200px;
}
.describe {
border-radius: 4px;
opacity: 1;
background: #fafafa;
width: 98%;
height: 110px;
/* margin: 0 auto 20px; */
.describe-title {
display: flex;
justify-content: center; /* 水平居中 */
padding: 17px 0 0 9px;
.describe-title-text {
font-size: 16px;
font-weight: 600;
padding-left: 10px;
}
.describe-title-tips {
font-size: 14px;
color: #999999;
padding-left: 8px;
}
}
.describe-text {
font-size: 14px;
color: #333333;
text-align: center;
padding-top: 5px;
}
}
.footer {
text-align: center;
padding: 20px 0 20px 0;
}
</style>
<template>
<div class="range">
<div :class="[
' el-date-editor',
'el-range-editor',
'el-input__inner',
'el-date-editor--daterange',
'el-range-editor--small',
pickerVisible ? 'is-active' : ''
]"
@click="handleRangeClick"
@mouseleave="showClose = false"
@mousemove="handleMove"
ref="reference">
<template v-if="infinity">
<el-input-number class="el-range-input hide-btn"
:placeholder="startPlaceholder"
v-model="userInput[0]"
@blur="handleBlur(0)"></el-input-number>
<span class="el-range-separator">至</span>
<el-input-number class="el-range-input hide-btn"
:placeholder="endPlaceholder"
v-model="userInput[1]"
@blur="handleBlur(1)"></el-input-number>
</template>
<template v-else>
<el-input v-model="userInput[0]"
:placeholder="startPlaceholder"
@blur="handleBlur(0)"
@input="handleStartInput"
class="el-range-input"></el-input>
<span class="el-range-separator">至</span>
<el-input v-model="userInput[1]"
:placeholder="endPlaceholder"
@input="handleEndInput"
@focus="handleFocus"
@blur="handleBlur(1)"
class="el-range-input"></el-input>
</template>
<i v-show="showClose"
@click="handleClickIcon"
class="el-icon-circle-close"></i>
</div>
<div class="errorTips"
v-if="tipsShow">最大金额需大于最小金额</div>
</div>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
data() {
return {
pickerVisible: false,
showClose: false,
userInput: this.displayValue,
oldVal: {
startInput: '',
endInput: ''
},
tipsShow: false
}
},
props: {
displayValue: Array,
placeholder: String,
startPlaceholder: String,
endPlaceholder: String,
infinity: Boolean
},
watch: {
displayValue(val) {
if (val) {
this.userInput = val
if (val.length == 0) {
this.tipsShow = false
}
}
}
},
methods: {
handleStartInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[0] = event
this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2)
this.oldVal.startInput = this.userInput[0]
},
handleEndInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[1] = event
this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2)
this.oldVal.endInput = this.userInput[1]
},
handleClickIcon(event) {
this.userInput[0] = null
this.userInput[1] = null
this.tipsShow = false
},
valueIsEmpty() {
const val = this.userInput
if (Array.isArray(val)) {
for (let i = 0, len = val.length; i < len; i++) {
if (val[i]) {
return false
}
}
}
return true
},
handleRangeClick() {
this.pickerVisible = true
},
handleMove() {
if (this.valueIsEmpty()) {
this.showClose = false
} else {
this.showClose = true
}
},
handleFocus() {
if (!this.pickerVisible) {
this.pickerVisible = true
this.$emit("focus", this)
}
},
handleBlur(index) {
this.pickerVisible = false
this.contrastValue()
},
contrastValue() {
const val = this.userInput
if (Array.isArray(val)) {
if (+val[0] > +val[1]) {
val[1] = null
this.tipsShow = true
} else {
this.tipsShow = false
}
}
}
}
}
</script>
<style scoped lang="scss">
.range {
.el-range-input {
::v-deep {
input {
border: 0;
margin-top: -2px;
height: 28px;
}
}
}
.el-icon-circle-close {
color: #dcdfe6;
margin-left: 10px;
}
.hide-btn {
::v-deep {
span {
display: none;
}
input {
padding: 0;
}
}
}
.errorTips {
color: red;
// text-align: center;
font-size: 12px;
}
}
</style>
<!-- 重取明细 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="dialogShow"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="tipFont">重新获取银行明细与回单,需等待15分钟,且接口限制单次获取上限1000条,请谨慎选择筛选条件!</div>
<div class="add-dialog">
<glsx-combi-form class="edit-form-container"
ref="editFormRef"
label-width="150px"
default-width="400px"
:form-ref="handleFormRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules">
<div slot="accHtml">
<el-select v-model="infoForm.accNameList"
clearable
:style="{ width: '400px'}"
placeholder="请选择单位名称"
multiple
collapse-tags>
<span class="select-all">
<el-checkbox v-model="allSelected"
@change="toggleAll">全选</el-checkbox>
</span>
<el-option v-for="item in baseData.accNameList"
:key="item.confId"
:label="item.confValue"
:value="item.confId"></el-option>
</el-select>
</div>
</glsx-combi-form>
</div>
<!-- <span class="dialog-footer">
<el-button size="small"
@click="dialogShow = false">取 消</el-button>
<el-button size="small"
type="primary"
@click="handleSelect">确 定</el-button>
</span> -->
</baseDialog>
</template>
<script>
import { nbcbAccDetailConfig, nbcbAccDetailRefetch } from '@api/theAssetData'
import { Util, deepClone } from '@/common/util'
export default {
name: 'RefetchDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
accNameList: [],
bankType: '',
bankAcc: '',
transactionTime: ''
},
dialogConfig: {
title: '重取明细',
width: '720px'
// isShowFooter: false
},
config: {
// isShowFooter: false
},
handleFormRef: 'handleFormRef',
formRules: {
transactionTime: [{ required: true, message: '请选择交易时间', trigger: 'change' }]
},
editFormData: [
{
label: '单位名称',
addHtml: 'accHtml'
},
// {
// label: '单位名称',
// name: 'accNameList',
// type: 'select',
// isClear: true,
// multiple: true,
// collapseTags: true,
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'accNameList'
// },
{
label: '银行类别',
name: 'bankType',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'bankTypeList'
}, {
label: '本方账号',
name: 'bankAcc',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'bankAccList'
}, {
label: '交易时间',
name: 'transactionTime',
type: 'datePicker',
isClear: true,
// pickerOptions: 'beforeRangePickerOptions'
pickerOptions: "rangePickerOptions_30day2"
}],
baseData: {
accNameList: [],
bankTypeList: [],
bankAccList: []
},
allSelected: false
}
},
props: {
visible: {
type: Boolean,
default: false
}
// paramsObj: {
// type: Object,
// default: {}
// }
},
watch: {
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'visible' })
}
}
},
mounted() {
this.nbcbAccDetailConfig()
// this.getOptionsList()
},
methods: {
getOptionsList() {
this.editFormData.forEach((item, index) => {
if (item.type === 'select') {
// if (
// this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部' && item.label != '单位名称'
// ) {
// const temp = {}
// temp[this.showFormData[index].optionId] = ''
// temp[this.showFormData[index].optionLabel] = '全部'
// this.baseData[item.optionsName].unshift(temp)
// }
this.$set(
this.editFormData[index],
'optionList',
this.baseData[item.optionsName]
)
}
})
},
// 财资数据筛选项列表
nbcbAccDetailConfig() {
const params = {
// 主体类型:1-广联 2-优加
custType: 2
}
nbcbAccDetailConfig(params).then(res => {
for (var key in res) {
if (this.baseData[key]) {
this.baseData[key] = res[key]
this.baseData[key] = this.baseData[key].map(item => {
return {
confId: item,
confValue: item
}
})
}
}
this.getOptionsList()
})
},
// 实现全选功能的方法
toggleAll() {
console.log('this.allSelected', this.allSelected)
if (this.allSelected) {
this.infoForm.accNameList = this.baseData.accNameList.map(option => option.confId)
} else {
this.infoForm.accNameList = []
}
// 更新allSelected状态,确保下一次操作时状态正确
// this.allSelected = !this.allSelected
},
handleAddConfirm() {
this.$refs.editFormRef.$refs[this.handleFormRef].validate(valid => {
if (valid) {
var params = deepClone(this.infoForm)
// 主体类型:1-广联 2-优加
params.custType = 2
if (params.accNameList.length == 0 && params.bankType == '' && params.bankAcc == '') {
// this.notice.warningTips('请选择除日期外的任意一个或多个条件!')
this.$message({
message: "请选择除日期外的任意一个或多个条件!",
type: "warning",
showClose: true
})
return
}
if (params.transactionTime) {
params.transTimeStart = Util.dateFormate(params.transactionTime[0], 'YYYY-MM-DD')
params.transTimeEnd = Util.dateFormate(params.transactionTime[1], 'YYYY-MM-DD')
} else {
delete params.transTimeStart
delete params.transTimeEnd
}
this.$confirm('请确认是否要执行当前操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
nbcbAccDetailRefetch(params).then(res => {
this.notice.okTips()
this.dialogShow = true
})
}).catch(err => {
console.log(err)
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.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;
}
.upload-file {
::v-deep .el-upload-dragger {
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
width: 300px;
height: 160px;
background: #f7f7f7;
.el-icon-upload {
margin: 0;
}
.el-upload__text {
font-size: 14px;
color: #000000;
}
.item-tips {
font-size: 12px;
color: #999999;
height: 22px;
line-height: 22px;
}
.text-tips {
font-size: 14px;
}
}
}
.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;
}
}
}
}
.tipFont {
margin: 10px 0 0 60px;
width: 535px;
height: 22px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #eb4e4e;
}
.select-all {
margin: 0 0 20px 20px;
}
</style>
<!-- 导入明细&回单主页面 -->
<template>
<div class="importDetail">
<div class="header"
slot="header">
<div>
<import-one ref="importOne"
v-if="activeName === 'one'"
@oneStepComplete="oneStepComplete" />
<import-two v-if="activeName === 'two'"
:task-info="taskInfo"
@twoStepComplete="twoStepComplete"
@goBackOneStep="goBackOneStep" />
<import-three v-if="activeName === 'three'"
:result-info="resultInfo"
@importAgain="importAgain"
@goBackListPage="goBackListPage" />
</div>
</div>
</div>
</template>
<script>
import importOne from './components/importOne'
import importTwo from './components/importTwo'
import importThree from './components/importThree'
import { mapActions } from 'vuex'
export default {
name: 'StaffIndex',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: 'one',
taskInfo: null,
resultInfo: null
}
},
components: {
importOne,
importTwo,
importThree
},
mounted() {
if (this.$route.query.step) {
console.log('step', this.$route.query.step)
this.activeName = this.$route.query.step
this.taskInfo = this.$route.query.taskInfo
}
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
oneStepComplete(data) {
console.log('data', data)
this.activeName = 'two'
},
goBackOneStep() {
this.activeName = 'one'
},
twoStepComplete(data) {
this.resultInfo = data
this.activeName = 'three'
},
importAgain() {
this.activeName = 'one'
},
goBackListPage() {
this.close({ tagName: "/importDetailControl" })
this.$router.push({
name: "theAssetData"
})
}
}
}
</script>
<style lang="scss" scoped>
.importDetail {
padding: 0 20px;
.header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
export const IMPORT_BILL_FILE_RULE = {
extensions: [".xls", ".xlsx"],
maxSizeMb: 10,
maxCount: 1,
accept: ".xls,.xlsx",
};
export const IMPORT_BILL_TYPE_OPTIONS = [
{ value: "1", label: "流量方对账单" },
{ value: "2", label: "服务商对账单" },
];
// 导入弹窗统一使用 glsx-combi-form,这里集中维护表单结构,避免组件里散落配置。
export function buildImportBillFormData() {
return [
{
label: "对账单类型",
name: "billType",
type: "select",
optionList: IMPORT_BILL_TYPE_OPTIONS,
optionId: "value",
optionLabel: "label",
isClear: true,
},
{
label: "对账单文件",
name: "fileName",
addHtml: "fileHtml",
},
];
}
// 后端要求 file 字段为“文件后缀@base64内容”,不要把完整 dataURL 传过去。
export function buildImportBillPayload({ billType, fileName, base64 }) {
const extension = fileName.split(".").pop();
return {
billType,
file: `${extension}@${base64}`,
};
}
export function buildImportTemplateDownloadTask(billType) {
const params = {
billType,
method: "dj.api.smartcarlife.reconciliationBill.merchant.template.export.async",
};
return {
name: "对账单导入模板",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime(),
};
}
// 轮询接口返回 100% 后才算结束,再根据失败数量判断成功或失败。
export function getImportPollStatus(result = {}) {
if (result.progress === 100 && Number(result.failNum) === 0) {
return "success";
}
if (result.progress === 100 && Number(result.failNum) > 0) {
return "failed";
}
return "processing";
}
export function getImportUuid(result) {
if (typeof result === "string") {
return result;
}
return result?.uuid || result?.data?.uuid || result?.data || "";
}
export function normalizeImportPollResult(result) {
return Array.isArray(result) ? result[0] || {} : result || {};
}
export const EXPENSE_CATEGORY_OPTIONS = [
{ id: 706, label: "管理层市场费1", amountLabel: "管理层市场费1金额" },
{ id: 808, label: "管理层市场费2", amountLabel: "管理层市场费2金额" },
{ id: 809, label: "阳光激励费", amountLabel: "阳光激励费金额" },
{ id: 901, label: "阳光激励费2", amountLabel: "阳光激励费2金额" },
{ id: 900, label: "资源费", amountLabel: "资源费金额" },
];
export const MARKET_TRANSFER_UPLOAD_RULE = {
extensions: [".xls", ".xlsx", ".doc", ".docx", ".pdf", ".jpg", ".jpeg", ".png", ".bmp"],
maxSizeMb: 10,
maxCount: 4,
accept: ".xls,.xlsx,.doc,.docx,.pdf,.jpg,.jpeg,.png,.bmp",
};
export const FORM_COMPONENT_RULE = {
component: "glsx-combi-form",
requiredFor: ["finance dialog forms", "new business forms"],
};
export function buildMarketTransferFormData() {
return [
{
label: "所属平台方",
name: "platformMerchantName",
type: "showTxt",
},
{
label: "所属服务商",
name: "billMerchantName",
type: "showTxt",
},
{
label: "费用类型",
name: "expenseCategoryIds",
addHtml: "expenseCategoryHtml",
},
{
label: "",
name: "downloadDetail",
addHtml: "downloadDetailHtml",
},
{
label: "收款账户",
name: "rcvMerchantId",
type: "select",
attrs: {
popperClass: "market-transfer-account-popper",
},
isClear: true,
optionList: [],
optionId: "value",
optionLabel: "label",
optionsName: "bankAccountList",
},
{
label: "转账金额",
name: "transferTotalAmount",
type: "showTxt",
formatter: row => row.transferTotalAmount,
},
{
label: "发票及其他说明",
name: "invoiceRemark",
type: "input",
maxlength: 100,
},
{
label: "转账凭证",
name: "fileUrlList",
addHtml: "fileHtml",
},
{
label: "备注",
name: "remark",
type: "input",
maxlength: 50,
},
];
}
export function buildMarketTransferSubmitParams(form = {}, excludeExpenseCategoryIds = []) {
const params = { ...form };
const fileUrlList = Array.isArray(params.fileUrlList) ? params.fileUrlList : [];
const expenseCategoryIds = Array.isArray(params.expenseCategoryIds) ? params.expenseCategoryIds : [];
params.expenseCategoryIds = expenseCategoryIds.filter(id => !excludeExpenseCategoryIds.includes(id));
params.fileUrlList = fileUrlList
.map(item => item && item.fileUrl)
.filter(Boolean);
delete params.fileUrl;
return params;
}
export function normalizeApprovedMarketTransferFees(list = []) {
const amountMap = {};
const expenseCategoryIds = [];
(list || []).forEach((item) => {
const id = item && item.expenseCategoryId;
if (id === undefined || id === null)
return;
if (!expenseCategoryIds.includes(id))
expenseCategoryIds.push(id);
amountMap[id] = item.expenseCategoryResult;
});
return {
expenseCategoryIds,
amountMap,
totalAmount: Object.keys(amountMap).reduce((total, id) => total + (Number(amountMap[id]) || 0), 0),
};
}
export function getVisibleAmountFields(expenseCategoryIds = []) {
return EXPENSE_CATEGORY_OPTIONS.filter(item => expenseCategoryIds.includes(item.id));
}
export function mapMarketFeeResults(data = {}) {
const amountMap = {}
;(data.list || []).forEach((item) => {
amountMap[item.expenseCategoryId] = item.expenseCategoryResult;
});
return {
amountMap,
totalAmount: data.expenseCategoryTotalResult || 0,
};
}
<template>
<d2-dialog
title="对账单导入"
:is-visible="importBillVisible"
class="import-bill-dialog"
width="800px"
:btnOkLabel="importing ? '导入中' : '确定'"
@closeDialog="handleClose"
@confirmDialog="handleConfirm"
>
<glsx-combi-form
ref="importFormRef"
label-width="130px"
default-width="560px"
:isBlock="isBlock"
:form-ref="importChildRef"
:form-obj="form"
:form-data="formData"
:form-rules="formRules"
>
<template slot="fileHtml">
<div class="import-file-box">
<el-button size="small" type="primary" plain class="select-file-btn" :disabled="importing">
选择文件
<input
:key="fileInputKey"
ref="fileInput"
type="file"
class="file-input"
:accept="fileRule.accept"
@change="handleFileChange"
/>
</el-button>
<el-button type="text" class="template-btn" :disabled="importing" @click="handleDownloadTemplate">
下载模板
</el-button>
<div v-if="form.fileName" class="file-name-box">
<i class="el-icon-document"></i>
<span class="file-name">{{ form.fileName }}</span>
<i v-if="!importing" class="el-icon-close file-remove" @click="removeFile"></i>
</div>
<div class="file-tip">支持 xls、xlsx,文件不超过10M,最多上传1个。</div>
<div v-if="importing || progress > 0" class="progress-text">
导入进度:{{ progress }}%
</div>
<div v-if="failUrl" class="fail-file">
导入失败,
<el-button type="text" @click="handleDownloadFailFile">下载失败文件</el-button>
</div>
</div>
</template>
</glsx-combi-form>
</d2-dialog>
</template>
<script>
import { downLoadFile } from "@/common/util"
import { readFileAsDataURL } from "@/libs/file"
import { startPolling } from "@/libs/interval"
import { mapActions, mapState } from "vuex"
import { getImportExcelProcess, importReconciliationBill } from "@api/accountManage"
import {
IMPORT_BILL_FILE_RULE,
buildImportBillFormData,
buildImportBillPayload,
buildImportTemplateDownloadTask,
getImportPollStatus,
getImportUuid,
normalizeImportPollResult
} from "../accountStateManage/importBill"
export default {
name: "ImportBillDialog",
props: {
importBillVisible: {
type: Boolean,
default: false
}
},
data() {
return {
isBlock: true,
importChildRef: "importChildRef",
fileRule: IMPORT_BILL_FILE_RULE,
fileInputKey: Date.now(),
form: {
billType: "1",
fileName: "",
file: null
},
formData: buildImportBillFormData(),
formRules: {
billType: [{ required: true, message: "请选择对账单类型", trigger: "change" }],
fileName: [{ required: true, message: "请选择需要导入的对账单文件", trigger: "change" }]
},
importing: false,
polling: null,
progress: 0,
failUrl: ""
}
},
beforeDestroy() {
this.stopPolling()
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList
})
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
handleClose() {
if (this.importing) {
this.$message.warning("正在导入中,请稍后")
return
}
this.stopPolling()
this.$emit("dialogClose")
},
handleFileChange(event) {
const file = event.target.files && event.target.files[0]
this.resetFileInput()
if (!file || !this.validateFile(file)) {
return
}
this.failUrl = ""
this.progress = 0
this.form.file = file
this.form.fileName = file.name
this.validateField("fileName")
},
removeFile() {
this.form.file = null
this.form.fileName = ""
this.validateField("fileName")
},
validateFile(file) {
const fileName = file.name.toLowerCase()
const validType = this.fileRule.extensions.some(ext => fileName.endsWith(ext))
if (!validType) {
this.$message.error("仅支持上传 xls、xlsx 文件")
return false
}
if (file.size / 1024 / 1024 > this.fileRule.maxSizeMb) {
this.$message.error(`文件大小不能超过${this.fileRule.maxSizeMb}M`)
return false
}
return true
},
handleConfirm() {
if (this.importing) {
return
}
this.$refs.importFormRef.$refs[this.importChildRef].validate(async valid => {
if (!valid) {
return
}
await this.submitImport()
})
},
handleDownloadTemplate() {
if (!this.form.billType) {
this.$message.warning("请先选择对账单类型")
return
}
const list = [
...this.dowloadList,
buildImportTemplateDownloadTask(this.form.billType)
]
this.actionSetDownloadList({ list, type: "dowloadList" })
},
async submitImport() {
try {
this.importing = true
this.failUrl = ""
this.progress = 0
// 直接转 base64 后提交给导入接口。
const event = await readFileAsDataURL(this.form.file)
const base64 = event?.target?.result?.split(",")?.[1] || ""
const payload = buildImportBillPayload({
billType: this.form.billType,
fileName: this.form.fileName,
base64
})
const result = await importReconciliationBill(payload)
const uuid = getImportUuid(result)
if (!uuid) {
this.$message.error("导入任务创建失败")
this.importing = false
return
}
this.startImportPolling(uuid)
} catch (error) {
this.importing = false
}
},
startImportPolling(uuid) {
this.stopPolling()
const requestFn = () => getImportExcelProcess({ fileUuidList: [uuid] })
const stopCondition = result => {
// 查询结果可能是数组或对象,先统一格式再判断进度。
const pollResult = normalizeImportPollResult(result)
this.progress = pollResult.progress || 0
const status = getImportPollStatus(pollResult)
if (status === "success") {
this.importing = false
this.$message.success("导入成功")
this.$emit("handleConfirm")
return true
}
if (status === "failed") {
this.importing = false
this.failUrl = pollResult.url || ""
this.$message.error("导入失败,请查看失败文件")
return true
}
return false
}
this.polling = startPolling(requestFn, 1000, stopCondition)
},
stopPolling() {
if (this.polling) {
this.polling()
this.polling = null
}
},
resetFileInput() {
this.fileInputKey = Date.now()
},
validateField(field) {
this.$nextTick(() => {
this.$refs.importFormRef?.$refs?.[this.importChildRef]?.validateField(field)
})
},
handleDownloadFailFile() {
if (this.failUrl) {
downLoadFile(this.failUrl)
}
}
}
}
</script>
<style scoped>
.import-bill-dialog .import-file-box {
line-height: 1;
}
.select-file-btn {
position: relative;
overflow: hidden;
}
.template-btn {
margin-left: 10px;
padding: 0;
}
.file-input {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
.file-name-box {
display: inline-flex;
align-items: center;
max-width: 560px;
margin-left: 10px;
color: #606266;
vertical-align: middle;
}
.file-name {
max-width: 240px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0 6px;
}
.file-remove {
cursor: pointer;
}
.file-tip,
.progress-text,
.fail-file {
margin-top: 10px;
color: #909399;
line-height: 18px;
}
.fail-file {
color: #f56c6c;
}
</style>
......@@ -26,6 +26,10 @@ export const billStatusList = [
export const sceneTypeList = [
{
confId: "-1",
confLabel: "未定义"
},
{
confId: "0",
confLabel: "会员权益/升级"
},
......
......@@ -172,7 +172,11 @@ export default {
// 财资数据筛选项列表
nbcbAccDetailConfig() {
nbcbAccDetailConfig({}).then(res => {
const params = {
// 主体类型:1-广联 2-优加
custType: 1
}
nbcbAccDetailConfig(params).then(res => {
for (var key in res) {
if (this.baseData[key]) {
this.baseData[key] = res[key]
......@@ -204,6 +208,8 @@ export default {
this.$refs.editFormRef.$refs[this.handleFormRef].validate(valid => {
if (valid) {
var params = deepClone(this.infoForm)
// 主体类型:1-广联 2-优加
params.custType = 1
if (params.accNameList.length == 0 && params.bankType == '' && params.bankAcc == '') {
// this.notice.warningTips('请选择除日期外的任意一个或多个条件!')
this.$message({
......
......@@ -185,6 +185,8 @@ export default {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '100px',
searchForm: {
// 主体类型:1-广联 2-优加
custType: 1,
accNameList: [],
qualityTestScore: [],
bankType: '',
......@@ -642,6 +644,7 @@ export default {
},
handleReset() {
this.searchForm = {
custType: 1,
accNameList: [],
qualityTestScore: [],
bankType: '',
......@@ -757,7 +760,11 @@ export default {
// 财资数据筛选项列表
nbcbAccDetailConfig() {
nbcbAccDetailConfig({}).then(res => {
const params = {
// 主体类型:1-广联 2-优加
custType: 1
}
nbcbAccDetailConfig(params).then(res => {
for (var key in res) {
if (this.baseData[key]) {
this.baseData[key] = res[key]
......
import { formatThousand } from "@/common/format";
function getFirstValue(row, props) {
const propList = Array.isArray(props) ? props : [props];
for (const prop of propList) {
const value = row[prop];
if (value === 0 || value) {
return value;
}
}
return "";
}
const textFormatter = props => row => getFirstValue(row, props) || "-";
const amountFormatter = props => row => formatThousand(getFirstValue(row, props));
const tradeDetailFormatter = prop => row => row.tradeDetail?.[prop] || "-";
const tradeDetailAmountFormatter = prop => row => formatThousand(row.tradeDetail?.[prop]) || "-";
export const ONLINE_DETAIL_TAB = {
SUMMARY_COLLECTION: "summery-collection",
DETAIL_COLLECTION: "detail-collection",
DETAIL_ALLOCATION: "detail-allocation",
};
export const ONLINE_DETAIL_TABLE_COLUMNS = {
// 汇总-收款
[ONLINE_DETAIL_TAB.SUMMARY_COLLECTION]: [
{
label: "收款月份",
prop: "tradeMonth",
minWidth: 60,
},
{
label: "园区店名",
prop: "yqMerchantName",
},
{
label: "门店名称",
prop: "merchantName",
},
{
label: "收入所属公司",
prop: "realityPlatformMerchantName",
},
{
label: "业务",
prop: "businessType",
},
{
label: "收款金额",
prop: "tradeAmount",
minWidth: 90,
formatter: amountFormatter(["tradeAmount"]),
},
],
// 明细-收款
[ONLINE_DETAIL_TAB.DETAIL_COLLECTION]: [
{
label: "收款时间",
prop: "tradeTime",
minWidth: 160,
formatter: textFormatter(["tradeTime"]),
},
{
label: "园区店名",
prop: "yqMerchantName",
},
{
label: "门店名称",
prop: "merchantName",
},
{
label: "收入所属公司",
prop: "realityPlatformMerchantName",
},
{
label: "业务",
prop: "businessType",
},
{
label: "交易参考号",
prop: "tradeNo",
minWidth: 150,
},
{
label: "订单编码",
prop: "orderCode",
minWidth: 150,
},
{
label: "收款金额",
prop: "tradeAmount",
minWidth: 90,
formatter: amountFormatter(["tradeAmount"]),
},
{
label: "手续费是否分账",
prop: "divisionFlag",
minWidth: 120,
},
],
// 明细-分账
[ONLINE_DETAIL_TAB.DETAIL_ALLOCATION]: [
{
label: "分账日期",
prop: "divisionDate",
minWidth: 160,
formatter: tradeDetailFormatter("divisionDate"),
},
{
label: "收款日期",
prop: "tradeTime",
minWidth: 160,
formatter: tradeDetailFormatter("tradeTime"),
},
{
label: "分账月份",
prop: "divisionMonth",
minWidth: 120,
formatter: tradeDetailFormatter("divisionMonth"),
},
{
label: "收款月份",
prop: "tradeMonth",
minWidth: 120,
formatter: tradeDetailFormatter("tradeMonth"),
},
{
label: "到账月份",
prop: "estimatedArrivalTime",
minWidth: 120,
formatter: tradeDetailFormatter("estimatedArrivalTime"),
},
{
label: "园区店名",
prop: "yqMerchantName",
minWidth: 150,
formatter: tradeDetailFormatter("yqMerchantName"),
},
{
label: "门店名称",
prop: "merchantName",
minWidth: 150,
formatter: tradeDetailFormatter("merchantName"),
},
{
label: "收入所属公司",
minWidth: 150,
prop: "realityPlatformMerchantName",
formatter: tradeDetailFormatter("realityPlatformMerchantName"),
},
{
label: "分账对象",
prop: "realityMerchantName",
minWidth: 140,
formatter: tradeDetailFormatter("realityMerchantName"),
},
{
label: "分账对象类型",
prop: "targetMerchantType",
minWidth: 120,
formatter: (row) => {
const typeObj = {
1: "平台方",
2: "服务商",
3: "门店",
};
return typeObj[row.tradeDetail?.targetMerchantType] || "-";
},
},
{
label: "业务",
prop: "businessType",
minWidth: 120,
formatter: tradeDetailFormatter("businessType"),
},
{
label: "交易参考号",
prop: "tradeNo",
minWidth: 150,
formatter: tradeDetailFormatter("tradeNo"),
},
{
label: "订单编码",
prop: "orderCode",
minWidth: 150,
formatter: tradeDetailFormatter("orderCode"),
},
{
label: "分账金额",
prop: "divisionMoney",
minWidth: 120,
formatter: amountFormatter("divisionMoney"),
},
{
label: "分账手续费",
prop: "serviceCharge",
minWidth: 120,
formatter: amountFormatter("serviceCharge"),
},
{
label: "分账类型",
prop: "divisionFlag",
minWidth: 120,
formatter: tradeDetailFormatter("divisionFlag"),
},
],
};
<!-- 门店预付款明细 -->
<template>
<d2-container class="container">
<div class="d2-container-content">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList"
:key="index"
:label="item.label"
:name="item.name">
</el-tab-pane>
</el-tabs>
<d2-table-header>
<div class="btns flex">
<el-button type="primary"
@click="handleExport">
导出
</el-button>
</div>
</d2-table-header>
<d2-table ref="usedCarFundWarningManageTable"
:key="tableKey"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
</d2-table>
</div>
<el-button class="go-back"
type="primary"
@click="goBack">
返回
</el-button>
</d2-container>
</template>
<script>
import { onlineDivisionDetailPage, onlinePaymentDetailPage, onlinePaymentMonthTotalPage } from "@api/prepaymentManage";
import { mapActions, mapState } from "vuex";
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin";
import { ONLINE_DETAIL_TAB, ONLINE_DETAIL_TABLE_COLUMNS } from "./onlineDetail.constant";
const ONLINE_DETAIL_API_MAP = {
[ONLINE_DETAIL_TAB.SUMMARY_COLLECTION]: onlinePaymentMonthTotalPage,
[ONLINE_DETAIL_TAB.DETAIL_COLLECTION]: onlinePaymentDetailPage,
[ONLINE_DETAIL_TAB.DETAIL_ALLOCATION]: onlineDivisionDetailPage,
};
export default {
name: "UsedCarPaymentManage",
components: {
},
mixins: [reportTrackPageMixin],
data() {
return {
// tab
activeName: ONLINE_DETAIL_TAB.SUMMARY_COLLECTION,
tabPaneList: [
{
label: "汇总-收款",
name: ONLINE_DETAIL_TAB.SUMMARY_COLLECTION,
},
{
label: "明细-收款",
name: ONLINE_DETAIL_TAB.DETAIL_COLLECTION,
},
{
label: "明细-分账",
name: ONLINE_DETAIL_TAB.DETAIL_ALLOCATION,
},
],
tableKey: ONLINE_DETAIL_TAB.SUMMARY_COLLECTION,
// 表格
getListApi: ONLINE_DETAIL_API_MAP[ONLINE_DETAIL_TAB.SUMMARY_COLLECTION],
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: ONLINE_DETAIL_TABLE_COLUMNS[ONLINE_DETAIL_TAB.SUMMARY_COLLECTION],
},
detailInfo: {},
};
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
}),
routerInfo() {
console.log(this.$route.params);
return this.$route.params;
},
},
mounted() {
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();
});
},
goBack() {
this.$router.push({
name: "ysprepaymentManage",
});
},
getParams() {
return this.searchFormSearch;
},
handleClick() {
this.getListApi = ONLINE_DETAIL_API_MAP[this.activeName];
this.tableParams = {
...this.tableParams,
tableColumns: ONLINE_DETAIL_TABLE_COLUMNS[this.activeName],
};
this.tableKey = this.activeName;
},
handleExport() {
let params = {
method: "dj.api.smartcarlife.onlineStatementAccount.detailpage.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" });
},
},
};
</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;
}
}
.go-back {
display: flex;
align-items: center;
margin: 10px auto;
}
</style>
......@@ -45,9 +45,11 @@ export default {
},
editForm: [{
title: '产品信息',
title: '产品信息',
formBlock: [{
name: 'goodsName',
label: '上架产品',
label: '上架产品',
type: 'incidBox',
key: 'goodsType',
detailInfo: [{
......
......@@ -3,7 +3,7 @@
background: #ffffff;
.title {
height: 50px;
height: 5051px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
......
......@@ -43,7 +43,8 @@
</d2-table>
</div>
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog>
<CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj" from-page="procurementBusiness"
<CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj"
from-page="procurementBusiness"
@dialogClose="dialogClose">
</CheckDialog>
<rejectDialog :reject-visible="rejectVisible" v-if="rejectVisible" :params-obj="paramsObj"
......
import {
IMPORT_BILL_FILE_RULE,
IMPORT_BILL_TYPE_OPTIONS,
buildImportBillFormData,
buildImportBillPayload,
buildImportTemplateDownloadTask,
getImportPollStatus
} from "@/views/financeManage/accountStateManage/importBill"
describe("importBill helpers", () => {
it("limits import file to one Excel file no larger than 10M", () => {
expect(IMPORT_BILL_FILE_RULE.extensions).toEqual([".xls", ".xlsx"])
expect(IMPORT_BILL_FILE_RULE.accept).toBe(".xls,.xlsx")
expect(IMPORT_BILL_FILE_RULE.maxSizeMb).toBe(10)
expect(IMPORT_BILL_FILE_RULE.maxCount).toBe(1)
})
it("keeps bill type options fixed", () => {
expect(IMPORT_BILL_TYPE_OPTIONS).toEqual([
{ value: "1", label: "流量方对账单" },
{ value: "2", label: "服务商对账单" }
])
})
it("builds glsx-combi-form data with bill type before file", () => {
const names = buildImportBillFormData().map(item => item.name)
expect(names).toEqual(["billType", "fileName"])
})
it("builds import payload as extension at base64", () => {
const payload = buildImportBillPayload({
billType: "1",
fileName: "demo.xlsx",
base64: "AAA111"
})
expect(payload).toEqual({
billType: "1",
file: "xlsx@AAA111"
})
})
it("normalizes poll status", () => {
expect(getImportPollStatus({ progress: 50, failNum: 0 })).toBe("processing")
expect(getImportPollStatus({ progress: 100, failNum: 0 })).toBe("success")
expect(getImportPollStatus({ progress: 100, failNum: 2 })).toBe("failed")
})
it("builds import template download task by bill type", () => {
const task = buildImportTemplateDownloadTask("1")
const exportParam = JSON.parse(task.exportParam)
expect(task.name).toBe("对账单导入模板")
expect(exportParam.billType).toBe("SHOP")
expect(exportParam.method).toBe("dj.api.smartcarlife.reconciliationBill.merchant.template.export.async")
})
})
import {
MARKET_TRANSFER_UPLOAD_RULE,
EXPENSE_CATEGORY_OPTIONS,
FORM_COMPONENT_RULE,
buildMarketTransferFormData,
buildMarketTransferSubmitParams,
getVisibleAmountFields,
normalizeApprovedMarketTransferFees,
mapMarketFeeResults
} from "@/views/financeManage/accountStateManage/marketTransfer"
describe("marketTransfer helpers", () => {
it("shows amount fields only for selected expense categories", () => {
const fields = getVisibleAmountFields([706, 900])
expect(fields.map(item => item.id)).toEqual([706, 900])
})
it("maps market fee result rows by expense category id", () => {
const result = mapMarketFeeResults({
list: [
{ expenseCategoryId: 706, expenseCategoryResult: 11 },
{ expenseCategoryId: 900, expenseCategoryResult: 22 }
],
expenseCategoryTotalResult: 33
})
expect(result.amountMap).toEqual({ 706: 11, 900: 22 })
expect(result.totalAmount).toBe(33)
})
it("normalizes approved market transfer fees for default checked readonly categories", () => {
const result = normalizeApprovedMarketTransferFees([
{ expenseCategoryId: 706, expenseCategoryResult: 11 },
{ expenseCategoryId: 706, expenseCategoryResult: 12 },
{ expenseCategoryId: 900, expenseCategoryResult: 22 },
{ expenseCategoryId: null, expenseCategoryResult: 33 }
])
expect(result.expenseCategoryIds).toEqual([706, 900])
expect(result.amountMap).toEqual({ 706: 12, 900: 22 })
expect(result.totalAmount).toBe(34)
})
it("keeps the expense category ids fixed", () => {
expect(EXPENSE_CATEGORY_OPTIONS.map(item => item.id)).toEqual([706, 808, 809, 901, 900])
})
it("uses the requested voucher upload rule", () => {
expect(MARKET_TRANSFER_UPLOAD_RULE.extensions).toEqual([
".xls",
".xlsx",
".doc",
".docx",
".pdf",
".jpg",
".jpeg",
".png",
".bmp"
])
expect(MARKET_TRANSFER_UPLOAD_RULE.maxSizeMb).toBe(10)
expect(MARKET_TRANSFER_UPLOAD_RULE.maxCount).toBe(4)
expect(MARKET_TRANSFER_UPLOAD_RULE.accept).toBe(".xls,.xlsx,.doc,.docx,.pdf,.jpg,.jpeg,.png,.bmp")
})
it("documents that finance forms should use glsx-combi-form", () => {
expect(FORM_COMPONENT_RULE.component).toBe("glsx-combi-form")
expect(FORM_COMPONENT_RULE.requiredFor).toContain("finance dialog forms")
})
it("keeps invoice remark before voucher in the market transfer form", () => {
const names = buildMarketTransferFormData().map(item => item.name)
expect(names.indexOf("invoiceRemark")).toBeLessThan(names.indexOf("fileUrlList"))
})
it("adds a horizontal-scroll popper class for bank account options", () => {
const bankAccount = buildMarketTransferFormData().find(item => item.name === "rcvMerchantId")
expect(bankAccount.attrs.popperClass).toBe("market-transfer-account-popper")
})
it("submits voucher urls as a fileUrlList array", () => {
const params = buildMarketTransferSubmitParams({
id: "bill-1",
remark: "ok",
expenseCategoryIds: [706, 808, 900],
fileUrlList: [
{ fileUrl: "https://example.com/a.png" },
{ fileUrl: "" },
{ fileUrl: "https://example.com/b.jpg" }
]
}, [706, 900])
expect(params.expenseCategoryIds).toEqual([808])
expect(params.fileUrlList).toEqual(["https://example.com/a.png", "https://example.com/b.jpg"])
expect(params.fileUrl).toBeUndefined()
expect(params.id).toBe("bill-1")
expect(params.remark).toBe("ok")
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!