Commit bf14f9ef authored by jingnan's avatar jingnan 👀

归还情况说明编辑表单自定义

parent 3fb78d9b
/**
* @Description: 归还情况说明编辑
* @author gjn
* @date 2024-11-12
*/
<template>
<div class="EditReturnRemark">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" class="inputFormClass">
<el-form-item
prop="returnSituationDescription"
label="归还情况说明:"
>
<el-input v-model="form.returnSituationDescription" type="textarea" :rows="3" />
</el-form-item>
</el-form>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
// componentName: '归还情况说明编辑',
name: 'EditReturnRemark',
components: {},
props: {
scope: {
type: Object,
default: () => {}
},
basicData: {
type: Object,
default: () => {}
},
value: {
type: [String, Number],
default: 0
}
},
data() {
return {
returnSituationDescription: '',
form: {},
rules: {
returnSituationDescription: [
{ required: true, message: '归还情况说明不能为空', trigger: 'blur' }
]
}
}
},
computed: {},
watch: {
'basicData.returnSituationDescription': {
immediate: true,
handler(val) {
this.$set(this.form, 'returnSituationDescription', val)
}
}
},
created() {
},
methods: {
async handleChange(val) {
try {
const params = {
...this.basicData,
operator: 'MODIFY',
returnSituationDescription: this.form.returnSituationDescription
}
const res = await post('/ExtBorrowingForm/recursion', params)
return { success: true, data: res }
} catch (err) {
return { success: false, error: err }
}
},
validate() {
return new Promise((resolve, reject) => {
this.$refs['form'].validate(valid => {
if (valid) {
this.handleChange().then(result => {
resolve(result)
}).catch(error => {
reject(error)
})
} else {
reject(new Error('表单验证失败'))
}
})
})
}
}
}
</script>
<style lang='scss'>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment