|
@@ -16,7 +16,7 @@
|
|
end-placeholder="结束时间"
|
|
end-placeholder="结束时间"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="任务状态" v-if="currentstatus==1">
|
|
|
|
|
|
+ <el-form-item label="任务状态" v-if="currentstatus == 1">
|
|
<el-select
|
|
<el-select
|
|
v-model="queryparameters.status"
|
|
v-model="queryparameters.status"
|
|
class="m-1"
|
|
class="m-1"
|
|
@@ -88,13 +88,14 @@
|
|
<el-table-column prop="taskAddrRoad" label="道路名" />
|
|
<el-table-column prop="taskAddrRoad" label="道路名" />
|
|
<el-table-column prop="taskContent" label="任务内容" />
|
|
<el-table-column prop="taskContent" label="任务内容" />
|
|
<el-table-column prop="taskTime" label="来件时间" />
|
|
<el-table-column prop="taskTime" label="来件时间" />
|
|
- <!-- <el-table-column prop="address" label="操作" >
|
|
|
|
-<template #default="scope">
|
|
|
|
- <el-button text size="small" @click="handleClick">
|
|
|
|
- </el-button>
|
|
|
|
- <el-button text size="small">Edit</el-button>
|
|
|
|
-</template>
|
|
|
|
- </el-table-column> -->
|
|
|
|
|
|
+ <el-table-column prop="address" label="操作">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button text size="small" @click.stop="edittask(scope.row)"
|
|
|
|
+ >修改
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button text size="small" @click.stop="deltask(scope.row)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<div style="position: relative; padding-right: 20px; margin-top: -20px">
|
|
<div style="position: relative; padding-right: 20px; margin-top: -20px">
|
|
<Pagination
|
|
<Pagination
|
|
@@ -119,7 +120,13 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-dialog v-model="showadd" v-loading="loading" title="新增任务" width="70%" draggable>
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-model="showadd"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ title="新增任务"
|
|
|
|
+ width="70%"
|
|
|
|
+ draggable
|
|
|
|
+ >
|
|
<div>
|
|
<div>
|
|
<TaskAdd v-model:taskinfo="taskinfo" ref="taskaddref"></TaskAdd>
|
|
<TaskAdd v-model:taskinfo="taskinfo" ref="taskaddref"></TaskAdd>
|
|
</div>
|
|
</div>
|
|
@@ -138,6 +145,7 @@ import { defineComponent, ref, reactive, onMounted, computed } from "vue";
|
|
import { useDict } from "@/utils/dict";
|
|
import { useDict } from "@/utils/dict";
|
|
import TaskAdd from "@/components/Task/Add";
|
|
import TaskAdd from "@/components/Task/Add";
|
|
import router from "../../../router";
|
|
import router from "../../../router";
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
// 分页组件
|
|
// 分页组件
|
|
import Pagination from "@/components/Pagination";
|
|
import Pagination from "@/components/Pagination";
|
|
import {
|
|
import {
|
|
@@ -147,10 +155,11 @@ import {
|
|
addTask,
|
|
addTask,
|
|
updateTask,
|
|
updateTask,
|
|
} from "@/api/system/task";
|
|
} from "@/api/system/task";
|
|
-import { cloneDeep } from 'lodash';
|
|
|
|
|
|
+import { cloneDeep } from "lodash";
|
|
import { isArray } from "@vue/shared";
|
|
import { isArray } from "@vue/shared";
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
|
|
|
|
|
|
+
|
|
const {
|
|
const {
|
|
task_status,
|
|
task_status,
|
|
task_type,
|
|
task_type,
|
|
@@ -178,11 +187,8 @@ const tableData = ref([]);
|
|
const pagedata = ref({});
|
|
const pagedata = ref({});
|
|
const taskinfo = ref();
|
|
const taskinfo = ref();
|
|
const taskaddref = ref();
|
|
const taskaddref = ref();
|
|
-const route = useRoute()
|
|
|
|
- const currentstatus = computed(() => route.params.status);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+const route = useRoute();
|
|
|
|
+const currentstatus = computed(() => route.params.status);
|
|
|
|
|
|
const addtask = () => {
|
|
const addtask = () => {
|
|
showadd.value = true;
|
|
showadd.value = true;
|
|
@@ -199,7 +205,7 @@ const addtask = () => {
|
|
taskAddrRoad: null,
|
|
taskAddrRoad: null,
|
|
taskOtherId: null,
|
|
taskOtherId: null,
|
|
taskTime: null,
|
|
taskTime: null,
|
|
- taskArea:"1",
|
|
|
|
|
|
+ taskArea: "1",
|
|
taskReqCompleteTime: null,
|
|
taskReqCompleteTime: null,
|
|
status: 1,
|
|
status: 1,
|
|
remark: "",
|
|
remark: "",
|
|
@@ -213,32 +219,40 @@ const addtask = () => {
|
|
remark: "",
|
|
remark: "",
|
|
};
|
|
};
|
|
// console.log(taskaddref.value)
|
|
// console.log(taskaddref.value)
|
|
- taskaddref.value?.doinit();
|
|
|
|
|
|
+ taskaddref.value?.doinit(taskinfo.value);
|
|
};
|
|
};
|
|
|
|
|
|
const tblrowclick = (row) => {
|
|
const tblrowclick = (row) => {
|
|
// console.log(row)
|
|
// console.log(row)
|
|
router.push(`/task/detail/${row.taskId}`);
|
|
router.push(`/task/detail/${row.taskId}`);
|
|
};
|
|
};
|
|
-const ontaskadd = async ()=>{
|
|
|
|
|
|
+const ontaskadd = async () => {
|
|
showadd.value = false;
|
|
showadd.value = false;
|
|
var taskobj = cloneDeep(taskinfo.value);
|
|
var taskobj = cloneDeep(taskinfo.value);
|
|
taskobj.status = 1;
|
|
taskobj.status = 1;
|
|
- taskobj.taskDeptRange = (taskobj.taskDeptRange instanceof Array) ? taskobj.taskDeptRange.join(","):'';
|
|
|
|
|
|
+ taskobj.taskDeptRange =
|
|
|
|
+ taskobj.taskDeptRange instanceof Array
|
|
|
|
+ ? taskobj.taskDeptRange.join(",")
|
|
|
|
+ : "";
|
|
console.log(taskobj);
|
|
console.log(taskobj);
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
|
|
|
- await addTask(taskobj);
|
|
|
|
|
|
+ if (taskobj.taskId) {
|
|
|
|
+ await updateTask(taskobj);
|
|
|
|
+ } else {
|
|
|
|
+ await addTask(taskobj);
|
|
|
|
+ }
|
|
|
|
+
|
|
loading.value = false;
|
|
loading.value = false;
|
|
getList();
|
|
getList();
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
if (currentstatus.value != 1) {
|
|
if (currentstatus.value != 1) {
|
|
- if (currentstatus.value == 2){
|
|
|
|
|
|
+ if (currentstatus.value == 2) {
|
|
queryparameters.value.status = 1;
|
|
queryparameters.value.status = 1;
|
|
} else {
|
|
} else {
|
|
- queryparameters.value.status = currentstatus.value;
|
|
|
|
|
|
+ queryparameters.value.status = currentstatus.value;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
queryparameters.value.status = "";
|
|
queryparameters.value.status = "";
|
|
@@ -251,13 +265,22 @@ const getList = () => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
getList();
|
|
getList();
|
|
|
|
+const edittask = (row) => {
|
|
|
|
+ showadd.value = true;
|
|
|
|
+ taskinfo.value = cloneDeep(row);
|
|
|
|
|
|
|
|
+ taskaddref.value?.doinit(taskinfo.value);
|
|
|
|
|
|
|
|
+}
|
|
|
|
+const deltask = (row) => {
|
|
|
|
+ delTask(row.taskId).then(res => {
|
|
|
|
+ ElMessage.success("删除成功");
|
|
|
|
+ getList();
|
|
|
|
+ })
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
-
|
|
|
|
|
|
+}
|
|
|
|
|
|
-});
|
|
|
|
|
|
+onMounted(() => {});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|