<template>
  <div>
    <el-card>
      <el-form :model="formData" class="query-form" label-width="100px">
        <el-button-group style="display: flex;margin: 0px 0 10px 90%; height: 35px">
          <el-button type="primary" @click.native="submit()">保存</el-button>
        </el-button-group>
        <el-row>
          <el-col :span="18">
            <el-form-item class="query-form-item" prop="originCode" label="UDI码:">
              <el-input v-model="formData.originCode" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="deviceName" label="设备名称:">
              <el-input v-model="formData.deviceName" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="code" label="资产编码:">
              <el-input v-model="formData.code" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="nameCode" label="DI/物资编码:">
              <el-input v-model="formData.nameCode" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="cplb" label="设备类别:">
              <el-input v-model="formData.cplb" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="deptName" label="所属部门:">
              <el-input v-model="formData.deptName" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="manager" label="负责人:">
              <el-input v-model="formData.managerName" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="ggxh" label="规格型号:">
              <el-input v-model="formData.ggxh" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="batchNo" label="批次号:">
              <el-input v-model="formData.batchNo" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="productionDate" label="生产日期:">
              <el-input v-model="formData.productionDate" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="expireDate" label="失效日期:">
              <el-input v-model="formData.expireDate" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="serialNo" label="序列号:">
              <el-input v-model="formData.serialNo" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="manufactory" label="生产企业:">
              <el-input v-model="formData.manufactory" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="supName" label="供应商:">
              <el-input v-model="formData.supName" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="curUser" label="使用人:">
              <el-input v-model="formData.curUser" disabled style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item class="query-form-item" prop="location" label="设备位置:">
              <el-input v-model="formData.location" style="width: 90%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item class="query-form-item" prop="detailLocation" label="设备详情位置:">
              <el-input v-model="formData.detailLocation" style="width: 97%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item class="query-form-item" prop="remark" label="设备备注:">
              <el-input v-model="formData.remark" style="width: 97%" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {isBlank} from "@/utils/strUtil";
import {getDeptDeviceList, selectProductByRelId} from "@/api/inventory/deptDevice";

export default {
  name: "deptDeviceModelDetail",
  props: {
    rowData: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      formData: {}
    };
  },
  methods: {},
  created() {
    this.formData = this.rowData;
    if (!isBlank(this.formData.relId)) {
      selectProductByRelId({relId:this.formData.relId}).then((res) => {
        this.loading = false;
        if (res.code === 20000) {
          this.formData.cplb = res.data.cplb
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
