|
@@ -9,7 +9,10 @@
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="工单号">
|
|
|
- <el-input v-model="queryparameters.taskCode" placeholder="请输入工单号"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="queryparameters.taskCode"
|
|
|
+ placeholder="请输入工单号"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
@@ -25,13 +28,13 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3" v-if="currentstatus == 1">
|
|
|
- <el-form-item label="任务状态" >
|
|
|
+ <el-form-item label="任务状态">
|
|
|
<el-select
|
|
|
v-model="queryparameters.status"
|
|
|
class="m-1"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
- <el-option label="全部" value="0" ></el-option>
|
|
|
+ <el-option label="全部" value="0"></el-option>
|
|
|
<el-option
|
|
|
v-for="item in task_status"
|
|
|
:label="item.label"
|
|
@@ -84,7 +87,10 @@
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="关键字">
|
|
|
- <el-input v-model="queryparameters.searchkey" placeholder="道路名/任务内容/地址"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="queryparameters.searchkey"
|
|
|
+ placeholder="道路名/任务内容/地址"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -93,16 +99,21 @@
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="getList">查询</el-button>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="route.params.status==6">
|
|
|
- <el-button type="primary" @click="exportexcel2(queryparameters)"
|
|
|
- >导出成本记录
|
|
|
- </el-button>
|
|
|
+ <el-form-item v-if="route.params.status == 6">
|
|
|
+ <el-button type="primary" @click="exportexcel2(queryparameters)"
|
|
|
+ >导出成本记录
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="reset()">重置</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="success" @click="addtask" v-if="route.params.status==1">新增工单</el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ @click="addtask"
|
|
|
+ v-if="route.params.status == 1"
|
|
|
+ >新增工单</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -146,35 +157,87 @@
|
|
|
<el-table-column prop="taskAddrRoad" label="道路名" />
|
|
|
<el-table-column prop="taskContent" label="任务内容" />
|
|
|
<el-table-column prop="createTime" label="来件时间" />
|
|
|
- <el-table-column prop="taskTime" label="剩余时间" v-if="currentstatus!=6">
|
|
|
- <template #default="scope"><div>
|
|
|
- <div v-if="scope.row.taskReqCompleteTime!=null && scope.row.status<5" :class="moment(scope.row.taskReqCompleteTime).diff(moment(),'days')<2?'tip-e':(moment(scope.row.taskReqCompleteTime).diff(moment(),'days')<3?'tip-w':(moment(scope.row.taskReqCompleteTime).diff(moment(),'days')>5?'tip-i':''))">
|
|
|
- <el-icon style="vertical-align: middle;"><Clock /></el-icon> <span> {{ moment(scope.row.taskReqCompleteTime).diff(moment(),'days')}}天</span>
|
|
|
- </div>
|
|
|
- <div v-if="scope.row.taskReqCompleteTime==null">
|
|
|
- -
|
|
|
- </div>
|
|
|
-
|
|
|
+ <el-table-column
|
|
|
+ prop="taskTime"
|
|
|
+ label="剩余时间"
|
|
|
+ v-if="currentstatus != 6"
|
|
|
+ >
|
|
|
+ <template #default="scope"
|
|
|
+ ><div>
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ scope.row.taskReqCompleteTime != null &&
|
|
|
+ scope.row.status < 5
|
|
|
+ "
|
|
|
+ :class="
|
|
|
+ moment(scope.row.taskReqCompleteTime).diff(
|
|
|
+ moment(),
|
|
|
+ 'days'
|
|
|
+ ) < 2
|
|
|
+ ? 'tip-e'
|
|
|
+ : moment(scope.row.taskReqCompleteTime).diff(
|
|
|
+ moment(),
|
|
|
+ 'days'
|
|
|
+ ) < 3
|
|
|
+ ? 'tip-w'
|
|
|
+ : moment(scope.row.taskReqCompleteTime).diff(
|
|
|
+ moment(),
|
|
|
+ 'days'
|
|
|
+ ) > 5
|
|
|
+ ? 'tip-i'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-icon style="vertical-align: middle"><Clock /></el-icon>
|
|
|
+ <span>
|
|
|
+ {{
|
|
|
+ moment(scope.row.taskReqCompleteTime).diff(
|
|
|
+ moment(),
|
|
|
+ "days"
|
|
|
+ )
|
|
|
+ }}天</span
|
|
|
+ >
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="操作" :width="currentstatus==6?'400px':''">
|
|
|
+ <div v-if="scope.row.taskReqCompleteTime == null">-</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address"
|
|
|
+ label="操作"
|
|
|
+ :width="currentstatus == 6 ? '400px' : ''"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
- <el-button text size="small" v-if="route.params.status!=6" @click.stop="edittask(scope.row)"
|
|
|
+ <el-button
|
|
|
+ text
|
|
|
+ size="small"
|
|
|
+ v-if="route.params.status != 6"
|
|
|
+ @click.stop="edittask(scope.row)"
|
|
|
>修改
|
|
|
</el-button>
|
|
|
- <el-popconfirm title="确定删除?" @confirm="deltask(scope.row)" v-if="route.params.status==1">
|
|
|
+ <el-popconfirm
|
|
|
+ title="确定删除?"
|
|
|
+ @confirm="deltask(scope.row)"
|
|
|
+ v-if="route.params.status == 1"
|
|
|
+ >
|
|
|
<template #reference>
|
|
|
<el-button text size="small" @click.stop="">删除</el-button>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
- <el-button v-if="scope.row.status==6 && route.params.status==6" text size="small" @click.stop="exportexcel(scope.row)"
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.status == 6 && route.params.status == 6"
|
|
|
+ text
|
|
|
+ size="small"
|
|
|
+ @click.stop="exportexcel(scope.row)"
|
|
|
>导出工单
|
|
|
</el-button>
|
|
|
- <el-button v-if="scope.row.status==6 && route.params.status==6" text size="small" @click.stop="exportexcel1(scope.row)"
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.status == 6 && route.params.status == 6"
|
|
|
+ text
|
|
|
+ size="small"
|
|
|
+ @click.stop="exportexcel1(scope.row)"
|
|
|
>导出热线照片
|
|
|
</el-button>
|
|
|
-
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -264,11 +327,11 @@ const {
|
|
|
);
|
|
|
const queryparameters = ref({
|
|
|
status: "0",
|
|
|
- taskCode:"",
|
|
|
+ taskCode: "",
|
|
|
taskArea: "",
|
|
|
taskType: "",
|
|
|
- taskDeptRange:[],
|
|
|
- searchkey:"",
|
|
|
+ taskDeptRange: [],
|
|
|
+ searchkey: "",
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
});
|
|
@@ -308,16 +371,18 @@ const taskaddref = ref();
|
|
|
const route = useRoute();
|
|
|
const currentstatus = computed(() => route.params.status);
|
|
|
|
|
|
-const reset=()=>{
|
|
|
- queryparameters.value = {status: "0",
|
|
|
- taskCode:"",
|
|
|
+const reset = () => {
|
|
|
+ queryparameters.value = {
|
|
|
+ status: "0",
|
|
|
+ taskCode: "",
|
|
|
taskArea: "",
|
|
|
taskType: "",
|
|
|
- taskDeptRange:[],
|
|
|
- searchkey:"",
|
|
|
+ taskDeptRange: [],
|
|
|
+ searchkey: "",
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10,};
|
|
|
-}
|
|
|
+ pageSize: 10,
|
|
|
+ };
|
|
|
+};
|
|
|
|
|
|
const addtask = () => {
|
|
|
showadd.value = true;
|
|
@@ -351,7 +416,6 @@ const addtask = () => {
|
|
|
};
|
|
|
|
|
|
const tblrowclick = (row) => {
|
|
|
-
|
|
|
router.push(`/task/detail/${row.taskId}`);
|
|
|
};
|
|
|
const ontaskadd = async () => {
|
|
@@ -363,6 +427,9 @@ const ontaskadd = async () => {
|
|
|
taskobj.taskDeptRange instanceof Array
|
|
|
? taskobj.taskDeptRange.join(",")
|
|
|
: "";
|
|
|
+ taskobj.taskReqCompleteTime = taskobj.taskReqCompleteTime
|
|
|
+ ? ""
|
|
|
+ : moment(taskobj.taskReqCompleteTime).format('YYYY-MM-DD HH:mm:ss');
|
|
|
console.log(taskobj);
|
|
|
loading.value = true;
|
|
|
|
|
@@ -377,34 +444,36 @@ const ontaskadd = async () => {
|
|
|
};
|
|
|
|
|
|
const getList = () => {
|
|
|
- if (currentstatus.value != '1' && currentstatus.value != 1 && queryparameters.value.status==="") {
|
|
|
- if (currentstatus.value == '2') {
|
|
|
+ if (
|
|
|
+ currentstatus.value != "1" &&
|
|
|
+ currentstatus.value != 1 &&
|
|
|
+ queryparameters.value.status === ""
|
|
|
+ ) {
|
|
|
+ if (currentstatus.value == "2") {
|
|
|
queryparameters.value.status = 1;
|
|
|
} else {
|
|
|
queryparameters.value.status = currentstatus.value;
|
|
|
}
|
|
|
} else {
|
|
|
- // queryparameters.value.status = "";
|
|
|
+ // queryparameters.value.status = "";
|
|
|
}
|
|
|
var cq = cloneDeep(queryparameters.value);
|
|
|
|
|
|
- var query = proxy.addDateRange(cq, qdate.value)
|
|
|
- if(query.status=="0"){
|
|
|
+ var query = proxy.addDateRange(cq, qdate.value);
|
|
|
+ if (query.status == "0") {
|
|
|
delete query.status;
|
|
|
}
|
|
|
- if (query.searchkey!=undefined && query.searchkey !== '') {
|
|
|
- query.params['searchkey'] = query.searchkey;
|
|
|
+ if (query.searchkey != undefined && query.searchkey !== "") {
|
|
|
+ query.params["searchkey"] = query.searchkey;
|
|
|
}
|
|
|
- if(query.taskDeptRange !=undefined){
|
|
|
+ if (query.taskDeptRange != undefined) {
|
|
|
query.taskDeptRange = query.taskDeptRange.join(",");
|
|
|
}
|
|
|
|
|
|
- listTask(query).then(
|
|
|
- (response) => {
|
|
|
- tableData.value = response.rows;
|
|
|
- pagedata.value = response;
|
|
|
- }
|
|
|
- );
|
|
|
+ listTask(query).then((response) => {
|
|
|
+ tableData.value = response.rows;
|
|
|
+ pagedata.value = response;
|
|
|
+ });
|
|
|
};
|
|
|
getList();
|
|
|
const edittask = (row) => {
|
|
@@ -419,36 +488,42 @@ const deltask = (row) => {
|
|
|
});
|
|
|
};
|
|
|
const exportexcel = (row) => {
|
|
|
- proxy.download("system/task/export", {
|
|
|
- ...{ "taskId": row.taskId},
|
|
|
- }, `${row.taskCode}工单.xlsx`);
|
|
|
-
|
|
|
-}
|
|
|
+ proxy.download(
|
|
|
+ "system/task/export",
|
|
|
+ {
|
|
|
+ ...{ taskId: row.taskId },
|
|
|
+ },
|
|
|
+ `${row.taskCode}工单.xlsx`
|
|
|
+ );
|
|
|
+};
|
|
|
const exportexcel1 = (row) => {
|
|
|
- proxy.download("system/task/export1", {
|
|
|
- ...{ "taskId": row.taskId},
|
|
|
- }, `${row.taskCode}热线照片.xlsx`);
|
|
|
-
|
|
|
-}
|
|
|
+ proxy.download(
|
|
|
+ "system/task/export1",
|
|
|
+ {
|
|
|
+ ...{ taskId: row.taskId },
|
|
|
+ },
|
|
|
+ `${row.taskCode}热线照片.xlsx`
|
|
|
+ );
|
|
|
+};
|
|
|
const exportexcel2 = (row) => {
|
|
|
- proxy.download("system/task/export2", {
|
|
|
- ...row,
|
|
|
- }, `成本记录.xlsx`);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-const tableRowClassName = ({
|
|
|
- row,
|
|
|
- rowIndex,
|
|
|
-}) => {
|
|
|
+ proxy.download(
|
|
|
+ "system/task/export2",
|
|
|
+ {
|
|
|
+ ...row,
|
|
|
+ },
|
|
|
+ `成本记录.xlsx`
|
|
|
+ );
|
|
|
+};
|
|
|
|
|
|
- if (row.status < 5 && row.tblTaskLogList.filter((ii) => ii.taskStatus === 6).length>0) {
|
|
|
- return 'warning-row'
|
|
|
+const tableRowClassName = ({ row, rowIndex }) => {
|
|
|
+ if (
|
|
|
+ row.status < 5 &&
|
|
|
+ row.tblTaskLogList.filter((ii) => ii.taskStatus === 6).length > 0
|
|
|
+ ) {
|
|
|
+ return "warning-row";
|
|
|
}
|
|
|
- return ''
|
|
|
-}
|
|
|
-
|
|
|
+ return "";
|
|
|
+};
|
|
|
|
|
|
function setdatakey(dept) {
|
|
|
if (dept.children) {
|
|
@@ -474,14 +549,13 @@ deptTreeselect().then((res) => {
|
|
|
treedept.value = [setdatakey(res.data[0])];
|
|
|
});
|
|
|
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
- if (currentstatus.value == '2') {
|
|
|
- queryparameters.value.status = 1;
|
|
|
- } else {
|
|
|
-
|
|
|
- queryparameters.value.status = currentstatus.value=="1"?'0':currentstatus.value;
|
|
|
- }
|
|
|
+ if (currentstatus.value == "2") {
|
|
|
+ queryparameters.value.status = 1;
|
|
|
+ } else {
|
|
|
+ queryparameters.value.status =
|
|
|
+ currentstatus.value == "1" ? "0" : currentstatus.value;
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -495,14 +569,14 @@ onMounted(() => {
|
|
|
.eltable {
|
|
|
border: 1px solid #e5e9f2;
|
|
|
border-radius: 5px;
|
|
|
- .tip-e{
|
|
|
- color:red;
|
|
|
+ .tip-e {
|
|
|
+ color: red;
|
|
|
}
|
|
|
- .tip-w{
|
|
|
- color:yellow;
|
|
|
+ .tip-w {
|
|
|
+ color: yellow;
|
|
|
}
|
|
|
- .tip-i{
|
|
|
- color:green;
|
|
|
+ .tip-i {
|
|
|
+ color: green;
|
|
|
}
|
|
|
}
|
|
|
}
|