diff --git a/src/views/device/inspectionPlan/index.vue b/src/views/device/inspectionPlan/index.vue index fec55ba..7a72553 100644 --- a/src/views/device/inspectionPlan/index.vue +++ b/src/views/device/inspectionPlan/index.vue @@ -328,7 +328,7 @@ /> - +
@@ -603,6 +603,8 @@ export default { dicts: ['device_loop_type', 'sys_normal_disable'], data() { return { + // 加载 + planLoading:false, // 工作中心list workCenterList: [], // 巡检人员选择穿梭框 @@ -1160,9 +1162,11 @@ export default { this.$refs["form"].validate(valid => { if (valid) { + this.planLoading = true; if (this.form.planId != null) { this.form.personList = this.selectPersonList; updatePlan(this.form).then(response => { + this.planLoading = false; this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); @@ -1170,6 +1174,7 @@ export default { } else { this.form.personList = this.selectPersonList; addPlan(this.form).then(response => { + this.planLoading = false; this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); diff --git a/src/views/device/spotCheckPlan/index.vue b/src/views/device/spotCheckPlan/index.vue index f00fed6..76ad8bb 100644 --- a/src/views/device/spotCheckPlan/index.vue +++ b/src/views/device/spotCheckPlan/index.vue @@ -191,38 +191,48 @@ @keyup.enter.native="handleQuery" /> - - - - - - - - - - - - - - + + + + + + + + + + + + + + 搜索 重置 @@ -282,6 +292,7 @@ + @@ -645,7 +656,7 @@ import { getEquList, getPersonList, getWorkCenter, - initUpdatePlanInfo, + initUpdatePlanInfo, listPlan, updatePlan } from "@/api/device/plan"; @@ -654,6 +665,34 @@ export default { dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'], data() { return { + // 日期范围选择快捷 + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近三个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + } + }] + }, // 加载 planLoading: false, // 工作中心list @@ -738,7 +777,9 @@ export default { createBy: null, createTime: null, updateBy: null, - updateTime: null + updateTime: null, + createTimeArray: [], + updateTimeArray: [], }, // 表单参数 form: { @@ -1015,7 +1056,7 @@ export default { }; this.getEquList(); }, - // 下一步 + // 上一步 stepLast() { this.spotCheckStep--; }, @@ -1033,11 +1074,12 @@ export default { /** 查询点检计划列表 */ getList() { this.loading = true; - listSpotCheckPlan(this.queryParams).then(response => { - this.spotCheckPlanList = response.rows; - this.total = response.total; - this.loading = false; - }); + listPlan(this.queryParams).then(response => { + this.spotCheckPlanList = response.rows; + + this.total = response.total; + this.loading = false; + }); }, // 取消按钮 cancel() { @@ -1092,6 +1134,9 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + // 重置日期范围 + this.queryParams.createTimeArray = []; + this.queryParams.updateTimeArray = []; this.handleQuery(); }, // 多选框选中数据 diff --git a/src/views/device/upkeepPlan/index.vue b/src/views/device/upkeepPlan/index.vue index 2fe13c2..7bebe55 100644 --- a/src/views/device/upkeepPlan/index.vue +++ b/src/views/device/upkeepPlan/index.vue @@ -174,11 +174,16 @@ /> - + @@ -190,11 +195,16 @@ /> - + @@ -259,6 +269,7 @@ + @@ -336,7 +347,7 @@ /> - + @@ -365,8 +376,8 @@ - - + + { + listPlan(this.queryParams).then(response => { this.upkeepPlanList = response.rows; + this.total = response.total; this.loading = false; }); @@ -1358,6 +1409,9 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + // 重置日期范围 + this.queryParams.createTimeArray = []; + this.queryParams.updateTimeArray = []; this.handleQuery(); }, // 多选框选中数据 @@ -1420,11 +1474,13 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { + this.planLoading = true; if (this.form.planId != null) { this.form.personList = this.selectPersonList; console.log("这里时修改后") console.log(this.form) updateUpkeepPlan(this.form).then(response => { + this.planLoading = false; this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); @@ -1432,6 +1488,7 @@ export default { } else { this.form.personList = this.selectPersonList; addUpkeepPlan(this.form).then(response => { + this.planLoading = false; this.$modal.msgSuccess("新增成功"); this.open = false; this.getList();