feat(inspect): 新增默认审批意见和默认抄送人功能
- bpm-select-user 新增 value prop 支持初始值回显 - MyHandleContent/TaskHandleInnerContent 新增 defaultCc prop 透传默认抄送人 - DqInspectTaskBPMForm 按任务节点自动生成审批意见 - DqInspectTaskBPMForm 党群负责人收集后审批节点自动查询抄送人 - 所有新增 prop 均可选,不影响现有调用方 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
/**
|
||||
* 流程审批中选择用户用 - 只管选择,不管回显
|
||||
*/
|
||||
import { ref, toRaw, computed } from 'vue';
|
||||
import { ref, toRaw, computed, watch } from 'vue';
|
||||
import BpmSelectUserModal from './BpmSelectUserModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
|
||||
@@ -27,15 +27,32 @@
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
emits: ['change'],
|
||||
setup(_p, { emit }) {
|
||||
setup(props, { emit }) {
|
||||
let selectedUserList = [];
|
||||
const options = ref([]);
|
||||
const selectValue = ref([]);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const lastSelectedRows = ref([]);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
const list = (Array.isArray(val) ? val : []).filter((u) => u?.username);
|
||||
if (!list.length) return;
|
||||
selectValue.value = list.map((u) => u.username);
|
||||
options.value = list.map((u) => ({ value: u.username }));
|
||||
selectedUserList = list;
|
||||
lastSelectedRows.value = list;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
function openSelect() {
|
||||
let arr = getModalData();
|
||||
openModal(true, {
|
||||
|
||||
+20
-2
@@ -83,7 +83,7 @@
|
||||
<!-- 抄送 -->
|
||||
<a-list-item style="line-height: 32px" v-show="checkedCc">
|
||||
<span>抄送给:</span>
|
||||
<bpm-select-user style="display: inline-block" placeholder="请选择抄送人" @change="handleSelectCcUser"></bpm-select-user>
|
||||
<bpm-select-user style="display: inline-block" placeholder="请选择抄送人" :value="defaultCc" @change="handleSelectCcUser"></bpm-select-user>
|
||||
</a-list-item>
|
||||
</a-list>
|
||||
|
||||
@@ -187,7 +187,11 @@
|
||||
defaultReason: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
defaultCc: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
emits: ['success'],
|
||||
setup(props, { emit }) {
|
||||
@@ -288,6 +292,20 @@
|
||||
ccPersonList.value = [];
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.defaultCc,
|
||||
(val) => {
|
||||
const list = (Array.isArray(val) ? val : []).filter((u) => u?.username);
|
||||
if (!list.length) return;
|
||||
checkedCc.value = true;
|
||||
const usernames = list.map((u) => u.username);
|
||||
const realnames = list.map((u) => u.realname);
|
||||
model.ccUserIds = usernames.join(',');
|
||||
model.ccUserRealNames = realnames.join(',');
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
function changeReasonSelection(value) {
|
||||
model.reason = value;
|
||||
}
|
||||
|
||||
+5
@@ -21,6 +21,7 @@
|
||||
:allowReject="allowReject"
|
||||
:beforeHandle="beforeHandle"
|
||||
:defaultReason="defaultReason"
|
||||
:defaultCc="defaultCc"
|
||||
:currentTaskName="currentNode.taskName">
|
||||
</my-handle-content>
|
||||
|
||||
@@ -66,6 +67,10 @@
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
defaultCc: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
showSelnextUser: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
|
||||
Reference in New Issue
Block a user