|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template> |
|
|
|
|
<el-dialog v-model="visible" width="50vw" title="信件退回"> |
|
|
|
|
<el-dialog width="50vw" title="信件退回"> |
|
|
|
|
<el-form |
|
|
|
|
label-position="top" |
|
|
|
|
:model="form" |
|
|
|
|
@ -25,11 +25,12 @@
|
|
|
|
|
v-model="form.reason" |
|
|
|
|
type="textarea" |
|
|
|
|
:rows="3" |
|
|
|
|
placeholder="请输入退回原因" |
|
|
|
|
:placeholder="showReturnAttachments() ? '请写明信件涉及的具体机构以及退回原因' : '请填写退回整改原因'" |
|
|
|
|
></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<p>请写明信件涉及的具体机构。</p> |
|
|
|
|
|
|
|
|
|
<el-form-item label="附件" prop="attachments" v-if="showReturnAttachments()"> |
|
|
|
|
<Upload v-model="form.attachments" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<footer class="flex end"> |
|
|
|
|
<el-button type="primary" size="large" @click="submit" |
|
|
|
|
@ -39,7 +40,6 @@
|
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
<script setup> |
|
|
|
|
const visible = ref(false); |
|
|
|
|
const form = reactive({}); |
|
|
|
|
const rules = { |
|
|
|
|
returnOperate: [ |
|
|
|
|
@ -58,10 +58,6 @@ const rules = {
|
|
|
|
|
const formRef = ref(); |
|
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
|
show: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default: false, |
|
|
|
|
}, |
|
|
|
|
data: { |
|
|
|
|
type: Object, |
|
|
|
|
default: {}, |
|
|
|
|
@ -71,40 +67,18 @@ const props = defineProps({
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
watch(() => props.mail.id, () => { |
|
|
|
|
formRef.value?.resetFields(); |
|
|
|
|
form.attachments = [] |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const emits = defineEmits(["update:data", "submit", "close"]); |
|
|
|
|
|
|
|
|
|
const flowKeys = ['second_sign', 'second_distribute', 'three_sign'] |
|
|
|
|
function showReturnAttachments() { |
|
|
|
|
return flowKeys.indexOf(props.mail.flowKey) > -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function submit() { |
|
|
|
|
formRef.value.validate((valid) => { |
|
|
|
|
@ -113,7 +87,7 @@ function submit() {
|
|
|
|
|
const data = { ...props.data, ...form }; |
|
|
|
|
emits("update:data", data); |
|
|
|
|
emits("submit", "returnSubmit"); |
|
|
|
|
visible.value = false; |
|
|
|
|
emits("close"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |