<template>
  <div class="personne-information" v-loading="isLoading">
    <el-form ref="ruleForm" :key="key" :model="ruleForm" :rules="rules" label-width="150px" label-position="top" class="rule-form-orange">
      <cy-info-title>
        货物信息
      </cy-info-title>
      <div class="table-box" style="width: 100%">
        <el-table :data="businessInfo.list">
          <el-table-column type="index" label="序号" width="50" />
          <el-table-column prop="goodsName" label="名称" label-class-name="rule-required"></el-table-column>
          <el-table-column prop="goodsFactory" label="厂家" label-class-name="rule-required"></el-table-column>
          <el-table-column prop="modelNumber" label="型号" label-class-name="rule-required"></el-table-column>
          <el-table-column prop="units" label="单位" label-class-name="rule-required"></el-table-column>
          <el-table-column prop="quantity" label="数量" label-class-name="rule-required"></el-table-column>
          <el-table-column prop="price" label="暂定单价"></el-table-column>
          <el-table-column prop="remark" label="备注">
            <template slot-scope="scope">
              <el-input
                v-model="scope.row.remark"
                placeholder="请输入备注" disabled
              />
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-form>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  props: {
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      ruleForm: {},
      rules: {},
      key: 0,
      loading: false,
      businessInfo: {
        businessNumber: '',
        info: {},
        list: []
      },
      isLoading: false
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  watch: {
    'info.mathId': {
      handler(newV) {
        if (newV) {
          this.businessInfo.list = [ ...this.info.purchContractGoodsInfoList ]
        }
      },
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
.personne-iInformation {

}
</style>
