<template>
  <div>
    <Modal v-model="maintainFreeModal" width="430">
      <p slot="header">
        {{ modalTitle }}
      </p>
      <Row>
        <!--维护实际时间-->
        <Col span="24" />
        <Form
          id="edit-time-scrap-forms"
          ref="formObj"
          :model="formObj"
          :rules="ruleValidate"
          inline
          onsubmit="return false"
          :label-width="130"
        >
          <Form-item label="报废处理方式" prop="scrapMode">
            <Input
              v-model="formObj.scrapMode"
              style="width:245px"
              placeholder="请输入报废处理方式"
            /></Input>
          </Form-item>
        </Form>
        </Col>
      </Row>
      <div slot="footer">
        <Button type="ghost" style="margin-left: 8px" @click="_cancel">
          取消
        </Button>
        <Button type="info" @click="_ok">
          确定
        </Button>
      </div>
    </Modal>
  </div>
</template>

<script>
const defVal = {
  scrapMode: ''
}
export default {
  name: 'LmsMaintainStartTimeAct',

  data() {
    return {
      maintainFreeModal: false,
      modalTitle: '',
      types: '',
      selectIds: [],
      maintainerNamesList: [],
      formObj: defVal,
      detailId: '',
      ruleValidate: {
        scrapMode: [
          { required: true, message: '报废处理方式不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    _open(ids, detailId) {
      this.formObj = defVal
      this.$refs.formObj.resetFields()
      this.detailId = detailId
      this.modalTitle = '维护报废处理方式'
      this.maintainFreeModal = true
      this.selectIds = ids
    },
    _cancel() {
      this.maintainFreeModal = false
    },
    _ok() {
      this.$refs.formObj.validate(valid => {
        if (valid) {
          this._resultChange('保存成功!')
        }
      })
    },
    _resultChange(msg) {
      this.maintainFreeModal = false
      this.$Message.success(msg)
      this.$emit('on-result-change', this.formObj.scrapMode, 'scrapMode')
    }
  }
}
</script>

<style scoped>
</style>
