调试安全通知选择人员回调问题

dev
wangpeng 2024-04-11 10:38:24 +08:00
parent edb4fc5c1a
commit 14a8be1d8d
3 changed files with 24 additions and 21 deletions

View File

@ -103,7 +103,7 @@ const fnSubmit = debounce(
const ADDRESSEE = selectionData.map((item) => item.USER_ID).join(","); const ADDRESSEE = selectionData.map((item) => item.USER_ID).join(",");
const USERNAME = selectionData.map((item) => item.NAME).join(","); const USERNAME = selectionData.map((item) => item.NAME).join(",");
await ElMessageBox.confirm( await ElMessageBox.confirm(
`确定要发送短信给<span class="text-green">${USERNAME.split(",").join( `确定要发送提醒信息给<span class="text-green">${USERNAME.split(",").join(
"、" "、"
)}</span>`, )}</span>`,
{ {

View File

@ -67,11 +67,10 @@
import { useVModel } from "@vueuse/core"; import { useVModel } from "@vueuse/core";
import { debounce } from "throttle-debounce"; import { debounce } from "throttle-debounce";
import useListData from "@/assets/js/useListData.js"; import useListData from "@/assets/js/useListData.js";
import { reactive, watch } from "vue"; import { nextTick, reactive, watch } from "vue";
import { serialNumber } from "@/assets/js/utils.js"; import { serialNumber } from "@/assets/js/utils.js";
import { getUserSelectListAll } from "@/request/user_practitioner.js"; import { getUserSelectListAll } from "@/request/user_practitioner.js";
import { layoutFnGetPersonnelTypeTraffic } from "@/assets/js/data_dictionary.js"; import { layoutFnGetPersonnelTypeTraffic } from "@/assets/js/data_dictionary.js";
import { differenceWith } from "lodash-es";
const props = defineProps({ const props = defineProps({
visible: { visible: {
@ -87,12 +86,6 @@ const props = defineProps({
}); });
const emits = defineEmits(["update:visible", "submit", "submitall"]); const emits = defineEmits(["update:visible", "submit", "submitall"]);
const visible = useVModel(props, "visible", emits); const visible = useVModel(props, "visible", emits);
const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } =
useListData(getUserSelectListAll, {
key: "userList",
immediate: false,
});
const data = reactive({ const data = reactive({
personnelTypeList: [], personnelTypeList: [],
}); });
@ -102,12 +95,28 @@ const { value: personnelTypeList } = await layoutFnGetPersonnelTypeTraffic({
BIANMA: "TRAFFIC_EMPLOYMENT", BIANMA: "TRAFFIC_EMPLOYMENT",
}); });
data.personnelTypeList = personnelTypeList; data.personnelTypeList = personnelTypeList;
const stop = watch(
const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } =
useListData(getUserSelectListAll, {
immediate: false,
clearSelection: false,
key: "userList",
});
const fnInit = async () => {
await fnResetPagination();
await nextTick();
const checkUserList = props.listData.map((item) => ({ USER_ID: item }));
checkUserList.forEach((item) => {
tableRef.value.toggleRowSelection(item);
});
fnResetPagination();
};
watch(
() => props.visible, () => props.visible,
(value) => { (value) => {
if (value) { if (value) {
fnGetData(); fnInit();
stop && stop();
} }
} }
); );
@ -119,12 +128,7 @@ const fnSubmit = debounce(
1000, 1000,
() => { () => {
const selectionData = tableRef.value.getSelectionRows(); const selectionData = tableRef.value.getSelectionRows();
const listData = differenceWith( emits("submit", selectionData);
selectionData,
props.listData,
(a, b) => a.USER_ID === b.USER_ID
);
emits("submit", listData);
fnClose(); fnClose();
}, },
{ atBegin: true } { atBegin: true }

View File

@ -98,7 +98,7 @@
</div> </div>
<select-person <select-person
v-model:visible="data.dialog.selectPersonDialogVisible" v-model:visible="data.dialog.selectPersonDialogVisible"
:list-data="data.form.PERSON_ID" :list-data="data.form.PERSON_ID.split(',')"
@submit="fnSelectPersonSubmit" @submit="fnSelectPersonSubmit"
@submitall="fnSelectAllRiskSubmit" @submitall="fnSelectAllRiskSubmit"
/> />
@ -146,7 +146,7 @@ const data = reactive({
TITLE: "", TITLE: "",
CORPINFO_ID: "", CORPINFO_ID: "",
LEVEL: "", LEVEL: "",
PERSON_ID: [], PERSON_ID: '',
PERSON: [], PERSON: [],
fileList: [], fileList: [],
videoList: [], videoList: [],
@ -167,7 +167,6 @@ const fnGetData = async () => {
if (!NOTIFICATION_ID) return; if (!NOTIFICATION_ID) return;
const resData = await getSecurityNoticeInfo({ NOTIFICATION_ID }); const resData = await getSecurityNoticeInfo({ NOTIFICATION_ID });
data.form = resData.pd; data.form = resData.pd;
data.form.PERSON_ID = data.form.PERSON_ID.split(",");
data.form.fileList = addingPrefixToFile([ data.form.fileList = addingPrefixToFile([
{ {
FILEPATH: data.form.ATTACHMENT_ROUTE, FILEPATH: data.form.ATTACHMENT_ROUTE,