Commit d95fea61 by zhangxw

分账/费用类目需求开发

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