123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <a-modal
- title="编辑"
- :width="800"
- :visible="visible"
- :confirmLoading="confirmLoading"
- class="ant-modal2"
- @cancel="handleCancel"
- >
- <a-form >
- <a-form-item
- label="故障描述"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol">
- <a-textarea
- v-model="content"
- placeholder="请输入内容!"
- />
- </a-form-item>
- </a-form>
- <template slot="footer">
- <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
- </template>
- </a-modal>
- </template>
- <script>
- import { changeEditForm } from '@/api/repair/application-form'
- export default {
- name: 'BaseRepairApplicationForm',
- data () {
- return {
- model: null,
- confirmLoading: false,
- visible: false,
- content: ''
- }
- },
- created () {
- // 下拉框map
- },
- methods: {
- base (record) {
- this.visible = true
- this.model = record
- this.content = record.content
- },
- save () {
- if (this.content === '' || this.content == null) {
- this.$message.error('请填写故障描述!')
- return
- }
- changeEditForm({
- id: this.model.id,
- content: this.content
- }).then(() => {
- this.$message.info('故障描述已修改!')
- this.handleCancel(this.model.content)
- }).catch(() => {
- this.confirmLoading = false
- })
- },
- handleCancel (values) {
- this.visible = false
- this.confirmLoading = false
- this.$emit('ok', values)
- }
- }
- }
- </script>
|