|
|
@ -80,7 +80,7 @@ |
|
|
|
</el-form> |
|
|
|
<template slot="footer"> |
|
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
<el-button :disabled="disabled" type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
@ -100,6 +100,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
disabled: false, |
|
|
|
visible: false, |
|
|
|
dataForm: { |
|
|
|
platform: 2, |
|
|
@ -194,27 +195,34 @@ export default { |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function() { |
|
|
|
this.disabled = true |
|
|
|
this.$refs.dataForm.validate((valid) => { |
|
|
|
if (!valid) { |
|
|
|
this.disabled = false |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dataForm.zlProjectCode = this.dataForm.zlProjectCode.length && this.dataForm.zlProjectCode.join(',') |
|
|
|
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.visible = false |
|
|
|
this.$emit('refreshDataList') |
|
|
|
this.$http[!this.dataForm.id ? 'post' : 'put']('/patient/savePatient', this.dataForm) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.$message({ |
|
|
|
message: this.$t('prompt.success'), |
|
|
|
type: 'success', |
|
|
|
duration: 500, |
|
|
|
onClose: () => { |
|
|
|
this.visible = false |
|
|
|
this.$emit('refreshDataList') |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(res => { |
|
|
|
this.$message.error(res.msg) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.disabled = false |
|
|
|
}) |
|
|
|
}).catch(res => { |
|
|
|
this.$message.error(res.msg) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, 1000, { leading: true, trailing: false }), |
|
|
|
// 关闭弹框 |
|
|
|