开始日期和生产时长处理
This commit is contained in:
parent
6791ae679b
commit
6c5968a9ce
@ -11,11 +11,10 @@ export function listRouteprocess(query) {
|
||||
|
||||
|
||||
// 查询产品的工艺组成列表
|
||||
export function listProductprocess(query) {
|
||||
export function listProductprocess(productId) {
|
||||
return request({
|
||||
url: '/mes/pro/routeprocess/listProductProcess',
|
||||
method: 'get',
|
||||
params: query
|
||||
url: '/mes/pro/routeprocess/listProductProcess/'+productId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,6 @@
|
||||
<el-table-column label="产品物料名称" width="150px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="生产数量" align="center" prop="quantity" />
|
||||
<el-table-column label="生产用时" align="center" prop="productionTime" />
|
||||
<el-table-column label="时间单位" align="center" prop="timeUnitType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_time_type" :value="scope.row.timeUnitType"/>
|
||||
</template>
|
||||
@ -142,7 +139,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产数量" prop="quantity">
|
||||
<el-input-number :min="1" v-model="form.quantity" placeholder="请输入生产数量" />
|
||||
@ -165,7 +162,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
|
@ -239,12 +239,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-steps :active="activeProcess" align-center simple>
|
||||
<el-steps :active="activeProcess" v-if="form.workorderId !=null" align-center simple>
|
||||
<el-step v-for="(item,index) in processOptions"
|
||||
:title="item.processName" @click.native="handleStepClick(index)">
|
||||
</el-step>
|
||||
</el-steps>
|
||||
<el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index">
|
||||
<el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index && form.workorderId !=null">
|
||||
<ProTask :workorderId="form.workorderId" :processId="item.processId" :colorCode="item.colorCode" :optType="optType"></ProTask>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -392,8 +392,9 @@ export default {
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
updateTime: null
|
||||
};
|
||||
this.activeProcess =0;
|
||||
this.autoGenFlag = false;
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -431,7 +432,6 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.reset();
|
||||
this.getProcess();
|
||||
this.getTreeselect();
|
||||
if (row != null && row.workorderId) {
|
||||
this.form.parentId = row.workorderId;
|
||||
@ -449,12 +449,12 @@ export default {
|
||||
},
|
||||
// 查询明细按钮操作
|
||||
handleView(row){
|
||||
this.reset();
|
||||
this.getProcess();
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
const workorderId = row.workorderId || this.ids;
|
||||
getWorkorder(workorderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.getProcess();
|
||||
this.open = true;
|
||||
this.title = "查看工单信息";
|
||||
this.optType = "view";
|
||||
@ -463,13 +463,14 @@ export default {
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getProcess();
|
||||
this.getTreeselect();
|
||||
if (row != null) {
|
||||
this.form.parentId = row.workorderId;
|
||||
}
|
||||
getWorkorder(row.workorderId).then(response => {
|
||||
debugger;
|
||||
this.form = response.data;
|
||||
this.getProcess();
|
||||
this.open = true;
|
||||
this.title = "修改生产工单";
|
||||
this.optType="edit";
|
||||
|
@ -130,24 +130,24 @@
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.startTime"
|
||||
@change="calculateEndTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH"
|
||||
value-format="yyyy-MM-dd HH:00:00"
|
||||
placeholder="请选择开始生产时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产时长" prop="duration">
|
||||
<el-input v-model="form.duration" placeholder="请输入生产时长" />
|
||||
<el-input v-model="form.duration" @change="calculateEndTime" placeholder="请输入生产时长" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="完成时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
<el-date-picker clearable disabled
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH"
|
||||
placeholder="请选择完成生产时间">
|
||||
value-format="yyyy-MM-dd HH:00:00">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -229,6 +229,12 @@ export default {
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: "排产数量不能为空", trigger: "blur" }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: "请选择开始生产日期",trigger: "blur"}
|
||||
],
|
||||
duration: [
|
||||
{ required: true, message: "清输入估算的生产用时",trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -252,6 +258,29 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//计算结束时间
|
||||
calculateEndTime(){
|
||||
debugger;
|
||||
if(this.form.startTime !=null && this.form.duration !=null){
|
||||
let startDate = new Date(this.form.startTime);
|
||||
startDate = startDate.getFullYear() + '-'
|
||||
+ (startDate.getMonth()+1) + '-'
|
||||
+ startDate.getDate() + ' '
|
||||
+ startDate.getHours() + ':'
|
||||
+ startDate.getMinutes() + ':'
|
||||
+ startDate.getSeconds();
|
||||
startDate = Date.parse(new Date(startDate))/1000;
|
||||
startDate += (3600) * this.form.duration;
|
||||
let endDate = new Date(parseInt(startDate) * 1000);
|
||||
this.form.endTime =new Date(endDate.getFullYear() + '-'
|
||||
+ (endDate.getMonth()+1) + '-'
|
||||
+ endDate.getDate() + ' '
|
||||
+ endDate.getHours() + ':'
|
||||
+ endDate.getMinutes() + ':'
|
||||
+ endDate.getSeconds());
|
||||
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@ -329,6 +358,8 @@ export default {
|
||||
const taskId = row.taskId || this.ids
|
||||
getProtask(taskId).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.startTime = new Date(response.data.startTime);
|
||||
this.form.endTime = new Date(response.data.endTime);
|
||||
this.open = true;
|
||||
this.title = "修改生产任务";
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user