From 043e071b64113b6775855761a2ba5bc2912b9f5a Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Tue, 5 Mar 2024 18:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BE=8B=E4=BC=9A=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/request/traffic_safety_staffing.js | 7 + .../customer_management/add.vue | 8 - .../waybill_registration/add.vue | 8 - .../inventory_management/add.vue | 1 - .../management_staffing/components/add.vue | 164 ++++++++++++++++++ src/views/management_staffing/details.vue | 130 ++++++++++++++ src/views/management_staffing/index.vue | 146 ++++++++++++++++ .../management_staffing/staffing_info.vue | 96 ++++++++++ .../safety_meeting/add.vue | 89 +++++++--- .../components/select_person.vue | 133 ++++++++++++++ .../safety_meeting/details.vue | 2 +- .../security_notice/add.vue | 17 +- .../components/select_person.vue | 3 +- .../security_notice/index.vue | 6 +- 14 files changed, 756 insertions(+), 54 deletions(-) create mode 100644 src/request/traffic_safety_staffing.js create mode 100644 src/views/management_staffing/components/add.vue create mode 100644 src/views/management_staffing/details.vue create mode 100644 src/views/management_staffing/index.vue create mode 100644 src/views/management_staffing/staffing_info.vue create mode 100644 src/views/safety_production_related/safety_meeting/components/select_person.vue diff --git a/src/request/traffic_safety_staffing.js b/src/request/traffic_safety_staffing.js new file mode 100644 index 0000000..2790f5d --- /dev/null +++ b/src/request/traffic_safety_staffing.js @@ -0,0 +1,7 @@ +import { post, upload } from "@/request/axios.js"; +export const getSafetyStaffingList = (params) => + post("/staffing/listForSecurityStaffing", params); // 管理人员配备列表 + +export const addStaffingView = (params) => upload("/staffing/add", params); // 添加 管理人员配备 + +export const editStaffingView = (params) => upload("/staffing/edit", params); // 添加 管理人员配备 diff --git a/src/views/electronic_waybill_management/customer_management/add.vue b/src/views/electronic_waybill_management/customer_management/add.vue index cc8f509..58bbf44 100644 --- a/src/views/electronic_waybill_management/customer_management/add.vue +++ b/src/views/electronic_waybill_management/customer_management/add.vue @@ -62,7 +62,6 @@ + + diff --git a/src/views/management_staffing/details.vue b/src/views/management_staffing/details.vue new file mode 100644 index 0000000..8ae254a --- /dev/null +++ b/src/views/management_staffing/details.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/views/management_staffing/index.vue b/src/views/management_staffing/index.vue new file mode 100644 index 0000000..53d9ff8 --- /dev/null +++ b/src/views/management_staffing/index.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/views/management_staffing/staffing_info.vue b/src/views/management_staffing/staffing_info.vue new file mode 100644 index 0000000..b336981 --- /dev/null +++ b/src/views/management_staffing/staffing_info.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/safety_production_related/safety_meeting/add.vue b/src/views/safety_production_related/safety_meeting/add.vue index 997177c..62f1563 100644 --- a/src/views/safety_production_related/safety_meeting/add.vue +++ b/src/views/safety_production_related/safety_meeting/add.vue @@ -66,15 +66,22 @@ - - - {{ - city - }} - + +
+ + + 选择 + +
@@ -113,6 +120,12 @@
确定
+ @@ -125,17 +138,8 @@ import LayoutUpload from "@/components/upload/index.vue"; import LayoutEditor from "@/components/editor/index.vue"; import useFormValidate from "@/assets/js/useFormValidate.js"; import { ElMessage } from "element-plus"; +import SelectPerson from "@/views/safety_production_related/security_notice/components/select_person.vue"; const formRef = ref(null); -const cities = [ - "驾驶员", - "押运员", - "安全管理员", - "装卸员", - "安全负责人", - "其他", - "监控员", -]; -const handleCheckedCitiesChange = () => {}; const rules = { MEETING_TITLE: [ { required: true, message: "请输入会议标题", trigger: "blur" }, @@ -168,6 +172,7 @@ const data = reactive({ MEETING_TYPE: "", MEETING_ADDRESS: "", MEETING_DATE: "", + PERSON: "", HOST_PERSON: "", RECORDER: "", fileList: [], @@ -179,25 +184,34 @@ const data = reactive({ const handleMeetingTypeChange = (value) => { data.form.MEETING_TYPE = value; }; - const fnSubmit = async () => { await useFormValidate(formRef); const formData = new FormData(); + // 添加文本类型的字段 Object.keys(data.form).forEach((key) => { - formData.append(key, data.form[key]); + if (key === "MEETING_DATE") { + const dateRangeString = data.form.MEETING_DATE.join(" , "); + formData.append(key, dateRangeString); + } else if (!Array.isArray(data.form[key])) { + formData.append(key, data.form[key]); + } }); - formData.delete("fileList"); + // 处理 fileList - 添加文件 + data.form.fileList.forEach((file) => { + if (file.raw) formData.append("FFILE", file.raw); + }); - for (let i = 0; i < data.form.fileList.length; i++) { - if (data.form.fileList[i].raw) - formData.append("FFILE", data.form.fileList[i].raw); - } + // 处理 videoList - 添加视频文件 + data.form.videoList.forEach((video) => { + if (video.raw) formData.append("VVIDEO", video.raw); // 注意: 用不同的字段名区分文件和视频 + }); try { await addSafetyMeetingView(formData); ElMessage.success("添加成功"); + // 清空表单 Object.keys(data.form).forEach((key) => { if (Array.isArray(data.form[key])) { data.form[key] = []; @@ -218,6 +232,29 @@ const fnUpload = (file) => { } return true; }; + +const fnSelectPersonSubmit = (selectionData) => { + const userIds = selectionData.map((item) => item.USER_ID).join(", "); + const names = selectionData.map((item) => item.NAME).join(", "); + data.form.PERSON_ID = userIds; + data.form.PERSON = names; +}; +const fnSelectAllRiskSubmit = (allData) => { + const dataList = allData.value; + + const userIds = dataList.map((item) => item.USER_ID).join(", "); + const names = dataList.map((item) => item.NAME).join(", "); + + data.form.PERSON_ID = userIds; + data.form.PERSON = names; + + data.form.allStatus = 1; + data.form.PERSON = "已全部选择"; + + console.log("选中的用户ID:", userIds); + console.log("选中的用户姓名:", names); + console.log("是否全选:", data.form.allStatus); +}; diff --git a/src/views/safety_production_related/safety_meeting/details.vue b/src/views/safety_production_related/safety_meeting/details.vue index 8ae254a..52e925b 100644 --- a/src/views/safety_production_related/safety_meeting/details.vue +++ b/src/views/safety_production_related/safety_meeting/details.vue @@ -59,7 +59,7 @@ {{ serialNumber(pagination, $index) }} - + diff --git a/src/views/safety_production_related/security_notice/add.vue b/src/views/safety_production_related/security_notice/add.vue index a81be2b..dcb5962 100644 --- a/src/views/safety_production_related/security_notice/add.vue +++ b/src/views/safety_production_related/security_notice/add.vue @@ -207,10 +207,21 @@ const fnSelectPersonSubmit = (selectionData) => { data.form.PERSON = names; }; -const fnSelectAllRiskSubmit = () => { +const fnSelectAllRiskSubmit = (allData) => { + const dataList = allData.value; + + const userIds = dataList.map((item) => item.USER_ID).join(", "); + const names = dataList.map((item) => item.NAME).join(", "); + + data.form.PERSON_ID = userIds; + data.form.PERSON = names; + data.form.allStatus = 1; - data.PERSON = "已全部选择"; - console.log("是否全选", data.form.allStatus); + data.form.PERSON = "已全部选择"; + + console.log("选中的用户ID:", userIds); + console.log("选中的用户姓名:", names); + console.log("是否全选:", data.form.allStatus); }; diff --git a/src/views/safety_production_related/security_notice/components/select_person.vue b/src/views/safety_production_related/security_notice/components/select_person.vue index b7549ed..be60b6c 100644 --- a/src/views/safety_production_related/security_notice/components/select_person.vue +++ b/src/views/safety_production_related/security_notice/components/select_person.vue @@ -97,7 +97,6 @@ const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = clearSelection: false, }); -// const riskClassificationList = await layoutFnGetRiskClassification(); const stop = watch( () => props.visible, (value) => { @@ -127,7 +126,7 @@ const fnSubmit = debounce( const fnAllSubmit = () => { fnClose(); - emits("submitall"); + emits("submitall", list); }; diff --git a/src/views/safety_production_related/security_notice/index.vue b/src/views/safety_production_related/security_notice/index.vue index e4cf48a..267adbe 100644 --- a/src/views/safety_production_related/security_notice/index.vue +++ b/src/views/safety_production_related/security_notice/index.vue @@ -90,11 +90,7 @@ - +