<template>
  <view style="padding-top: 50rpx">
    <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx">
      <equipment-line title="编码" :content="infoData.account" />
      <equipment-line title="名称" :content="infoData.name" />
      <equipment-line
        title="等级"
        :content="
          $BaseTool.Object.getField(firmProducerLevelMap, infoData.level)
        "
      />
      <equipment-line title="联系人" :content="infoData.contactPerson" />
      <equipment-line title="联系电话" :content="infoData.phone" />
      <equipment-line title="联系地址" :content="infoData.registerAddress" />
      <equipment-line title="备注" :content="infoData.remark" />
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      detailId: "",
      infoData: {},
      firmProducerLevelMap: {},
    };
  },
  onLoad(options) {
    this.detailId = options.detailId;
    this.initData();
    this.firmProducerLevelMap = this.$DictCache.getLabelByValueMapByType(
      this.$DictCache.TYPE.FIRM_PRODUCER_LEVEL
    );
  },

  methods: {
    initData() {
      this.$Http
        .fetchFirmProducer({
          id: this.detailId,
        })
        .then((res) => {
          this.infoData = res.data;
        });
      this.statusMap = this.$DictCache.getLabelByValueMapByType(
        this.$DictCache.TYPE.SB_INFO_STATUS
      );
    },
  },
};
</script>

<style lang="less">
page {
  background-color: #f4f4f4;
}
</style>
