点检巡检保养优化

master
wws 1 year ago
parent ea7bde5dd9
commit be8573f928

@ -328,7 +328,7 @@
/>
<!-- 添加或修改计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-dialog v-loading="planLoading" :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<div class="my-step-mar">
<el-steps :active="inspectionPlanStep" finish-status="success" align-center>
@ -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();

@ -191,38 +191,48 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建人" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入创建人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable
v-model="queryParams.createTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updateBy">
<el-input
v-model="queryParams.updateBy"
placeholder="请输入更新人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker clearable
v-model="queryParams.updateTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="创建人" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入创建人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updateBy">
<el-input
v-model="queryParams.updateBy"
placeholder="请输入更新人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker
v-model="queryParams.updateTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -282,6 +292,7 @@
<el-table-column width="120" label="计划编码" align="center" prop="planCode" />
<el-table-column width="120" label="计划名称" align="center" prop="planName" />
<el-table-column label="车间编码" align="center" prop="planWorkshop" />
<el-table-column width="150" label="工作中心" align="center" prop="workCenterName"/>
<el-table-column v-if="false" label="产线" align="center" prop="planProdLine" />
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName" />
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode" />
@ -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();
},
//

@ -174,11 +174,16 @@
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable
v-model="queryParams.createTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
<el-date-picker
v-model="queryParams.createTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updateBy">
@ -190,11 +195,16 @@
/>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-date-picker clearable
v-model="queryParams.updateTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
<el-date-picker
v-model="queryParams.updateTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
@ -259,6 +269,7 @@
<el-table-column width="150" label="计划编码" align="center" prop="planCode"/>
<el-table-column width="150" label="计划名称" align="center" prop="planName"/>
<el-table-column label="车间" align="center" prop="planWorkshop"/>
<el-table-column width="150" label="工作中心" align="center" prop="workCenterName"/>
<el-table-column v-if="false" label="产线" align="center" prop="planProdLine"/>
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName"/>
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode"/>
@ -336,7 +347,7 @@
/>
<!-- 添加或修改保养计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-dialog v-loading="planLoading" :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item v-if="false" label="计划编码" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编码"/>
@ -365,8 +376,8 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="工作中心:">
<el-select v-model="form.planWorkshop" placeholder="工作中心" clearable>
<el-form-item label="车间:">
<el-select v-model="form.planWorkshop" placeholder="请选择车间" clearable>
<el-option
v-for="item in workCenterList"
:key="item.factoryCode"
@ -821,13 +832,43 @@ import {
updateUpkeepPlan,
formatEquItem, setSpareList, querySpareList
} from "@/api/device/upkeepPlan";
import {delPlan, getEquList, getPersonList, getWorkCenter, initUpdatePlanInfo} from "@/api/device/plan";
import {delPlan, getEquList, getPersonList, getWorkCenter, initUpdatePlanInfo, listPlan} from "@/api/device/plan";
export default {
name: "UpkeepPlan",
dicts: ['device_loop_type', 'sys_normal_disable'],
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,
//
selOnSpare: [],
//
@ -928,7 +969,9 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
createTimeArray: [],
updateTimeArray: [],
},
//
form: {
@ -1284,13 +1327,21 @@ export default {
},
//
stepNext() {
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择车间!',
type: 'warning'
})
return
}
this.upkeepSteps++;
},
/** 查询保养计划列表 */
getList() {
this.loading = true;
listUpkeepPlan(this.queryParams).then(response => {
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();

Loading…
Cancel
Save