| | |
| | | adjustSubtask(subtask){ |
| | | return $fysp.post(`subtask/adjust`, subtask).then((res) => res.data); |
| | | }, |
| | | |
| | | putSubtasks(subtaskList) { |
| | | return $fysp.put(`subtask/addlist`, subtaskList).then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElTag: typeof import('element-plus/es')['ElTag'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
| | | ElTree: typeof import('element-plus/es')['ElTree'] |
| | | ElUpload: typeof import('element-plus/es')['ElUpload'] |
| | | Footer: typeof import('./components/core/Footer.vue')['default'] |
| | |
| | | 'submit', |
| | | formObj, |
| | | () => { |
| | | loading.value = false; |
| | | resolve(); |
| | | }, |
| | | (err) => { |
| | | loading.value = false; |
| | | reject(err ? err : ''); |
| | | } |
| | | ); |
| | | }); |
| | | }).finally(() => (loading.value = false)); |
| | | } |
| | | |
| | | //取消按钮触发 |
| | |
| | | <el-row> |
| | | <el-col :span="curSubTaskList ? 16 : 24"> |
| | | <CompMonitorPlan |
| | | ref="planRef" |
| | | :task="curTask.data" |
| | | @date-change="onDateChange" |
| | | ></CompMonitorPlan> |
| | |
| | | :loading="subTaskLoading" |
| | | height="56vh" |
| | | @add="subTaskDrawer = true" |
| | | @submit="handleSubtaskSubmit" |
| | | ></CompSubTaskList> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | this.sideLoading = false; |
| | | this.mainLoading = true; |
| | | this.curSubTaskList = undefined; |
| | | this.curTask = task; |
| | | taskApi |
| | | .fetchMonitorObjectVersion(task.data.tguid) |
| | | .then((res) => { |
| | | this.curMonitorObjList = res; |
| | | this.curTask = task; |
| | | }) |
| | | .finally(() => { |
| | | this.mainLoading = false; |
| | |
| | | task: encodeURIComponent(JSON.stringify(value)) |
| | | } |
| | | }); |
| | | }, |
| | | handleSubtaskSubmit() { |
| | | this.subTaskLoading = true; |
| | | this.$refs.planRef |
| | | .fetchDayTasks() |
| | | .finally(() => (this.subTaskLoading = false)); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | */ |
| | | ceateSubTask(){ |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 根据多选下拉框的选项值,返回任务执行人对象 |
| | | * @returns |
| | | */ |
| | | getExecutors(data, executorOptions) { |
| | | const ids = []; |
| | | const uNames = []; |
| | | const rNames = []; |
| | | executorOptions.forEach((e) => { |
| | | const index = data.indexOf(e.value); |
| | | if (index != -1) { |
| | | ids.push(e.data.guid); |
| | | uNames.push(e.data.acountname); |
| | | rNames.push(e.data.realname); |
| | | } |
| | | }); |
| | | return { |
| | | id: ids.join('#'), |
| | | uName: uNames.join('#'), |
| | | rName: rNames.join('#') |
| | | }; |
| | | } |
| | | } |
| | |
| | | :data="seletedSceneList" |
| | | :dayTask="dayTask" |
| | | @delete="deleteScene" |
| | | @submit="createSubtasks" |
| | | ></CompSubTaskSelect> |
| | | <div> |
| | | <!-- <el-scrollbar height="50vh"> --> |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-row justify="space-between"> |
| | | <el-text>单日计划</el-text> |
| | | <el-button type="success" size="small" @click="editTask" |
| | | >新增</el-button |
| | | > |
| | | </el-row> |
| | | <el-divider /> |
| | | <div> |
| | | <el-scrollbar :height="height"> |
| | | <ItemSubTask |
| | | v-for="stask in curSubTaskList" |
| | | :key="stask.guid" |
| | | :item="stask" |
| | | > |
| | | <template #default="{ item }"> |
| | | <el-button type="danger" size="small" @click="editTask" |
| | | >移除</el-button |
| | | > |
| | | </template> |
| | | </ItemSubTask> |
| | | </el-scrollbar> |
| | | </div> |
| | | <CompSubTaskList |
| | | v-model="curSubTaskList" |
| | | :height="height" |
| | | ></CompSubTaskList> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | |
| | | import { useCloned } from '@vueuse/core'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import subtaskApi from '@/api/fysp/subtaskApi'; |
| | | import TaskProxy from '../TaskProxy'; |
| | | |
| | | import CompMonitorObj from './CompMonitorObj.vue'; |
| | | import CompSubTaskSelect from './CompSubTaskSelect.vue'; |
| | | import CompSubTaskList from './CompSubTaskList.vue'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | const route = useRoute(); |
| | | |
| | |
| | | const index = seletedSceneList.value.indexOf(item); |
| | | seletedSceneList.value.splice(index, 1); |
| | | } |
| | | |
| | | function createSubtasks(executors) { |
| | | const dt = props.dayTask; |
| | | const subtasks = seletedSceneList.value.map((_) => { |
| | | const s = _.scene |
| | | return { |
| | | // 主键由服务端创建 |
| | | stguid: undefined, |
| | | tguid: dt.tsGuid, |
| | | tsguid: dt.guid, |
| | | name: `${s.name}巡查`, |
| | | typeno: 1, |
| | | type: '巡查', |
| | | provincecode: s.provincecode, |
| | | provincename: s.provincename, |
| | | citycode: s.citycode, |
| | | cityname: s.cityname, |
| | | districtcode: s.districtcode, |
| | | districtname: s.districtname, |
| | | scensename: s.name, |
| | | scenseid: s.guid, |
| | | scenseaddress: s.location, |
| | | planstarttime: dt.date, |
| | | planendtime: dayjs(dt.date).endOf('day').set('millisecond', 0).toDate(), |
| | | deployerguid: 'rAR0A4gJdlOZEqZs', |
| | | deployerusername: 'ccheck', |
| | | deployerrealname: '整改审核', |
| | | executorguids: executors.ids, |
| | | executorusernames: executors.uName, |
| | | executorrealtimes: executors.rName, |
| | | status: '未执行', |
| | | remark: undefined |
| | | }; |
| | | }); |
| | | subtaskApi.putSubtasks(subtasks) |
| | | } |
| | | </script> |
| | | <style scoped></style> |
| | |
| | | }); |
| | | const emit = defineEmits(['dateChange']); |
| | | // 选中日期 |
| | | const dateValue = ref(new Date()); |
| | | const dateValue = ref(); |
| | | // 日历标题 |
| | | const title = computed(() => { |
| | | if (props.task) { |
| | |
| | | // 获取日任务统计信息 |
| | | const dayTaskLoading = ref(false); |
| | | const dayTaskList = ref([]); |
| | | function fetchDayTasks(topTaskId) { |
| | | function fetchDayTasks() { |
| | | dayTaskLoading.value = true; |
| | | taskApi |
| | | .fetchDayTasks(topTaskId) |
| | | return taskApi |
| | | .fetchDayTasks(props.task.tguid) |
| | | .then((res) => { |
| | | dayTaskList.value = res; |
| | | // 如果已选日期存在,在重新获取日任务统计信息后,再次触发点击事件 |
| | | if (dateValue.value) { |
| | | onDateChange(dateValue.value) |
| | | } |
| | | }) |
| | | .finally(() => (dayTaskLoading.value = false)); |
| | | } |
| | |
| | | watch( |
| | | () => props.task, |
| | | (nV) => { |
| | | if (nV.tguid) { |
| | | fetchDayTasks(nV.tguid); |
| | | if (nV && nV.tguid) { |
| | | fetchDayTasks(); |
| | | } |
| | | }, |
| | | { immediate: true } |
| | | ); |
| | | |
| | | defineExpose({ fetchDayTasks }); |
| | | </script> |
| | | <style scoped> |
| | | .li-01 { |
| | |
| | | <template> |
| | | <FYForm |
| | | ref="formRef" |
| | | :form-info="formInfo" |
| | | :rules="rules" |
| | | :useCancel="true" |
| | |
| | | :initValue="false" |
| | | type="date" |
| | | v-model:value="formObj.planstarttime" |
| | | @change="handleTimeChange" |
| | | ></FYOptionTime> |
| | | <el-form-item label="执行人" prop="_executors"> |
| | | <el-select |
| | |
| | | import { ref, computed, onMounted, reactive } from 'vue'; |
| | | import subtaskApi from '@/api/fysp/subtaskApi'; |
| | | import userApi from '@/api/fysp/userApi'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | const props = defineProps({ |
| | | //基本信息 |
| | |
| | | create: Boolean |
| | | }); |
| | | |
| | | const emit = defineEmits(['submit', 'cancel']); |
| | | const emit = defineEmits(['submit', 'cancel', 'update:modelValue']); |
| | | |
| | | const formRef = ref(null); |
| | | // 任务执行人选项 |
| | | const executorOptions = ref([]); |
| | | const formInfo = computed(() => { |
| | |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | function handleTimeChange(time) { |
| | | formRef.value.formObj.planendtime = dayjs(time).endOf('day').set('millisecond', 0) |
| | | } |
| | | |
| | | function getExecutors(data) { |
| | | const ids = []; |
| | |
| | | return subtaskApi |
| | | .adjustSubtask(v) |
| | | .then(() => { |
| | | emit('update:modelValue', v) |
| | | emit('submit', v); |
| | | success(); |
| | | }) |
| | |
| | | }); |
| | | } |
| | | function submit(v, success, fail) { |
| | | const executors = getExecutors(v.value); |
| | | v.value.executorguids = executors.id |
| | | v.value.executorusernames = executors.uName |
| | | v.value.executorrealtimes = executors.rName |
| | | return props.create |
| | | ? createScene(v.value, success, fail) |
| | | : updateScene(v.value, success, fail); |
| | |
| | | <el-row justify="space-between"> |
| | | <el-text>单日计划</el-text> |
| | | <el-button |
| | | v-show="create && modelValue && modelValue.length > 0" |
| | | v-show="create && data && data.length > 0" |
| | | type="success" |
| | | size="small" |
| | | @click="add" |
| | |
| | | <div> |
| | | <el-scrollbar v-loading="loading" :height="height"> |
| | | <el-space |
| | | v-if="modelValue && modelValue.length > 0" |
| | | v-if="data && data.length > 0" |
| | | fill |
| | | :fill-ratio="100" |
| | | direction="vertical" |
| | | style="width: 100%" |
| | | > |
| | | <ItemSubTask v-for="s in modelValue" :key="s.guid" :item="s"> |
| | | <ItemSubTask v-for="s in data" :key="s.guid" :item="s"> |
| | | <template #default="{ item }"> |
| | | <el-space direction="vertical"> |
| | | <el-button plain type="primary" size="small" @click="edit(item)" |
| | | <el-button |
| | | :disabled="item.status != '未执行'" |
| | | plain |
| | | type="primary" |
| | | size="small" |
| | | @click="edit(item)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | |
| | | </el-space> |
| | | <div v-else> |
| | | <el-empty description="无任务记录" /> |
| | | <el-row justify="center"> |
| | | <el-row v-if="create" justify="center"> |
| | | <el-button type="success" size="small" @click="add" |
| | | >添加任务</el-button |
| | | > |
| | |
| | | > |
| | | <CompSubTaskEdit |
| | | v-model="activeItem" |
| | | @submit="dialogVisible = false" |
| | | @submit="onEditSubmit" |
| | | @cancel="dialogVisible = false" |
| | | ></CompSubTaskEdit> |
| | | </el-dialog> |
| | |
| | | loading: Boolean |
| | | }); |
| | | |
| | | const dialogVisible = ref(false) |
| | | const activeItem = ref(null) |
| | | const dialogVisible = ref(false); |
| | | const activeItem = ref(null); |
| | | const data = computed(() => props.modelValue); |
| | | |
| | | const emit = defineEmits(['edit', 'add', 'remove', 'update:modelValue']); |
| | | const emit = defineEmits(['submit', 'add', 'remove', 'update:modelValue']); |
| | | |
| | | function remove(item) { |
| | | if (item.status == '未执行') { |
| | |
| | | } |
| | | |
| | | function edit(item) { |
| | | activeItem.value = item |
| | | dialogVisible.value = true |
| | | emit('edit'); |
| | | activeItem.value = item; |
| | | dialogVisible.value = true; |
| | | } |
| | | |
| | | function onEditSubmit(item) { |
| | | dialogVisible.value = false; |
| | | const index = data.value.findIndex((v) => { |
| | | return item.stguid == v.stguid; |
| | | }); |
| | | data.value.splice(index, 1, item); |
| | | emit('update:modelValue', data.value); |
| | | emit('submit'); |
| | | } |
| | | |
| | | function add() { |
| | |
| | | } |
| | | |
| | | onUnmounted(()=>{ |
| | | dialogVisible.value = false |
| | | }) |
| | | dialogVisible.value = false; |
| | | }); |
| | | </script> |
| | |
| | | import { ref, reactive, watch, computed, onMounted } from 'vue'; |
| | | import { ElMessageBox, ElNotification, ElMessage } from 'element-plus'; |
| | | import taskApi from '@/api/fysp/taskApi'; |
| | | import TaskProxy from '../TaskProxy'; |
| | | |
| | | onMounted(() => { |
| | | // if (props.height) { |
| | |
| | | dayTask: Object |
| | | }); |
| | | |
| | | const emit = defineEmits(['delete']); |
| | | const emit = defineEmits(['submit', 'delete']); |
| | | |
| | | const scrollHeight = ref('14vh'); |
| | | |
| | |
| | | fail('未选择监管场景'); |
| | | } else { |
| | | success(); |
| | | // 将任务执行人格式化并传递 |
| | | const param = TaskProxy.getExecutors(v.value.executor, executors.value) |
| | | emit('submit', param) |
| | | } |
| | | } |
| | | |