Commit 081efa6e by 前端

Merge branch 'SAAS+V4.50.0-0311' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.50.0-0311
2 parents 7cb51251 25b33c15
......@@ -74,19 +74,19 @@
>
<el-form-item label="分账品类">
{{
financialObj.goodsTypeGroupRules[editableTabsValue]
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.categoryType || "--"
}}</el-form-item
>
<el-form-item label="">
{{
financialObj.goodsTypeGroupRules[editableTabsValue]
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.packageArrText
}}</el-form-item
>
<template
v-for="(item, index) in financialObj.goodsTypeGroupRules[
editableTabsValue
editableTabsValue - 1
].expenseCategoryRules"
>
<el-form-item :key="index" :label="item.expenseCategoryName">
......@@ -103,7 +103,7 @@
<tableAccount
ref="tableAccount"
:merchant-distribution-rules="
financialObj.goodsTypeGroupRules[editableTabsValue]
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.merchantDistributionRules
"
:table-select-options="tableSelectOptions"
......@@ -145,7 +145,7 @@ export default {
computed: {
tableClassificationObjSelect() {
const filterObj = deepClone(
this.financialObj.goodsTypeGroupRules[this.editableTabsValue]
this.financialObj.goodsTypeGroupRules[this.editableTabsValue - 1]
.expenseCategoryRules
)
const obj = {
......@@ -177,12 +177,18 @@ export default {
merchantName: info.realityPlatformMerchantName,
targetMerchantType: 1
}
// 4s 店
// 流量方
const merchantSideobj = {
merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1)
merchantName: info.realityShopMerchantName,
targetMerchantType: 3
}
//服务商
const serviceObj = {
merchantId: info.partnerMerchantId,
merchantName: info.partnerMerchantName,
targetMerchantType: 2
}
// // 如果勾选商户 就追加进去
// if (info.djzhySubMerchantId) {
// const dizhySubMerchantObj = {
......@@ -197,10 +203,9 @@ export default {
// merchantSideobj
// ]
// }
return [platformSideobj, merchantSideobj]
return [platformSideobj, merchantSideobj, serviceObj]
}
},
}
},
watch: {
divisiObj: {
......@@ -315,7 +320,6 @@ export default {
)
})
this.initSettleTimeObj()
console.log(this.financialObj, 555555555)
},
initSettleTimeObj() {
const { settleTimeType, settleTime } = this.financialObj
......
......@@ -17,23 +17,24 @@
<el-form label-suffix=":" label-width="154px">
<el-form-item label="分账品类">
{{
financialObj[editableTabsValue].categoryType || "--"
financialObj[editableTabsValue-1].categoryType || "--"
}}</el-form-item
>
<el-form-item label="">
{{
financialObj[editableTabsValue].packageArrText
financialObj[editableTabsValue-1].packageArrText
}}</el-form-item
>
<template
v-for="(item, index) in financialObj[editableTabsValue]
v-for="(item, index) in financialObj[editableTabsValue-1]
.expenseCategoryTypeRules"
>
<el-form-item :key="index" :label="item.expenseCategoryName">
<span>{{
getExpenseCategoryCalculateType(
item.expenseCategoryCalculateType,
item.expenseCategoryValue
item.expenseCategoryValue,
item.expenseCategoryName
)
}}</span>
</el-form-item>
......@@ -76,11 +77,11 @@ export default {
}
},
methods: {
getExpenseCategoryCalculateType(value, num) {
getExpenseCategoryCalculateType(value, num,name) {
if (!value || num == null) {
return "-"
}
// console.log('num: ', num)
let res
switch (value) {
case 1:
......@@ -193,7 +194,6 @@ export default {
})
this.$set(item, "expenseCategoryTypeRules", item.expenseCategoryTypeRules)
})
console.log(this.financialObj,76666)
}
}
}
......
......@@ -187,7 +187,7 @@ export default {
},
data() {
return {
submitParams:'',
submitParams: "",
verificationCodeVisible: false,
merchantTestVisible: false,
rulesTestParams: {},
......@@ -223,7 +223,9 @@ export default {
djzhySubMerchantId: "",
djzhySubMerchantName: "",
multiPlatformMerchantFlag: "N", // 是否多平台
goodsTypeGroupRules: []
goodsTypeGroupRules: [],
partnerMerchantId: "",
partnerMerchantName: ""
},
// 结算周期
settleTimeObj: {
......@@ -244,7 +246,6 @@ export default {
},
// merchantId: '44211227',
// yqMerchantId: '44209389',
rules: {
realityPlatformMerchantId: [
{ required: true, message: "请选择平台方", trigger: "change" }
......@@ -399,7 +400,9 @@ export default {
realityShopMerchantId,
realityShopMerchantName,
djzhySubMerchantId,
djzhySubMerchantName
djzhySubMerchantName,
partnerMerchantId,
partnerMerchantName
} = this.financialObj
return {
realityPlatformMerchantId, // 实际分账平台方商户id(嘀加智慧云为-1)
......@@ -407,7 +410,9 @@ export default {
realityShopMerchantId,
realityShopMerchantName,
djzhySubMerchantName,
djzhySubMerchantId
djzhySubMerchantId,
partnerMerchantId,
partnerMerchantName
}
}
},
......@@ -448,16 +453,10 @@ export default {
handler(val) {
console.log(val, "financialObj.multiPlatformMerchantFlag")
if (val == "Y") {
// const { djzhySubMerchantId, djzhySubMerchantName } = this.DjzhySubMerchantObj
// console.log(djzhySubMerchantId, djzhySubMerchantName, 'djzhySubMerchantId')
this.financialObj = Object.assign(
this.financialObj,
this.DjzhySubMerchantObj
)
// this.$forceUpdate()
// this.financialObj.djzhySubMerchantId = djzhySubMerchantId
// this.financialObj.djzhySubMerchantName = djzhySubMerchantName
console.log(this.financialObj, "this.financialObj")
} else {
this.financialObj.djzhySubMerchantId = ""
this.financialObj.djzhySubMerchantName = ""
......@@ -478,27 +477,44 @@ export default {
// this.getFinancialObj()
// this.init4sServiceList()
this.initFeeCategoryByType()
this.getGoodsCategoryConfiguration() //商品分类
this.getGoodsCategoryConfiguration() // 商品分类
const { merchantId, scene } = this.routerInfo
// yqMerchant && this.getMerchantLevel(yqMerchant.merchantId, 'PlatformLevelList')
// this.initPlatformLevelList()
// this.getFinancialObj()
// let eventArr = [this.init4sServiceList(), this.getFinancialObj()]
let eventArr = [this.getFinancialObj()]
if (merchantId) eventArr.push(this.getMerchantLevel(merchantId, "merchantLevelList", scene))
const eventArr = [this.getFinancialObj()]
if (merchantId) {
eventArr.push(
this.getMerchantLevel(merchantId, "merchantLevelList", scene)
)
}
Promise.all(eventArr).then(() => {
this.checkSelectEmpty()
})
//平台方
this.$EventBus.$on('shelfUpdateConstractMer',(obj)=>{
this.financialObj.realityPlatformMerchantId=obj.merchantId
this.financialObj.realityPlatformMerchantName=obj.merchantName
this.$EventBus.$on("packageInfoList", (obj) => {
console.log(obj)
this.getSelectingListPackage([], obj)
})
//服务商
this.$EventBus.$on('shelfUpdateParMer', (obj)=>{
// 平台方
this.$EventBus.$on("shelfUpdateConstractMer", (obj) => {
this.$set(this.financialObj, "realityPlatformMerchantId", obj.merchantId)
this.$set(
this.financialObj,
"realityPlatformMerchantName",
obj.merchantName
)
// this.financialObj.realityPlatformMerchantId = obj.merchantId
// this.financialObj.realityPlatformMerchantName = obj.merchantName
})
// 服务商
this.$EventBus.$on("shelfUpdateParMer", (obj) => {
console.log(obj, "this.$set")
this.$set(this.financialObj, "partnerMerchantId", obj.merchantId)
this.$set(this.financialObj, "partnerMerchantName", obj.merchantName)
// this.financialObj.partnerMerchantId = obj.merchantId
// this.financialObj.partnerMerchantName = obj.merchantName
})
},
methods: {
......@@ -531,7 +547,7 @@ export default {
const { settleTimeType, settleTime } = this.financialObj
this.settleTimeObj[settleTimeType == 1 ? "first" : "second"] = settleTime
},
//按商品分类
// 按商品分类
getGoodsCategoryConfiguration() {
getGoodsCategoryConfiguration({}).then((result) => {
const { list } = result
......@@ -586,7 +602,6 @@ export default {
if (arrIdx.includes(obj.id)) {
prev.trafficSide.push(obj)
}
} else if (applicationObjectType == 2) {
if (obj.id == 2) {
prev.trafficSide.push(obj)
......@@ -625,25 +640,17 @@ export default {
})
},
getFinancialObj() {
console.log(666666)
return new Promise((resolve) => {
const { id } = this.routerInfo
merchantSettleDistributeRuleLastRule({
id: 1
})
.then((result) => {
// 判空处理
// result.goodsTypeGroupRules = [...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules]
const goodsTypeGroupRules =
result?.merchantSettleDistributeRule.goodsTypeGroupRules
const createBusinessApproveMerchant =
result?.createBusinessApproveMerchant
result = result?.merchantSettleDistributeRule || this.financialObj
// result.autoFlag = null
// result.settleTimeType = null
// 解决老财务规则只做了一部分的问题 就不取老的了
// 处理 autoFlag 为空的兼容问题
// console.log(result.autoFlag)
// debugger
result.autoFlag = result.autoFlag ? result.autoFlag : "N"
result.settleTimeType = result.settleTimeType
? result.settleTimeType
......@@ -651,6 +658,10 @@ export default {
result && result.divisionRuleId && (this.financialObj = result)
result.multiPlatformMerchantFlag =
result.multiPlatformMerchantFlag || "N"
result.partnerMerchantName =
createBusinessApproveMerchant.partnerMerchantName
result.partnerMerchantId =
createBusinessApproveMerchant.partnerMerchantId
const autoFlag = result?.autoFlag == "Y"
// 隐藏固定周期分账 处理历史数据
if (result?.settleTimeType == 2) result.settleTimeType = 1
......@@ -658,7 +669,7 @@ export default {
const upgradeArr = []
const packageArr = []
goodsTypeGroupRules &&
goodsTypeGroupRules.forEach((item, index) => {
this.editableTabs[index] = {
......@@ -715,7 +726,7 @@ export default {
})
// 获取商品
this.getSelectingList(upgradeArr)
this.getSelectingListPackage(packageArr)
// this.getSelectingListPackage(packageArr)
this.initSettleTimeObj()
resolve()
})
......@@ -870,7 +881,7 @@ export default {
)
if (!this.checkParamsType(res, goodsTypeGroupRules)) {
this.$message.warning("请完善分账规则")
return false
return false
}
try {
this.submitParams = {
......@@ -1253,33 +1264,40 @@ export default {
)
},
// 或者商品套餐
getSelectingListPackage(defaultSelect = []) {
merchantPackageGoodsInfoPage({
// goodsNameKeyword: this.goodsNameKeyword,
currentPage: 1,
pageSize: 20,
status: 1,
sceneType: this.routerInfo.scene,
merchantIdList: [this.routerInfo.merchantId]
getSelectingListPackage(defaultSelect = [], packageArr = []) {
packageArr = packageArr.map((item) => {
item.packageCode = item.packageCode || item.timeId
item.packageName = item.packageName || item.val1
return item
})
.then((res) => {
console.log(res, "merchantPackageGoodsInfoPage")
// this.allPages = res.pages
const resArr = []
res.list &&
res.list.forEach((val) => {
resArr.push({
packageCode: val.packageCode,
packageName: val.packageName
})
})
// console.log(resArr, 'resArr')
let arr = this.packageGoodsList.concat(resArr)
// console.log(arr, 'arr')
if (defaultSelect?.length) arr = arr.concat(defaultSelect)
this.packageGoodsList = this.uniquePackage(arr)
})
.catch(() => {})
console.log(packageArr, "packageArr")
this.packageGoodsList = this.uniquePackage(packageArr)
// merchantPackageGoodsInfoPage({
// // goodsNameKeyword: this.goodsNameKeyword,
// currentPage: 1,
// pageSize: 20,
// status: 1,
// sceneType: this.routerInfo.scene,
// merchantIdList: [this.routerInfo.merchantId]
// })
// .then((res) => {
// console.log(res, "merchantPackageGoodsInfoPage")
// // this.allPages = res.pages
// const resArr = []
// res.list &&
// res.list.forEach((val) => {
// resArr.push({
// packageCode: val.packageCode,
// packageName: val.packageName
// })
// })
// // console.log(resArr, 'resArr')
// // console.log(arr, 'arr')
// let arr = this.packageGoodsList.concat(resArr)
// if (defaultSelect?.length) arr = arr.concat(defaultSelect)
// this.packageGoodsList = this.uniquePackage(arr)
// })
// .catch(() => {})
},
uniquePackage(arr) {
......@@ -1351,7 +1369,6 @@ export default {
scene
})
.then((res) => {
const attrToVal = deepClone(attrToValOptions)
if (name == "PlatformLevelList") {
delete attrToVal[2]
......@@ -1600,7 +1617,7 @@ export default {
console.log(upgradeArr, "upgradeArr")
// 获取商品
this.getSelectingList(upgradeArr)
this.getSelectingListPackage(packageArr)
// this.getSelectingListPackage(packageArr)
// this.$forceUpdate()
this.$message({
type: "success",
......
......@@ -94,6 +94,8 @@
:prop="classificationObj.categoryType == 3 ? 'packageGoods' : 'empty'"
label-width="20px"
>
<!-- @visible-change="visibleChangePackage" :remote-method="remoteMethodPackage"
v-el-select-loadmore-package="interestsLoadmorePackage" -->
<el-select
v-model="classificationObj.packageGoods"
multiple
......@@ -101,9 +103,6 @@
remote
reserve-keyword
placeholder="请选择套餐商品"
@visible-change="visibleChangePackage"
:remote-method="remoteMethodPackage"
v-el-select-loadmore-package="interestsLoadmorePackage"
style="width: 370px"
value-key="packageCode"
filterable
......@@ -445,6 +444,7 @@ export default {
const list = this.goodsSelectList.filter((item) => {
// item.goodsType
// const flag = selectList.findIndex(el => { return el.goodsType == item.goodsType })
console.log(selectList, "selectList")
if (
selectList.findIndex((el) => {
return el.goodsType == item.goodsType
......@@ -488,7 +488,6 @@ export default {
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: {
get() {
console.log(this.financialLedgerParty, "this.financialLedgerParty")
const info = this.financialLedgerParty
// 平台方
const platformSideobj = {
......@@ -496,12 +495,18 @@ export default {
merchantName: info.realityPlatformMerchantName,
targetMerchantType: 1
}
// 4s 店
// 流量方
const merchantSideobj = {
merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1)
merchantName: info.realityShopMerchantName,
targetMerchantType: 3
}
//服务商
const serviceObj = {
merchantId: info.partnerMerchantId,
merchantName: info.partnerMerchantName,
targetMerchantType: 2
}
// 如果勾选商户 就追加进去
if (info.djzhySubMerchantId) {
const dizhySubMerchantObj = {
......@@ -512,13 +517,11 @@ export default {
return [
platformSideobj,
dizhySubMerchantObj,
...this.serviceSelectList,
merchantSideobj
merchantSideobj,
serviceObj
]
}
return info.realityShopMerchantId
? [platformSideobj, ...this.serviceSelectList, merchantSideobj]
: [platformSideobj, ...this.serviceSelectList]
return [platformSideobj, merchantSideobj, serviceObj]
}
},
tableClassificationObjSelect() {
......@@ -533,7 +536,6 @@ export default {
obj[key] = []
}
filterObj[key].map((item) => {
if (item.formType == 2) {
obj[key].push(...item.feeCategoryNameList)
} else {
......@@ -661,6 +663,8 @@ export default {
handler(val, oldVal) {
if (val) {
this.copyPackageGoodsList = deepClone(val)
// 然后对比一下当前选择的套件是否还在队列,不在就删除
this.diffPackageGoodsList()
}
},
deep: true
......@@ -748,6 +752,27 @@ export default {
methods: {
...mapMutations("FinancialRules", ["setGoodsSource", "delGoodsSource"]),
diffPackageGoodsList() {
// copyPackageGoodsList 如果有变动,对比一下当前选择的套件是否还在队列,不在就删除
// 找到需要删除的对象
const deleteObj = this.classificationObj.packageGoods.find((item) => {
return this.copyPackageGoodsList.every(
(el) => el.packageCode != item.packageCode
)
})
// 如果找到需要删除的对象
if (deleteObj) {
this.$emit("deletePackageGoodsItem", deleteObj)
// 直接过滤掉删除的对象
this.classificationObj.packageGoods =
this.classificationObj.packageGoods.filter(
(item) => item.packageCode !== deleteObj.packageCode
)
}
console.log(deleteObj, "deleteObj")
},
clearValidate() {
this.$refs.classification.clearValidate([
"goodsTypes",
......
......@@ -77,8 +77,13 @@ export default {
merchantSettleDistributeRuleLastRule({
id: 1
}).then((result) => {
this.divisiObj = result.merchantSettleDistributeRule
this.divisiObj = Object.assign(result.merchantSettleDistributeRule,{
partnerMerchantName:result.createBusinessApproveMerchant.partnerMerchantName,
partnerMerchantId:result.createBusinessApproveMerchant.partnerMerchantId
})
this.financialObj = result.merchantReconciliationRule
})
},
handleBack() {
......
......@@ -47,18 +47,16 @@
</template>
<script>
import { mapActions } from 'vuex'
import BaseInfo from './components/editCon/BaseInfo.vue'
import ShopMerchantInfo from './components/editCon/ShopMerchantInfo'
import AddMerchant from './components/editCon/AddMerchant'
import GoodsInfo from './components/editCon/GoodsInfo.vue'
import DivisionConfig from './components/editCon/DivisionConfig.vue'
import FinanceConfig from './components/editCon/FinanceConfig.vue'
import {
getBusisDetailBasic
} from "@api/shelfManage"
import { mapActions } from "vuex"
import BaseInfo from "./components/editCon/BaseInfo.vue"
import ShopMerchantInfo from "./components/editCon/ShopMerchantInfo"
import AddMerchant from "./components/editCon/AddMerchant"
import GoodsInfo from "./components/editCon/GoodsInfo.vue"
import DivisionConfig from "./components/editCon/DivisionConfig.vue"
import FinanceConfig from "./components/editCon/FinanceConfig.vue"
import { getBusisDetailBasic } from "@api/shelfManage"
export default {
name: 'EditContract',
name: "EditContract",
data() {
return {
routeObj: {},
......@@ -88,30 +86,36 @@ export default {
// 方法集合
methods: {
...mapActions({
close: 'd2admin/page/close'
close: "d2admin/page/close"
}),
getBasicDetail() {
getBusisDetailBasic({ id: this.routeObj.id }).then(res => {
console.log(res, 'res----')
this.basicInfo = res.basicInfo || {}
this.merchantEditData = res.createBusinessApproveMerchant || {}
}).finally(() => {
this.isLoad = false
})
getBusisDetailBasic({ id: this.routeObj.id })
.then((res) => {
console.log(res, "res----")
this.basicInfo = res.basicInfo || {}
this.merchantEditData = res.createBusinessApproveMerchant || {}
})
.finally(() => {
this.isLoad = false
})
},
handleAddMerchant() {
console.log('新建---')
console.log("新建---")
this.addMerVisible = !this.addMerVisible
},
handleConfirm(confirmType) {
if (confirmType == 'save') {
if (confirmType == "save") {
// 各模块校验
if (!this.$refs.shopMerchant.submit() || !this.$refs.divisionConfig.submit() || !this.$refs.financeConfig.submit()) {
if (
!this.$refs.shopMerchant.submit() ||
!this.$refs.divisionConfig.submit() ||
!this.$refs.financeConfig.submit()
) {
return true
}
}
var params = {
saveDraft: confirmType == 'draft',
saveDraft: confirmType == "draft",
businessCode: this.routeObj.businessCode,
merchant: this.$refs.editData,
settleDistributeRule: this.$refs.divisionConfig.submitParams,
......@@ -119,9 +123,9 @@ export default {
}
},
handleCancel() {
this.close({ tagName: '/shelfManage' })
this.$router.push({ name: 'shelfManage' })
this.close({ tagName: '/editContract' })
this.close({ tagName: "/shelfManage" })
this.$router.push({ name: "shelfManage" })
this.close({ tagName: "/editContract" })
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!