forked from integrated_whb/integrated_whb_vue
调试安全通知选择人员回调问题
parent
edb4fc5c1a
commit
14a8be1d8d
|
@ -103,7 +103,7 @@ const fnSubmit = debounce(
|
|||
const ADDRESSEE = selectionData.map((item) => item.USER_ID).join(",");
|
||||
const USERNAME = selectionData.map((item) => item.NAME).join(",");
|
||||
await ElMessageBox.confirm(
|
||||
`确定要发送短信给<span class="text-green">${USERNAME.split(",").join(
|
||||
`确定要发送提醒信息给<span class="text-green">${USERNAME.split(",").join(
|
||||
"、"
|
||||
)}</span>吗?`,
|
||||
{
|
||||
|
|
|
@ -67,11 +67,10 @@
|
|||
import { useVModel } from "@vueuse/core";
|
||||
import { debounce } from "throttle-debounce";
|
||||
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 { getUserSelectListAll } from "@/request/user_practitioner.js";
|
||||
import { layoutFnGetPersonnelTypeTraffic } from "@/assets/js/data_dictionary.js";
|
||||
import { differenceWith } from "lodash-es";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
|
@ -87,12 +86,6 @@ const props = defineProps({
|
|||
});
|
||||
const emits = defineEmits(["update:visible", "submit", "submitall"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
|
||||
const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } =
|
||||
useListData(getUserSelectListAll, {
|
||||
key: "userList",
|
||||
immediate: false,
|
||||
});
|
||||
const data = reactive({
|
||||
personnelTypeList: [],
|
||||
});
|
||||
|
@ -102,12 +95,28 @@ const { value: personnelTypeList } = await layoutFnGetPersonnelTypeTraffic({
|
|||
BIANMA: "TRAFFIC_EMPLOYMENT",
|
||||
});
|
||||
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,
|
||||
(value) => {
|
||||
if (value) {
|
||||
fnGetData();
|
||||
stop && stop();
|
||||
fnInit();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -119,12 +128,7 @@ const fnSubmit = debounce(
|
|||
1000,
|
||||
() => {
|
||||
const selectionData = tableRef.value.getSelectionRows();
|
||||
const listData = differenceWith(
|
||||
selectionData,
|
||||
props.listData,
|
||||
(a, b) => a.USER_ID === b.USER_ID
|
||||
);
|
||||
emits("submit", listData);
|
||||
emits("submit", selectionData);
|
||||
fnClose();
|
||||
},
|
||||
{ atBegin: true }
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
</div>
|
||||
<select-person
|
||||
v-model:visible="data.dialog.selectPersonDialogVisible"
|
||||
:list-data="data.form.PERSON_ID"
|
||||
:list-data="data.form.PERSON_ID.split(',')"
|
||||
@submit="fnSelectPersonSubmit"
|
||||
@submitall="fnSelectAllRiskSubmit"
|
||||
/>
|
||||
|
@ -146,7 +146,7 @@ const data = reactive({
|
|||
TITLE: "",
|
||||
CORPINFO_ID: "",
|
||||
LEVEL: "",
|
||||
PERSON_ID: [],
|
||||
PERSON_ID: '',
|
||||
PERSON: [],
|
||||
fileList: [],
|
||||
videoList: [],
|
||||
|
@ -167,7 +167,6 @@ const fnGetData = async () => {
|
|||
if (!NOTIFICATION_ID) return;
|
||||
const resData = await getSecurityNoticeInfo({ NOTIFICATION_ID });
|
||||
data.form = resData.pd;
|
||||
data.form.PERSON_ID = data.form.PERSON_ID.split(",");
|
||||
data.form.fileList = addingPrefixToFile([
|
||||
{
|
||||
FILEPATH: data.form.ATTACHMENT_ROUTE,
|
||||
|
|
Loading…
Reference in New Issue