<template>
  <el-form ref="form" :rules="rules" :model="formData" label-width="100px">

    <input v-model="formData.id" type="hidden" name="id">

    <el-row>
      <el-col :span="12">
        <el-form-item label="故障编号">
          <el-select v-model="formData.faultNumber" placeholder="请选择">
            <el-option label="#1" value="#1" />
            <el-option label="#2" value="#2" />
          </el-select>
        </el-form-item>
      </el-col>

      <el-col :span="12">
        <el-form-item label="工序名称">
          <el-select v-model="formData.workingProcedure" placeholder="请选择">
            <el-option label="冷轧保障作业区" value="01" />
            <el-option label="XXX作业区" value="02" />
          </el-select>
        </el-form-item>
      </el-col>

    </el-row>

    <el-row>
      <el-col :span="12">
        <el-form-item label="设备名称">
          <el-select v-model="formData.deviceName" placeholder="请选择">
            <el-option label="罩式炉19#天车副钩电缆卷筒故障" value="01" />
            <el-option label="XXX设备" value="02" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="事故分级">
          <el-select v-model="formData.level" placeholder="请选择">
            <el-option label="设备故障" value="01" />
            <el-option label="非设备故障" value="02" />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>

    <el-form-item label="故障日期">
      <el-date-picker v-model="formData.faultDate" type="date" placeholder="选择日期" style="width: 100%;" />
    </el-form-item>

    <el-form-item label="故障描述">
      <el-input v-model="formData.describe" type="textarea" :autosize="true" />
    </el-form-item>

    <el-form-item label="故障原因简述">
      <el-input v-model="formData.reasonDescribe" type="textarea" :rows="4" :show-word-limit="true" />
    </el-form-item>

    <el-row>
      <el-col :span="12">
        <el-form-item label="影响生产时间">
          <el-input-number v-model="formData.affectingProductionTime" :size="'mini'" :precision="1" :step="1" :min="0" />
          <span style="margin-left: 12px;">分钟</span>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="故障时间">
          <el-input-number v-model="formData.faultTime" :size="'mini'" :precision="1" :step="1" :min="0" />
          <span style="margin-left: 12px;">分钟</span>
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider />
    <h4>事故损失</h4>
    <el-row>
      <el-col :span="12">
        <el-form-item label="修复损失">
          <el-input-number v-model="formData.repairLoss" :size="'mini'" :precision="2" :step="1" :min="0" />
          <span style="margin-left: 12px;">万元</span>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="产量损失">
          <el-input-number v-model="formData.yeildLoss" :size="'mini'" :precision="2" :step="1" :min="0" />
          <span style="margin-left: 12px;">吨</span>
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider />
    <h4>追究责任</h4>
    <el-form-item label="责任人">
      <el-select v-model="formData.personLiable" placeholder="请选择">
        <el-option label="许成龙" value="许成龙" />
        <el-option label="XXX1" value="XXX1" />
        <el-option label="XXX2" value="XXX2" />
      </el-select>
    </el-form-item>

    <el-form-item label="考核">
      <el-input v-model="formData.assessment" />
    </el-form-item>

    <el-form-item label="考核依据">
      <el-input v-model="formData.assessmentBasis" />
    </el-form-item>

    <el-divider />
    <h4>故障统计</h4>
    <el-form-item label="故障专业">
      <el-radio-group v-model="formData.faultDiscipline" size="small">
        <el-radio-button label="机械" />
        <el-radio-button label="动力" />
        <el-radio-button label="电气" />
        <el-radio-button label="仪表计算机" />
      </el-radio-group>
    </el-form-item>

    <el-form-item label="故障分类">
      <el-select v-model="formData.faultCause" placeholder="请选择">
        <el-option label="违章作业" value="违章作业" />
        <el-option label="检修质量" value="检修质量" />
        <el-option label="检修拖期" value="检修拖期" />
        <el-option label="备件质量" value="备件质量" />
        <el-option label="维护不周" value="维护不周" />
        <el-option label="润滑不良" value="润滑不良" />
        <el-option label="设备失修" value="设备失修" />
        <el-option label="生产工艺事故" value="生产工艺事故" />
        <el-option label="其他故障" value="其他故障" />
      </el-select>
    </el-form-item>

    <el-form-item label="故障分类">
      <el-radio-group v-model="formData.faultType" size="small">
        <el-radio-button label="己方故障" />
        <el-radio-button label="双方故障" />
        <el-radio-button label="他方故障" />
      </el-radio-group>
    </el-form-item>

    <el-form-item label="特殊故障">
      <el-radio-group v-model="formData.faultSpecial" size="small">
        <el-radio-button label="重复故障" />
        <el-radio-button label="典型故障" />
        <el-radio-button label="典型重复故障" />
      </el-radio-group>
    </el-form-item>

    <el-form-item label="标准是否健全">
      <el-radio-group v-model="formData.faultSpecial" size="small">
        <el-radio-button label="标准健全" />
        <el-radio-button label="标准不完善" />
        <el-radio-button label="没有标准" />
      </el-radio-group>
    </el-form-item>

    <el-form-item label="标准是否健全">
      <el-select v-model="formData.integral" placeholder="请选择">
        <el-option label="标准健全" :value="1" />
        <el-option label="标准不完善" :value="2" />
        <el-option label="没有标准" :value="3" />
      </el-select>
    </el-form-item>

    <el-divider />
    <el-form-item label="备注">
      <el-input v-model="formData.remarks" type="textarea" :rows="6" :show-word-limit="true" />
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="onSubmit">{{ editMode? '确认修改' : '立即创建' }}</el-button>
      <el-button @click="hideDialog">取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script>

import Mixins_AddDialogForm from '@/mixins/AddDialogForm'

export default {
  name: 'RepairFaultAddDialogForm',
  mixins: [Mixins_AddDialogForm],
  props: {},

  data() {
    return {
      orgFormData: {
        faultNumber: '#1',
        workingProcedure: '01',
        deviceName: '01',
        faultDate: '2012.1.31',
        level: '设备故障',
        describe: '罩式炉19#天车副钩电缆卷筒故障',
        reasonDescribe: '打开损坏的电缆卷筒检查卷簧，发现卷簧从根部第2圈处断裂。卷筒在平时使用中无异常声音，内部无犯卡情况，卷簧断裂是因为卷簧机械疲劳导致，这个卷筒使用时间为8个多月，因此判断该卷簧质量存在问题',
        affectingProductionTime: '35',

        faultTime: 0,
        repairLoss: 0,
        yeildLoss: 0,

        personLiable: '许成龙',
        assessment: '',
        assessmentBasis: '',

        faultDiscipline: '',
        faultCause: '备件质量',
        faultType: '己方故障',
        faultSpecial: false,
        integral: 1,

        remarks: '',

        // ////////////////////////

        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
  }
}
</script>

<style lang="scss" scoped>

</style>
