RemarkForm.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <a-modal
  3. title="编辑"
  4. :width="800"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. class="ant-modal2"
  8. @cancel="handleCancel"
  9. >
  10. <a-form >
  11. <a-form-item
  12. label="故障描述"
  13. :labelCol="BaseTool.Constant.labelCol"
  14. :wrapperCol="BaseTool.Constant.wrapperCol">
  15. <a-textarea
  16. v-model="content"
  17. placeholder="请输入内容!"
  18. />
  19. </a-form-item>
  20. </a-form>
  21. <template slot="footer">
  22. <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
  23. </template>
  24. </a-modal>
  25. </template>
  26. <script>
  27. import { changeEditForm } from '@/api/repair/application-form'
  28. export default {
  29. name: 'BaseRepairApplicationForm',
  30. data () {
  31. return {
  32. model: null,
  33. confirmLoading: false,
  34. visible: false,
  35. content: ''
  36. }
  37. },
  38. created () {
  39. // 下拉框map
  40. },
  41. methods: {
  42. base (record) {
  43. this.visible = true
  44. this.model = record
  45. this.content = record.content
  46. },
  47. save () {
  48. if (this.content === '' || this.content == null) {
  49. this.$message.error('请填写故障描述!')
  50. return
  51. }
  52. changeEditForm({
  53. id: this.model.id,
  54. content: this.content
  55. }).then(() => {
  56. this.$message.info('故障描述已修改!')
  57. this.handleCancel(this.model.content)
  58. }).catch(() => {
  59. this.confirmLoading = false
  60. })
  61. },
  62. handleCancel (values) {
  63. this.visible = false
  64. this.confirmLoading = false
  65. this.$emit('ok', values)
  66. }
  67. }
  68. }
  69. </script>