3 changed files with 106 additions and 4 deletions
@ -0,0 +1,87 @@ |
|||||
|
<template> |
||||
|
<el-dialog :visible.sync="visible" :title="'处理'" :close-on-click-modal="false" :close-on-press-escape="false"> |
||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
||||
|
<el-form-item label="审批状态" prop="checkResult" label-width="80px"> |
||||
|
<el-select v-model="dataForm.checkResult" placeholder="请选择" clearable> |
||||
|
<el-option label="通过" value="2"> </el-option> |
||||
|
<el-option label="驳回" value="4"> </el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="审核理由" prop="checkOpinion"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:rows="3" |
||||
|
v-model="dataForm.checkOpinion" |
||||
|
maxlength="200" |
||||
|
style="width:calc(100% - 110px)"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template slot="footer"> |
||||
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
||||
|
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
||||
|
</template> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import debounce from 'lodash/debounce' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
visible: false, |
||||
|
dataForm: { |
||||
|
infoId: '', |
||||
|
checkResult: '', |
||||
|
checkOpinion: '' |
||||
|
}, |
||||
|
isAble: false |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
dataRule () { |
||||
|
return { |
||||
|
checkResult: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
], |
||||
|
checkOpinion: [ |
||||
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init () { |
||||
|
this.visible = true |
||||
|
this.isAble = false |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['dataForm'].resetFields() |
||||
|
}) |
||||
|
}, |
||||
|
// 表单提交 |
||||
|
dataFormSubmitHandle: debounce(function () { |
||||
|
this.$refs['dataForm'].validate((valid) => { |
||||
|
if (!valid) { |
||||
|
return false |
||||
|
} |
||||
|
this.isAble = true |
||||
|
this.$http['post']('/kpi/subpositioncheckinfo/firstTrial', this.dataForm).then(({ data: res }) => { |
||||
|
if (res.code !== 0) { |
||||
|
this.isAble = false |
||||
|
return this.$message.error(res.msg) |
||||
|
} |
||||
|
this.$message({ |
||||
|
message: this.$t('prompt.success'), |
||||
|
type: 'success', |
||||
|
duration: 500, |
||||
|
onClose: () => { |
||||
|
this.$emit('connectResponse') |
||||
|
this.visible = false |
||||
|
this.$emit('refreshDataList') |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}) |
||||
|
}, 1000, { 'leading': true, 'trailing': false }) |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
Loading…
Reference in new issue