Commit e746d531 by 张立顺

fix 优化

1 parent 78d10b7c
import { getGoodsCategoryConfiguration } from "@/api/sys.base.js"
import { getAllGoodsList } from "@api/grounding"
import { merchantSettleDistributeRuleLastRule } from "@api/shelfManage"
import { set } from "nprogress"
export default {
namespaced: true,
state: {
......@@ -138,12 +139,32 @@ export default {
data: response.list,
name: "goodsCategoryConfigurationList"
})
// 判断一下是商户多还是分账规则多, 去最大值做loading
const {
createBusinessApproveMerchantList,
merchantSettleDistributeRule
} = response
let timeNum = Math.max(
createBusinessApproveMerchantList?.length || 0,
merchantSettleDistributeRule?.goodsTypeGroupRules || 0,
15
)
console.log(timeNum, "timeNum")
timeNum = timeNum >= 15 ? timeNum : 0
console.log(timeNum, "timeNum")
setTimeout(() => {
commit("SET_LOADING", {
isLoading: false,
name: "isLoadingGoodsCategoryConfiguration"
})
}, timeNum * 1000)
return response.list
} finally {
commit("SET_LOADING", {
isLoading: false,
name: "isLoadingGoodsCategoryConfiguration"
})
// commit("SET_LOADING", {
// isLoading: false,
// name: "isLoadingGoodsCategoryConfiguration"
// })
commit("SET_PROMISE", {
promise: null,
name: "promiseGetGoodsCategoryConfiguration"
......@@ -270,6 +291,9 @@ export default {
firstLineSunshine2OnlinePointsFlagAsync(state) {
return state.firstLineSunshine2OnlinePointsFlag
},
isLoadingGoodsCategoryConfiguration(state) {
return state.isLoadingGoodsCategoryConfiguration
},
shelfType(state) {
// 多商户
return (
......
......@@ -6,12 +6,8 @@
</div>
<div style="padding: 20px 20px 0">
<el-form :model="basicInfo" label-width="150px">
<el-form-item
v-for="(item, index) in editFormData"
:key="index"
class="form-item"
:style="{ width: [2, 7].includes(item.inputType) ? '100%' : '48%' }"
>
<el-form-item v-for="(item, index) in editFormData" :key="index" class="form-item"
:style="{ width: [2, 7].includes(item.inputType) ? '100%' : '48%' }">
<span slot="label" class="label">{{ item.title }}:</span>
<div v-if="item.inputType == 7">
<div v-if="item.fileList.length == 0">-</div>
......@@ -24,7 +20,7 @@
</div>
</div>
</div>
<span v-else>{{ item.showValue || "-" }}</span>
<span v-else class="rich-text">{{ item.showValue || "-" }}</span>
</el-form-item>
</el-form>
</div>
......@@ -37,7 +33,7 @@ export default {
props: {
basicInfo: {
type: Object,
default: () => {}
default: () => { }
}
},
......@@ -58,7 +54,7 @@ export default {
}
},
mounted() {},
mounted() { },
methods: {
dealFormData() {
......@@ -88,7 +84,7 @@ export default {
url: this.basicInfo.goodsCreateExcel,
fileName:
this.basicInfo.goodsCreateExcel.split("/")[
this.basicInfo.goodsCreateExcel.split("/").length - 1
this.basicInfo.goodsCreateExcel.split("/").length - 1
]
})
}
......@@ -97,7 +93,7 @@ export default {
url: this.basicInfo.submitGoodsCreateExcel,
fileName:
this.basicInfo.submitGoodsCreateExcel.split("/")[
this.basicInfo.goodsCreateExcel.split("/").length - 1
this.basicInfo.goodsCreateExcel.split("/").length - 1
]
})
}
......@@ -139,5 +135,11 @@ export default {
.download {
margin-left: 8px;
}
.rich-text {
display: inline-block;
max-width: 90%;
overflow-wrap: break-word;
}
}
</style>
......@@ -8,7 +8,7 @@
-->
<!-- 编辑 - 运营确认 -->
<template>
<d2-container class="edit-contract" v-loading="isLoad">
<d2-container class="edit-contract" v-loading="isLoadingGoodsCategoryConfiguration">
<!-- 基础信息 -->
<base-info :basic-info="basicInfo"></base-info>
<!-- 流量方信息 -->
......@@ -36,7 +36,7 @@
</template>
<script>
import { mapActions, mapMutations } from "vuex"
import { mapActions, mapMutations, mapGetters } from "vuex"
import BaseInfo from "./components/editCon/BaseInfo.vue"
import ShopMerchantInfo from "./components/editCon/ShopMerchantInfo"
import AddMerchant from "./components/editCon/AddMerchant"
......@@ -54,6 +54,14 @@ const getBackoffInterval = (attempt, base = 1000) =>
Math.min(base * 2 ** attempt, 30000) // 最大间隔30秒
export default {
name: "EditContract",
components: {
BaseInfo,
ShopMerchantInfo,
AddMerchant,
GoodsInfo,
DivisionConfig,
FinanceConfig
},
data() {
return {
routeObj: {},
......@@ -74,15 +82,12 @@ export default {
MAX_DURATION: 5 * 60 * 1000 // 5分钟超时
}
},
components: {
BaseInfo,
ShopMerchantInfo,
AddMerchant,
GoodsInfo,
DivisionConfig,
FinanceConfig
computed: {
...mapGetters("goodsInfoData", {
isLoadingGoodsCategoryConfiguration: "isLoadingGoodsCategoryConfiguration"
})
},
created() {
this.isLoad = true
this.routeObj = this.$route.query
......
......@@ -8,7 +8,7 @@
-->
<!-- 编辑 - 运营确认 -->
<template>
<d2-container class="edit-contract" v-loading="isLoad">
<d2-container class="edit-contract" v-loading="isLoadingGoodsCategoryConfiguration">
<!-- 基础信息 -->
<base-info :basic-info="basicInfo"></base-info>
......@@ -37,7 +37,7 @@
</template>
<script>
import { mapActions, mapMutations } from "vuex"
import { mapActions, mapMutations, mapGetters } from "vuex"
import BaseInfo from "./components/editCon/BaseInfo.vue"
// import ShopMerchantInfo from "./components/editCon/ShopMerchantInfo"
import multilateralShopMerchant from "./components/editMultilateralCon/multilateralShopMerchant"
......@@ -56,6 +56,15 @@ const getBackoffInterval = (attempt, base = 1000) =>
Math.min(base * 2 ** attempt, 30000) // 最大间隔30秒
export default {
name: "EditMultilateralContract",
components: {
BaseInfo,
// ShopMerchantInfo,
AddMerchant,
GoodsInfo,
DivisionConfig,
FinanceConfig,
multilateralShopMerchant
},
data() {
return {
routeObj: {},
......@@ -77,14 +86,11 @@ export default {
}
},
components: {
BaseInfo,
// ShopMerchantInfo,
AddMerchant,
GoodsInfo,
DivisionConfig,
FinanceConfig,
multilateralShopMerchant
computed: {
...mapGetters("goodsInfoData", {
isLoadingGoodsCategoryConfiguration: "isLoadingGoodsCategoryConfiguration"
})
},
created() {
this.routeObj = this.$route.query
......@@ -92,7 +98,6 @@ export default {
// this.getMerchantSettleDistributeRuleLastRule()
},
mounted() {
this.getBasicDetail()
this.$EventBus.$on("requestData", this.sendData)
// 页面可见性监听
......@@ -135,11 +140,6 @@ export default {
// }
this.merchantEditData = res.createBusinessApproveMerchantList || []
console.log(this.merchantEditData, ' this.merchantEditData')
// this.$EventBus.$emit("shelfUpdatMerchantId", {
// merchantId: this.merchantEditData.merchantId,
// merchantName: this.merchantEditData.merchantName,
// scene: this.merchantEditData.sceneType
// })
this.SET_DATA({
name: "shelfUpdateMerchant",
data: {
......@@ -148,9 +148,6 @@ export default {
scene: this.merchantEditData[0].sceneType
}
})
// })
// .finally(() => {
// })
this.$nextTick(() => {
this.isLoad = false
}, 3000)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!