feat: 动土作业申请的回显修补

八项作业
mengfanliang 2024-08-30 12:42:34 +08:00
parent 743a7408e8
commit 0dcfee9404
1 changed files with 26 additions and 0 deletions

View File

@ -91,6 +91,7 @@
</template> </template>
<script> <script>
import { getTaskInfo } from "@/api";
import OtherSelect from '@/components/other-select/index.vue'; import OtherSelect from '@/components/other-select/index.vue';
import Sign from '@/components/sign/sign.vue' import Sign from '@/components/sign/sign.vue'
import {setSubmitForm} from "@/utils/submitHomeworkProcess"; import {setSubmitForm} from "@/utils/submitHomeworkProcess";
@ -190,8 +191,33 @@ export default {
this.form.CORP_ID = options.CORPINFO_ID this.form.CORP_ID = options.CORPINFO_ID
this.form.CORP_NAME = options.CORP_NAME this.form.CORP_NAME = options.CORP_NAME
this.type = options.type this.type = options.type
if (options.taskId) {
this.fnGetData(options.taskId)
}
}, },
methods: { 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;
}
//
if (sos.ITEM_NAME === "CONTENT_IMG_PATH") {
newFormData.CONTENT_IMG_PATH = [{ url: `${this.$filePath}${sos.ITEM_VALUE}` }]
}
//
if (sos.ITEM_NAME === "SIGN") {
newFormData.SIGN = `${this.$filePath}${sos.ITEM_VALUE}`
}
});
this.form = newFormData;
}
},
fnDateTimePickerClick(event) { fnDateTimePickerClick(event) {
this.dateTimePicker.type = event this.dateTimePicker.type = event
this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date()) this.dateTimePicker.value = Number(new Date(this.form[event])) || Number(new Date())