| | |
| | | <template> |
| | | <el-row justify="space-between"> |
| | | <el-text>单日计划</el-text> |
| | | <el-button |
| | | v-show="create && data && data.length > 0" |
| | | type="success" |
| | | size="small" |
| | | @click="add" |
| | | >任务调整</el-button |
| | | > |
| | | <div> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | @click="handleInspectFileDownload" |
| | | >单据下载</el-button |
| | | > |
| | | <el-button |
| | | v-show="create && data && data.length > 0" |
| | | type="success" |
| | | size="small" |
| | | @click="add" |
| | | >任务调整</el-button |
| | | > |
| | | </div> |
| | | </el-row> |
| | | <el-divider /> |
| | | <div> |
| | |
| | | <div v-else> |
| | | <el-empty description="无任务记录" /> |
| | | <el-row v-if="create" justify="center"> |
| | | <el-button type="success" size="small" @click="add" |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | :loading="createLoading" |
| | | @click="add" |
| | | >添加任务</el-button |
| | | > |
| | | </el-row> |
| | |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600" |
| | | title="一键创建总任务" |
| | | title="巡查任务编辑" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | |
| | | @cancel="dialogVisible = false" |
| | | ></CompSubTaskEdit> |
| | | </el-dialog> |
| | | <SceneInspectFile v-model="downloadDialog" :value="downloadSceneList"></SceneInspectFile> |
| | | </template> |
| | | <script setup> |
| | | import { ref, computed, watch, onMounted, onUnmounted } from 'vue'; |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | import CompSubTaskEdit from './CompSubTaskEdit.vue'; |
| | | import SceneInspectFile from "@/views/fysp/scene/SceneInspectFile.vue"; |
| | | import subtaskApi from '@/api/fysp/subtaskApi'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: Array, |
| | |
| | | }, |
| | | // 是否显示添加任务按钮 |
| | | create: Boolean, |
| | | loading: Boolean |
| | | loading: Boolean, |
| | | createLoading: Boolean |
| | | }); |
| | | |
| | | const dialogVisible = ref(false); |
| | | const activeItem = ref(null); |
| | | const data = computed(() => props.modelValue); |
| | | const downloadDialog = ref(false); |
| | | const downloadSceneList = ref([]) |
| | | |
| | | const emit = defineEmits(['submit', 'add', 'remove', 'update:modelValue']); |
| | | |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const index = data.value.indexOf(item); |
| | | data.value.splice(index, 1); |
| | | return subtaskApi.deleteSubtask(item.stguid).then((res) => { |
| | | if (res == 1) { |
| | | const index = data.value.indexOf(item); |
| | | data.value.splice(index, 1); |
| | | |
| | | emit('update:modelValue', data.value); |
| | | emit('remove', item); |
| | | emit('update:modelValue', data.value); |
| | | emit('remove', item); |
| | | } else { |
| | | Promise.reject('删除巡查任务失败'); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | |
| | | onUnmounted(() => { |
| | | dialogVisible.value = false; |
| | | }); |
| | | |
| | | function handleInspectFileDownload() { |
| | | downloadSceneList.value = data.value.map(v=>v.scenseid) |
| | | downloadDialog.value = true |
| | | } |
| | | </script> |