|
|
|
@ -174,11 +174,16 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="queryParams.createTime"
|
|
|
|
|
type="date"
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.createTimeArray"
|
|
|
|
|
type="daterange"
|
|
|
|
|
align="right"
|
|
|
|
|
unlink-panels
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择创建时间">
|
|
|
|
|
: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"
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.updateTimeArray"
|
|
|
|
|
type="daterange"
|
|
|
|
|
align="right"
|
|
|
|
|
unlink-panels
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择更新时间">
|
|
|
|
|
: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();
|
|
|
|
|