Commit d95fea61 by zhangxw

分账/费用类目需求开发

1 parent 5bb14243
......@@ -6,7 +6,7 @@
:visible.sync="drawerDetailVisible"
:before-close="handleDrawerClose">
<div class="d2-drawer-content car-txt">
<div class="title-block">
<div class="title-block flex">
<p class="title-text">产品详情</p>
<p class="close-icon"
@click="handleDrawerClose">
......@@ -98,12 +98,27 @@
</el-form>
</div>
</div>
<div class="d2-drawer-content car-txt">
<div class="title-block">
<p class="title-text">操作信息</p>
</div>
<div class="log-box">
<el-timeline>
<el-timeline-item v-for="(reviewInfo,infoId) in commodityInfo.operationLogList"
color="#0bbd87"
:key="infoId"
:timestamp="reviewInfo.updatedDateStr">
{{ reviewInfo.updatedBy + reviewInfo.methodDescription }}
</el-timeline-item>
</el-timeline>
</div>
</div>
</el-drawer>
</template>
<script>
import { getGoodsInfoById } from '@/api/commodity'
import { deepClone } from '@/common/util'
import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main'
export default {
name: 'DrawerDetail',
......@@ -113,7 +128,8 @@ export default {
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
userInfo: this.$store.state.d2admin.user.info,
commodityInfo: {},
membraneTypeList: baseConfig.membraneTypeList
membraneTypeList: baseConfig.membraneTypeList,
operationLogList: [] // 操作信息
}
},
......@@ -159,6 +175,9 @@ export default {
item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : ''
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
})
res?.operationLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
this.commodityInfo = res
})
},
......@@ -178,7 +197,6 @@ export default {
.d2-drawer-content{
background: #ffffff;
.title-block{
display: flex;
justify-content: space-between;
border-bottom: 1px solid #e7eaec;
padding: 16px 20px;
......@@ -194,6 +212,9 @@ export default {
cursor: pointer;
}
}
.title-block.flex{
display: flex;
}
.content-box{
.SPU_class{
position: relative;
......@@ -238,6 +259,9 @@ export default {
}
}
.log-box{
padding-top: 20px;
}
}
.child-drawer-block
/* .child-drawer-block .d2-drawer-row {
......
......@@ -344,7 +344,7 @@ export default {
showDemo() {
// public 文件需要使用绝对路径引入
// this.lookUrl = `${process.env.VUE_APP_PUBLIC_PATH}account/category.png`
this.lookUrl = `${process.env.VUE_APP_PUBLIC_IMGPATH}template01.png`
this.lookUrl = `${process.env.VUE_APP_PUBLIC_IMGPATH}template_ledger.png`
this.lookImgVisible = !this.lookImgVisible
}
}
......
......@@ -3,13 +3,22 @@
<d2-container>
<el-form ref="editReconciliationFrom" class="editReconciliationFrom d2-container-content" :model="form"
:rules="formRules" label-width="150px" v-loading="$store.state.d2admin.loading.value">
<el-form-item label="费用类目名:" prop="feeCategoryName">
<el-input v-model.trim="form.feeCategoryName" maxlength="20" class="itd" placeholder="请输入费用类目名称" clearable />
</el-form-item>
<el-form-item label="费用类型:" prop="formType">
<el-radio-group v-model="form.formType" @change="changeFormType">
<el-radio v-for="(item, index) in formTypeList" :label="item.confId" :key="index">{{
item.confLabel }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="应用对象" prop="applicationObjectType">
<el-radio-group v-model="form.applicationObjectType">
<el-radio v-for="(item, index) in objList" :label="item.confId" :key="index" :disabled="isDisabled">{{
item.confLabel }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="" prop="sceneType">
<el-form-item label="" prop="applicationSceneTypes">
<span class="tips-block" slot="label">
<span class="tips-label">应用场景</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
......@@ -17,14 +26,14 @@
<span class="tips-icon" />
</el-tooltip>:
</span>
<el-checkbox-group v-model="form.sceneType">
<el-checkbox-group v-model="form.applicationSceneTypes">
<el-checkbox v-for="(item, index) in sceneTypeList" :key="index" :label="item.confId">{{ item.confValue
}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="" prop="costCategory">
<el-form-item label="" prop="costCategory" v-if="form.formType == 2">
<span class="tips-block" slot="label">
<span class="tips-label">费用类目</span>
<span class="tips-label">子类目</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
<div slot="content">定义对账费用类目,完成对账规则配置后,会按照以下配置的类目排序进行金额计算和拆分,最后一个费用类目自动承担剩余金额;</div>
<span class="tips-icon" />
......@@ -38,12 +47,12 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="费用类目名称" align="center" width="400">
<el-table-column label="子类目名称" align="center" width="400">
<template slot-scope="scope">
<div class="inputCol">
<el-form-item :prop="'tableData.' + scope.$index + '.feeCategoryName'"
:rules="[{ required: true, message: '请输入费用类目名称', trigger: 'change' }]">
<el-input v-model="scope.row.feeCategoryName" placeholder="请输入费用类目名称" maxlength="20"
:rules="[{ required: true, message: '请输入子类目名称', trigger: 'change' }]">
<el-input v-model="scope.row.feeCategoryName" placeholder="请输入子类目名称" maxlength="20"
style="width: 300px" clearable />
</el-form-item>
</div>
......@@ -101,34 +110,38 @@ export default {
}, {
confId: 2,
confLabel: '服务商'
}, {
confId: 3,
confLabel: '平台方'
}
],
formTypeList: [
{
confId: 1,
confLabel: '普通'
}, {
confId: 2,
confLabel: '可拓展'
}
],
userInfo: this.$store.state.d2admin.user.info,
key: new Date(),
form: {
feeCategoryName: '',
sceneType: [],
feeCategoryName: '', // 费用类目名称
formType: 1, // 费用类型
applicationSceneTypes: [], // 应用场景
applicationObjectType: 1,
feeCategoryType: 2, // 1= 分账类目;2= 对账类目;
categoryToSort: 1,
tableData: [
// {
// sortVal: 1,
// feeCategoryName: '王小虎1'
// }, {
// sortVal: 2,
// feeCategoryName: '王小虎2'
// }, {
// sortVal: 3,
// feeCategoryName: '王小虎3'
// }, {
// sortVal: 4,
// feeCategoryName: '王小虎4'
// }
]
tableData: []
},
formRules: {
sceneType: [{
feeCategoryName: [{
required: true,
message: '请输入费用类目名称',
trigger: 'blur'
}],
applicationSceneTypes: [{
required: true,
message: '请选择应用场景',
trigger: 'change'
......@@ -167,21 +180,26 @@ export default {
close: 'd2admin/page/close'
}),
changeFormType(e) {
if (this.form.formType == '2') {
this.form.tableData = [
{ sortVal: '', feeCategoryName: '' },
{ sortVal: '', feeCategoryName: '' }
]
} else {
this.form.tableData = []
}
},
getById(id) {
queryById({ id: id, feeCategoryType: 2 }).then(res => {
// this.form.feeCategoryName = res.feeCategoryName || ''
// const scenes = res[0].feeCategorySceneList
// const scenes = res.applicationSceneTypes
// if (scenes && scenes.length > 0) {
// // const list = scenes.map(item => {
// // return item.applicationSceneType
// // })
// }
this.form.sceneType = res.applicationSceneTypes
this.form.feeCategoryName = res.feeCategoryName
this.form.feeCategoryNameId = res?.feeCategoryNameId || ''
this.form.applicationSceneTypes = res.applicationSceneTypes
this.form.applicationObjectType = res.applicationObjectType
// this.form.tableData = res[0].feeCategoryNameList
this.form.tableData = res.feeCategoryChildren
// this.form.feeCategoryNameId = res?.feeCategoryNameId || ''
this.form.formType = res.formType
})
},
......@@ -234,26 +252,18 @@ export default {
this.$refs.editReconciliationFrom.validate(valid => {
if (valid) {
const params = deepClone(this.form)
params.formType = 1
// params.sceneType = params.sceneType.join(',')
params.applicationSceneTypes = params.sceneType
if (params.tableData && params.tableData.length > 1) {
params.tableData.forEach((element, index) => {
element.categoryToSort = index + 1
})
params.categoryToSort = params.tableData.map((item, index) => {
return index + 1
}).join(",")
params.feeCategoryName = params.tableData.map(item => {
return item.feeCategoryName
}).join(",")
} else {
this.notice.warningTips('请添加类目到两行以上')
return
if (params.formType == 2) {
if (params.tableData && params.tableData.length > 1) {
params.feeCategoryChildren = params.tableData.map((item, index) => {
item.categoryToSort = index + 1
return item
})
} else {
this.notice.warningTips('请添加子类目到两行以上')
return
}
}
params.feeCategoryChildren = params.tableData
params.sceneType && delete params.sceneType
params.tableData && delete params.tableData
delete params.tableData
this.$confirm("保存后该费用类目将按照设定应用到对账规则中,是否确定保存?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -294,7 +304,7 @@ export default {
showDemo() {
// public 文件需要使用绝对路径引入
this.lookUrl = `${process.env.VUE_APP_PUBLIC_IMGPATH}template02.png`
this.lookUrl = `${process.env.VUE_APP_PUBLIC_IMGPATH}template_reconciliation.png`
this.lookImgVisible = !this.lookImgVisible
}
}
......
......@@ -234,7 +234,7 @@ export default {
this.getBaseData()
this.$nextTick(() => {
// console.log(this.$refs.ledgerListTable, 'this.$refs.ledgerListTable.page')
this.$refs.ledgerListTable.page.pageSize = 10
if (this.$refs.ledgerListTable && this.$refs.ledgerListTable.page) this.$refs.ledgerListTable.page.pageSize = 10
})
},
......
<!-- 对账类目 -->
<template>
<div>
<div class="d2-container-content">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :form-data="showFormData" />
<div class="d2-container-content" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :label-width="'110px'" :search-form="searchForm" :form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
......@@ -31,7 +31,7 @@
</el-popover>
</template>
<template slot="typeName" slot-scope="scope">
<el-popover placement="top" width="300" trigger="hover">
<el-popover placement="top" width="300" trigger="hover" v-if="scope.scope.formType == 2">
<div class="merchant-name-box">
{{ formTypeFilter(scope.scope) }}
</div>
......@@ -39,8 +39,9 @@
{{ formTypeFilter(scope.scope, 20) }}
</div>
</el-popover>
<div v-else>-</div>
</template>
<div slot="auth-button" slot-scope="scope" v-if="!hideOptList.includes(scope.scope.id)">
<div slot="auth-button" slot-scope="scope" v-if="filterEnableEdit(scope.scope.sourceType)">
<auth-button slot="auth-button" :show-btn-ids="['9061605']" :data="scope.scope" />
<auth-button slot="auth-button" :show-btn-ids="['9061606']" :data="scope.scope" />
</div>
......@@ -61,9 +62,27 @@ export default {
searchForm: {
feeCategoryType: 2,
applicationSceneType: '',
applicationObjectType: ''
applicationObjectType: '',
feeCategoryName: '',
formType: ''
},
showFormData: [{
label: '费用类目名称',
name: 'feeCategoryName',
type: 'input',
maxlength: '20',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '应用场景',
name: 'applicationSceneType',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneTypeList'
}, {
label: '应用对象',
name: 'applicationObjectType',
type: 'select',
......@@ -73,14 +92,14 @@ export default {
optionLabel: 'confLabel',
optionsName: 'objList'
}, {
label: '应用场景',
name: 'applicationSceneType',
label: '费用类型',
name: 'formType',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneTypeList'
optionLabel: 'confLabel',
optionsName: 'formTypeList'
}],
getListApi: selectFeeCategoryList,
// 表格参数
......@@ -89,24 +108,32 @@ export default {
listName: 'list',
tableOption: true,
tableColumns: [{
label: '应用对象',
prop: 'applicationObjectName',
label: '费用类目名称',
prop: 'feeCategoryName',
minWidth: '140'
}, {
label: '费用类型',
width: '90',
formatter: (cellValue) => {
return targetType[cellValue.applicationObjectType]
return cellValue.formType == 1 ? '普通' : '可拓展'
}
}, {
label: '子类目',
prop: 'typeName',
addHtml: 'typeName',
width: '300'
}, {
label: '应用场景',
prop: 'feeCategorySceneList',
addHtml: 'applicationSceneTypes',
width: '300'
}, {
label: '费用类目',
prop: 'typeName',
addHtml: 'typeName',
width: '300'
// html: true,
label: '应用对象',
prop: 'applicationObjectName',
formatter: (cellValue) => {
return cellValue.applicationObjectType == 3 ? '平台方' : targetType[cellValue.applicationObjectType]
}
}, {
label: '创建人',
prop: 'createdBy'
......@@ -127,11 +154,22 @@ export default {
}, {
confId: 2,
confLabel: '服务商'
}, {
confId: 3,
confLabel: '平台方'
}
],
sceneTypeList: deepClone(sceneCodeList)
},
hideOptList: [1, 2, 3, 4, 5]
sceneTypeList: deepClone(sceneCodeList),
formTypeList: [
{
confId: 1,
confLabel: '普通'
}, {
confId: 2,
confLabel: '可拓展'
}
],
}
}
},
......@@ -142,8 +180,8 @@ export default {
mounted() {
this.getBaseData()
this.$nextTick(() => {
console.log(this.$refs.reconciliationListTable.page, 'this.$refs.reconciliationListTable.page')
this.$refs.reconciliationListTable.page.pageSize = 10
// console.log(this.$refs.reconciliationListTable.page, 'this.$refs.reconciliationListTable.page')
if (this.$refs.reconciliationListTable && this.$refs.reconciliationListTable.page) this.$refs.reconciliationListTable.page.pageSize = 10
})
},
......@@ -153,23 +191,21 @@ export default {
this.getOptionsList()
},
formTypeFilter(cellValue, lenght) {
console.log(cellValue)
console.log(lenght, cellValue)
// return 222
// formatter: (cellValue) => {
if (cellValue.feeCategoryChildren) {
const nameString = cellValue.feeCategoryChildren.reduce(
(nameString, item, index) => {
nameString = nameString + `${item.feeCategoryName}` + (index == cellValue.feeCategoryChildren.length - 1 ? '' : ',')
return nameString
},
""
)
console.log(nameString, 'nameString')
return lenght ? nameString.substring(0, lenght) : nameString
filterEnableEdit(sourceType) {
return sourceType != 2
},
formTypeFilter(ele, length) {
if (ele.formType == 2 && ele.feeCategoryChildren.length) {
let str = ''
ele.feeCategoryChildren.map((item, index) => {
// console.log(item.)
const unit = ele.feeCategoryChildren.length - 1 == index ? '' : ','
str += item.feeCategoryName + unit
})
return length ? str.substring(0, length) : str
} else {
return "-"
return '-'
}
// }
// if (ele.formType == 2 && ele.feeCategoryChildren.length) {
......@@ -208,7 +244,9 @@ export default {
this.searchForm = {
feeCategoryType: 2,
applicationSceneType: '',
applicationObjectType: ''
applicationObjectType: '',
feeCategoryName: '',
formType: ''
}
this.$refs.reconciliationListTable.refreshTable()
},
......
<!-- 财务 -->
<template>
<d2-Container class="financialRulesContainer">
<d2-Container class="financialRulesContainer " v-loading="$store.state.d2admin.loading.value">
<div class="d2-container-content">
<div class="headerContainer">
<p>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!