|
@@ -20,9 +20,8 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['system:admin:add']"
|
|
|
>新增</el-button>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
type="warning"
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
@@ -30,15 +29,21 @@
|
|
|
:loading="exportLoading"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['system:admin:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出</el-button> -->
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-table v-loading="loading" :data="adminList" height="calc(100vh - 28vh)">
|
|
|
+ <el-table v-loading="loading" :data="adminList" :max-height="tableHeight">
|
|
|
<el-table-column label="计划名称" align="center" prop="name" show-overflow-tooltip />
|
|
|
- <el-table-column label="周期" align="center" prop="cycle" show-overflow-tooltip />
|
|
|
+ <el-table-column label="周期" align="center" prop="cycle" show-overflow-tooltip >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.cycle == 1 ? "日" : scope.row.cycle == 2 ? "周" : "月"}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="计划开始时间" align="center" prop="startTime" show-overflow-tooltip />
|
|
|
+ <el-table-column label="计划结束时间" align="center" prop="endTime" show-overflow-tooltip />
|
|
|
<el-table-column label="执行开始时间" align="center" prop="startInspectTime" show-overflow-tooltip />
|
|
|
<el-table-column label="执行结束时间" align="center" prop="endInspectTime" show-overflow-tooltip />
|
|
|
- <el-table-column label="执行团队" align="center" prop="teamName" show-overflow-tooltip />
|
|
|
+ <el-table-column label="执行班组" align="center" prop="teamName" show-overflow-tooltip />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -46,33 +51,31 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['system:admin:edit']"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['system:admin:remove']"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 修改、新增对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="auto" >
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="640px" append-to-body :before-close="cancel" :close-on-click-modal="false">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px" >
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="计划名称" prop="planName">
|
|
|
- <el-input v-model="form.planName" placeholder="请填写计划名称" @input="onInput()" maxlength="15" show-word-limit />
|
|
|
+ <el-form-item label="计划名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请填写计划名称" @input="onInput()" maxlength="15" show-word-limit />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="执行团队" prop="teamId">
|
|
|
+ <el-form-item label="执行班组" prop="teamId">
|
|
|
<el-select
|
|
|
v-model="form.teamId"
|
|
|
- placeholder="请选择执行团队"
|
|
|
+ placeholder="请选择执行班组"
|
|
|
clearable
|
|
|
size="small"
|
|
|
style="width: 160px"
|
|
@@ -80,34 +83,17 @@
|
|
|
<el-option
|
|
|
v-for="dict in teamList"
|
|
|
:key="dict.id"
|
|
|
- :label="dict.teamName"
|
|
|
+ :label="dict.name"
|
|
|
:value="dict.id"
|
|
|
+ width="30%"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="周期" prop="cycle">
|
|
|
- <el-select
|
|
|
- v-model="form.cycle"
|
|
|
- placeholder="请选择周期"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- style="width: 160px"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in cycleList"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="计划开始时间" prop="startDate">
|
|
|
+ <el-form-item label="计划开始时间" prop="startTime">
|
|
|
<el-date-picker
|
|
|
- v-model="form.startDate"
|
|
|
+ v-model="form.startTime"
|
|
|
type="date"
|
|
|
style="width:160px"
|
|
|
placeholder="选择日期">
|
|
@@ -115,11 +101,11 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="计划结束时间" prop="endDate">
|
|
|
+ <el-form-item label="计划结束时间" prop="endTime">
|
|
|
<el-date-picker
|
|
|
- v-model="form.endDate"
|
|
|
+ v-model="form.endTime"
|
|
|
type="date"
|
|
|
- style="width:160px"
|
|
|
+ style="width:160px;"
|
|
|
placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
@@ -160,20 +146,44 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="周期" prop="cycle">
|
|
|
+ <el-select
|
|
|
+ v-model="form.cycle"
|
|
|
+ placeholder="请选择周期"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 160px;"
|
|
|
+
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in cycleList"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
|
|
|
<el-col style="font-size:16px;font-weight:700;margin:10px 0 20px;">巡更路线</el-col>
|
|
|
- <el-table v-loading="loading2" :data="adminList2" height="200" @select="dialogCheck" ref="dataTable">
|
|
|
+ <el-table v-loading="loading2" :data="adminList2" height="150" @select="dialogCheck" ref="dataTable" style="margin-bottom:50px">
|
|
|
<el-table-column type="selection" />
|
|
|
<el-table-column label="线路名称" align="center" prop="name" show-overflow-tooltip />
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" show-overflow-tooltip />
|
|
|
</el-table>
|
|
|
- <pagination
|
|
|
- v-show="total2>0"
|
|
|
- :total="total2"
|
|
|
- :page.sync="queryParams2.current"
|
|
|
- :limit.sync="queryParams2.size"
|
|
|
- @pagination="getList2"
|
|
|
- />
|
|
|
+ <el-pagination
|
|
|
+ style="bottom:0px"
|
|
|
+ background
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
+ :page-sizes="[10, 15, 20, 30]"
|
|
|
+ @size-change="handleSizeChange2"
|
|
|
+ :current-page="queryParams2.pageNo"
|
|
|
+ :page-size="queryParams2.pageSize"
|
|
|
+ layout="sizes,prev, pager, next"
|
|
|
+ :total="totalCount2"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -181,13 +191,17 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.current"
|
|
|
- :limit.sync="queryParams.size"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @current-change="handleCurrentChange1"
|
|
|
+ :page-sizes="[10, 15, 20, 30]"
|
|
|
+ @size-change="handleSizeChange1"
|
|
|
+ :current-page="queryParams.pageNo"
|
|
|
+ :page-size="queryParams.pageSize"
|
|
|
+ layout="sizes,prev, pager, next"
|
|
|
+ :total="totalCount1"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
<a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -206,9 +220,9 @@ export default {
|
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
- total: 0,
|
|
|
+ totalCount1: undefined,
|
|
|
// 总条数
|
|
|
- total2: 0,
|
|
|
+ totalCount2: undefined,
|
|
|
// 参数表格数据
|
|
|
adminList: [],
|
|
|
adminList2:[],
|
|
@@ -219,23 +233,27 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
|
- size: 20,
|
|
|
+ size: 15,
|
|
|
name: undefined,
|
|
|
+ pageNo:1,
|
|
|
+ pageSize:15,
|
|
|
},
|
|
|
// 查询参数
|
|
|
queryParams2: {
|
|
|
current: 1,
|
|
|
- size: 20,
|
|
|
+ size: 15,
|
|
|
+ pageNo:1,
|
|
|
+ pageSize:15,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- planName: [
|
|
|
+ name: [
|
|
|
{ required: true, message: "任务名称不能为空", trigger: "blur" }
|
|
|
],
|
|
|
teamId: [
|
|
|
- { required: true, message: "团队名称不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "班组名称不能为空", trigger: ["blur",'change'] }
|
|
|
],
|
|
|
companyCode: [
|
|
|
{ required: true, message: "单位名称不能为空", trigger: ["blur",'change']}
|
|
@@ -243,11 +261,11 @@ export default {
|
|
|
cycle: [
|
|
|
{ required: true, message: "周期不能为空", trigger: ["blur",'change']}
|
|
|
],
|
|
|
- startDate: [
|
|
|
- { required: true, message: "维保开始时间不能为空", trigger: ["blur",'change']}
|
|
|
+ startTime: [
|
|
|
+ { required: true, message: "计划开始时间不能为空", trigger: ["blur",'change']}
|
|
|
],
|
|
|
- endDate: [
|
|
|
- { required: true, message: "维保结束时间不能为空", trigger: ["blur",'change']}
|
|
|
+ endTime: [
|
|
|
+ { required: true, message: "计划结束时间不能为空", trigger: ["blur",'change']}
|
|
|
],
|
|
|
startInspectTime: [
|
|
|
{ required: true, message: "执行开始时间称不能为空", trigger: ["blur",'change']}
|
|
@@ -258,27 +276,56 @@ export default {
|
|
|
},
|
|
|
zrr:[],
|
|
|
cycleList:[
|
|
|
- {dictValue:"周一",dictValue:"周一"},
|
|
|
- {dictValue:"周二",dictValue:"周二"},
|
|
|
- {dictValue:"周三",dictValue:"周三"},
|
|
|
- {dictValue:"周四",dictValue:"周四"},
|
|
|
- {dictValue:"周五",dictValue:"周五"},
|
|
|
- {dictValue:"周六",dictValue:"周六"},
|
|
|
- {dictValue:"周日",dictValue:"周日"},
|
|
|
+ {dictValue:1,dictLabel:"日"},
|
|
|
+ {dictValue:2,dictLabel:"周"},
|
|
|
+ {dictValue:3,dictLabel:"月"},
|
|
|
],
|
|
|
inspectTimeList:[],
|
|
|
|
|
|
dateRange:[],
|
|
|
teamList:[],
|
|
|
selectioned:'',//单选中的值
|
|
|
+ tableHeight:undefined,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();//初始化table
|
|
|
this.zxtime()//执行时间
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ // table高度
|
|
|
+ if(window.innerWidth <1920){
|
|
|
+ this.tableHeight = window.innerHeight - 300
|
|
|
+ }else{
|
|
|
+ this.tableHeight = window.innerHeight - 295
|
|
|
+ }
|
|
|
+ // 监听窗口大小变化
|
|
|
+ let self = this;
|
|
|
+ window.onresize = function() {
|
|
|
+ self.tableHeight = window.innerHeight - 300
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
-
|
|
|
+ //分页查询
|
|
|
+ handleCurrentChange1(val) {
|
|
|
+ this.queryParams.pageNo = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //分页查询
|
|
|
+ handleSizeChange1(val) {
|
|
|
+ this.queryParams.pageSize = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //分页查询
|
|
|
+ handleCurrentChange2(val) {
|
|
|
+ this.queryParams2.pageNo = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //分页查询
|
|
|
+ handleSizeChange2(val) {
|
|
|
+ this.queryParams2.pageSize = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
|
|
|
//强制el-input刷新
|
|
|
onInput(){
|
|
@@ -287,7 +334,10 @@ export default {
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
- this.reset();
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.reset();
|
|
|
+ },500)
|
|
|
+
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
@@ -295,14 +345,16 @@ export default {
|
|
|
this.queryParams = {
|
|
|
name:undefined,
|
|
|
current:1,
|
|
|
- size:20
|
|
|
+ size:15,
|
|
|
+ pageSize:15,
|
|
|
+ pageNo1,
|
|
|
}
|
|
|
- this.resetForm("queryForm");
|
|
|
+ // this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
- this.form = {};
|
|
|
+ this.form={}
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
@@ -339,20 +391,21 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
getMaintianPlan(this.queryParams).then(response => {
|
|
|
- this.adminList = response.data.records;
|
|
|
- this.total = response.data.total;
|
|
|
+ this.adminList = response.data.pageList;
|
|
|
+ this.totalCount1 = response.data.totalCount;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
getDevopsTeam(this.queryParams).then(response => {
|
|
|
- if(response.data.records.length>0){
|
|
|
- this.teamList = response.data.records;
|
|
|
+ if(response.data.pageList.length>0){
|
|
|
+ this.teamList = response.data.pageList;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getList2(row){
|
|
|
this.adminList2 = []
|
|
|
getPlanPath(this.queryParams2).then(response => {
|
|
|
- this.adminList2 = response.data.records;
|
|
|
+ this.adminList2 = response.data.pageList;
|
|
|
+ this.totalCount2 = response.data.totalCount;
|
|
|
if(row){
|
|
|
let list = []
|
|
|
for(let i = 0; i<this.adminList2.length;i++){
|
|
@@ -369,18 +422,15 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- this.total2 = response.data.total;
|
|
|
this.loading2 = false;
|
|
|
})
|
|
|
}else{
|
|
|
- this.total2 = response.data.total;
|
|
|
this.loading2 = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
this.title = "修改";
|
|
|
this.form = JSON.parse(JSON.stringify(row))
|
|
|
this.getList2(row)
|
|
@@ -390,31 +440,31 @@ export default {
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
this.getList2()
|
|
|
- this.open = true;
|
|
|
this.title = "新增";
|
|
|
this.list = []
|
|
|
+ this.open = true;
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm(row) {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.form.endDate = timestampToTime(this.form.endDate)
|
|
|
- this.form.startDate = timestampToTime(this.form.startDate)
|
|
|
+ this.form.endTime = timestampToTime(this.form.endTime)
|
|
|
+ this.form.startTime = timestampToTime(this.form.startTime)
|
|
|
let start = YearMonthDate().split(" ")[0] + " " + this.form.startInspectTime
|
|
|
let end = YearMonthDate().split(" ")[0] + " " + this.form.endInspectTime
|
|
|
- if(getTimeFormat(this.form.endDate) < getTimeFormat(this.form.startDate)){
|
|
|
- this.msgError("计划结束时间不能小于计划开始时间");
|
|
|
+ if(getTimeFormat(this.form.endTime) < getTimeFormat(this.form.startTime)){
|
|
|
+ this.$message.error("计划结束时间不能小于计划开始时间");
|
|
|
return
|
|
|
}
|
|
|
if(getTimeFormat(end) < getTimeFormat(start)){
|
|
|
- this.msgError("执行结束时间不能小于执行开始时间");
|
|
|
+ this.$message.error("执行结束时间不能小于执行开始时间");
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
if (this.form.id != undefined) {
|
|
|
updateMaintianPlan(this.form).then(response => {
|
|
|
this.loading = false,
|
|
|
- this.msgSuccess("修改成功");
|
|
|
+ this.$message.success("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
}).catch(()=>{
|
|
@@ -422,12 +472,13 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
addMaintianPlan(this.form).then(response => {
|
|
|
- this.loading = false,
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }).catch(()=>{
|
|
|
this.loading = false
|
|
|
+ if(response.status == "SUCCESS"){
|
|
|
+ this.loading = false,
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -444,7 +495,7 @@ export default {
|
|
|
return delMaintianPlan(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
+ this.$message.success("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
/** table */
|