点检巡检保养优化

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"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<div class="my-step-mar"> <div class="my-step-mar">
<el-steps :active="inspectionPlanStep" finish-status="success" align-center> <el-steps :active="inspectionPlanStep" finish-status="success" align-center>
@ -603,6 +603,8 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable'], dicts: ['device_loop_type', 'sys_normal_disable'],
data() { data() {
return { return {
//
planLoading:false,
// list // list
workCenterList: [], workCenterList: [],
// 穿 // 穿
@ -1160,9 +1162,11 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.planLoading = true;
if (this.form.planId != null) { if (this.form.planId != null) {
this.form.personList = this.selectPersonList; this.form.personList = this.selectPersonList;
updatePlan(this.form).then(response => { updatePlan(this.form).then(response => {
this.planLoading = false;
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -1170,6 +1174,7 @@ export default {
} else { } else {
this.form.personList = this.selectPersonList; this.form.personList = this.selectPersonList;
addPlan(this.form).then(response => { addPlan(this.form).then(response => {
this.planLoading = false;
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();

@ -191,38 +191,48 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createBy"> <el-form-item label="创建人" prop="createBy">
<el-input <el-input
v-model="queryParams.createBy" v-model="queryParams.createBy"
placeholder="请输入创建人" placeholder="请输入创建人"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable <el-date-picker
v-model="queryParams.createTime" v-model="queryParams.createTimeArray"
type="date" type="daterange"
value-format="yyyy-MM-dd" align="right"
placeholder="请选择创建时间"> unlink-panels
</el-date-picker> range-separator="至"
</el-form-item> start-placeholder="开始日期"
<el-form-item label="更新人" prop="updateBy"> end-placeholder="结束日期"
<el-input value-format="yyyy-MM-dd"
v-model="queryParams.updateBy" :picker-options="pickerOptions">
placeholder="请输入更新人" </el-date-picker>
clearable </el-form-item>
@keyup.enter.native="handleQuery" <el-form-item label="更新人" prop="updateBy">
/> <el-input
</el-form-item> v-model="queryParams.updateBy"
<el-form-item label="更新时间" prop="updateTime"> placeholder="请输入更新人"
<el-date-picker clearable clearable
v-model="queryParams.updateTime" @keyup.enter.native="handleQuery"
type="date" />
value-format="yyyy-MM-dd" </el-form-item>
placeholder="请选择更新时间"> <el-form-item label="更新时间" prop="updateTime">
</el-date-picker> <el-date-picker
</el-form-item> 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-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <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> <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="planCode" />
<el-table-column width="120" label="计划名称" align="center" prop="planName" /> <el-table-column width="120" label="计划名称" align="center" prop="planName" />
<el-table-column label="车间编码" align="center" prop="planWorkshop" /> <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="planProdLine" />
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName" /> <el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName" />
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode" /> <el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode" />
@ -645,7 +656,7 @@ import {
getEquList, getEquList,
getPersonList, getPersonList,
getWorkCenter, getWorkCenter,
initUpdatePlanInfo, initUpdatePlanInfo, listPlan,
updatePlan updatePlan
} from "@/api/device/plan"; } from "@/api/device/plan";
@ -654,6 +665,34 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'], dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'],
data() { data() {
return { 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, planLoading: false,
// list // list
@ -738,7 +777,9 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
createTimeArray: [],
updateTimeArray: [],
}, },
// //
form: { form: {
@ -1015,7 +1056,7 @@ export default {
}; };
this.getEquList(); this.getEquList();
}, },
// //
stepLast() { stepLast() {
this.spotCheckStep--; this.spotCheckStep--;
}, },
@ -1033,11 +1074,12 @@ export default {
/** 查询点检计划列表 */ /** 查询点检计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listSpotCheckPlan(this.queryParams).then(response => { listPlan(this.queryParams).then(response => {
this.spotCheckPlanList = response.rows; this.spotCheckPlanList = response.rows;
this.total = response.total;
this.loading = false; this.total = response.total;
}); this.loading = false;
});
}, },
// //
cancel() { cancel() {
@ -1092,6 +1134,9 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
//
this.queryParams.createTimeArray = [];
this.queryParams.updateTimeArray = [];
this.handleQuery(); this.handleQuery();
}, },
// //

@ -174,11 +174,16 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker clearable <el-date-picker
v-model="queryParams.createTime" v-model="queryParams.createTimeArray"
type="date" type="daterange"
value-format="yyyy-MM-dd" align="right"
placeholder="请选择创建时间"> unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updateBy"> <el-form-item label="更新人" prop="updateBy">
@ -190,11 +195,16 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="更新时间" prop="updateTime">
<el-date-picker clearable <el-date-picker
v-model="queryParams.updateTime" v-model="queryParams.updateTimeArray"
type="date" type="daterange"
value-format="yyyy-MM-dd" align="right"
placeholder="请选择更新时间"> unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<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="planCode"/>
<el-table-column width="150" label="计划名称" align="center" prop="planName"/> <el-table-column width="150" label="计划名称" align="center" prop="planName"/>
<el-table-column label="车间" align="center" prop="planWorkshop"/> <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="planProdLine"/>
<el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName"/> <el-table-column v-if="false" label="设备名称" align="center" prop="equipmentName"/>
<el-table-column v-if="false" label="设备编码" align="center" prop="equipmentCode"/> <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 ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item v-if="false" label="计划编码" prop="planCode"> <el-form-item v-if="false" label="计划编码" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编码"/> <el-input v-model="form.planCode" placeholder="请输入计划编码"/>
@ -365,8 +376,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工作中心:"> <el-form-item label="车间:">
<el-select v-model="form.planWorkshop" placeholder="工作中心" clearable> <el-select v-model="form.planWorkshop" placeholder="请选择车间" clearable>
<el-option <el-option
v-for="item in workCenterList" v-for="item in workCenterList"
:key="item.factoryCode" :key="item.factoryCode"
@ -821,13 +832,43 @@ import {
updateUpkeepPlan, updateUpkeepPlan,
formatEquItem, setSpareList, querySpareList formatEquItem, setSpareList, querySpareList
} from "@/api/device/upkeepPlan"; } 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 { export default {
name: "UpkeepPlan", name: "UpkeepPlan",
dicts: ['device_loop_type', 'sys_normal_disable'], dicts: ['device_loop_type', 'sys_normal_disable'],
data() { data() {
return { 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: [], selOnSpare: [],
// //
@ -928,7 +969,9 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
createTimeArray: [],
updateTimeArray: [],
}, },
// //
form: { form: {
@ -1284,13 +1327,21 @@ export default {
}, },
// //
stepNext() { stepNext() {
if (this.form.planWorkshop == null) {
this.$message({
message: '请选择车间!',
type: 'warning'
})
return
}
this.upkeepSteps++; this.upkeepSteps++;
}, },
/** 查询保养计划列表 */ /** 查询保养计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listUpkeepPlan(this.queryParams).then(response => { listPlan(this.queryParams).then(response => {
this.upkeepPlanList = response.rows; this.upkeepPlanList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -1358,6 +1409,9 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
//
this.queryParams.createTimeArray = [];
this.queryParams.updateTimeArray = [];
this.handleQuery(); this.handleQuery();
}, },
// //
@ -1420,11 +1474,13 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.planLoading = true;
if (this.form.planId != null) { if (this.form.planId != null) {
this.form.personList = this.selectPersonList; this.form.personList = this.selectPersonList;
console.log("这里时修改后") console.log("这里时修改后")
console.log(this.form) console.log(this.form)
updateUpkeepPlan(this.form).then(response => { updateUpkeepPlan(this.form).then(response => {
this.planLoading = false;
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -1432,6 +1488,7 @@ export default {
} else { } else {
this.form.personList = this.selectPersonList; this.form.personList = this.selectPersonList;
addUpkeepPlan(this.form).then(response => { addUpkeepPlan(this.form).then(response => {
this.planLoading = false;
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();

Loading…
Cancel
Save