Commit 2e8884b0 by chenwq

店铺设置,对账单

1 parent d139b455
......@@ -49,3 +49,50 @@ export function getBillTmplAdapter(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.generateUseRequestAdapter'
return request(data, "post")
}
// 对账单测算
export function billCompute(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.computeByJson'
return request(data, "post")
}
// 对账单编辑
export function editBill(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.updateByJson'
return request(data, "post")
}
export function billDetail(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.detail'
return request(data, "post")
}
//根据服务商商户号分页获取4S店列表
export function getShopList(data) {
data.method = 'dj.api.scenemerchantref.queryShopRefByPartnerShopPage'
return request(data)
}
// 对账单确认
export function billConfirm(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.confirm'
return request(data, "post")
}
// 对账单取消
export function billCancel(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.cancel'
return request(data, "post")
}
// 对账单待确认内容确认
export function billConfirmChange(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.confirmChange'
return request(data, "post")
}
// 对账单待取消内容确认
export function billCancelChange(data) {
data.method = 'dj.api.smartcarlife.reconciliationBill.cancelChange'
return request(data, "post")
}
......@@ -17,7 +17,7 @@
<div class="d2-container-content">
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
<div slot="hasConfirmContent" slot-scope="scope">
<el-button v-if="scope.scope.hasConfirmContent" type="text" @click="handleDetail(scope.scope)">查看说明</el-button>
<el-button v-if="scope.scope.hasConfirmContent" type="text" @click="handleChangeDetail(scope.scope)">查看说明</el-button>
<span v-else>——</span>
</div>
<div slot="auth-button" slot-scope="scope">
......@@ -54,28 +54,36 @@
</div>
</d2-container>
<ChangeDetailDialog v-if="detailVisible" :detailVisible="detailVisible" :info="info" @dialogClose="handleChangeDetail"></ChangeDetailDialog>
<system-bill-dialog v-if="billVisible" :billVisible="billVisible" :billTmplInfo="billTmplInfo" @handleClose="handleBillVisible"></system-bill-dialog>
<system-bill-detail-dialog v-if="billDetailVisible" :billVisible="billDetailVisible" :billTmplInfo="billTmplInfo" @handleClose="handleChangeDetailVisible"></system-bill-detail-dialog>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
// import { mapActions, mapState } from 'vuex'
import { getBillList } from '@api/accountManage'
import { tmplTypeList, billStatusList } from "../constant/baseData"
import { mapActions, mapState } from 'vuex'
import { getBillList, editBill, billDetail, billConfirm, billCancel, billConfirmChange, billCancelChange } from '@api/accountManage'
import { tmplTypeList, billStatusList, sceneTypeList } from "../constant/baseData"
import ChangeDetailDialog from '../components/ChangeDetailDialog'
import SystemBillDialog from "../components/SystemBillDialog"
import SystemBillDetailDialog from "../components/SystemBillDetailDialog"
export default {
name: 'accountStateManage',
components: {
ChangeDetailDialog
ChangeDetailDialog,
SystemBillDialog,
SystemBillDetailDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '110px',
detailVisible: false,
billDetailVisible: false,
info: '',
searchForm: {
shopMerchantName: '',
sceneType: '',
billMerchantName: '',
accountDate: [],
createdDate: [],
......@@ -121,6 +129,14 @@ export default {
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'tmplTypeList'
}, {
label: '业务场景',
name: 'sceneType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'sceneTypeList'
}],
getListApi: getBillList,
tableParams: {
......@@ -131,6 +147,12 @@ export default {
label: '流量方',
prop: 'shopMerchantName'
}, {
label: '业务场景',
prop: 'sceneType',
formatter: (cellValue) => {
return this.baseData.sceneTypeList.find(item => item.confId == cellValue.sceneType)?.confLabel || '——'
}
}, {
label: '对账周期',
prop: '',
formatter: (cellValue) => {
......@@ -176,15 +198,24 @@ export default {
},
baseData: {
billStatusList: billStatusList,
tmplTypeList: tmplTypeList
tmplTypeList: tmplTypeList,
sceneTypeList: sceneTypeList
},
billVisible: false,
billTmplInfo: []
}
},
mounted() {
this.getOptionsList('showFormData')
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
}),
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getParams() {
var params = deepClone(this.searchForm)
const dateFormatList = [{
......@@ -244,6 +275,7 @@ export default {
handleReset() {
this.searchForm = {
shopMerchantName: '',
sceneType: '',
billMerchantName: '',
accountDate: [],
createdDate: [],
......@@ -253,14 +285,107 @@ export default {
this.$refs.recordTable.refreshTable(false, true)
},
handleChangeDetail() {
handleBillVisible() {
this.billVisible = !this.billVisible
},
handleEdit(row) {
billDetail({ id: row.id }).then(res => {
this.billTmplInfo = deepClone(res)
this.handleBillVisible()
})
},
handleBillConfirm(row) {
this.$confirm('是否确认对账?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = { id: row.id }
billConfirm(params).then(res => {
this.$message.success("操作成功")
this.handleReset()
})
}).catch(() => { })
},
handleCancel(row) {
this.$confirm('是否取消对账?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = { id: row.id }
billCancel(params).then(res => {
this.$message.success("操作成功")
this.handleReset()
})
}).catch(() => { })
},
handleChangeConfirm(row) {
this.$confirm('是否确认内容变更?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = { id: row.id }
billConfirmChange(params).then(res => {
this.$message.success("操作成功")
this.handleReset()
})
}).catch(() => { })
},
handleChangeCacel(row) {
this.$confirm('是否取消内容变更?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = { id: row.id }
billCancelChange(params).then(res => {
this.$message.success("操作成功")
this.handleReset()
})
}).catch(() => { })
},
handleExport(row) {
var params = { id: row.id }
params.method = 'dj.api.smartcarlife.reconciliationBill.export.async'
const list = [
...this.dowloadList,
{
name: '对账单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleChangeVisible() {
this.detailVisible = !this.detailVisible
},
handleDetail(row) {
handleChangeDetail(row) {
console.log(row, 'row---')
this.info = row
this.handleChangeDetail()
this.handleChangeVisible()
},
handleChangeDetailVisible() {
this.billDetailVisible = !this.billDetailVisible
},
handleDetail(row) {
console.log(row, 'row---')
this.info = row
this.handleChangeDetailVisible()
}
}
}
......
<!-- 对账单管理 - 变更说明弹窗 -->
<template>
<d2-dialog title="变更说明" :is-visible="detailVisible" class="privacyDailog" width="30%" btnOkLabel="关闭" :noCancel="true" @closeDialog="handleClose" @confirmDialog="handleClose">
<d2-dialog title="变更说明" :is-visible="detailVisible" class="privacyDailog" width="1080px" btnOkLabel="关闭" :noCancel="true" @closeDialog="handleClose" @confirmDialog="handleClose">
<d2-table ref="tmplTable" :get-list-api="getListApi" :search-form="searchForm" :table-params="tableParams" :before-search-fn="beforeSearchFn">
</d2-table>
</d2-dialog>
......@@ -8,7 +8,7 @@
<script>
import { getBillDetailList } from '@api/accountManage'
import { deepClone } from '@/common/util'
import { Util, deepClone } from '@/common/util'
export default {
name: 'ChangeDetailDialog',
data() {
......@@ -21,16 +21,23 @@ export default {
tableOption: false,
tableColumns: [{
label: '变更类型',
prop: '',
prop: 'changeType',
formatter: (cellValue) => {
return {1: '删除', 2: '新增'}[cellValue.changeType]
}
}, {
label: '订单编码',
prop: '',
prop: 'orderCode',
}, {
label: '变更人',
prop: '',
prop: 'operator',
}, {
label: '变更时间',
prop: '',
width: '150px',
prop: 'createdDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
}
}
......
<template>
<div class="dynamic-table-container">
员工标签:<el-button
type="default"
@click="addRow"
>
员工标签:<el-button type="default" v-if="isEdit" @click="addRow">
添加事由
</el-button>
<el-form :model="dynamicForm" ref="dynamicForm">
<el-table
:data="tableData"
border
style="width: 100%; margin-top: 20px"
>
<el-table-column
prop="index"
label="序号"
width="80"
align="center"
>
<el-table :data="tableData" border style="width: 100%; margin-top: 20px">
<el-table-column prop="index" label="序号" width="80" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column
prop="adjustAmount"
label="调整金额"
width="180"
>
<el-table-column prop="adjustAmount" label="调整金额" width="180">
<template slot-scope="scope">
<el-form-item
:prop="'tableData.' + scope.$index + '.adjustAmount'"
:rules="adjustAmountRules"
>
<el-input
v-model="scope.row.adjustAmount"
placeholder="请输入金额"
type="number"
></el-input>
<el-form-item :prop="'tableData.' + scope.$index + '.adjustAmount'" :rules="adjustAmountRules">
<el-input v-model="scope.row.adjustAmount" :disabled="!isEdit" placeholder="请输入金额" type="number" @blur="handleInputBlur"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column
prop="adjustReason"
label="调整事由"
>
<el-table-column prop="adjustReason" label="调整事由">
<template slot-scope="scope">
<el-form-item
:prop="'tableData.' + scope.$index + '.adjustReason'"
:rules="adjustReasonRules"
>
<el-input
v-model="scope.row.adjustReason"
placeholder="请输入调整事由"
></el-input>
<el-form-item :prop="'tableData.' + scope.$index + '.adjustReason'" :rules="adjustReasonRules">
<el-input v-model="scope.row.adjustReason" placeholder="请输入调整事由" :disabled="!isEdit"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="操作"
width="120"
align="center"
>
<el-table-column label="操作" width="120" align="center" v-if="isEdit">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="deleteRow(scope.$index)"
icon="el-icon-delete"
></el-button>
<el-button size="mini" type="danger" @click="deleteRow(scope.$index)" icon="el-icon-delete"></el-button>
</template>
</el-table-column>
</el-table>
......@@ -87,6 +46,16 @@
<script>
export default {
name: 'DynamicAdjustmentTable',
props: {
adjustments: {
type: Array,
default: () => []
},
isEdit: {
type: Boolean,
default: true
}
},
data() {
return {
dynamicForm: {
......@@ -107,7 +76,7 @@ export default {
],
adjustReasonRules: [
{ required: true, message: '请输入调整事由', trigger: 'blur' },
{ min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur' }
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
]
}
},
......@@ -125,6 +94,9 @@ export default {
// 初始化一行数据
this.addRow();
},
mounted() {
this.dynamicForm.tableData = this.adjustments
},
methods: {
addRow() {
this.tableData.push({
......@@ -133,20 +105,22 @@ export default {
});
},
deleteRow(index) {
if (this.tableData.length <= 1) {
this.$message.warning('至少保留一行数据');
return;
}
// if (this.tableData.length <= 1) {
// this.$message.warning('至少保留一行数据');
// return;
// }
this.tableData.splice(index, 1);
},
handleInputBlur() {
this.$emit('handleInputBlur')
},
showTableData() {
const formattedData = this.tableData.map((row, index) => ({
序号: index + 1,
调整金额: row.adjustAmount,
调整事由: row.adjustReason
'序号': index + 1,
'调整金额': row.adjustAmount,
'调整事由': row.adjustReason
}));
console.log('当前表格数据:', formattedData);
this.$message.success('表格数据已打印到控制台');
},
validateForm() {
this.$refs.dynamicForm.validate(valid => {
......
......@@ -24,6 +24,28 @@ export const billStatusList = [
}
]
export const sceneTypeList = [
{
confId: "0",
confLabel: "会员权益/升级"
},
{
confId: "1",
confLabel: "精品升级"
},
{
confId: "2",
confLabel: "次新车转化"
},
{
confId: "3",
confLabel: "售后众筹"
},
{
confId: "4",
confLabel: "积分商城"
}
]
// 存储到内存里面的模版数据,减少频繁请求(进入和退出页面会清空)
export const localTmplList = [
{
......
......@@ -33,13 +33,13 @@
</el-radio-group>
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant" multiple :multiple-limit="1" filterable style="width:400px">
<el-select v-model="infoForm.merchant" multiple :multiple-limit="1" filterable style="width:400px" @change="handleChangeMerchant">
<el-option v-for="item in baseData.merchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
<el-form-item v-if="isTmpl && infoForm.merchantType == '7'" label="流量方:" prop="shopMerchantId">
<el-select v-model="infoForm.shopMerchantId" style="width:400px">
<el-option v-for="item in baseData.shopMerchantList" :key="item.confId" :label="item.confLabel" :value="item.confId" />
<el-option v-for="item in baseData.shopMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
<el-form-item label="对账周期:" class="dateItem" prop="payStartDate">
......@@ -65,8 +65,13 @@
</el-select>
</el-form-item>
<el-form-item v-if="isTmpl" label="对账字段:" prop="fieldsJson">
<span>{{infoForm.fieldsTxt}}</span>
<el-button v-if="infoForm.fieldsJson" type="text" @click="handleCustTmpl">自定义</el-button>
<div class="tmpl-box">
<el-tooltip v-show="infoForm.fieldsTxt" effect="dark" placement="top" :content="infoForm.fieldsTxt">
<span class="fields-txt">{{infoForm.fieldsTxt}}</span>
</el-tooltip>
<div v-show="tmplSelectList.length">共{{tmplSelectList.length}}个字段</div>
<el-button v-if="infoForm.templateId" type="text" @click="handleCustTmpl" style="margin-left: 8px;">自定义</el-button>
</div>
</el-form-item>
</el-form>
</d2-dialog>
......@@ -79,7 +84,7 @@ import {
import dayjs from 'dayjs'
import { deepClone } from '@/common/util'
import { getMerchantPageSearch } from '@api/publicAccount'
import { getTmplList, getMetaTmpl, getBillTmplAdapter } from '@api/accountManage'
import { getTmplList, getMetaTmpl, getBillTmplAdapter, getShopList } from '@api/accountManage'
import { mapActions, mapState } from 'vuex'
import { localTmplList } from "./constant/baseData"
import { resData } from "./resData"
......@@ -148,7 +153,8 @@ export default {
reconciliationStatus: 'all',
payeeType: 'all',
templateId: '',
fieldsJson: ''
fieldsJson: '',
fieldsTxt: ''
},
// 1 - traffic; 2 - service
......@@ -235,6 +241,7 @@ export default {
mounted() {
// console.log(this.scene)
this.$EventBus.$on('changeFieldIds', obj => {
console.log(obj, 'obj---')
this.tmplSelectList = obj?.fieldIds || []
this.infoForm.fieldsTxt = this.getFieldsTxt()
this.getMetaTmpl()
......@@ -267,6 +274,20 @@ export default {
})
},
handleChangeMerchant(e) {
console.log(e)
this.infoForm.shopMerchantId = ''
const params = {
currentPage: 1,
pageSize: 9999,
partnerMerchantId: e[0],
scene: this.scene
}
getShopList(params).then(res => {
this.baseData.shopMerchantList = res.list
})
},
clickMerchantType(e) {
e === this.infoForm.merchantType
? (this.infoForm.merchantType = '')
......@@ -298,7 +319,7 @@ export default {
this.infoForm.templateId = ''
this.infoForm.fieldsJson = ''
this.infoForm.fieldsTxt = ''
this.infoForm.tmplType
this.infoForm.tmplType = ''
this.tmplSelectList = []
const ruleAttrList = ['templateId', 'fieldsJson']
ruleAttrList.forEach(item => {
......@@ -310,7 +331,9 @@ export default {
getFieldsTxt() {
var fieldNames = ''
const tmplName = this.localTmplList.find(item => item.type == this.infoForm.tmplType)?.name || 'trafficTmpl'
console.log(tmplName, 'tmplName---')
var list = JSON.parse(localStorage.getItem(tmplName))
console.log(list, 'list---')
this.dealFieldsJson(list, true)
},
......@@ -341,17 +364,31 @@ export default {
currentPage: 1
}
// 流量方
getTmplList({...params, type: 1}).then(res => {
getTmplList({ ...params, type: 1 }).then(res => {
this.baseData.trafficTemplateList = res.list || []
this.baseData.trafficTemplateList.unshift({
id: 'all',
type: 1,
templateName: '无',
fieldNames: '',
fieldIds: []
})
})
// 服务商
getTmplList({...params, type: 2}).then(res => {
getTmplList({ ...params, type: 2 }).then(res => {
this.baseData.serviceTemplateList = res.list || []
this.baseData.serviceTemplateList.unshift({
id: 'all',
type: 2,
templateName: '无',
fieldNames: '',
fieldIds: []
})
})
},
handleTmplChange(e) {
if(!(Object.keys(this.typeObj)).includes(this.infoForm.merchantType)) {
if (!(Object.keys(this.typeObj)).includes(this.infoForm.merchantType)) {
return true
}
const item = this.baseData[this.merchantTypeStr + 'TemplateList'].find(item => item.id == e)
......@@ -401,9 +438,10 @@ export default {
},
handleCustTmpl() {
this.infoForm.tmplType = this.infoForm.merchantType == '2' ? '1' : '2'
this.$emit('custTmpl', {
tmplType: this.infoForm.tmplType + '',
tmplSelectList: this.tmplSelectList
tmplSelectList: this.tmplSelectList || []
})
},
......@@ -435,10 +473,14 @@ export default {
}
params.sceneType = this.scene
// 对账状态
params.reconciliationStatus = infoForm.reconciliationStatus == 'all' ? '' : infoForm.reconciliationStatus
params.payeeType = infoForm.payeeType == 'all' ? '' : infoForm.payeeType
infoForm.reconciliationStatus == 'all' ? '' : (params.reconciliationStatus = infoForm.reconciliationStatus)
infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
if (infoForm.shopMerchantId) {
params.shopMerchantId = infoForm.shopMerchantId
params.shopMerchantName = this.baseData.shopMerchantList.find(item => item.merchantId == infoForm.shopMerchantId)?.merchantName
}
if (this.isTmpl) {
params.templateId = infoForm.templateId
params.templateId = infoForm.templateId == 'all' ? '' : infoForm.templateId
params.fieldsJson = infoForm.fieldsJson
}
return params
......@@ -446,17 +488,17 @@ export default {
// 系统对账
handleSystemBill() {
this.$emit('handleBill', { billTmplInfo: resData.data })
// this.$refs.accountForm.validate(valid => {
// if (valid) {
// var params = this.getParams()
// console.log('params', params)
// getBillTmplAdapter(params).then(res => {
// console.log(res, 'res')
// this.$emit('handleBill', { billTmplInfo: res })
// })
// }
// })
// this.$emit('handleBill', { billTmplInfo: resData.data })
this.$refs.accountForm.validate(valid => {
if (valid) {
var params = this.getParams()
console.log('params', params)
getBillTmplAdapter(params).then(res => {
console.log(res, 'res')
this.$emit('handleBill', { billTmplInfo: res })
})
}
})
},
handleAddConfirm() {
......@@ -525,4 +567,15 @@ export default {
width: 395px !important;
}
}
.tmpl-box {
display: flex;
}
.fields-txt {
width: 305px;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin-right: 8px;
}
</style>
......@@ -199,7 +199,10 @@ export default {
optionList: [],
optionId: "adcode",
optionLabel: "name",
optionsName: "provinceInfoList"
optionsName: "provinceInfoList",
changeAttr: (value, targetItem) => {
this.searchForm.cityId = ''
}
},
{
label: "所属城市",
......@@ -328,7 +331,7 @@ export default {
mutiSelectName: "merchantId",
tableColumns: [
{
label: "区域",
label: "所属省份",
prop: "provinceName"
},
{
......@@ -344,7 +347,7 @@ export default {
prop: "merchantName",
width: "200px",
formatter: (cellValue) => {
return cellValue.merchantName + cellValue.merchantId
return cellValue.merchantName
}
},
{
......@@ -466,8 +469,13 @@ export default {
addHtml: 'businessDevelopmentScene',
formatter: (cellValue, idx) => {
const list = this.removeListAll('busiDelpList')
const target = list.find(item => item.confId == cellValue.businessTypeList[idx].businessDevelopmentScene)
return target ? target.confValue : '——'
let str = []
if (cellValue?.businessTypeList && cellValue?.businessTypeList.length && cellValue?.businessTypeList[idx]?.businessDevelopmentSceneList) {
cellValue?.businessTypeList[idx]?.businessDevelopmentSceneList.forEach(item => {
str.push(list.find(k => k.confId == item)?.confValue)
})
}
return str.length ? str.join('/') : '——'
}
},
{
......
......@@ -892,7 +892,8 @@ export default {
directorList.push({
directorUserId: target?.userId,
directorType: key,
directorName: target?.userName
directorName: target?.userName,
directorPhone: target?.userNum
})
})
}
......@@ -1022,7 +1023,8 @@ export default {
this.sellerMerchantStaffList = result.map((item) => {
return {
userId: item.uuid,
userName: item.staffName
userName: item.staffName,
userNum: item.staffPhone
}
})
resolve()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!