Commit d346b7d3 by 张立顺

切换分支

1 parent e787a79b
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
// DB -> store 持久化数据加载全局尺寸 // DB -> store 持久化数据加载全局尺寸
await dispatch("d2admin/size/load", null, { root: true }) await dispatch("d2admin/size/load", null, { root: true })
// DB - > 初始化 基础数据 // DB - > 初始化 基础数据
// await dispatch('d2admin/base/init', null, { root: true }) await dispatch("d2admin/base/init", null, { root: true })
// 后台接口 -> store // 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true }) // await dispatch('d2admin/auth/init', null, { root: true })
// end // end
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
async ([channelType, productType]) => { async ([channelType, productType]) => {
state.channelType = channelType state.channelType = channelType
state.productType = productType state.productType = productType
console.log(productType, "productType") // console.log(productType, "productType")
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
value: state value: state
......
...@@ -28,32 +28,144 @@ ...@@ -28,32 +28,144 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<p v-if="!tabindex">全部商品</p> <p v-if="!tabindex">全部商品</p>
<p class="edit-sub-title">
流量方分润
</p>
<el-form-item required
:label="'手续费计算'">
<el-radio-group v-model="classificationObj.shop4sDeductChargeFlag ">
<el-radio :label="'Y'">
扣除手续费
</el-radio>
<el-radio :label="'N'">
不扣除手续费
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-for="(item,index) in classificationObj.trafficSide"
:key="index+100"
:label="item.expenseCategoryName"
required>
<el-select v-model="classificationObj.trafficSide[index].expenseCategoryCalculateType"
placeholder="请选择分润模式">
<el-option v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
</el-form-item>
<p class="edit-sub-title">
服务商分润
</p>
<el-form-item required
:label="'手续费计算'">
<el-radio-group v-model="classificationObj.partnerDeductChargeFlag ">
<el-radio :label="'Y'">
扣除手续费
</el-radio>
<el-radio :label="'N'">
不扣除手续费
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-for="(item,index) in classificationObj.serviceProvider"
:key="index+200"
:label="item.expenseCategoryName"
required>
<el-select v-model="classificationObj.serviceProvider[index].expenseCategoryCalculateType"
placeholder="请选择分润模式">
<el-option v-for="el in severSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
</el-form-item>
<p class="edit-sub-title">
其他费用
<span class="title-tips">用于费用预留,进行完流量方和服务商分润后,会自动先预留出对应的费用给承担方</span>
</p>
<el-form-item required
:label="'产品成本'">
<el-radio-group v-model="classificationObj.goodsCostFlag ">
<el-radio :label="'Y'">
不扣除产品成本
</el-radio>
<el-radio :label="'N'">
扣除产品成本
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-for="(item,index) in classificationObj.platformPublic"
:key="index+300"
:label="item.expenseCategoryName"
required>
<el-select v-model="classificationObj.platformPublic[index].expenseCategoryCalculateType"
placeholder="请选择分润模式">
<el-option v-for="el in defaultSelectOptions"
:key="el.expenseCategoryCalculateType"
:label="el.label"
:value="el.expenseCategoryCalculateType" />
</el-select>
</el-form-item>
<!-- <p>区别</p> --> <!-- <p>区别</p> -->
</el-form> </el-form>
<!-- <div>classificationCpt</div> --> <tableAccount :table-select-options="tableSelectOptions"
:classification-obj-select="classificationObjSelect" />
<!-- <div class="headerContainer"></div>
<div class="publicContainer"></div>
<el-tabs type="border-card">
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i> 我的行程</span>
我的行程
</el-tab-pane>
<el-tab-pane label="消息中心">消息中心</el-tab-pane>
<el-tab-pane label="角色管理">角色管理</el-tab-pane>
<el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
</el-tabs> -->
</div> </div>
</template> </template>
<script> <script>
// 1按毛利比例;2按收入比例;3按固定金额
// 1按收入比例;2按毛利比例;3按固定金额;4按(产值-流量成本)比例;5按(产值-流量成本-其他费用不包含产品成本))比例;6按(产值-流量成本-其他费用包含产品成本)比例);其他费用:1按收入比例
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import tableAccount from './tableAccount'
const defaultSelectOptions = [
{
expenseCategoryCalculateType: 1,
label: '按毛利比例'
},
{
expenseCategoryCalculateType: 2,
label: '按收入比例'
},
{
expenseCategoryCalculateType: 3,
label: '按固定金额'
}
]
const severSelectOptions = [
{
expenseCategoryCalculateType: 1,
label: '按收入比例'
},
{
expenseCategoryCalculateType: 2,
label: '按毛利比例'
},
{
expenseCategoryCalculateType: 3,
label: '按固定金额'
},
{
expenseCategoryCalculateType: 4,
label: '按(产值-流量成本)比例'
},
{
expenseCategoryCalculateType: 5,
label: '按(产值-流量成本-其他费用不包含产品成本))比例'
},
{
expenseCategoryCalculateType: 6,
label: '按(产值-流量成本-其他费用包含产品成本)比例'
}
]
export default { export default {
name: 'ClassificationCpt', name: 'ClassificationCpt',
// isNeedVuex: true, // isNeedVuex: true,
components: {
tableAccount
},
props: { props: {
goodsList: { goodsList: {
type: Array, type: Array,
...@@ -65,13 +177,50 @@ export default { ...@@ -65,13 +177,50 @@ export default {
}, },
tabindex: { tabindex: {
default: 0 default: 0
},
classificationObjSelect: // 类目选择
{
type: Object,
default() {
return {}
}
},
// 平台方和导流方
financialLedgerParty:
{
type: Object,
default() {
return {}
}
} }
}, },
data() { data() {
return { return {
classificationObj: { classificationObj: {
goodsTypeGroupRelations: [] goodsTypeGroupRelations: [],
trafficSide: [],
serviceProviderSide: [],
platformPublic: [],
shop4sDeductChargeFlag: 'Y', // 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣)
partnerDeductChargeFlag: 'Y', // 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣)
goodsCostFlag: 'Y', // 平台方是否扣除产品成本(Y:计算,N:不计算)
groupType: 1,
expenseCategoryRules: []
// expenseCategoryRules: [
// {
// expenseCategoryCalculateType: "string", // 计算方式
// expenseCategoryValue: 0, // 费用类目计算值(%/元)
// targetMerchantName: 'test',
// targetMerchantId: '22',
// expenseCategoryId: 0, // 费用类目id
// expenseCategoryName: "string" // 费用类目名
// }
// ]
}, },
defaultSelectOptions: Object.freeze(defaultSelectOptions),
severSelectOptions: Object.freeze(severSelectOptions),
rules: { rules: {
goodsTypeGroupRelations: [{ required: true, message: '请选择商品', trigger: 'change' }] goodsTypeGroupRelations: [{ required: true, message: '请选择商品', trigger: 'change' }]
} }
...@@ -102,6 +251,37 @@ export default { ...@@ -102,6 +251,37 @@ export default {
} }
}) })
return list return list
},
// 已选的服务商列表
severList() {
const list = this.classificationObj.expenseCategoryRules
return list.map((item) => {
if (item.targetMerchantId) {
return {
targetMerchantType: 2,
merchantId: item.targetMerchantId,
merchantName: item.targetMerchantName
}
}
})
},
// 分账金额设置 对应的选项
tableSelectOptions() {
const info = this.financialLedgerParty
// 平台方
const platformSideobj = {
merchantId: info.realityPlatformMerchantId, // 实际分账平台方商户id(嘀加智慧云为-1)
merchantName: info.realityPlatformMerchantName,
targetMerchantType: 1
}
// 4s 店
const merchantSideobj = {
merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1)
merchantName: info.realityShopMerchantName,
targetMerchantType: 3
}
return [platformSideobj, merchantSideobj]
// this.tableSelectOptions =
} }
}, },
filters: { filters: {
...@@ -128,7 +308,21 @@ export default { ...@@ -128,7 +308,21 @@ export default {
} }
}, },
deep: true deep: true
},
classificationObjSelect: {
handler() {
this.initList()
},
deep: true,
immediate: true
} }
// financialLedgerParty: {
// handler() {
// this.changeFinancialLedgerPartySelect()
// },
// immediate: true
// }
}, },
mounted() { mounted() {
// console.log(this.test, 'test') // console.log(this.test, 'test')
...@@ -147,9 +341,36 @@ export default { ...@@ -147,9 +341,36 @@ export default {
}, },
getParams() { getParams() {
return this.classificationObj return this.classificationObj
},
initList() {
this.classificationObj.groupType = this.tabindex ? 1 : 2
const setList = this.classificationObjSelect
// const list = {}
// console.log('setList', setList)
for (const key in setList) {
// console.log('setList[key]', setList[key])
this.classificationObj[key] = []
setList[key].forEach((item) => {
const obj = {
expenseCategoryCalculateType: '', // 计算方式
expenseCategoryValue: '', // 费用类目计算值(%/元)
targetMerchantName: '2',
targetMerchantId: '1',
expenseCategoryId: item.id, // 费用类目id
expenseCategoryName: item.applicationObjectName // 费用类目名
// { applicationObjectType: 1, applicationObjectName: 'test1', id: 1 }
}
// console.log(obj, 'obj')
this.classificationObj[key].push(obj)
})
}
// console.log(list)
// this.classificationObj.expenseCategoryRules = list
// this.classificationObjSelect =
} }
// song() { // changeFinancialLedgerPartySelect() {
// return 111
// } // }
} }
} }
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</div> </div>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="平台方分账方:" <el-form-item label="平台方分账方"
prop="realityPlatformMerchantId" prop="realityPlatformMerchantId"
required> required>
<el-select v-model="financialObj.realityPlatformMerchantId" <el-select v-model="financialObj.realityPlatformMerchantId"
...@@ -89,9 +89,10 @@ ...@@ -89,9 +89,10 @@
:value="item.merchantId" /> :value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="流量方分账方:" <el-form-item label="流量方分账方"
prop="realityShopMerchantId" prop="realityShopMerchantId"
required> required>
<!-- @change="refreshData" -->
<el-select v-model="financialObj.realityShopMerchantId" <el-select v-model="financialObj.realityShopMerchantId"
placeholder=""> placeholder="">
<el-option v-for="item in baseData.merchantLevelList" <el-option v-for="item in baseData.merchantLevelList"
...@@ -119,7 +120,9 @@ ...@@ -119,7 +120,9 @@
<classificationCpt :goods-list="goodsTypeGroupRelations" <classificationCpt :goods-list="goodsTypeGroupRelations"
:ref="`classification${item.name}`" :ref="`classification${item.name}`"
:goods-select-list="goodsSelectList" :goods-select-list="goodsSelectList"
:financial-ledger-party="financialLedgerParty"
:tabindex="idx" :tabindex="idx"
:classification-obj-select="classificationObj"
@assignGoodsList="assignGoodsList" @assignGoodsList="assignGoodsList"
@deleteGoodsItem="deleteGoodsItem" /> @deleteGoodsItem="deleteGoodsItem" />
</div> </div>
...@@ -184,6 +187,11 @@ export default { ...@@ -184,6 +187,11 @@ export default {
{ goodsType: 5, goodsTypeName: '商品5' }, { goodsType: 5, goodsTypeName: '商品5' },
{ goodsType: 6, goodsTypeName: '商品6' } { goodsType: 6, goodsTypeName: '商品6' }
], ],
classificationObj: {
trafficSide: [{ applicationObjectType: 2, applicationObjectName: 'test1', id: 3 }, { applicationObjectType: 2, applicationObjectName: 'test2', id: 4 }],
serviceProvider: [{ applicationObjectType: 3, applicationObjectName: 'test1', id: 6 }, { applicationObjectType: 2, applicationObjectName: 'test2', id: 5 }],
platformPublic: [{ applicationObjectType: 1, applicationObjectName: 'test1', id: 1 }, { applicationObjectType: 2, applicationObjectName: 'test2', id: 2 }]
},
sceneList: Object.freeze(sceneList), sceneList: Object.freeze(sceneList),
// tabsList: [{ name: '全部商品分类', showIcon: false }], // tabsList: [{ name: '全部商品分类', showIcon: false }],
// tabsIndex: '1', // tabsIndex: '1',
...@@ -235,12 +243,12 @@ export default { ...@@ -235,12 +243,12 @@ export default {
}, },
expenseCategoryRules: [ expenseCategoryRules: [
{ {
expenseCategoryId: 0, // 费用类目id
expenseCategoryName: "string", // 费用类目名
expenseCategoryCalculateType: "string", // 计算方式 expenseCategoryCalculateType: "string", // 计算方式
expenseCategoryValue: 0, // 费用类目计算值(%/元) expenseCategoryValue: 0, // 费用类目计算值(%/元)
targetMerchantName: 'test',
targetMerchantId: '22', targetMerchantId: '22',
targetMerchantName: 'test' expenseCategoryId: 0, // 费用类目id
expenseCategoryName: "string" // 费用类目名
} }
] ]
} }
...@@ -292,9 +300,11 @@ export default { ...@@ -292,9 +300,11 @@ export default {
// .FinancialRules.active // .FinancialRules.active
test: (state) => state.FinancialRules.active, test: (state) => state.FinancialRules.active,
productType: (state) => state.d2admin.base.productType productType: (state) => state.d2admin.base.productType
//
}), }),
routerInfo() { routerInfo() {
// console.log(this.$route) // console.log(this.$route)
return this.$route.query.params ? JSON.parse(this.$route.query.params) : '' return this.$route.query.params ? JSON.parse(this.$route.query.params) : ''
}, },
addVisible() { addVisible() {
...@@ -308,8 +318,45 @@ export default { ...@@ -308,8 +318,45 @@ export default {
// console.log(length2 < length3) // console.log(length2 < length3)
console.log((length1 - length3) > 0 && length1 > length2) console.log((length1 - length3) > 0 && length1 > length2)
return (length1 - length3) > 0 && length1 > length2 return (length1 - length3) > 0 && length1 > length2
},
//
financialLedgerParty() {
const { realityPlatformMerchantId, realityPlatformMerchantName, realityShopMerchantId, realityShopMerchantName } = this.financialObj
return {
realityPlatformMerchantId, // 实际分账平台方商户id(嘀加智慧云为-1)
realityPlatformMerchantName, // 实际分账平台方商户名称
realityShopMerchantId,
realityShopMerchantName
}
} }
}, },
watch: {
'financialObj.realityShopMerchantId': {
handler(val) {
// this.financialObj.realityShopMerchantId
const obj = this.baseData.merchantLevelList.find(item => item.merchantId == val)
const shop = {
realityShopMerchantId: obj.merchantId,
realityShopMerchantName: obj.merchantName,
realityShopUserType: obj.userType
}
this.financialObj = Object.assign(this.financialObj, shop)
}
},
'financialObj.PlatformLevelList': {
handler(val) {
// this.financialObj.realityShopMerchantId
const obj = this.baseData.PlatformLevelList.find(item => item.merchantId == val)
const Platform = {
realityPlatformMerchantId: obj.merchantId,
realityPlatformMerchantName: obj.merchantName,
realityPlatformUserType: obj.userType
}
this.financialObj = Object.assign(this.financialObj, Platform)
}
}
},
mounted() { mounted() {
// console.log(this.$route.query.params) // console.log(this.$route.query.params)
// console.log(JSON.parse(this.$route.query.params)) // console.log(JSON.parse(this.$route.query.params))
...@@ -490,6 +537,10 @@ export default { ...@@ -490,6 +537,10 @@ export default {
} }
return arr return arr
}, []) }, [])
},
refreshData() {
// el-select 强制刷新
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!