| | |
| | | <template> |
| | | <el-row class="layout"> |
| | | <el-col :span="16"> |
| | | <el-col :span="10"> |
| | | <el-form :inline="true" :model="formSearch"> |
| | | <el-form-item label="总任务"> |
| | | <!-- <el-input v-model="formSearch.topTaskId" placeholder="总任务" /> --> |
| | | <el-select v-model="formSearch.topTaskId" placeholder="总任务"> |
| | | <el-select |
| | | v-model="formSearch.topTaskId" |
| | | placeholder="总任务" |
| | | style="width: 260px" |
| | | > |
| | | <el-option |
| | | v-for="s in topTasks" |
| | | :key="s.value" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="场景类型"> |
| | | <el-select v-model="formSearch.sceneTypeId" placeholder="场景类型"> |
| | | <el-option |
| | | v-for="s in sceneTypes" |
| | | :key="s.value" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <FYOptionScene |
| | | :allOption="false" |
| | | :type="2" |
| | | v-model:value="formSearch.scenetype" |
| | | ></FYOptionScene> |
| | | <el-form-item v-show="btnShow"> |
| | | <el-button type="primary" @click="onSubmit">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="14"> |
| | | <el-row justify="end"> |
| | | <slot name="summary"></slot> |
| | | </el-row> |
| | |
| | | |
| | | <script> |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import { enumScene_2NA } from "@/enum/scene"; |
| | | |
| | | export default { |
| | | emits: ['onSubmit'], |
| | | props: { |
| | | btnShow: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | init: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | topTasks: [], |
| | | sceneTypes: enumScene_2NA(), |
| | | formSearch: { |
| | | topTaskId: '', |
| | | sceneTypeId: '', |
| | | }, |
| | | scenetype: '' |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | //获取查询条件 |
| | | getOptions() { |
| | | taskApi.getTopTask().then((res) => { |
| | | const list = []; |
| | | res.forEach((r) => { |
| | | list.push({ |
| | | const list = res.map((r) => { |
| | | return { |
| | | value: r.tguid, |
| | | label: r.name, |
| | | towncode: r.towncode, |
| | | districtCode: r.districtcode, |
| | | month: r.starttime.slice(0, 7), |
| | | }); |
| | | data: r |
| | | }; |
| | | }); |
| | | this.topTasks = list; |
| | | this.formSearch.topTaskId = list[0].value; |
| | | this.$emit('onSubmit', this.formSearch); |
| | | if (this.init) { |
| | | this.onSubmit(); |
| | | } |
| | | }); |
| | | }, |
| | | //查询子任务统计信息 |
| | | onSubmit() { |
| | | // console.log(this.formSearch.sceneTypeId) |
| | | this.$emit('onSubmit', this.formSearch); |
| | | }, |
| | | const task = this.topTasks.find( |
| | | (t) => t.data.tguid == this.formSearch.topTaskId |
| | | ); |
| | | const param = { |
| | | topTask: task ? task.data : {}, |
| | | sceneTypeId: this.formSearch.scenetype.value |
| | | }; |
| | | // console.log(param); |
| | | |
| | | this.$emit('onSubmit', param); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.formSearch.sceneTypeId = this.sceneTypes[0].value; |
| | | this.getOptions(); |
| | | }, |
| | | expose: ['onSubmit'] |
| | | }; |
| | | </script> |
| | | |