中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.7 KiB

4 months ago
<template>
<el-dialog title="审核" append-to-body :modelValue="openShow" width="30%" @close="closeDialog">
<avue-form v-model="obj" :option="option" ref="form"></avue-form>
4 months ago
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit" v-loading="submitLoading"> </el-button>
</span>
</template>
</el-dialog>
4 months ago
</template>
<script>
import { directorApproval, factoryApproval } from '@/api/processManagement/planClass.js';
4 months ago
export default {
props: {
showDialog: {
type: Boolean,
default: false,
4 months ago
},
rowItem: {
type: Object,
default: {},
4 months ago
},
},
data() {
return {
obj: {},
openShow: false,
submitLoading: false,
option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: '审批结果',
prop: 'isPass',
span: 24,
type: 'radio',
dicData: [
{ label: '审批通过', value: 1 },
{ label: '审批不通过', value: 2 },
],
rules: [{ required: true, message: '请选择', trigger: 'blur' }],
},
{
label: '驳回原因',
prop: 'approvalOpinions',
type: 'textarea',
span: 24,
},
],
},
};
},
mounted() {
this.openShow = this.showDialog;
},
methods: {
closeDialog() {
this.openShow = false;
this.$emit('closeDialog');
4 months ago
},
submit() {
this.$refs.form.validate((valid, done, msg) => {
if (valid) {
this.submitLoading = true;
// 室主任审核
if (this.rowItem.approvalStatus == '-1' || this.rowItem.approvalStatus == 1) {
directorApproval({ ...this.obj, id: this.rowItem.id }).then(res => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.closeDialog();
this.submitLoading = false;
});
}
// 厂长审核
if (this.rowItem.approvalStatus == 2) {
factoryApproval({ ...this.obj, id: this.rowItem.id }).then(res => {
this.$message({
type: 'success',
message: '操作成功!',
});
this.closeDialog();
this.submitLoading = false;
});
}
this.submitLoading = false;
done();
} else {
console.log('error submit!!');
this.submitLoading = false;
return false;
4 months ago
}
});
},
},
};
4 months ago
</script>
<style lang="scss" scoped></style>