| | |
| | | <template #main> |
| | | <el-scrollbar class="el-scrollbar" v-loading="mainLoading"> |
| | | <CompSceneConstructionInfo |
| | | v-if="curSubtask.data && curSubtask.data.sceneTypeId == 1" |
| | | title="A、基本信息" |
| | | :scene="formScene" |
| | | :form-info="formSubScene" |
| | | :scene-type="1" |
| | | /> |
| | | <CompSceneWharfInfo |
| | | v-else-if="curSubtask.data && curSubtask.data.sceneTypeId == 2" |
| | | title="A、基本信息" |
| | | :scene="formScene" |
| | | :form-info="formSubScene" |
| | | :scene-type="2" |
| | | /> |
| | | <CompSceneMixingPlantInfo |
| | | v-else-if="curSubtask.data && curSubtask.data.sceneTypeId == 3" |
| | | title="A、基本信息" |
| | | :scene="formScene" |
| | | :form-info="formSubScene" |
| | | :scene-type="3" |
| | | /> |
| | | <div v-else><el-text tag="h1">A、基本信息</el-text></div> |
| | | <div><el-text type="">附图片:</el-text></div> |
| | | <CompImgInfo |
| | | v-model:title="imgTitle" |
| | |
| | | </el-scrollbar> |
| | | </template> |
| | | </BaseContentLayout> |
| | | <el-dialog |
| | | v-model="anyPhotoDialog" |
| | | width="66%" |
| | | title="任意图片" |
| | | destroy-on-close |
| | | <ArbitraryPhoto |
| | | v-if="anyPhotoDialog" |
| | | v-model:dialog-visible="anyPhotoDialog" |
| | | :max-select="1" |
| | | :readonly="false" |
| | | :subtask="curSubtask.data" |
| | | @submit="handleSelectAnyPhoto" |
| | | :defaultFile="[sceneImg]" |
| | | > |
| | | <ArbitraryPhoto |
| | | :max-select="1" |
| | | :readonly="false" |
| | | :subtask="curSubtask.data" |
| | | @selectByAnyPhonoEvent="handleSelectAnyPhoto" |
| | | :defaultFile="[sceneImg]" |
| | | > |
| | | </ArbitraryPhoto> |
| | | </el-dialog> |
| | | </ArbitraryPhoto> |
| | | <el-dialog |
| | | title="设备图片" |
| | | width="66%" |
| | |
| | | </template> |
| | | <script setup> |
| | | import { ref, computed } from 'vue'; |
| | | |
| | | import { $fysp } from '@/api/index'; |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import sceneApi from '@/api/fysp/sceneApi'; |
| | |
| | | import evaluateApi from '@/api/fysp/evaluateApi'; |
| | | import { formatDeviceList } from '@/model/fysp/device'; |
| | | import { enumDevice, toLabel } from '@/enum/device/device'; |
| | | import { enumScene } from '@/enum/scene'; |
| | | import { exportDocx } from '@/utils/doc'; |
| | | import right_triangle from '@/assets/image/right_triangle.png'; |
| | | |
| | | import CompSceneConstructionInfo from '@/views/fysp/scene/CompSceneConstructionInfo.vue'; |
| | | import CompSceneWharfInfo from '@/views/fysp/scene/CompSceneWharfInfo.vue'; |
| | | import CompSceneMixingPlantInfo from '@/views/fysp/scene/CompSceneMixingPlantInfo.vue'; |
| | | import ArbitraryPhoto from '@/views/fysp/check/components/ArbitraryPhoto.vue'; |
| | | import CompDevicePhono from '@/views/fysp/check/components/CompDevicePhono.vue'; |
| | | import CompImgInfo from '@/views/fysp/data-product/components/CompImgInfo.vue'; |
| | | import CompProblemTable from './components/CompProblemTable.vue'; |
| | | import dayjs from 'dayjs'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | |
| | | /************************* 左侧巡查任务选单 **********************************/ |
| | | const curSubtask = ref({}); |
| | |
| | | } |
| | | |
| | | /************************* 生成报告 **********************************/ |
| | | // 标准化属性名 |
| | | function convertKeys(obj) { |
| | | // 将一个js对象中所有w, mp, cs开头的属性全部改成去掉这些前缀并且重新变为驼峰式命名 |
| | | const newObj = {}; |
| | | for (const key in obj) { |
| | | let newKey = key; |
| | | if (key.startsWith('w')) { |
| | | newKey = key.substring(1); |
| | | } else if (key.startsWith('mp')) { |
| | | newKey = key.substring(2); |
| | | } else if (key.startsWith('cs')) { |
| | | newKey = key.substring(2); |
| | | } |
| | | newKey = newKey.charAt(0).toLowerCase() + newKey.slice(1); |
| | | newObj[newKey] = obj[key]; |
| | | } |
| | | return newObj; |
| | | } |
| | | |
| | | const docLoading = ref(false); |
| | | // 生成word报告 |
| | | function genWord() { |
| | | // 让原来的对象不受影响 |
| | | let formSceneCopy = ref(useCloned(formSubScene.value).cloned.value); |
| | | // 标准化属性值 |
| | | let convertedFormScene = convertKeys(formSceneCopy.value); |
| | | |
| | | const _deviceList = []; |
| | | for (let i = 0; i < deviceList.value.length; i += 2) { |
| | | const d1 = deviceList.value[i]; |
| | |
| | | const param = { |
| | | index: formScene.value.index, |
| | | sceneName: formScene.value.name, |
| | | projectType: formSubScene.value.csProjectType, |
| | | stage: formSubScene.value.siExtension1, |
| | | startTime: formSubScene.value.csStartTime, |
| | | endTime: formSubScene.value.csEndTime, |
| | | leftTime: formSubScene.value.csLeftTime, |
| | | projectType: convertedFormScene.projectType, |
| | | stage: convertedFormScene.siExtension1, |
| | | startTime: convertedFormScene.startTime, |
| | | endTime: convertedFormScene.endTime, |
| | | leftTime: convertedFormScene.leftTime, |
| | | location: formScene.value.location, |
| | | floorSpace: formSubScene.value.csFloorSpace, |
| | | constructionArea: formSubScene.value.csConstructionArea, |
| | | constructionAreaPerMonth: formSubScene.value.csConstructionAreaPerMonth, |
| | | floorSpace: convertedFormScene.floorSpace, |
| | | constructionArea: convertedFormScene.constructionArea, |
| | | constructionAreaPerMonth: convertedFormScene.constructionAreaPerMonth, |
| | | contacts: formScene.value.contacts, |
| | | contactst: formScene.value.contactst, |
| | | securityOfficer: formSubScene.value.csSecurityOfficer, |
| | | securityOfficerTel: formSubScene.value.csSecurityOfficerTel, |
| | | constructionUnit: formSubScene.value.csConstructionUnit, |
| | | employerUnit: formSubScene.value.csEmployerUnit, |
| | | securityOfficer: convertedFormScene.securityOfficer, |
| | | securityOfficerTel: convertedFormScene.securityOfficerTel, |
| | | constructionUnit: convertedFormScene.constructionUnit, |
| | | employerUnit: convertedFormScene.employerUnit, |
| | | |
| | | planningArea: convertedFormScene.planningArea, |
| | | rentUnit: convertedFormScene.rentUnit, |
| | | |
| | | greenPlant: convertedFormScene.greenPlant, |
| | | civillyPlant: convertedFormScene.civillyPlant, |
| | | |
| | | sceneType: formScene.value.type, |
| | | imgTitle: imgTitle.value, |
| | | imgTitle_url: sceneImg.value.url, |
| | |
| | | console.log(param); |
| | | |
| | | docLoading.value = true; |
| | | // 根据场景类型选择模板 |
| | | const sceneTypes = enumScene(2, false); |
| | | const type = sceneTypes.filter( |
| | | (item) => item.value == formScene.value.typeid |
| | | )[0].label; |
| | | const docxTemplatepath = `/单体模版(${type}).docx`; |
| | | exportDocx( |
| | | '/单体模版.docx', |
| | | docxTemplatepath, |
| | | param, |
| | | `${param.sceneName}单体(${date}).docx`, |
| | | { |