<template lang="pug">
  el-dialog( :close-on-click-modal='false', :visible.sync='visible' :modal-append-to-body='false')
    div(slot='title')
      span.title-bold 应急物资详情
    el-form(:model='dataForm',  ref='dataForm',  label-width='120px')
      el-row(:gutter='20')
        el-col(:span='12')
          el-form-item(label="应急物资名称:" )
             el-input.mywidth(v-model='dataForm.name' placeholder="请输入应急物资名称"  clearable readonly)
        el-col(:span='12')
          el-form-item(label="规格型号:")
            el-input.mywidth(v-model='dataForm.specifications' placeholder="请输入规格型号"  clearable readonly)
      el-row(:gutter='20')
        el-col(:span='12')
          el-form-item(label="类型:")
            el-input.mywidth(v-model='dataForm.typeName' placeholder="请输入规格型号"  clearable readonly)
        el-col(:span='12')
          el-form-item(label="品牌:" )
            el-input.mywidth(v-model='dataForm.brand' placeholder="请输入品牌"  clearable readonly)
      el-row(:gutter='20')
        el-col(:span='12')
          el-form-item(label="单位:")
            el-input.mywidth(v-model='dataForm.unit' placeholder="请输入单位"  clearable readonly)
        el-col(:span='12')
          el-form-item(label="可使用数量:")
            el-input.mywidth(v-model='dataForm.count' placeholder="请输入可使用数量" type='number' clearable readonly)
      el-row(:gutter='20')
        //- el-col(:span='12')
          el-form-item(label="是否使用:" prop="status")
            el-radio-group.my_radio(disabled v-model='dataForm.status')
                el-radio(:label='1') 是
                el-radio(:label='2') 否
            //- el-input.mywidth(v-model='dataForm.placeFor' placeholder=""  clearable readonly)
        el-col(:span='12')
          el-form-item(label="存放位置:" prop="placeFor")
            el-input.mywidth(v-model='dataForm.placeFor' placeholder=""  clearable readonly)
        el-col(:span='12')
          el-form-item(label="排序值:" prop="sortValue")
            el-input.mywidth(v-model='dataForm.sortValue' placeholder=""  clearable readonly)
      el-row
        el-col(:span='24')
          el-form-item(label="物资说明:")
            el-input.mywidth(v-model="dataForm.remark"  type="textarea" :rows="5" resize="none" placeholder="请输入物资说明" readonly)
    span.dialog-footer(slot='footer')
      el-button(type='primary' size='medium' @click='visible = false') 关闭
</template>

<script>
export default {
  data () {
    return {
      dataList: [],
      dataListLoading: false,
      visible: false,
      dataForm: {},
      typeList: [
        { id: '1', name: '通讯器材类' },
        { id: '2', name: '防疫类' },
        { id: '3', name: '消防器材' }
      ]
    }
  },
  created () {
    // this.getType()
  },
  methods: {
    init (row) {
      this.visible = true
      this.dataForm = row
      this.typeList.forEach(e => {
        if (e.id === this.dataForm.type) {
          this.dataForm.typeName = e.name
        }
      })
    },
    //获取物资类型
    getType () {
      this.$http({
        url: this.$http.adornUrl('/sysDictionary/getListByParent'),
        method: 'get',
        params: { parentId: 'bf8efa4ef7fc4d4b94c7b7eaab4c9bed', stationId: localStorage.getItem('stationId') }
      }).then(data => {
        if (data && data.code === 0) {
          this.typeList = data.list
        }
      })
    }

  }
}
</script>
<style>
.el-table__header {
  width: 100% !important;
}
.el-table__body {
  width: 100% !important;
}
</style>
