ShopMerchantInfo.vue 3.02 KB
<!-- 查看 - 流量方信息 -->
<template>
  <div class="edit-page shop-merchant-info-detail">
    <div class="title">
      <span>流量方信息</span>
    </div>
    <div style="padding: 20px 20px 0;">
      <el-form :model="merchantInfo" label-width="150px">
        <el-form-item v-for="(item, index) in editFormData" :key="index" class="form-item" :style="{ 'width': '48%'}">
          <span slot="label" class="label">{{item.label}}:</span>
          <span>{{merchantInfo[item.name] || '-'}}{{item.suffix}}</span>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { sceneCodeList } from '@/common/constants.js'
import { busiModeList, operationModeList } from '../../constant/baseData'
export default {
  name: 'ShopMerchantInfo',
  props: {
    merchantInfo: {
      type: Object,
      default: () => { }
    }
  },

  watch: {
    merchantInfo(val) {
      this.dealInitData()
    }
  },
  data() {
    //这里存放数据
    return {
      editFormData: [{
        label: "流量方信息",
        name: 'merchantName',
      }, {
        label: "集团(上级商户)",
        name: 'parentMerchantName',
      }, {
        label: "业务模式",
        name: 'businessModeName',
        attrName: 'businessMode',
        optionsName: 'busiModeList'
      }, {
        label: "签约主体",
        name: 'contractingMerchantName',
      }, {
        label: "业务场景",
        name: 'sceneTypeName',
        attrName: 'sceneType',
        optionLabel: 'confValue',
        optionsName: 'sceneCodeList'
      }, {
        label: "园区店",
        name: 'yqMerchantName',
      }, {
        label: '预估流量/月',
        name: 'estimatedFlow',
      }, {
        label: '预估转化率',
        name: 'estimatedUpgradeRate',
        suffix: '%',
      }, {
        label: "运营模式",
        name: 'operationModeName',
        attrName: 'operationMode',
        optionsName: 'operationModeList'
      }, {
        label: "服务商",
        name: 'partnerMerchantName',
      }, {
        label: "上级服务商",
        name: 'parentPartnerMerchantName',
      }],
      baseData: {
        busiModeList: busiModeList,
        sceneCodeList: sceneCodeList,
        operationModeList: operationModeList
      }
    }
  },
  methods: {
    dealInitData() {
      console.log(this.merchantInfo, 'merchantInfo')
      this.editFormData.forEach(item => {
        if (item.attrName) {
          const obj = this.baseData[item.optionsName].find(k => k[item.optionId || 'confId'] == this.merchantInfo[item.attrName]) || {}
          this.merchantInfo[item.name] = obj[item.optionLabel || 'confName']
        }
      })
    },
  },
};
</script>
<style lang="scss">
@import "../../style/editdetailCon.scss";
.shop-merchant-info-detail {
  .el-form-item__label {
    padding-right: 0;
  }
  .el-form-item__label,
  .el-form-item__content {
    line-height: 20px !important;
  }
  .form-item {
    display: inline-block;
    line-height: 20px;
    margin-bottom: 20px;
  }
  .download {
    margin-left: 8px;
  }
}
</style>