<template>
  <view>
    <Navbar title="点火维护详情" canBack></Navbar>
    <basisCellCard class="margin-sm" title="基本信息" :list="dataList" v-if="current === 0"></basisCellCard>
  </view>
</template>

<script>
  import {
    getMcFileList
  } from '@/api/charge.js'
  import basisCellCard from '@/components/basisCellCard/basisCellCard.vue'
  export default {
    components: {
      basisCellCard,
    },
    props: {

    },
    data() {
      return {
        current: 0,
        list: [{
          name: '基本信息',
        }, {
          name: '拜访信息',
        }, {
          name: '决策人信息'
        }, {
          name: '收费信息'
        }],
        itemStyle: {
          padding: '0',
          marginBottom: '5px',
          fontSize: '12rpx',
          width: '25%',
          height: '30px',
        },
        objData: {},
        dataList: [{
          name: "区域",
          value: "",
          key: "regionName"
        }, {
          name: "经管集团",
          value: "",
          key: "groupName"
        }, {
          name: "省",
          value: "",
          key: "userProvince"
        }, {
          name: "市",
          value: "",
          key: "userCity"
        }, {
          name: "县/区",
          value: "",
          key: "userDistrict"
        }, {
          name: "乡镇/街道",
          value: "",
          key: "userStreet"
        }, {
          name: "村(小区)",
          value: "",
          key: "vlgOrCmty"
        }, {
          name: "城乡分类",
          value: "",
          key: "urbRurCls"
        }, {
          name: "详细地址",
          value: "",
          key: "userDetailedAddress"
        },{
          name: "用户编号",
          value: "",
          key: "userCode"
        },{
          name: "户名",
          value: "",
          key: "userName"
        }, {
          name: "联系电话",
          value: "",
          key: "userPhone"
        }, {
          name: "点火确认",
          value: "",
          key: "ignCnfStatusCode",
          dict:"sys_yes_no"
        }, {
          name: "点火时间",
          value: "",
          key: "ignTime",
          mode:'time'
        }, {
          name: "未点火原因",
          value: "",
          key: "nIgnRsn"
        }, {
          name: "负责人",
          value: "",
          key: "cnfPersonName"
        }, {
          name: "更新时间",
          value: "",
          key: "updateTime"
        }],
        fileList: []
      }
    },
    computed: {

    },
    onLoad(data) {
      if (data.objData) {
        this.objData = JSON.parse(data.objData);
        console.log('传递data', JSON.parse(JSON.stringify(this.objData)));
        this.dataList = this.$assignValues(this.objData, this.dataList);
        // 如果已点火则手动删除未点火原因
        const hasIgnCnfStatusCodeY = this.dataList.some(item => item.key === 'ignCnfStatusCode' && item.value === 'Y');
        if (hasIgnCnfStatusCodeY) {
            this.dataList = this.dataList.filter(item => item.key !== 'nIgnRsn');
        }
      }
    },
    methods: {
    }
  }
</script>

<style lang="scss" scoped>
  .attachmentCss {
    margin-top: 38rpx;
    padding: 20rpx;
    border-radius: 10px;
    background-color: #f8f9fd;
    box-sizing: border-box;
  }

  .flexCss {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32rpx 0;
  }

  .leftCss {
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .textCss {
    width: 466rpx;
    height: 35rpx;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0);
    box-sizing: border-box;
    font-family: '苹方 中等', '苹方', sans-serif;
    color: #999db0;
    text-align: left;
    line-height: normal;
    font-size: 26rpx;
  }

  .rightCss {
    width: 60rpx;
    height: 35rpx;
    display: flex;
    background-color: rgba(255, 255, 255, 0);
    box-sizing: border-box;
    font-family: '苹方 中等', '苹方', sans-serif;
    color: #ff5630;
    text-align: left;
    font-size: 26rpx;
  }
</style>
