From a290a75ce5c0a44f6b8a17a6e4ecb1db28805acb Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 1 Apr 2024 09:52:19 +0800 Subject: [PATCH] add --- src/views/cost_approved_projects/index.vue | 1 + src/views/safety_accident/detail.vue | 6 +- src/views/safety_accident/edit.vue | 67 +------------------ src/views/safety_accident/index.vue | 2 +- src/views/safety_check/detail.vue | 7 +- src/views/safety_check/edit.vue | 69 +------------------- src/views/safety_check/index.vue | 2 +- src/views/safety_emergency_plan/detail.vue | 3 +- src/views/safety_emergency_plan/edit.vue | 74 ++------------------- src/views/safety_emergency_plan/index.vue | 2 +- src/views/safety_evaluate/detail.vue | 3 +- src/views/safety_evaluate/edit.vue | 38 +---------- src/views/safety_evaluate/index.vue | 2 +- src/views/safety_event/detail.vue | 3 +- src/views/safety_event/edit.vue | 76 ++-------------------- src/views/safety_event/index.vue | 2 +- src/views/safety_modify/edit.vue | 3 +- src/views/safety_modify/index.vue | 2 +- src/views/safety_rehearsal/detail.vue | 3 +- src/views/safety_rehearsal/edit.vue | 68 +------------------ src/views/safety_rehearsal/index.vue | 2 +- src/views/safety_standard/detail.vue | 4 +- src/views/safety_standard/edit.vue | 58 +---------------- src/views/safety_standard/index.vue | 2 +- src/views/safety_supervise/detail.vue | 4 +- src/views/safety_supervise/edit.vue | 75 ++------------------- src/views/safety_supervise/index.vue | 2 +- src/views/safety_target/detail.vue | 3 +- src/views/safety_target/edit.vue | 67 +------------------ src/views/safety_target/index.vue | 2 +- 30 files changed, 55 insertions(+), 597 deletions(-) diff --git a/src/views/cost_approved_projects/index.vue b/src/views/cost_approved_projects/index.vue index 8f37d74..1d0ebe3 100644 --- a/src/views/cost_approved_projects/index.vue +++ b/src/views/cost_approved_projects/index.vue @@ -87,6 +87,7 @@ + diff --git a/src/views/safety_accident/edit.vue b/src/views/safety_accident/edit.vue index 329b889..2786bb0 100644 --- a/src/views/safety_accident/edit.vue +++ b/src/views/safety_accident/edit.vue @@ -91,24 +91,7 @@ - - -
-
- {{ item.name }} - x -
-
- +
@@ -130,18 +113,12 @@ import porjectDialog from '@/components/project/index.vue' import type { FormInstance } from 'element-plus' import Popup from '@/components/popup/index.vue' import { safetyaccidentAdd, safetyaccidentEdit, safetyaccidentDetail } from '@/api/safety_accident' -import { toChinesNum } from "@/utils/util"; -import { getAllProjectTypes } from '@/api/projecttype' -import { timeFormat } from '@/utils/util' -import { isEmail, isIdCard, isPhone } from '@/utils/validate' + import type { PropType } from 'vue' import configs from "@/config" import useUserStore from "@/stores/modules/user"; -const protype = reactive([]) -const base_url = configs.baseUrl + configs.urlPrefix + const userStore = useUserStore(); -const active = ref(0) -const formDataannex = reactive([]) const list1 = reactive([]) const list2 = reactive([]) const showDialog = ref(false) @@ -149,27 +126,8 @@ const project_name = ref('') const project_code = ref('') import { deptAll } from '@/api/org/department' import { getAll } from '@/api/org/organization' -const userInfo = userStore.userInfo -// 上传文件 -const handleAvatarSuccess_four = ( - response, - uploadFile -) => { - if (response.code == 0) { - ElMessage.error(response.msg); - return; - } - formDataannex.push( - { uri: response.data.uri, name: response.data.name } - ); -}; - -// 删除上传的文件 -const delFileFn = (index: number) => { - formDataannex.splice(index, 1) -} defineProps({ dictData: { type: Object as PropType>, @@ -240,18 +198,6 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { - if (data.file && data.file.length > 0) { - - const arry1 = data.file.map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } - - for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore @@ -262,11 +208,8 @@ const setFormData = async (data: Record) => { getlist1(data.dept_id ) } - project_name.value = data.project_name - project_code.value = data.project_code - getlist1(formData.org_id); } const getDetail = async (row: Record) => { @@ -279,11 +222,7 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { - formData.file = formDataannex.map((item) => item.uri) - await formRef.value?.validate() - - const data = { ...formData } mode.value == 'edit' ? await safetyaccidentEdit(data) diff --git a/src/views/safety_accident/index.vue b/src/views/safety_accident/index.vue index 625fe9a..aa2bb45 100644 --- a/src/views/safety_accident/index.vue +++ b/src/views/safety_accident/index.vue @@ -51,7 +51,7 @@ - + diff --git a/src/views/safety_check/edit.vue b/src/views/safety_check/edit.vue index 049a16e..ee6ac1e 100644 --- a/src/views/safety_check/edit.vue +++ b/src/views/safety_check/edit.vue @@ -125,35 +125,16 @@ - + - - - - -
-
- {{ item.name }} - x -
-
- +
@@ -175,18 +156,8 @@ import porjectDialog from '@/components/project/index.vue' import type { FormInstance } from 'element-plus' import Popup from '@/components/popup/index.vue' import { safetycheckAdd, safetycheckEdit, safetycheckDetail } from '@/api/safety_check' -import { toChinesNum } from "@/utils/util"; -import { getAllProjectTypes } from '@/api/projecttype' -import { timeFormat } from '@/utils/util' -import { isEmail, isIdCard, isPhone } from '@/utils/validate' import type { PropType } from 'vue' -import configs from "@/config" import useUserStore from "@/stores/modules/user"; -const protype = reactive([]) -const base_url = configs.baseUrl + configs.urlPrefix -const userStore = useUserStore(); -const active = ref(0) -const formDataannex = reactive([]) const list1 = reactive([]) const list2 = reactive([]) const showDialog = ref(false) @@ -194,27 +165,8 @@ const project_name = ref('') const project_code = ref('') import { deptAll } from '@/api/org/department' import { getAll } from '@/api/org/organization' -const userInfo = userStore.userInfo -// 上传文件 -const handleAvatarSuccess_four = ( - response, - uploadFile -) => { - if (response.code == 0) { - ElMessage.error(response.msg); - return; - } - formDataannex.push( - { uri: response.data.uri, name: response.data.name } - ); -}; - -// 删除上传的文件 -const delFileFn = (index: number) => { - formDataannex.splice(index, 1) -} defineProps({ dictData: { type: Object as PropType>, @@ -293,19 +245,6 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { - if (data.file && data.file.length > 0) { - - const arry1 = data.file.map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - - } - - for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore @@ -329,11 +268,7 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { - formData.file = formDataannex.map((item) => item.uri) - await formRef.value?.validate() - - const data = { ...formData } mode.value == 'edit' ? await safetycheckEdit(data) diff --git a/src/views/safety_check/index.vue b/src/views/safety_check/index.vue index d6a02f2..167a893 100644 --- a/src/views/safety_check/index.vue +++ b/src/views/safety_check/index.vue @@ -62,7 +62,7 @@ - +