Kaynağa Gözat

预案管理

zhangyihao 11 ay önce
ebeveyn
işleme
15214ca363

+ 15 - 5
src/api/system/user/index.ts

@@ -72,12 +72,22 @@ export const optionSelect = (userIds: (number | string)[]): AxiosPromise<UserVO[
 
 /**
  * 获取培训详情
- * @param userId
+ * @param textId
  */
-export const getUser = (userId?: string | number): AxiosPromise<UserInfoVO> => {
+export const getUser = (textId?: string | number): AxiosPromise<UserInfoVO> => {
   return request({
-    url: '/system/user/' + parseStrEmpty(userId),
-    method: 'get'
+    url: '/api/emergency_plan/training/create',
+    method: 'post',
+    params: {
+      theme: params.theme, // 培训主题
+      unitName: params.unitName, // 培训单位
+      address: params.address, // 培训地点
+      startTime: params.startTime, // 开始时间
+      endTime: params.endTime, // 结束时间
+      peopleNum: params.peopleNum, // 参与人数
+      Content: params.Content, // 培训内容
+      trainingWay: params.trainingWay // 培训方式
+    }
   });
 };
 /**
@@ -115,7 +125,7 @@ export const getResponse = (drillId?: string | number): AxiosPromise<ResponseInf
  */
 export const addUser = (data: UserForm) => {
   return request({
-    url: '/system/user',
+    url: '/api/emergency_plan/training/create',
     method: 'post',
     data: data
   });

+ 22 - 20
src/views/riskPrevention/planManage/planList.vue

@@ -23,7 +23,9 @@
         <div style="white-space: nowrap">
           <el-text :lg="15" class="mx-1">附件</el-text>
           <el-text :lg="15" class="mx-2" type="primary">
-            <a v-if="detailData.file_list && detailData.file_list[0]" :href="detailData.file_list[0].file_url">{{ detailData.file_list[0].file_name_desc }}</a>
+            <a v-if="detailData.file_list && detailData.file_list[0]" :href="detailData.file_list[0].file_url">{{
+              detailData.file_list[0].file_name_desc
+            }}</a>
           </el-text>
         </div>
         <el-card style="margin-top: 10px" shadow="hover">
@@ -507,7 +509,7 @@
 
 <script setup name="User" lang="ts">
 import api from '@/api/system/user';
-import { UserForm, UserQuery, UserVO, PlanVO, DrillVO, PlanForm } from "@/api/system/user/types";
+import { UserForm, UserQuery, UserVO, PlanVO, DrillVO, PlanForm } from '@/api/system/user/types';
 import { DeptVO } from '@/api/system/dept/types';
 import { RoleVO } from '@/api/system/role/types';
 import { PostQuery, PostVO } from '@/api/system/post/types';
@@ -518,7 +520,7 @@ import { optionselect } from '@/api/system/post';
 import type { TabsPaneContext } from 'element-plus';
 import { ArrowLeft } from '@element-plus/icons-vue';
 import { useRouter } from 'vue-router';
-import { reactive } from "vue";
+import { reactive } from 'vue';
 import { getDrillList, getPlanDetail, getTrainingList } from '@/api/riskPrevention/planManage';
 
 const router = useRouter();
@@ -782,10 +784,10 @@ const getList2 = async () => {
   loading2.value = true;
   const res = await getDrillList(drillForm);
   loading2.value = false;
-  res.data.forEach(item => {
-    item.drillPicture = item.drillPicture[0].file_name_desc
-    item.drillVideo = item.drillVideo[0].file_name_desc
-  })
+  res.data.forEach((item) => {
+    item.drillPicture = item.drillPicture[0].file_name_desc;
+    item.drillVideo = item.drillVideo[0].file_name_desc;
+  });
   drillList.value = res.data;
   total2.value = res.total;
 };
@@ -899,8 +901,8 @@ const cancel = () => {
 /** 修改按钮操作 */
 const handleUpdate = async (row?: UserForm) => {
   reset();
-  const textId = row?.textId || ids.value[0];
-  const { data } = await api.getUser(textId);
+  //const textId = row?.textId || ids.value[0];
+  //const { data } = await api.getUser(textId);
   dialog.visible = true;
   dialog.title = '修改培训记录';
   await initTreeData();
@@ -938,20 +940,20 @@ const resetForm = () => {
 /** 新增按钮操作 */
 const handleAdd = async () => {
   reset();
-  const { data } = await api.getUser();
+  //const { data } = await api.getUser();
   dialog.visible = true;
   dialog.title = '新增培训记录';
 };
-let detailData =ref({
+let detailData = ref({
   file_list: []
-})
+});
 onMounted(() => {
-  const planId = route.query.planId
-  drillForm.planNum = planId
-  queryParams3.planNum = planId
-  getPlanDetail(planId).then(res => {
-    detailData.value = res.data
-  })
+  const planId = route.query.planId;
+  drillForm.planNum = planId;
+  queryParams3.planNum = planId;
+  getPlanDetail(planId).then((res) => {
+    detailData.value = res.data;
+  });
   getTreeSelect(); // 初始化培训内容数据
   getList(); // 初始化列表数据
   getList2(); // 初始化列表数据
@@ -966,11 +968,11 @@ async function handleDeptChange(value: number | string) {
   postOptions.value = response.data;
 }
 
-/** 新增预案按钮操作 */
+/** 新增预案按钮操作
 const planAdd = () => {
   dialog0.visible = true;
   dialog0.id = '';
-};
+};*/
 /** 修改预案按钮操作 */
 const planUpdate = (row) => {
   dialog1.visible = true;