Commit dfd6ec10 by 张立顺

fix bug修复

1 parent 65c50740
...@@ -1001,9 +1001,8 @@ export default { ...@@ -1001,9 +1001,8 @@ export default {
getAllGoodsList({ getAllGoodsList({
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
merchantIdList: [this.financialObj.realityShopMerchantId],
statusList: [1], statusList: [1],
sceneTypeList: [0], sceneTypeList: [0]
}) })
.then((res) => { .then((res) => {
this.allPages = res.pages this.allPages = res.pages
...@@ -1309,10 +1308,10 @@ export default { ...@@ -1309,10 +1308,10 @@ export default {
const upgradeArr = [] const upgradeArr = []
const packageArr = [] const packageArr = []
this.editableTabs = [] this.editableTabs = []
// console.log(goodsTypeGroupRules, "goodsTypeGroupRules") console.log(goodsTypeGroupRules, "goodsTypeGroupRules")
const childParams = goodsTypeGroupRules.splice(tabIndex, 1) const childParams = goodsTypeGroupRules.splice(tabIndex, 1)
// debugger
// console.log(goodsTypeGroupRules, this.financialObj, "goodsTypeGroupRules") console.log(goodsTypeGroupRules, this.financialObj, "goodsTypeGroupRules")
// console.log(childParams, "packageArr") // console.log(childParams, "packageArr")
// return // return
this.$nextTick(() => { this.$nextTick(() => {
...@@ -1361,14 +1360,14 @@ export default { ...@@ -1361,14 +1360,14 @@ export default {
item.packageGoods = [] item.packageGoods = []
} }
// 按套餐商品 // 按套餐商品
// console.log(item.goodsTypes, 'item.goodsTypes') console.log(item, item.goodsTypes, 'item.goodsTypes')
if ( if (
item.goodsTypes?.length && item.goodsTypeGroupRelations?.length &&
item.goodsTypes[0]?.categoryType == 3 item.goodsTypeGroupRelations[0]?.categoryType == 3
) { ) {
item.packageGoods = deepClone(item.goodsTypes) item.packageGoods = deepClone(item.goodsTypeGroupRelations)
item.categoryType = 3 item.categoryType = 3
item.goodsTypes?.forEach((val) => { item.goodsTypeGroupRelations?.forEach((val) => {
packageArr.push({ packageArr.push({
packageCode: val.packageCode, packageCode: val.packageCode,
packageName: val.packageName packageName: val.packageName
...@@ -1380,10 +1379,11 @@ export default { ...@@ -1380,10 +1379,11 @@ export default {
} }
}) })
console.log(upgradeArr, "upgradeArr") console.log(upgradeArr, "upgradeArr")
console.log(packageArr, "upgradeArr")
// 获取商品 // 获取商品
this.getSelectingList(upgradeArr) this.getSelectingList(upgradeArr)
this.getSelectingListPackage(packageArr) this.getSelectingListPackage(packageArr)
this.$forceUpdate() // this.$forceUpdate()
this.$message({ this.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
@deletePackageGoodsItem="deletePackageGoodsItem" @deletePackageGoodsItem="deletePackageGoodsItem"
@deleteSelectUpgradeGoodsList="deleteSelectUpgradeGoodsList" @deleteSelectUpgradeGoodsList="deleteSelectUpgradeGoodsList"
@deleteSelectPackageGoodsList="deleteSelectPackageGoodsList" @deleteSelectPackageGoodsList="deleteSelectPackageGoodsList"
@deleteSelectGoodsTypeList="deleteSelectGoodsTypeList" /> @deleteSelectGoodsTypeList="deleteSelectGoodsTypeList" :ruleInfo="ruleInfo" />
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -71,12 +71,7 @@ export default { ...@@ -71,12 +71,7 @@ export default {
currentIndex: 1, currentIndex: 1,
addIndex: 1, addIndex: 1,
tabIndex: 1, tabIndex: 1,
editableTabs: [ editableTabs: [],
// {
// title: "全部分类",
// name: "1"
// }
],
errorIndex: -1, errorIndex: -1,
goodsSelectList: [], goodsSelectList: [],
goodsTypeGroupRelations: [], goodsTypeGroupRelations: [],
...@@ -93,7 +88,8 @@ export default { ...@@ -93,7 +88,8 @@ export default {
selectUpgradeGoodsList: [], selectUpgradeGoodsList: [],
upgradeGoodsList: [], upgradeGoodsList: [],
selectPackageGoodsList: [], selectPackageGoodsList: [],
packageGoodsList: [] packageGoodsList: [],
ruleInfo: {}
} }
}, },
computed: { computed: {
...@@ -118,6 +114,13 @@ export default { ...@@ -118,6 +114,13 @@ export default {
// if(JSON.stringify(obj)== this.set) // if(JSON.stringify(obj)== this.set)
this.getSelectingListPackage([], obj) this.getSelectingListPackage([], obj)
}) })
this.$EventBus.$on("shelfUpdatMerchantId", (obj) => {
if (this.ruleInfo?.createBusinessApproveMerchant) {
this.ruleInfo.createBusinessApproveMerchant.merchantId = obj.merchantId
this.ruleInfo.createBusinessApproveMerchant.merchantName = obj.merchantName
this.getSelectingListPackage()
}
})
this.getGoodsCategoryConfiguration() this.getGoodsCategoryConfiguration()
setTimeout(() => { setTimeout(() => {
this.getEffectRule() // 获取对账规则 this.getEffectRule() // 获取对账规则
...@@ -233,7 +236,9 @@ export default { ...@@ -233,7 +236,9 @@ export default {
getSelectingList(defaultSelect) { getSelectingList(defaultSelect) {
getAllGoodsList({ getAllGoodsList({
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize,
statusList: [1],
sceneTypeList: [0]
}) })
.then((res) => { .then((res) => {
this.allPages = res.pages this.allPages = res.pages
...@@ -264,7 +269,7 @@ export default { ...@@ -264,7 +269,7 @@ export default {
) )
}, },
// 或者商品套餐 // 或者商品套餐
getSelectingListPackage(defaultSelect = [], packageArr) { getSelectingListPackage(defaultSelect = [], packageArr = []) {
packageArr = packageArr.map((item) => { packageArr = packageArr.map((item) => {
// item.packageCode = item.id // item.packageCode = item.id
// item.packageName = item.name // item.packageName = item.name
...@@ -276,14 +281,15 @@ export default { ...@@ -276,14 +281,15 @@ export default {
}) })
// console.log(packageArr, "packageArr") // console.log(packageArr, "packageArr")
this.packageGoodsList = this.uniquePackage(packageArr) this.packageGoodsList = this.uniquePackage(packageArr)
merchantPackageGoodsInfoPage({ this.ruleInfo?.createBusinessApproveMerchant && merchantPackageGoodsInfoPage({
// goodsNameKeyword: this.goodsNameKeyword, // goodsNameKeyword: this.goodsNameKeyword,
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
status: 1, status: 1,
// sceneType: this.routerInfo.scene, // sceneType: this.routerInfo.scene,
sceneType: 0, // 固定查权益类的 sceneType: 0, // 固定查权益类的
merchantIdList: [this.routerInfo.merchantId] // merchantIdList: [this.routerInfo.merchantId]
merchantIdList: [this.ruleInfo.createBusinessApproveMerchant.merchantId]
}) })
.then((res) => { .then((res) => {
// this.allPages = res.pages // this.allPages = res.pages
...@@ -423,7 +429,6 @@ export default { ...@@ -423,7 +429,6 @@ export default {
} }
const goodsTypeGroupRules = this.getClassificationCptFormData() const goodsTypeGroupRules = this.getClassificationCptFormData()
// debugger
if (activeName === targetName) { if (activeName === targetName) {
tabs.forEach((tab, index) => { tabs.forEach((tab, index) => {
if (tab.name === targetName) { if (tab.name === targetName) {
...@@ -520,7 +525,7 @@ export default { ...@@ -520,7 +525,7 @@ export default {
} }
}) })
this.getSelectingList(upgradeArr) this.getSelectingList(upgradeArr)
// this.getSelectingListPackage(packageArr) this.getSelectingListPackage(packageArr)
// this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow) // this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow)
this.$message({ this.$message({
type: "success", type: "success",
...@@ -611,6 +616,8 @@ export default { ...@@ -611,6 +616,8 @@ export default {
const res = await merchantSettleDistributeRuleLastRule(params) const res = await merchantSettleDistributeRuleLastRule(params)
console.log(res, "getEffectRule") console.log(res, "getEffectRule")
if (res) { if (res) {
// debugger
this.ruleInfo = res
const typeList = const typeList =
res?.merchantReconciliationRule.goodsTypeGroupReconciliationRules res?.merchantReconciliationRule.goodsTypeGroupReconciliationRules
...@@ -677,10 +684,10 @@ export default { ...@@ -677,10 +684,10 @@ export default {
} }
}) })
this.getSelectingList(upgradeArr) this.getSelectingList(upgradeArr)
// this.getSelectingListPackage(packageArr) this.getSelectingListPackage(packageArr)
} else { } else {
this.getSelectingList() this.getSelectingList()
// this.getSelectingListPackage() this.getSelectingListPackage()
} }
}, },
checkParamsType(array) { checkParamsType(array) {
...@@ -815,7 +822,8 @@ export default { ...@@ -815,7 +822,8 @@ export default {
} }
}, },
beforeDestroy() { beforeDestroy() {
this.$EventBus.$off("packageInfoList", this.handlePackageInfoList) this.$EventBus.$off("packageInfoList")
this.$EventBus.$off("shelfUpdatMerchantId")
// 删除子组件保留的数据 // 删除子组件保留的数据
localStorage.removeItem("getListPartnerMerchant") localStorage.removeItem("getListPartnerMerchant")
......
...@@ -43,8 +43,7 @@ ...@@ -43,8 +43,7 @@
:prop="classificationObj.categoryType == 3 ? 'packageGoods' : 'empty'" label-width="20px"> :prop="classificationObj.categoryType == 3 ? 'packageGoods' : 'empty'" label-width="20px">
<!-- --> <!-- -->
<el-select v-model="classificationObj.packageGoods" multiple collapse-tags remote reserve-keyword <el-select v-model="classificationObj.packageGoods" multiple collapse-tags remote reserve-keyword
@change="upgradeGoodsChange" @change="upgradeGoodsChange" @visible-change="visibleChangePackage" :remote-method="remoteMethodPackage"
@visible-change="visibleChangePackage" :remote-method="remoteMethodPackage"
v-el-select-loadmore-package="interestsLoadmorePackage" placeholder="请选择套餐商品" style="width: 370px" v-el-select-loadmore-package="interestsLoadmorePackage" placeholder="请选择套餐商品" style="width: 370px"
value-key="packageCode" filterable> value-key="packageCode" filterable>
<el-option v-for="subItem in copyPackageGoodsList" :key="subItem.packageCode" <el-option v-for="subItem in copyPackageGoodsList" :key="subItem.packageCode"
...@@ -516,9 +515,6 @@ export default { ...@@ -516,9 +515,6 @@ export default {
watch: { watch: {
"classificationObj.goodsSource": { "classificationObj.goodsSource": {
handler(newVal, oldVal) { handler(newVal, oldVal) {
// this.initList()
// tabindex
// this.set
this.setGoodsSource({ this.setGoodsSource({
goodsSource: newVal, goodsSource: newVal,
tabIndex: this.tabindex tabIndex: this.tabindex
...@@ -619,8 +615,7 @@ export default { ...@@ -619,8 +615,7 @@ export default {
}, },
classificationObjSelect: { classificationObjSelect: {
handler(val) { handler(val) {
// console.log(val, "🚀") this.initList('classificationObjSelect')
this.initList()
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -716,10 +711,10 @@ export default { ...@@ -716,10 +711,10 @@ export default {
}, },
upgradeGoodsChange(val) { upgradeGoodsChange(val) {
this.$refs.classification.clearValidate([ this.$refs.classification.clearValidate([
"goodsTypes", "goodsTypes",
"upgradeGoods", "upgradeGoods",
"packageGoods" "packageGoods"
]); ]);
}, },
visibleChange(data) { visibleChange(data) {
// 获取焦点重新渲染下拉框数据 // 获取焦点重新渲染下拉框数据
...@@ -770,7 +765,7 @@ export default { ...@@ -770,7 +765,7 @@ export default {
// goodsNameKeyword: this.goodsNameKeyword, // goodsNameKeyword: this.goodsNameKeyword,
// upgradeGoodsNameOrCCode: this.goodsNameKeyword, // upgradeGoodsNameOrCCode: this.goodsNameKeyword,
goodsNameKeyword: this.goodsNameKeyword, goodsNameKeyword: this.goodsNameKeyword,
merchantIdList: [this.financialLedgerParty.realityShopMerchantId], // merchantIdList: [this.financialLedgerParty.realityShopMerchantId],
statusList: [1], statusList: [1],
sceneTypeList: [0], sceneTypeList: [0],
currentPage: this.currentPage, currentPage: this.currentPage,
...@@ -827,7 +822,6 @@ export default { ...@@ -827,7 +822,6 @@ export default {
let arr = this.copyPackageGoodsList.concat(resArr) let arr = this.copyPackageGoodsList.concat(resArr)
if (defaultSelect?.length) arr = arr.concat(defaultSelect) if (defaultSelect?.length) arr = arr.concat(defaultSelect)
this.copyPackageGoodsList = this.uniquePackage(arr) this.copyPackageGoodsList = this.uniquePackage(arr)
// this.copyPackageGoodsList = arr
}) })
.catch(() => { }) .catch(() => { })
}, },
...@@ -999,22 +993,18 @@ export default { ...@@ -999,22 +993,18 @@ export default {
this.$refs["tableAccount"]?.$refs["divisionRuleRef"].clearValidate() this.$refs["tableAccount"]?.$refs["divisionRuleRef"].clearValidate()
}) })
}, },
initList() { initList(name) {
this.classificationObj.groupType = this.tabindex ? 1 : 2 this.classificationObj.groupType = this.tabindex ? 1 : 2
const expenseCategoryRules = const expenseCategoryRules =
deepClone(this.goodsTypeGroupRules.expenseCategoryRules) || [] deepClone(this.goodsTypeGroupRules.expenseCategoryRules) || []
// console.log('expenseCategoryRules', expenseCategoryRules)
const setList = this.classificationObjSelect const setList = this.classificationObjSelect
// const list = {}
// console.log("setList", this.classificationObjSelect)
// 初始化类目 // 初始化类目
for (const key in setList) { for (const key in setList) {
// console.log('setList[key]', setList[key]) // console.log('setList[key]', setList[key])
// console.log('key', key) // console.log('key', key)
this.classificationObj[key] = [] this.classificationObj[key] = []
setList[key].forEach((item) => { setList[key].forEach((item) => {
// debugger
// console.log(setList[key])
const editObj = const editObj =
expenseCategoryRules.find( expenseCategoryRules.find(
(el) => el.expenseCategoryId == item.expenseCategoryId (el) => el.expenseCategoryId == item.expenseCategoryId
...@@ -1063,7 +1053,6 @@ export default { ...@@ -1063,7 +1053,6 @@ export default {
obj.targetMerchantType = 2 obj.targetMerchantType = 2
} }
// 是多子类目 // 是多子类目
// if (item.formType == 2) {
if (item.nodeType == 2) { if (item.nodeType == 2) {
// console.log(item.feeCategoryNameList, 'item.feeCategoryNameList') // console.log(item.feeCategoryNameList, 'item.feeCategoryNameList')
// 解决子选项问题 // 解决子选项问题
...@@ -1158,14 +1147,12 @@ export default { ...@@ -1158,14 +1147,12 @@ export default {
this.classificationObj.packageGoods = "" this.classificationObj.packageGoods = ""
this.classificationObj.categoryType = "" this.classificationObj.categoryType = ""
keyNameList.forEach((item) => { keyNameList.forEach((item) => {
this.goodsTypeGroupRules[item] && if (this.goodsTypeGroupRules[item]) {
(this.classificationObj[item] = this.goodsTypeGroupRules[item]) this.classificationObj[item] = this.goodsTypeGroupRules[item]
}
}) })
// console.log(this.classificationObj)
this.classificationObj = deepClone(this.classificationObj) this.classificationObj = deepClone(this.classificationObj)
// console.log(list)
this.handleSelectChange() this.handleSelectChange()
// this.classificationObj.expenseCategoryRules = list
}, },
filterEmpty(data) { filterEmpty(data) {
return (data ?? "") === "" return (data ?? "") === ""
...@@ -1335,8 +1322,6 @@ export default { ...@@ -1335,8 +1322,6 @@ export default {
(item) => (item) =>
item.expenseCategoryId != 701 && item.expenseCategoryId != 1104 item.expenseCategoryId != 701 && item.expenseCategoryId != 1104
) )
// debugger
console.log(packageGoods, "packageGoods")
const returnObj = { const returnObj = {
expenseCategoryRules, expenseCategoryRules,
shop4sDeductChargeFlag: obj.shop4sDeductChargeFlag, shop4sDeductChargeFlag: obj.shop4sDeductChargeFlag,
......
...@@ -190,6 +190,12 @@ export default { ...@@ -190,6 +190,12 @@ export default {
default() { default() {
return {} return {}
} }
},
ruleInfo: {
type: Object,
default() {
return {}
}
} }
}, },
directives: { directives: {
...@@ -517,12 +523,6 @@ export default { ...@@ -517,12 +523,6 @@ export default {
this.getRowItem() this.getRowItem()
}, },
mounted() { mounted() {
// this.getListPartnerMerchant()
// this.getMerchantLevelList()
// this.getListPlatformMerchant()
// setTimeout(() => {
// this.getEffectRule()
// }, 1000)
this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList) this.copyUpgradeGoodsList = deepClone(this.upgradeGoodsList)
this.copyPackageGoodsList = deepClone(this.packageGoodsList) this.copyPackageGoodsList = deepClone(this.packageGoodsList)
}, },
...@@ -692,7 +692,7 @@ export default { ...@@ -692,7 +692,7 @@ export default {
// goodsNameKeyword: this.goodsNameKeyword, // goodsNameKeyword: this.goodsNameKeyword,
// upgradeGoodsNameOrCCode: this.goodsNameKeyword, // upgradeGoodsNameOrCCode: this.goodsNameKeyword,
goodsNameKeyword: this.goodsNameKeyword, goodsNameKeyword: this.goodsNameKeyword,
merchantIdList: [this.financialLedgerParty.realityShopMerchantId], // merchantIdList: [this.financialLedgerParty.realityShopMerchantId],
statusList: [1], statusList: [1],
sceneTypeList: [0], sceneTypeList: [0],
currentPage: this.currentPage, currentPage: this.currentPage,
...@@ -726,14 +726,14 @@ export default { ...@@ -726,14 +726,14 @@ export default {
}, },
// 或者商品套餐 // 或者商品套餐
getSelectingListPackage(defaultSelect = []) { getSelectingListPackage(defaultSelect = []) {
merchantPackageGoodsInfoPage({ this.ruleInfo?.createBusinessApproveMerchant && merchantPackageGoodsInfoPage({
matchPackageNameOrCode: this.packageNameKeyword, matchPackageNameOrCode: this.packageNameKeyword,
currentPage: this.currentPagePackage, currentPage: this.currentPagePackage,
pageSize: this.pageSizePackage, pageSize: this.pageSizePackage,
status: 1, status: 1,
// sceneType: this.routerInfo.scene, // sceneType: this.routerInfo.scene,
sceneType: 0, // 固定查权益类的 sceneType: 0, // 固定查权益类的
merchantIdList: [this.financialLedgerParty.realityShopMerchantId] merchantIdList: [this.ruleInfo.createBusinessApproveMerchant.merchantId]
}) })
.then((res) => { .then((res) => {
this.allPagesPackage = res.pages this.allPagesPackage = res.pages
...@@ -747,7 +747,6 @@ export default { ...@@ -747,7 +747,6 @@ export default {
}) })
let arr = this.copyPackageGoodsList.concat(resArr) let arr = this.copyPackageGoodsList.concat(resArr)
if (defaultSelect?.length) arr = arr.concat(defaultSelect) if (defaultSelect?.length) arr = arr.concat(defaultSelect)
// this.packageGoodsList = this.unique(arr)
this.copyPackageGoodsList = this.uniquePackage(arr) this.copyPackageGoodsList = this.uniquePackage(arr)
}) })
.catch(() => { }) .catch(() => { })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!