<template>
  <el-dialog
    title="设备档案详情"
    width="1100px"
    :visible.sync="dialogVisible"
    @close="close"
  >
    <el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="120px" label-suffix=":">
      <el-form-item label="设备档案编码" prop="devicerecord_code">
        <label slot="label">设备档案编码:</label>
        <el-input v-model="form.devicerecord_code" disabled placeholder="系统生成" style="width: 210px" />
      </el-form-item>
      <el-form-item label="设备状态" prop="status">
        <el-select
          v-model="form.status"
          placeholder="设备状态"
          style="width: 210px"
          class="filter-item"
          disabled
        >
          <el-option
            v-for="item in dict.device_status"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="设备编码" prop="device_code">
        <label slot="label">设备编码:</label>
        <el-input v-model="form.device_code" disabled  style="width: 210px" />
      </el-form-item>
      <el-form-item label="设备名称" prop="device_name">
        <label slot="label">设备名称:</label>
        <el-input v-model="form.device_name"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="设备规格" prop="device_spec">
        <label slot="label">设备规格:</label>
        <el-input v-model="form.device_spec"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="设备型号" prop="device_model">
        <label slot="label">设备型号:</label>
        <el-input v-model="form.device_model"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="制造商" prop="manufacturer">
        <label slot="label">制造商:</label>
        <el-input v-model="form.manufacturer"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="制造国别" prop="country_manufactur">
        <label slot="label">制造国别:</label>
        <el-input v-model="form.country_manufactur"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="出厂编号" prop="leavefactory_number">
        <label slot="label">出厂编号:</label>
        <el-input v-model="form.leavefactory_number"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="出厂日期" prop="leavefactory_date">
        <label slot="label">出厂日期:</label>
        <el-date-picker v-model="form.leavefactory_date"  disabled value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" style="width: 210px"   />
      </el-form-item>
      <el-form-item label="图号" prop="drawing_number">
        <label slot="label">图号:</label>
        <el-input v-model="form.drawing_number"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="供应商" prop="supplier_name">
        <label slot="label">供应商:</label>
        <el-input v-model="form.supplier_name"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="设备类别" prop="material_type_name">
        <label slot="label">设备类别:</label>
        <el-input v-model="form.material_type_name"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="生产用途" prop="is_produceuse">
        <el-select
          v-model="form.is_produceuse"
          placeholder="生产用途"
          style="width: 210px"
          class="filter-item"
          disabled
        >
          <el-option
            v-for="item in dict.is_produceuse"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="使用部门" prop="use_deptname">
        <label slot="label">使用部门:</label>
        <el-input v-model="form.use_deptname"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="使用班组" prop="use_groupid">
        <el-select
          v-model="form.use_groupid"
          placeholder="使用班组"
          disabled
          style="width: 210px"
          class="filter-item"
        >
          <el-option
            v-for="item in dict.device_type"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="设备属性" prop="device_type">
        <el-select
          v-model="form.device_type"
          placeholder="设备属性"
          disabled
          style="width: 210px"
          class="filter-item"
        >
          <el-option
            v-for="item in dict.device_type"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="外部编码" prop="extend_code">
        <label slot="label">外部编码:</label>
        <el-input v-model="form.extend_code"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="资产编码" prop="assets_code">
        <label slot="label">资产编码:</label>
        <el-input v-model="form.assets_code"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="资产名称" prop="assets_name">
        <label slot="label">资产名称:</label>
        <el-input v-model="form.assets_name"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="归属部门" prop="belong_deptname">
        <label slot="label">归属部门:</label>
        <el-input v-model="form.belong_deptname"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="启用日期" prop="beginuse_date">
        <label slot="label">启用日期:</label>
        <el-date-picker v-model="form.beginuse_date" value-format="yyyy-MM-dd" type="date" placeholder="启用日期" style="width: 210px"   disabled />
      </el-form-item>
      <el-form-item label="工序" prop="workprocedure_id">
        <el-select
          v-model="form.workprocedure_id"
          placeholder="工序"
          style="width: 210px"
          class="filter-item"
          disabled
        >
          <el-option
            v-for="item in workProcedureList"
            :key="item.workprocedure_id"
            :label="item.workprocedure_name"
            :value="item.workprocedure_id"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="理论节拍" prop="theory_beat">
        <label slot="label">理论节拍:</label>
        <el-input-number
          v-model="form.theory_beat"
          :controls="false"
          :precision="3"
          disabled
          :min="0"
          style="width: 210px"
        />
      </el-form-item>
      <el-form-item label="设备BOM" prop="device_bom_id">
        <el-select
          v-model="form.device_bom_id"
          placeholder="设备BOM"
          disabled
          style="width: 210px"
          class="filter-item"
        >
          <el-option
            v-for="item in dict.workorder_type"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="卡片编号" prop="card_code">
        <label slot="label">卡片编号:</label>
        <el-input v-model="form.card_code"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="安装地点" prop="setting_place">
        <label slot="label">安装地点:</label>
        <el-input v-model="form.setting_place"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="使用人" prop="user_name">
        <label slot="label">使用人:</label>
        <el-input v-model="form.user_name"  disabled style="width: 210px" />
      </el-form-item>
      <el-form-item label="本币原值" prop="oraginal_value">
        <label slot="label">本币原值:</label>
        <el-input-number
          v-model="form.oraginal_value"
          :controls="false"
          :precision="3"
          disabled
          :min="0"
          style="width: 210px"
        />
      </el-form-item>
      <el-form-item label="净额" prop="net_amount">
        <label slot="label">净额:</label>
        <el-input-number
          v-model="form.net_amount"
          :controls="false"
          disabled
          :precision="3"
          :min="0"
          style="width: 210px"
        />
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
        <el-input v-model="form.remark" style="width: 480px;" rows="3" type="textarea" disabled />
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>

import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";

export default {
  name: 'ViewDialog',
  components: { },
  props: {
    dialogShow: {
      type: Boolean,
      default: false
    },
    rowmst: {
      type: Object
    }
  },
  dicts: ['device_type', 'workorder_type', 'is_produceuse', 'device_status'],
  data() {
    return {
      dialogVisible: false,
      workProcedureList: [],
      form: {}
    }
  },
  watch: {
    dialogShow: {
      handler(newValue) {
        this.dialogVisible = newValue
      }
    },
    rowmst: {
      handler(newValue) {
        this.form = newValue
      }
    }
  },
  created() {
    crudWorkProcedure.downSelect().then(res => {
      this.workProcedureList = res
    })
  },
  methods: {
    close() {
      this.$emit('update:dialogShow', false)
      this.form = {}
      this.$emit('AddChanged')
    },
    storChange() {
      return false
    }
  }
}
</script>

<style>
.crud-opts2 {
  padding: 0 0;
  display: -webkit-flex;
  display: flex;
  align-items: center;
}
.crud-opts2 .crud-opts-right2 {
  margin-left: auto;
  padding: 4px 4px;
}
.input-with-select  {
  background-color: #fff;
}
</style>
