Commit 1492e5c4 by 李伟康

Merge branch 'feature/584/lwk' into 'SAAS+V5.8.4'

feat(salesManagement): 优化门店销售合同流程功能

See merge request !860
2 parents f206b714 b0c14bb3
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<template v-for="(item, index) in fourFormObj"> <template v-for="(item, index) in fourFormObj">
<div class="item first-form-item" :key="index"> <div class="item first-form-item" :key="index">
<div class="label">{{ item.name }}:</div> <div class="label">{{ item.name }}:</div>
<template v-if="isViewMode">{{ componentData.pointsConfig[item.key] }}</template> <template v-if="isViewMode">{{ getSelectText(item, componentData.pointsConfig) }}</template>
<el-select :size="size" v-model="componentData.pointsConfig[item.key]" class="step-select" <el-select :size="size" v-model="componentData.pointsConfig[item.key]" class="step-select"
:disabled="disabled" v-else> :disabled="disabled" v-else>
<el-option v-for="(item, ind) in fourFormOptions" :key="ind" :label="item.label" :value="item.value"> <el-option v-for="(item, ind) in fourFormOptions" :key="ind" :label="item.label" :value="item.value">
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
{{ formateData(componentData.productCategoryRules[productCategoryIndex][item.key]) }} {{ formateData(componentData.productCategoryRules[productCategoryIndex][item.key]) }}
</template> </template>
<template v-else-if="item.type == 'radio'"> <template v-else-if="item.type == 'radio'">
<template v-if="isViewMode">FFFF</template> <template v-if="isViewMode">
<span v-html="getRadioText(item, componentData.productCategoryRules[productCategoryIndex])"> </span>
</template>
<template v-else> <template v-else>
<el-radio-group v-model="componentData.productCategoryRules[productCategoryIndex][item.key]" <el-radio-group v-model="componentData.productCategoryRules[productCategoryIndex][item.key]"
:disabled="disabled"> :disabled="disabled">
...@@ -230,6 +232,19 @@ export default { ...@@ -230,6 +232,19 @@ export default {
}, },
mounted() { }, mounted() { },
methods: { methods: {
getSelectText(i, data) {
const value = data[i.key]
const option = this.fourFormOptions.find(item => item.value === value)
return option?.label || '-'
},
getRadioText(i, data) {
const value = data[i.key]
const option = i.options.find(item => item.value === value),
selectOptions = this.getExpenseCategoryCalculateTypeOptions(i.targetType),
selectValue = selectOptions.find(item => item.expenseCategoryCalculateType == data[i.selectKey]),
unit = [3, 10].includes(Number(data[i.selectKey])) ? '元' : '%'
return `${option?.label}&nbsp;&nbsp;&nbsp;&nbsp;${selectValue?.label}:${data[i.inputKey]}${unit}`
},
formateData(list) { formateData(list) {
return list.map(item => { return list.map(item => {
return item.productCategory return item.productCategory
...@@ -314,6 +329,7 @@ export default { ...@@ -314,6 +329,7 @@ export default {
.first-form-item { .first-form-item {
width: calc(50% - 16px); width: calc(50% - 16px);
font-size: 14px;
.step-select { .step-select {
width: 320px; width: 320px;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<span class="tips-icon" /> <span class="tips-icon" />
</el-tooltip>: </el-tooltip>:
</span> </span>
<el-switch v-model="item.autoFlag" active-value="Y" class="switch" inactive-value="N" /> <el-switch v-model="item.autoFlag" active-value="Y" class="switch" inactive-value="N" :disabled="disabled" />
<div class="right"> <div class="right">
<span class="tips-block"> <span class="tips-block">
<span class="tips-label">分账周期</span> <span class="tips-label">分账周期</span>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</span> </span>
分账周期 T+ 分账周期 T+
<el-input-number class="input-number" controls-position="right" :min="1" :max="20" v-model="item.settleTime" <el-input-number class="input-number" controls-position="right" :min="1" :max="20" v-model="item.settleTime"
:disabled="item.autoFlag === 'N'"></el-input-number> :disabled="item.autoFlag === 'N' || disabled"></el-input-number>
<span>日</span> <span>日</span>
<span>(分账后第{{ item.settleTime }}天到分账方对公账户)</span> <span>(分账后第{{ item.settleTime }}天到分账方对公账户)</span>
</div> </div>
...@@ -36,7 +36,11 @@ export default { ...@@ -36,7 +36,11 @@ export default {
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []
} },
disabled: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
}, },
shelfType: Number, shelfType: Number,
currentTrafficParty: Object, currentTrafficParty: Object,
trafficParty: Array,
}, },
data() { data() {
return { return {
...@@ -84,10 +85,10 @@ export default { ...@@ -84,10 +85,10 @@ export default {
tableRows() { tableRows() {
const rows = [], const rows = [],
{ currentTrafficParty, shelfType, nameMap } = this { currentTrafficParty, shelfType, nameMap, trafficParty } = this
// 固定的业务对象类型(平台方、服务商、4s店) // 固定的业务对象类型(平台方、服务商、4s店)
const fixedMerchantTypes = [1, 2, 3] const fixedMerchantTypes = [1, 2, 3]
let hasService2 = trafficParty.some(item => item.serviceMerchant2fId)
// 添加固定的三行 // 添加固定的三行
fixedMerchantTypes.forEach(type => { fixedMerchantTypes.forEach(type => {
let merchantTypeName = this.merchantTypeMap[type] || '' let merchantTypeName = this.merchantTypeMap[type] || ''
...@@ -102,8 +103,6 @@ export default { ...@@ -102,8 +103,6 @@ export default {
rows.push(row) rows.push(row)
}) })
// 只有当 componentData 中存在 targetMerchantType = 5 的数据时,才添加服务商2行
const hasService2 = this.componentData.some(item => item.targetMerchantType === 5)
if (hasService2) { if (hasService2) {
let service2Name = this.merchantTypeMap[5] || '' let service2Name = this.merchantTypeMap[5] || ''
if (shelfType == 1) { if (shelfType == 1) {
...@@ -165,13 +164,22 @@ export default { ...@@ -165,13 +164,22 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.split-payment-table { .split-payment-table {
padding: 20px; // padding: 20px;
::v-deep .el-table { ::v-deep .el-table {
.is-leaf { .is-leaf {
color: #333333; color: #333333;
} }
.el-table__body-wrapper {
.el-table--medium {
td {
padding: 18px 0 !important;
}
}
}
.el-table__header-wrapper { .el-table__header-wrapper {
th { th {
......
...@@ -3,23 +3,27 @@ ...@@ -3,23 +3,27 @@
<SplitPayment :disabled="disabled || isViewMode" :list="componentData.divisionRuleAutos" /> <SplitPayment :disabled="disabled || isViewMode" :list="componentData.divisionRuleAutos" />
<div class="item"> <div class="item">
<div class="label">流量方分账方:</div> <div class="label">流量方分账方:</div>
<template v-if="isViewMode">123</template>
<template v-else> <template v-if="shelfType == 1">
<template v-if="shelfType == 1"> <template v-if="isViewMode">
<el-select :size="size" v-model="componentData.autoDivideConfig.realityShopMerchantId" class="step-select" {{ componentData.autoDivideConfig.realityShopMerchantName || '-' }}
@change="handleRealityShopMerchantIdChange">
<el-option v-for="(item, ind) in options.merchantLevel" :key="item.merchantId"
:label="item.showMerchantName" :value="item.merchantId">
</el-option>
</el-select>
</template> </template>
<template v-else> <el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopMerchantId"
<el-select :size="size" v-model="componentData.autoDivideConfig.realityShopLevel" class="step-select"> class="step-select" @change="handleRealityShopMerchantIdChange">
<el-option v-for="item in options.realityShopLevelOptions" :key="item.realityShopLevel" <el-option v-for="(item, ind) in options.merchantLevel" :key="item.merchantId" :label="item.showMerchantName"
:label="item.realityShopLevelName" :value="item.realityShopLevel"> :value="item.merchantId">
</el-option> </el-option>
</el-select> </el-select>
</template>
<template v-else>
<template v-if="isViewMode">
{{ getRealityShopLevelName(componentData) }}
</template> </template>
<el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopLevel" class="step-select">
<el-option v-for="item in options.realityShopLevelOptions" :key="item.realityShopLevel"
:label="item.realityShopLevelName" :value="item.realityShopLevel">
</el-option>
</el-select>
</template> </template>
</div> </div>
<div class="step-title flex"> <div class="step-title flex">
...@@ -49,13 +53,14 @@ ...@@ -49,13 +53,14 @@
<template v-if="item.htmlName == 'table'"> <template v-if="item.htmlName == 'table'">
<SplitPaymentTable :data="componentData.productCategoryRules[productCategoryIndex][item.key]" <SplitPaymentTable :data="componentData.productCategoryRules[productCategoryIndex][item.key]"
:isViewMode="isViewMode" :shelfType="shelfType" :currentTrafficParty="currentTrafficParty" :isViewMode="isViewMode" :shelfType="shelfType" :currentTrafficParty="currentTrafficParty"
@change="change($event, item)"> :trafficParty="trafficParty" @change="change($event, item)">
</SplitPaymentTable> </SplitPaymentTable>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.type == 'select'"> <template v-if="item.type == 'select'">
<template v-if="isViewMode">789</template> <template v-if="isViewMode"> {{ getSelectText(item,
componentData.productCategoryRules[productCategoryIndex]) }}</template>
<el-select v-model="componentData.productCategoryRules[productCategoryIndex][item.key]" <el-select v-model="componentData.productCategoryRules[productCategoryIndex][item.key]"
class="step-select" :disabled="disabled" v-else> class="step-select" :disabled="disabled" v-else>
<el-option v-for="(item, ind) in item.options" :key="ind" :label="item.label" :value="item.value"> <el-option v-for="(item, ind) in item.options" :key="ind" :label="item.label" :value="item.value">
...@@ -63,7 +68,9 @@ ...@@ -63,7 +68,9 @@
</el-select> </el-select>
</template> </template>
<template v-else-if="item.type == 'radio'"> <template v-else-if="item.type == 'radio'">
<template v-if="isViewMode">FFFF</template> <template v-if="isViewMode">
<span v-html="getRadioText(item, componentData.productCategoryRules[productCategoryIndex])"></span>
</template>
<template v-else> <template v-else>
<el-radio-group v-model="componentData.productCategoryRules[productCategoryIndex][item.key]" <el-radio-group v-model="componentData.productCategoryRules[productCategoryIndex][item.key]"
:disabled="disabled"> :disabled="disabled">
...@@ -132,10 +139,7 @@ export default { ...@@ -132,10 +139,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
shelfType: { shelfType: [Number, String],
type: Number,
default: 0
},
baseSceneCode: { baseSceneCode: {
type: String, type: String,
default: '' default: ''
...@@ -190,7 +194,7 @@ export default { ...@@ -190,7 +194,7 @@ export default {
type: 'select', type: 'select',
options: [ options: [
{ {
label: '按信息量', label: '按交付数',
value: '1', value: '1',
}, },
{ {
...@@ -283,12 +287,15 @@ export default { ...@@ -283,12 +287,15 @@ export default {
}, },
}, },
computed: { computed: {
currentTrafficParty() { trafficParty() {
let { baseSceneCode, trafficPartyConfigs } = this, let { baseSceneCode, trafficPartyConfigs } = this,
item = trafficPartyConfigs.find(item => item.baseSceneCode === baseSceneCode), item = trafficPartyConfigs.find(item => item.baseSceneCode === baseSceneCode),
trafficPartyDetails = {} trafficParty = []
if (item && item.trafficPartyDetails) trafficPartyDetails = item.trafficPartyDetails[0] if (item && item.trafficPartyDetails) trafficParty = item.trafficPartyDetails
return trafficPartyDetails return trafficParty
},
currentTrafficParty() {
return this.trafficParty[0]
}, },
formRef() { formRef() {
return this.$refs.formRef return this.$refs.formRef
...@@ -325,6 +332,21 @@ export default { ...@@ -325,6 +332,21 @@ export default {
}); });
return options; return options;
}, },
getSelectText(i, data) {
const value = data[i.key]
if (this.isViewMode && i.viewKey) return data[i.viewKey] || value || '-'
if (!value || !i?.options?.length) return '-'
const option = i.options.find(item => item.value === value)
return option?.label || (i.viewKey && data[i.viewKey]) || value || '-'
},
getRadioText(i, data) {
const value = data[i.key]
const option = i.options.find(item => item.value === value),
selectOptions = this.getExpenseCategoryCalculateTypeOptions(i.targetType),
selectValue = selectOptions.find(item => item.expenseCategoryCalculateType == data[i.selectKey]),
unit = [3, 10].includes(Number(data[i.selectKey])) ? '元' : '%'
return `${option?.label}&nbsp;&nbsp;&nbsp;&nbsp;${selectValue?.label}:${data[i.inputKey]}${unit}`
},
handleSelectChange(val, item) { handleSelectChange(val, item) {
this.componentData.productCategoryRules[this.productCategoryIndex][item.inputKey] = '' this.componentData.productCategoryRules[this.productCategoryIndex][item.inputKey] = ''
}, },
...@@ -396,6 +418,11 @@ export default { ...@@ -396,6 +418,11 @@ export default {
autoDivideConfig.realityShopLevel = realityMerchant?.realityShopLevel; autoDivideConfig.realityShopLevel = realityMerchant?.realityShopLevel;
this.$set(this.componentData, 'autoDivideConfig', autoDivideConfig); this.$set(this.componentData, 'autoDivideConfig', autoDivideConfig);
}, },
getRealityShopLevelName(realityShopLevel) {
console.log(realityShopLevel)
// return this.options.realityShopLevelOptions.find(item => item.realityShopLevel == realityShopLevel)?.realityShopLevelName || '-'
}
} }
} }
</script> </script>
...@@ -429,12 +456,13 @@ export default { ...@@ -429,12 +456,13 @@ export default {
align-items: center; align-items: center;
padding: 0 20px; padding: 0 20px;
margin-bottom: 20px; margin-bottom: 20px;
font-size: 14px;
.label { .label {
width: 150px; width: 150px;
text-align: right; text-align: right;
color: #333333; color: #333333;
font-size: 14px;
&::before { &::before {
content: '*'; content: '*';
......
<template> <template>
<div class="basic-information-container"> <div class="basic-information-container">
<template v-for="(i, index) in formList"> <template v-for="(i, index) in formList">
<div <div :class="['basic-item', { 'file-box': i.inputType == 7 }]" :key="index">
:class="['basic-item',{ 'file-box': i.inputType == 7 }]"
:key="index"
>
<div class="label">{{ i.title }}:</div> <div class="label">{{ i.title }}:</div>
<div class="value"> <div class="value">
<template v-if="i.inputType == 7"> <template v-if="i.inputType == 7">
<template v-for="(f,findex) in files"> <template v-for="(f, findex) in files">
<div <div class="file-item" :key="findex">
class="file-item"
:key="findex"
>
{{ f.fileName }} {{ f.fileName }}
<div <div class="download" @click="downloadFile(f)">下载</div>
class="download"
@click="downloadFile(f)"
>下载</div>
</div> </div>
</template> </template>
</template> </template>
...@@ -43,12 +34,12 @@ export default { ...@@ -43,12 +34,12 @@ export default {
default: () => [] default: () => []
}, },
}, },
data () { data() {
return { return {
} }
}, },
computed: { computed: {
files () { files() {
let { data, formList } = this, let { data, formList } = this,
files = [] files = []
formList.map(e => { formList.map(e => {
...@@ -57,21 +48,27 @@ export default { ...@@ -57,21 +48,27 @@ export default {
} }
}) })
if (data) { if (data) {
let name = data.fileName || '' if (data.originalExcelUrl) {
if (data.originalExcelUrl) name = data.originalExcelUrl.split('/').pop() || '' let originalExcelList = JSON.parse(data.originalExcelUrl)
files.push({ console.log()
fileName: name, Object.keys(originalExcelList).forEach(key => {
fileUrl: data.fileInfo || data.originalExcelUrl let fileName = originalExcelList[key].split('/').pop() || ''
}) files.push({
fileName,
fileUrl: originalExcelList[key]
})
})
}
} }
return files return files
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
// 1.文本;2.多行文本;3.数字;4.金额;5.单选;6.多选;7.附件 // 1.文本;2.多行文本;3.数字;4.金额;5.单选;6.多选;7.附件
formatValue (i) { formatValue(i) {
let str = null, let str = null,
{ formList, data } = this { formList, data } = this
str = data[i.controlId] || i.value str = data[i.controlId] || i.value
...@@ -89,7 +86,7 @@ export default { ...@@ -89,7 +86,7 @@ export default {
} else return '-' } else return '-'
}, },
downloadFile (i) { downloadFile(i) {
if (i.fileUrl) { if (i.fileUrl) {
const link = document.createElement("a"); const link = document.createElement("a");
if (i.fileUrl.includes("@")) { if (i.fileUrl.includes("@")) {
...@@ -143,30 +140,36 @@ export default { ...@@ -143,30 +140,36 @@ export default {
display: flex; display: flex;
gap: 20px; gap: 20px;
flex-wrap: wrap; flex-wrap: wrap;
.basic-item { .basic-item {
width: calc(50% - 10px); width: calc(50% - 10px);
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
.label { .label {
color: #666; color: #666;
width: 150px; width: 150px;
text-align: right; text-align: right;
} }
.value { .value {
width: calc(100% - 150px); width: calc(100% - 150px);
color: #333; color: #333;
} }
} }
.file-box { .file-box {
width: 100%; width: 100%;
align-items: flex-start; align-items: flex-start;
.file-item { .file-item {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
} }
.download { .download {
color: #2a58ad; color: #2a58ad;
cursor: pointer; cursor: pointer;
......
...@@ -6,8 +6,36 @@ ...@@ -6,8 +6,36 @@
0: '否' 0: '否'
}[data] }} }[data] }}
<div class="condition-box-view"> <div class="condition-box-view">
<template v-for="(item, index) in 2"> <template v-for="(item, index) in guaranteeConfigs">
<div class="block">{{ item }}</div> <div class="block" :key="index">
<div class="item">
<div class="item-label">兜底标准:</div>
<div class="item-value">{{ metricName(item) }}</div>
</div>
<div class="item">
<div class="item-label">赔付标准:</div>
<div class="item-value">
<template v-if="item.guaranteeIndex">
<template v-if="item.compensationMode == 0">无</template>
<template v-else>
<template v-if="item.compensationMode == 1">
固定模式
<div class="text">差距订单数每单赔付{{ item.guaranteeStandard }}元</div>
</template>
<template v-else>
阶梯模式
<template v-for="(i, ind) in formatGuaranteeConfigs(item.ladderConditions)">
<div class="text" :key="`i-${ind}`">
<span v-html="formatGuaranteeItem(i, item)"></span>
</div>
</template>
</template>
</template>
</template>
<template v-else>-</template>
</div>
</div>
</div>
</template> </template>
</div> </div>
</template> </template>
...@@ -59,7 +87,7 @@ export default { ...@@ -59,7 +87,7 @@ export default {
data: '', data: '',
guaranteeConfigs: [], guaranteeConfigs: [],
includesConditionList: [], includesConditionList: [],
options: [] metricConfigs: []
} }
}, },
watch: { watch: {
...@@ -72,6 +100,7 @@ export default { ...@@ -72,6 +100,7 @@ export default {
}, },
list: { list: {
handler(val) { handler(val) {
this.storeApproveQueryMetricConfigs()
if (val && val.length) { if (val && val.length) {
this.guaranteeConfigs = val this.guaranteeConfigs = val
this.includesConditionList = val.map(item => item.guaranteeIndex) this.includesConditionList = val.map(item => item.guaranteeIndex)
...@@ -87,7 +116,7 @@ export default { ...@@ -87,7 +116,7 @@ export default {
}, },
computed: {}, computed: {},
mounted() { mounted() {
this.storeApproveQueryMetricConfigs()
}, },
methods: { methods: {
async storeApproveQueryMetricConfigs() { async storeApproveQueryMetricConfigs() {
...@@ -98,10 +127,11 @@ export default { ...@@ -98,10 +127,11 @@ export default {
baseSceneCode baseSceneCode
}) })
if (data) { if (data) {
this.metricConfigs = data
metricConfigs[baseSceneCode] = data metricConfigs[baseSceneCode] = data
localStorage.setItem('metricConfigs', JSON.stringify(metricConfigs)) localStorage.setItem('metricConfigs', JSON.stringify(metricConfigs))
} }
} } else this.metricConfigs = metricConfigs[baseSceneCode]
}, },
addCondition() { addCondition() {
this.guaranteeConfigs.push({ this.guaranteeConfigs.push({
...@@ -133,9 +163,22 @@ export default { ...@@ -133,9 +163,22 @@ export default {
}) })
callback(guaranteeConfigs) callback(guaranteeConfigs)
} catch (error) { } catch (error) {
console.log(error)
this.$message.error(error) this.$message.error(error)
} }
},
metricName(item) {
let { metricConfigs } = this
console.log(metricConfigs)
if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-'
return '-'
},
formatGuaranteeConfigs(data) {
return JSON.parse(data)
},
formatGuaranteeItem(i, item) {
console.log(i)
let unit = i.unit || ''
return `满足${i.startValue}${unit} &le; ${this.metricName(item)}&lt;${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元`
} }
} }
} }
...@@ -161,11 +204,37 @@ export default { ...@@ -161,11 +204,37 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
margin-top: 4px;
.block { .block {
width: 100%; width: 100%;
height: 40px;
background: #F5F7FA; background: #F5F7FA;
padding: 8px 0;
font-size: 14px;
.item {
display: flex;
line-height: 20px;
&-label {
width: 150px;
text-align: right;
color: #666666;
flex-shrink: 0;
}
&-value {
color: #333333;
.text {
margin-top: 8px;
}
}
&:last-child {
margin-top: 16px;
}
}
} }
} }
......
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
this.$set(this.conditionForm, 2, deepClone(PFBZ)) this.$set(this.conditionForm, 2, deepClone(PFBZ))
} else { } else {
this.selectionChange(val.guaranteeIndex, false) this.selectionChange(val.guaranteeIndex, false)
if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions)
} }
}, },
deep: true, deep: true,
...@@ -151,13 +152,15 @@ export default { ...@@ -151,13 +152,15 @@ export default {
'componentData.guaranteeStandard': { 'componentData.guaranteeStandard': {
handler(val) { handler(val) {
let { ladderConditions } = this let { ladderConditions } = this
ladderConditions.map(e => { if (!ladderConditions.length) {
e.startValue = '' ladderConditions.map(e => {
e.endValue = '' e.startValue = ''
e.aError = false e.endValue = ''
e.bError = false e.aError = false
}) e.bError = false
this.$set(this, 'ladderConditions', ladderConditions) })
this.$set(this, 'ladderConditions', ladderConditions)
}
}, },
deep: true deep: true
}, },
...@@ -303,11 +306,16 @@ export default { ...@@ -303,11 +306,16 @@ export default {
} }
}, },
validate(callback) { validate(callback) {
let { componentData } = this, let { componentData, ladderConditions, conditionStartConfig } = this,
{ compensationMode } = componentData { compensationMode } = componentData
if (compensationMode == 2) { if (compensationMode == 2) {
let ladderConditions = deepClone(this.ladderConditions || []) ladderConditions.map(e => {
componentData.ladderConditions = JSON.stringify(ladderConditions) delete e.aError
delete e.bError
if (conditionStartConfig.unit) e.unit = conditionStartConfig.unit
})
let data = deepClone(ladderConditions || [])
componentData.ladderConditions = JSON.stringify(data)
} }
callback(componentData) callback(componentData)
// this.formRef.validate(valid => { // this.formRef.validate(valid => {
......
...@@ -46,9 +46,15 @@ ...@@ -46,9 +46,15 @@
{{ getSelectText(i) }} {{ getSelectText(i) }}
</template> </template>
<template v-else-if="i.type == 'addComponent'"> <template v-else-if="i.type == 'addComponent'">
<component :is="i.addComponent" :value.sync="componentData[i.key]" isViewMode /> <component :is="i.addComponent" :value.sync="componentData[i.key]" isViewMode
:list="componentData[i.listKey]" />
</template> </template>
<template v-else> {{ componentData[i.key] || '-' }}</template> <template v-else> {{ componentData[i.key] || '-' }}</template>
<template
v-if="i.unit && componentData[i.key] != null && componentData[i.key] != '' && componentData[i.key] != undefined">
<span class="unit">{{ i.unit }}</span>
</template>
</template> </template>
</el-form-item> </el-form-item>
...@@ -74,6 +80,9 @@ import { ...@@ -74,6 +80,9 @@ import {
import { baseConfig } from "@/main"; import { baseConfig } from "@/main";
import componentsMixin from './mixins.js'; import componentsMixin from './mixins.js';
import BottomLineCondition from './BottomLineCondition.vue' import BottomLineCondition from './BottomLineCondition.vue'
const monthSettlementDateOptions = Array.from({ length: 28 }, (_, i) => {
return { label: i == 0 ? '每月最后1天' : `每月${i}号`, value: i == 0 ? '-1' : `${i}` }
})
export default { export default {
components: { BottomLineCondition }, components: { BottomLineCondition },
name: 'TrafficProviderInformation', name: 'TrafficProviderInformation',
...@@ -172,11 +181,7 @@ export default { ...@@ -172,11 +181,7 @@ export default {
{ label: "预估毛利率", key: "estimatedGrossMargin", type: 'input', unit: "%", filterRule: "decimalRange", min: 0, max: 100, precision: 2 }, { label: "预估毛利率", key: "estimatedGrossMargin", type: 'input', unit: "%", filterRule: "decimalRange", min: 0, max: 100, precision: 2 },
{ label: "是否存在兜底", key: "hasGuarantee", type: 'addComponent', addComponent: 'BottomLineCondition', class: !this.isViewMode ? 'w100' : '', listKey: 'guaranteeConfigs' }, { label: "是否存在兜底", key: "hasGuarantee", type: 'addComponent', addComponent: 'BottomLineCondition', class: !this.isViewMode ? 'w100' : '', listKey: 'guaranteeConfigs' },
{ {
label: '兜底结算日期', key: 'monthlySettlementDate', type: 'select', options: () => { label: '兜底结算日期', key: 'monthlySettlementDate', type: 'select', viewKey: 'monthlySettlementDate', options: monthSettlementDateOptions, hide: (val) => val.e == 0
return Array.from({ length: 28 }, (_, i) => {
return { label: i == 0 ? '每月最后1天' : `每月${i}号`, value: i == 0 ? '-1' : `${i}` }
})
}, hide: (val) => val.e == 0
}, },
], ],
...@@ -208,7 +213,8 @@ export default { ...@@ -208,7 +213,8 @@ export default {
getSelectText(i) { getSelectText(i) {
const value = this.componentData[i.key] const value = this.componentData[i.key]
if (this.isViewMode && i.viewKey) { if (this.isViewMode && i.viewKey) {
return this.componentData[i.viewKey] || value || '-' if (i.viewKey == 'monthlySettlementDate') return monthSettlementDateOptions.find(e => e.value == value).label || '-'
else return this.componentData[i.viewKey] || value || '-'
} }
if (!value || !i?.options?.length) return '-' if (!value || !i?.options?.length) return '-'
......
...@@ -33,11 +33,12 @@ ...@@ -33,11 +33,12 @@
<template v-if="isViewMode"> <template v-if="isViewMode">
<div class="step-content"> <div class="step-content">
<div :class="['step-title', { top54: trafficPartyConfigs.length > 1 }]">分账配置</div> <div :class="['step-title', { top54: trafficPartyConfigs.length > 1 }]">分账配置</div>
<StepThreeForm :isViewMode="isViewMode" /> <StepThreeForm :isViewMode="isViewMode" :currentItem="currentDivisionSceneConfigs" :shelfType="shelfType"
:baseSceneCode="baseSceneCode" :trafficPartyConfigs="trafficPartyConfigs" />
</div> </div>
<div class="step-content"> <div class="step-content">
<div :class="['step-title', { top54: trafficPartyConfigs.length > 1 }]">对账配置</div> <div :class="['step-title', { top54: trafficPartyConfigs.length > 1 }]">对账配置</div>
<StepFourForm :isViewMode="isViewMode" /> <StepFourForm :isViewMode="isViewMode" :currentItem="currentReconciliationSceneConfigs" />
</div> </div>
<div class="step-content"> <div class="step-content">
<div class="step-title ">操作记录</div> <div class="step-title ">操作记录</div>
...@@ -100,6 +101,16 @@ export default { ...@@ -100,6 +101,16 @@ export default {
return trafficPartyDetails return trafficPartyDetails
} else null } else null
}, },
currentDivisionSceneConfigs() {
let { baseSceneCode, basicinformationData } = this
if (basicinformationData.divisionSceneConfigs) return basicinformationData.divisionSceneConfigs.find(i => i.baseSceneCode == baseSceneCode)
else return {}
},
currentReconciliationSceneConfigs() {
let { baseSceneCode, basicinformationData } = this
if (basicinformationData.reconciliationSceneConfigs) return basicinformationData.reconciliationSceneConfigs.find(i => i.baseSceneCode == baseSceneCode)
else return {}
},
}, },
watch: { watch: {
}, },
...@@ -149,13 +160,13 @@ export default { ...@@ -149,13 +160,13 @@ export default {
this.operateLogs = operateLogs this.operateLogs = operateLogs
}, },
async changeMerchant(trafficPartyId) { async changeMerchant(trafficPartyId) {
await this.trafficProviderInformationRef.synchronization() if (!this.isViewMode) await this.trafficProviderInformationRef.synchronization()
setTimeout(() => { setTimeout(() => {
this.trafficPartyId = trafficPartyId this.trafficPartyId = trafficPartyId
}, 100) }, 100)
}, },
async changeBaseSceneCode({ name, label }) { async changeBaseSceneCode({ name, label }) {
await this.trafficProviderInformationRef.synchronization() if (!this.isViewMode) await this.trafficProviderInformationRef.synchronization()
setTimeout(() => { setTimeout(() => {
this.baseSceneCode = name this.baseSceneCode = name
this.baseSceneName = label this.baseSceneName = label
...@@ -284,7 +295,7 @@ export default { ...@@ -284,7 +295,7 @@ export default {
margin-bottom: 0 !important; margin-bottom: 0 !important;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 2; z-index: 5;
} }
.step-content { .step-content {
...@@ -297,6 +308,7 @@ export default { ...@@ -297,6 +308,7 @@ export default {
.step-title { .step-title {
gap: 16px; gap: 16px;
z-index: 4 !important;
} }
.top54 { .top54 {
...@@ -316,8 +328,7 @@ export default { ...@@ -316,8 +328,7 @@ export default {
gap: 20px; gap: 20px;
.log-title { .log-title {
min-width: 68px; flex: 0 0 120px;
flex-shrink: 0;
} }
.log-name { .log-name {
......
...@@ -215,26 +215,41 @@ export default { ...@@ -215,26 +215,41 @@ export default {
this.basicinformationData = data this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo) let basicinformationFormList = JSON.parse(basicApproveInfo)
if (pageType != 'reapply') { if (pageType != 'reapply') {
this.step = step if (pageType == 'view') {
this.pageComplete = true this.step = 2
this.$nextTick(() => { this.pageComplete = true
if (step == 2) this.stepTwoRef.init({ this.$nextTick(() => {
basicinformationFormList, this.stepTwoRef.init({
basicinformationData: data, basicinformationFormList,
trafficPartyConfigs, basicinformationData: data,
operateLogs, trafficPartyConfigs,
shelfType operateLogs,
}) shelfType
else if (step == 3) this.stepThreeRef.init({ })
divisionSceneConfigs: data.divisionSceneConfigs,
shelfType,
trafficPartyConfigs: trafficPartyConfigs
}) })
else if (step == 4) this.stepFourRef.init({ } else {
reconciliationSceneConfigs: data.reconciliationSceneConfigs, this.step = step
shelfType this.pageComplete = true
this.$nextTick(() => {
if (step == 2) this.stepTwoRef.init({
basicinformationFormList,
basicinformationData: data,
trafficPartyConfigs,
operateLogs,
shelfType
})
else if (step == 3) this.stepThreeRef.init({
divisionSceneConfigs: data.divisionSceneConfigs,
shelfType,
trafficPartyConfigs: trafficPartyConfigs
})
else if (step == 4) this.stepFourRef.init({
reconciliationSceneConfigs: data.reconciliationSceneConfigs,
shelfType
})
}) })
}) }
} else { } else {
this.pageComplete = true this.pageComplete = true
let infoForm = {} let infoForm = {}
...@@ -365,13 +380,8 @@ export default { ...@@ -365,13 +380,8 @@ export default {
params.businessCode = businessCode params.businessCode = businessCode
const { data, message, code } = await storeApproveEditTrafficParty(params) const { data, message, code } = await storeApproveEditTrafficParty(params)
this.buttonLoading = false this.buttonLoading = false
if (code == '0') { if (code == '0') this.getDetail(businessCode)
this.stepThreeRef.init({ else this.$message.error(message)
divisionSceneConfigs: basicinformationData.divisionSceneConfigs,
shelfType: basicinformationData.shelfType
})
this.step += 1
} else this.$message.error(message)
} else { } else {
this.buttonLoading = false this.buttonLoading = false
if (params) this.$message.error(params) if (params) this.$message.error(params)
...@@ -384,17 +394,8 @@ export default { ...@@ -384,17 +394,8 @@ export default {
params.businessCode = businessCode params.businessCode = businessCode
const { data, message, code } = await storeApproveEditDivisionConfig(params) const { data, message, code } = await storeApproveEditDivisionConfig(params)
this.buttonLoading = false this.buttonLoading = false
if (code == '0') { if (code == '0') this.getDetail(businessCode)
console.log(data) else this.$message.error(message)
this.step += 1
this.$nextTick(() => {
this.stepThreeRef.init({
divisionSceneConfigs: basicinformationData.divisionSceneConfigs,
shelfType: basicinformationData.shelfType,
trafficPartyConfigs: basicinformationData.trafficPartyConfigs
})
})
} else this.$message.error(message)
} else { } else {
this.buttonLoading = false this.buttonLoading = false
this.$message.error(params) this.$message.error(params)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!