feat: 临时用电作业的回显修补

八项作业
mengfanliang 2024-08-30 12:56:43 +08:00
parent e6bf76cade
commit 835df9f697
1 changed files with 18 additions and 0 deletions

View File

@ -92,6 +92,7 @@
</template>
<script>
import { getTaskInfo } from "@/api";
import OtherSelect from '@/components/other-select/index.vue';
import {setSubmitForm} from "@/utils/submitHomeworkProcess";
@ -213,8 +214,25 @@ 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) {
let newFormData = { ...this.form };
resData.list.form.forEach((sos, index) => {
newFormData[sos.ITEM_NAME] = sos.ITEM_VALUE;
if (sos.FK_NAME) {
newFormData[sos.FK_NAME] = sos.FK_VALUE;
}
});
this.form = newFormData;
}
},
fnDateTimePickerClick(event) {
this.dateTimePicker.type = event
this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date())