From 26b5ef13014f64744d4c187c348755f2575d7d90 Mon Sep 17 00:00:00 2001 From: mengfanliang Date: Thu, 29 Aug 2024 18:02:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E6=98=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../confined_space/apply.vue | 12 ++++++++ pages/eight_assignments/hoisting/apply.vue | 28 +++++++++---------- pages/eight_assignments/hot_work/apply.vue | 4 ++- pages/eight_assignments/to_do_list.vue | 12 +++++--- utils/submitHomeworkProcess.js | 4 +-- 5 files changed, 38 insertions(+), 22 deletions(-) diff --git a/pages/eight_assignments/confined_space/apply.vue b/pages/eight_assignments/confined_space/apply.vue index 9e4ccea..d458ad8 100644 --- a/pages/eight_assignments/confined_space/apply.vue +++ b/pages/eight_assignments/confined_space/apply.vue @@ -81,6 +81,7 @@ import {getConfinedSpaceSelectList} from '@/api' import OtherSelect from '@/components/other-select/index.vue'; import {setSubmitForm} from "@/utils/submitHomeworkProcess"; +import { getTaskInfo } from '@/api'; export default { components: { @@ -177,8 +178,19 @@ export default { this.form.CORP_ID = options.CORPINFO_ID this.form.CORP_NAME = options.CORP_NAME this.type = options.type + if (options.taskId) { + this.fnGetData(options.taskId) + } }, methods: { + async fnGetData(taskId) { + let resData = await getTaskInfo({EW_RU_TASK_ID: taskId}); + if (resData.list.form && resData.list.form.length > 0) { + resData.list.form.forEach((sos, index) => { + this.form[sos.ITEM_NAME] = sos.ITEM_VALUE; + }) + } + }, async fnGetConfinedSpaceSelectList() { const resData = await getConfinedSpaceSelectList({TYPE: 2, CORP_ID: this.form.CORP_ID}) this.picker.columns = [resData.varList] diff --git a/pages/eight_assignments/hoisting/apply.vue b/pages/eight_assignments/hoisting/apply.vue index 66dc87a..3ee3a7c 100644 --- a/pages/eight_assignments/hoisting/apply.vue +++ b/pages/eight_assignments/hoisting/apply.vue @@ -90,6 +90,7 @@ import OtherSelect from '@/components/other-select/index.vue'; import Sign from '@/components/sign/sign.vue' import {setSubmitForm} from "@/utils/submitHomeworkProcess"; +import { getTaskInfo } from '@/api'; export default { components: { @@ -191,8 +192,19 @@ export default { this.form.CORP_ID = options.CORPINFO_ID this.form.CORP_NAME = options.CORP_NAME this.type = options.type + if (options.taskId) { + this.fnGetData(options.taskId) + } }, methods: { + async fnGetData(taskId) { + let resData = await getTaskInfo({EW_RU_TASK_ID: taskId}); + if (resData.list.form && resData.list.form.length > 0) { + resData.list.form.forEach((sos, index) => { + this.form[sos.ITEM_NAME] = sos.ITEM_VALUE; + }) + } + }, fnSingleChoiceClick(event) { this.picker.type = event if (event === 'WORK_LEVEL_NAME') this.picker.columns = [[ @@ -239,20 +251,6 @@ export default { async fnSubmit() { try { await this.$refs.formRef.validate() - for (let i = 0; i < this.form.boardList.length; i++) { - if (!this.form.boardList[i].BOARD_MATERIAL) { - uni.$u.toast(`盲板抽堵参数第${i + 1}项中,请输入管道材质`) - return - } - if (!this.form.boardList[i].BOARD_SPECIFICATION) { - uni.$u.toast(`盲板抽堵参数第${i + 1}项中,请输入管道规格`) - return - } - if (!this.form.boardList[i].BOARD_NO) { - uni.$u.toast(`盲板抽堵参数第${i + 1}项中,请输入管道编号`) - return - } - } try { await setSubmitForm({ form: this.form, @@ -262,7 +260,7 @@ export default { }) } catch { } - } catch { + } catch (err) { uni.$u.toast('请补全必填项') } } diff --git a/pages/eight_assignments/hot_work/apply.vue b/pages/eight_assignments/hot_work/apply.vue index 9a7c00a..824b747 100644 --- a/pages/eight_assignments/hot_work/apply.vue +++ b/pages/eight_assignments/hot_work/apply.vue @@ -165,7 +165,9 @@ export default { this.form.CORP_ID = options.CORPINFO_ID this.form.CORP_NAME = options.CORP_NAME this.type = options.type - this.fnGetData(options.taskId) + if (options.taskId) { + this.fnGetData(options.taskId) + } }, methods: { async fnGetData(taskId) { diff --git a/pages/eight_assignments/to_do_list.vue b/pages/eight_assignments/to_do_list.vue index 25be5a7..d29452a 100644 --- a/pages/eight_assignments/to_do_list.vue +++ b/pages/eight_assignments/to_do_list.vue @@ -20,10 +20,7 @@ - +