<template>
  <view class="container">
    <Navbar title="气瓶信息" canBack></Navbar>
    <view class="basisCardCss mr10">
      <basisCellCard title="基本信息" :list="basisList"></basisCellCard>
    </view>

    <view class="otherCardCss mr10">
      <basisCellCard title="其他信息" :list="otherList"></basisCellCard>
    </view>
  </view>
</template>

<script>
import basisCellCard from '@/components/basisCellCard/basisCellCard'

export default {
  components: {
    basisCellCard
  },
  data() {
    return {
      basisList: [{
        name: '气瓶条码',
        value: '',
        key: 'fQptm',
      }, {
        name: '充装单位',
        value: '',
        key: 'fSsczmc',
      }, {
        name: '气瓶状态',
        value: '',
        type: 'tag',
        bgColor: '#E6F7F7',
        color: '#00AEAA',
        borderColor: "#E6F7F7",
        key: 'fZt',
      }, {
        name: '出厂编号',
        value: '',
        key: 'fQptm',
      }, {
        name: '制造单位',
        value: '',
        key: 'fZzdw',
      }, {
        name: '制造时间',
        value: '',
        key: 'fZzrq',
      }, {
        name: '下次检验年月',
        value: '',
        key: 'fXcjysj',
      }, {
        name: '报废日期',
        value: '',
        key: 'fBfrq',
      }, {
        name: '气瓶种类',
        value: '',
        key: 'fQpzl',
      }],
      otherList: [{
        name: '气瓶规格',
        value: '',
        key: 'fQpgg',
      }, {
        name: '气瓶容积',
        value: '',
        key: 'fQprj',
      },
        // {
        // 	name: '原始重量',
        // 	value: '',
        // 	key: 'yszl',
        // }, {
        // 	name: '气瓶地址',
        // 	value: '',
        // 	key: 'qpdz',
        // },
        {
          name: '自有编号',
          value: '',
          key: 'fZybh',
        }, {
          name: '登记证号',
          value: '',
          key: 'fDjzh',
        },
        // {
        // 	name: '气瓶备注',
        // 	value: '',
        // 	key: 'qpbz',
        // },
        // {
        // 	name: '最新安检时间',
        // 	value: '',
        // 	key: 'zxajsj',
        // }, {
        // 	name: '最新安检结论',
        // 	value: '',
        // 	key: 'zxajjl',
        // },
        {
          name: '气站电话',
          value: '',
          key: 'fCzlxfs',
        },
        // {
        // 	name: '座机电话',
        // 	value: '',
        // 	key: 'zjdh',
        // },
        // {
        // 	name: '押金状态',
        // 	value: '无押金',
        // },
        // {
        // 	name: '审核原因',
        // 	value: '暂无',
        // }, {
        // 	name: '审核机构',
        // 	value: '暂无',
        // },
      ],
      qpData: {},
      qpbh: "",
      qpid: "",
      query: {},
    };
  },
  onLoad(data) {
    if (data.fQpbh) {
      this.qpbh = data.fQpbh;
      this.query = {
        fQpbh: this.qpbh
      }
    }
    if (data.qpid) {
      this.qpid = data.qpid;
      this.query = {
        yqjlid: this.qpid
      }
    }
    this.getQpxxData()
  },
  methods: {
    async getQpxxData() {
      const result = await this.$api.gasApi.getwQpxxDetail(this.query);
      let {
        code,
        value
      } = result;
      if (code === 200) {
        this.basisList = this.$assignValues(value.qpxx, this.basisList);
        this.otherList = this.$assignValues(value.qpxx, this.otherList);
        this.otherList.forEach(d=> d.name == '气站电话'?d.value = value.czxx.fCzlxfs:null)
      }
    }
  }
}
</script>

<style lang="scss">
.container {
  padding-bottom: 10px;
}

.mr10 {
  margin: 10px;
}
</style>
