yxk-20260509-党委会流程改造
1、部门负责人分配任务节点:领导可以直接反馈结果并办结任务
This commit is contained in:
@@ -125,22 +125,28 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form v-if="showSubApproveUser" class="process-variable-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form v-if="showSubApproveUser" class="process-variable-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="24">
|
<a-col :span="12">
|
||||||
|
<a-form-item label="是否办结" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||||
|
<a-radio-group v-model:value="isEnd" :disabled="savingSubApproveUser">
|
||||||
|
<a-radio :value="0">否(分配部门经办人)</a-radio>
|
||||||
|
<a-radio :value="1">是(办结)</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col v-if="showSubApproveUserSelector" :span="12">
|
||||||
<a-form-item label="部门经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
<a-form-item label="部门经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||||
<a-space class="sub-approve-user-row">
|
|
||||||
<j-select-user
|
<j-select-user
|
||||||
v-model:value="subApproveUser"
|
v-model:value="subApproveUser"
|
||||||
:disabled="savingSubApproveUser"
|
:disabled="savingSubApproveUser"
|
||||||
allow-clear
|
allow-clear
|
||||||
/>
|
/>
|
||||||
<!-- <a-input-->
|
|
||||||
<!-- v-model:value="subApproveUser"-->
|
</a-form-item>
|
||||||
<!-- placeholder="输入username,多个用英文逗号分隔"-->
|
</a-col>
|
||||||
<!-- allow-clear-->
|
<a-col :span="24">
|
||||||
<!-- :disabled="savingSubApproveUser"-->
|
<a-form-item :wrapperCol="wideActionWrapperCol">
|
||||||
<!-- />-->
|
<a-button type="primary" :loading="savingSubApproveUser" @click="saveSubApproveUserVariable">保存</a-button>
|
||||||
<a-button type="primary" :loading="savingSubApproveUser" @click="saveSubApproveUserVariable">保存经办人</a-button>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -190,6 +196,7 @@
|
|||||||
const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
||||||
const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } };
|
const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } };
|
||||||
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } };
|
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } };
|
||||||
|
const wideActionWrapperCol = { xs: { span: 24 }, sm: { span: 21, offset: 3 } };
|
||||||
|
|
||||||
const feedbackModalRef = ref();
|
const feedbackModalRef = ref();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@@ -198,6 +205,7 @@
|
|||||||
const showBaseInfoDetail = ref(false);
|
const showBaseInfoDetail = ref(false);
|
||||||
const feedbackList = ref<any[]>([]);
|
const feedbackList = ref<any[]>([]);
|
||||||
const subApproveUser = ref('');
|
const subApproveUser = ref('');
|
||||||
|
const isEnd = ref(0);
|
||||||
|
|
||||||
const mainForm = reactive<Record<string, any>>({
|
const mainForm = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
@@ -242,6 +250,7 @@
|
|||||||
const showProcessHandle = computed(() => props.formBpm && !!props.formData?.taskId);
|
const showProcessHandle = computed(() => props.formBpm && !!props.formData?.taskId);
|
||||||
const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1');
|
const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1');
|
||||||
const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1');
|
const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1');
|
||||||
|
const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1');
|
||||||
|
|
||||||
const processInfo = computed(() => ({
|
const processInfo = computed(() => ({
|
||||||
taskId: props.formData?.taskId,
|
taskId: props.formData?.taskId,
|
||||||
@@ -267,6 +276,14 @@
|
|||||||
() => initFormData()
|
() => initFormData()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.formData?.vars?.isEnd,
|
||||||
|
(value) => {
|
||||||
|
isEnd.value = String(value ?? '0') === '1' ? 1 : 0;
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
async function initFormData() {
|
async function initFormData() {
|
||||||
const dataId = props.formData?.dataId;
|
const dataId = props.formData?.dataId;
|
||||||
if (!dataId) {
|
if (!dataId) {
|
||||||
@@ -335,35 +352,48 @@
|
|||||||
|
|
||||||
async function saveSubApproveUserVariable() {
|
async function saveSubApproveUserVariable() {
|
||||||
const processInstanceId = processInfo.value.processInstanceId;
|
const processInstanceId = processInfo.value.processInstanceId;
|
||||||
|
const isEndValue = String(isEnd.value);
|
||||||
const usernameValue = normalizeUsernameList(subApproveUser.value);
|
const usernameValue = normalizeUsernameList(subApproveUser.value);
|
||||||
if (!processInstanceId) {
|
if (!processInstanceId) {
|
||||||
createMessage.warning('流程实例ID不能为空');
|
createMessage.warning('流程实例ID不能为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!usernameValue) {
|
if (isEndValue !== '1' && !usernameValue) {
|
||||||
createMessage.warning('请选择部门经办人');
|
createMessage.warning('请选择部门经办人');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
savingSubApproveUser.value = true;
|
savingSubApproveUser.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await setProcessVariable({
|
const isEndResult = await saveProcessVariable('isEnd', isEndValue);
|
||||||
processInstanceId,
|
if (!isEndResult?.success) {
|
||||||
taskId: processInfo.value.taskId,
|
createMessage.warning(isEndResult.message || '保存失败');
|
||||||
local: true,
|
return;
|
||||||
varField: 'subApproveUser',
|
|
||||||
varVal: usernameValue,
|
|
||||||
});
|
|
||||||
if (res.success) {
|
|
||||||
createMessage.success(res.message || '保存成功');
|
|
||||||
} else {
|
|
||||||
createMessage.warning(res.message || '保存失败');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEndValue !== '1') {
|
||||||
|
const subApproveUserResult = await saveProcessVariable('subApproveUser', usernameValue);
|
||||||
|
if (!subApproveUserResult?.success) {
|
||||||
|
createMessage.warning(subApproveUserResult.message || '保存失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createMessage.success('保存成功');
|
||||||
} finally {
|
} finally {
|
||||||
savingSubApproveUser.value = false;
|
savingSubApproveUser.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveProcessVariable(varField: string, varVal: any) {
|
||||||
|
return setProcessVariable({
|
||||||
|
processInstanceId: processInfo.value.processInstanceId,
|
||||||
|
taskId: processInfo.value.taskId,
|
||||||
|
local: true,
|
||||||
|
varField,
|
||||||
|
varVal,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function normalizeUsernameList(value: string) {
|
function normalizeUsernameList(value: string) {
|
||||||
return String(value || '')
|
return String(value || '')
|
||||||
.split(',')
|
.split(',')
|
||||||
|
|||||||
Reference in New Issue
Block a user