局长信箱-内网端(前端)
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.
 
 
 
 
 
 

95 lines
2.3 KiB

<template>
<el-dialog v-model="visible" width="50vw" title="信件退回">
<el-form
label-position="top"
:model="form"
:rules="rules"
ref="formRef"
style="height: 50vh"
>
<el-form-item label="退回原因" prop="reason">
<el-input
v-model="form.reason"
type="textarea"
:rows="3"
placeholder="请输入退回原因"
></el-input>
</el-form-item>
</el-form>
<footer class="flex end">
<el-button type="primary" size="large" @click="submit"
>信件退回</el-button
>
</footer>
</el-dialog>
</template>
<script setup>
const visible = ref(false);
const form = reactive({});
const rules = {
reason: [
{
required: true,
message: "请填写退回原因",
},
],
};
const formRef = ref();
const props = defineProps({
show: {
type: Boolean,
default: false,
},
data: {
type: Object,
default: {},
}
});
const selectLeaderVisible = ref(false)
const leaderType = ref('all')
watch(() => props.flowKey, (val) => {
if (val === 'second_approval' || val === 'second_deputy_approval') {
selectLeaderVisible.value = true
leaderType.value = val === 'second_deputy_approval' ? 'leader' : 'deputy'
}
if (val === 'second_approval') {
leaderType.value = 'deputy'
}
if (val === 'second_deputy_approval') {
leaderType.value = 'leader'
}
})
onMounted(() => {
if (props.data) {
Object.assign(form, props.data);
}
});
const emits = defineEmits(["update:show", "update:data", "submit"]);
watch(visible, (val) => {
emits("update:show", val);
});
watch(
() => props.show,
(val) => {
visible.value = val;
if (val) {
}
}
);
function submit() {
formRef.value.validate((valid) => {
if (valid) {
// 提交审批逻辑
const data = { ...props.data, ...form };
emits("update:data", data);
emits("submit", "returnSubmit");
visible.value = false;
}
});
}
</script>
<style lang="scss" scoped>
</style>