|
|
|
@ -18,12 +18,14 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="车间" prop="planWorkshop">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.planWorkshop"
|
|
|
|
|
placeholder="请输入车间编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
<el-select v-model="queryParams.planWorkshop" placeholder="请选择车间" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="work in workCenterList"
|
|
|
|
|
:key="work.factoryCode"
|
|
|
|
|
:label="work.factoryName"
|
|
|
|
|
:value="work.factoryCode"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="false" label="产线" prop="planProdLine">
|
|
|
|
|
<el-input
|
|
|
|
@ -145,7 +147,7 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="创建人" prop="createBy">
|
|
|
|
|
<el-form-item v-if="false" label="创建人" prop="createBy">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.createBy"
|
|
|
|
|
placeholder="请输入创建人"
|
|
|
|
@ -153,7 +155,7 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
|
|
|
<el-form-item v-if="false" label="创建时间" prop="createTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.createTimeArray"
|
|
|
|
|
type="daterange"
|
|
|
|
@ -166,7 +168,7 @@
|
|
|
|
|
:picker-options="pickerOptions">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="更新人" prop="updateBy">
|
|
|
|
|
<el-form-item v-if="false" label="更新人" prop="updateBy">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.updateBy"
|
|
|
|
|
placeholder="请输入更新人"
|
|
|
|
@ -174,7 +176,7 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="更新时间" prop="updateTime">
|
|
|
|
|
<el-form-item v-if="false" label="更新时间" prop="updateTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.updateTimeArray"
|
|
|
|
|
type="daterange"
|
|
|
|
@ -187,6 +189,32 @@
|
|
|
|
|
:picker-options="pickerOptions">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label-width="100px" label="循环范围开始" prop="planLoopStart">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.loopStartArray"
|
|
|
|
|
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-width="100px" label="循环范围结束" prop="planLoopEnd">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.loopEndArray"
|
|
|
|
|
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>
|
|
|
|
@ -250,7 +278,7 @@
|
|
|
|
|
<el-table-column width="150" label="计划编码" align="center" prop="planCode"/>
|
|
|
|
|
<el-table-column width="120" label="计划名称" align="center" prop="planName"/>
|
|
|
|
|
<el-table-column width="100" label="车间编码" align="center" prop="planWorkshop"/>
|
|
|
|
|
<el-table-column width="150" label="工作中心" align="center" prop="workCenterName"/>
|
|
|
|
|
<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"/>
|
|
|
|
@ -260,12 +288,12 @@
|
|
|
|
|
<dict-tag :options="dict.type.device_loop_type" :value="scope.row.planLoopType"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="循环执行时间开始" align="center" prop="planLoopStart" width="180">
|
|
|
|
|
<el-table-column label="循环范围开始" align="center" prop="planLoopStart" width="180">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.planLoopStart, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="循环执行时间结束" align="center" prop="planLoopEnd" width="180">
|
|
|
|
|
<el-table-column label="循环范围结束" align="center" prop="planLoopEnd" width="180">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.planLoopEnd, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
</template>
|
|
|
|
@ -713,6 +741,7 @@ export default {
|
|
|
|
|
updateTime: null,
|
|
|
|
|
createTimeArray: [],
|
|
|
|
|
updateTimeArray: [],
|
|
|
|
|
loopEndArray: [],
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {
|
|
|
|
@ -760,79 +789,79 @@ export default {
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检验
|
|
|
|
|
if (this.form.planLoopType == 'day'){
|
|
|
|
|
// 计算日期差值(以毫秒为单位)
|
|
|
|
|
let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
|
|
// 转换为天数
|
|
|
|
|
let days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
|
|
|
|
|
|
|
|
if (days > this.form.planLoop) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '可执行时间范围为'+days+'天,循环周期为'+days+'天,超过循环周期'+(days-this.form.planLoop)+'天,请重新选择执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.form.planLoopType == 'week') {
|
|
|
|
|
// 计算日期差值(以毫秒为单位)
|
|
|
|
|
let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
|
|
// 转换为周数
|
|
|
|
|
let weeks = Math.floor(diff / (1000 * 60 * 60 * 24 * 7));
|
|
|
|
|
|
|
|
|
|
if (weeks > (this.form.planLoop/7)) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '可执行时间范围为'+weeks+'周,循环周期为'+weeks+'周,超过循环周期'+(weeks*7-this.form.planLoop)+'天,请重新选择执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.form.planLoopType == 'month'){
|
|
|
|
|
let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
|
|
|
|
|
|
|
if (monthsDiff > this.form.planLoop) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '可执行时间范围为'+monthsDiff+'月,循环周期为'+monthsDiff+'月,超过循环周期'+(monthsDiff-this.form.planLoop)+'月,请重新选择执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.form.planLoopType == 'season'){
|
|
|
|
|
let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
|
|
|
|
|
|
|
if (monthsDiff*3 > this.form.planLoop) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '可执行时间范围为'+monthsDiff*3+'季度,循环周期为'+monthsDiff*3+'季度,超过循环周期'+(monthsDiff-this.form.planLoop)+'月,请重新选择执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.form.planLoopType == 'year'){
|
|
|
|
|
// 计算年份差值
|
|
|
|
|
let yearsDiff = this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear();
|
|
|
|
|
|
|
|
|
|
if (yearsDiff > this.form.planLoop) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '可执行时间范围为'+yearsDiff+'年,循环周期为'+yearsDiff+'年,超过循环周期'+(yearsDiff-this.form.planLoop)+'年,请重新选择执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
this.form.planTimeArray = [];
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// // 检验
|
|
|
|
|
// if (this.form.planLoopType == 'day'){
|
|
|
|
|
// // 计算日期差值(以毫秒为单位)
|
|
|
|
|
// let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
|
|
// // 转换为天数
|
|
|
|
|
// let days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
|
|
|
//
|
|
|
|
|
// if (days > this.form.planLoop) {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// message: '可执行时间范围为'+days+'天,循环周期为'+days+'天,超过循环周期'+(days-this.form.planLoop)+'天,请重新选择执行时间!',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// })
|
|
|
|
|
// this.form.planTimeArray = [];
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (this.form.planLoopType == 'week') {
|
|
|
|
|
// // 计算日期差值(以毫秒为单位)
|
|
|
|
|
// let diff = this.form.planTimeArray[1].getTime() - this.form.planTimeArray[0].getTime();
|
|
|
|
|
// // 转换为周数
|
|
|
|
|
// let weeks = Math.floor(diff / (1000 * 60 * 60 * 24 * 7));
|
|
|
|
|
//
|
|
|
|
|
// if (weeks > (this.form.planLoop/7)) {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// message: '可执行时间范围为'+weeks+'周,循环周期为'+weeks+'周,超过循环周期'+(weeks*7-this.form.planLoop)+'天,请重新选择执行时间!',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// })
|
|
|
|
|
// this.form.planTimeArray = [];
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (this.form.planLoopType == 'month'){
|
|
|
|
|
// let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
|
|
//
|
|
|
|
|
// if (monthsDiff > this.form.planLoop) {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// message: '可执行时间范围为'+monthsDiff+'月,循环周期为'+monthsDiff+'月,超过循环周期'+(monthsDiff-this.form.planLoop)+'月,请重新选择执行时间!',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// })
|
|
|
|
|
// this.form.planTimeArray = [];
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (this.form.planLoopType == 'season'){
|
|
|
|
|
// let monthsDiff = (this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear()) * 12 + this.form.planTimeArray[1].getMonth() - this.form.planTimeArray[0].getMonth();
|
|
|
|
|
//
|
|
|
|
|
// if (monthsDiff*3 > this.form.planLoop) {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// message: '可执行时间范围为'+monthsDiff*3+'季度,循环周期为'+monthsDiff*3+'季度,超过循环周期'+(monthsDiff-this.form.planLoop)+'月,请重新选择执行时间!',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// })
|
|
|
|
|
// this.form.planTimeArray = [];
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (this.form.planLoopType == 'year'){
|
|
|
|
|
// // 计算年份差值
|
|
|
|
|
// let yearsDiff = this.form.planTimeArray[1].getFullYear() - this.form.planTimeArray[0].getFullYear();
|
|
|
|
|
//
|
|
|
|
|
// if (yearsDiff > this.form.planLoop) {
|
|
|
|
|
// this.$message({
|
|
|
|
|
// message: '可执行时间范围为'+yearsDiff+'年,循环周期为'+yearsDiff+'年,超过循环周期'+(yearsDiff-this.form.planLoop)+'年,请重新选择执行时间!',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// })
|
|
|
|
|
// this.form.planTimeArray = [];
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 获取设备List-置入穿梭框信息
|
|
|
|
@ -1045,6 +1074,7 @@ export default {
|
|
|
|
|
planTimeArray: [],
|
|
|
|
|
equipmentItem: [],
|
|
|
|
|
personList: [],
|
|
|
|
|
loopEndArray: [],
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
@ -1059,6 +1089,7 @@ export default {
|
|
|
|
|
// 重置日期范围
|
|
|
|
|
this.queryParams.createTimeArray = [];
|
|
|
|
|
this.queryParams.updateTimeArray = [];
|
|
|
|
|
this.
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|