feat(生产时间): 添加生产开始时间自动填充功能
在卷材操作的各个页面中,自动将待操作任务的创建时间设置为生产开始时间。同时在生产面板中新增生产时间相关字段的显示列
This commit is contained in:
@@ -216,14 +216,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<!-- <div class="form-row"> -->
|
||||||
<el-form-item label="生产开始时间" prop="productionStartTime" class="form-item-half">
|
<el-form-item label="生产开始时间" prop="productionStartTime" class="form-item-half">
|
||||||
<TimeInput v-model="targetCoil.productionStartTime" @input="calculateProductionDuration" :disabled="readonly" />
|
<TimeInput v-model="targetCoil.productionStartTime" @input="calculateProductionDuration" :disabled="readonly" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="生产结束时间" prop="productionEndTime" class="form-item-half">
|
<el-form-item label="生产结束时间" prop="productionEndTime" class="form-item-half">
|
||||||
<TimeInput v-model="targetCoil.productionEndTime" @input="calculateProductionDuration" :disabled="readonly" :show-now-button="true" />
|
<TimeInput v-model="targetCoil.productionEndTime" @input="calculateProductionDuration" :disabled="readonly" :show-now-button="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<el-form-item label="生产耗时" prop="productionDuration" class="form-item-half">
|
<el-form-item label="生产耗时" prop="productionDuration" class="form-item-half">
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMaterialCoil, mergeMaterialCoil } from '@/api/wms/coil';
|
import { getMaterialCoil, mergeMaterialCoil } from '@/api/wms/coil';
|
||||||
import { listPendingAction, completeAction, addPendingAction } from '@/api/wms/pendingAction';
|
import { listPendingAction, completeAction, addPendingAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||||
import CoilSelector from '@/components/CoilSelector';
|
import CoilSelector from '@/components/CoilSelector';
|
||||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||||
import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
|
import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
|
||||||
@@ -329,7 +329,10 @@ export default {
|
|||||||
readonly: false,
|
readonly: false,
|
||||||
// 待合卷列表(其他待操作的合卷任务)
|
// 待合卷列表(其他待操作的合卷任务)
|
||||||
pendingMergeList: [],
|
pendingMergeList: [],
|
||||||
pendingLoading: false
|
pendingLoading: false,
|
||||||
|
// 待操作ID
|
||||||
|
actionId: null,
|
||||||
|
currentAction: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -377,6 +380,13 @@ export default {
|
|||||||
this.actionId = actionId;
|
this.actionId = actionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取待操作详情
|
||||||
|
getPendingAction(actionId).then(res => {
|
||||||
|
// 填写生产开始时间
|
||||||
|
this.currentAction = res.data
|
||||||
|
this.$set(this.targetCoil, 'productionStartTime', res.data.createTime)
|
||||||
|
})
|
||||||
|
|
||||||
// 保存当前页面的待操作类型
|
// 保存当前页面的待操作类型
|
||||||
if (actionTypeCode) {
|
if (actionTypeCode) {
|
||||||
this.actionTypeCode = actionTypeCode;
|
this.actionTypeCode = actionTypeCode;
|
||||||
|
|||||||
@@ -245,6 +245,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="生产开始" align="center" prop="productionStartTime" v-if="showProductionTimeEdit" width="150">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="生产结束" align="center" prop="productionEndTime" v-if="showProductionTimeEdit" width="150">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="生产耗时" align="center" prop="productionDuration" v-if="showProductionTimeEdit" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ formatDuration(scope.row.productionDuration * 60 * 1000)}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ export default {
|
|||||||
warehouseId: [{ required: true, message: '请选择所在库位', trigger: 'change' }],
|
warehouseId: [{ required: true, message: '请选择所在库位', trigger: 'change' }],
|
||||||
},
|
},
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
|
currentAction: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -404,6 +405,8 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const action = await getPendingAction(this.actionId)
|
const action = await getPendingAction(this.actionId)
|
||||||
|
this.currentAction = action.data || {}
|
||||||
|
// this.$set(this.splitForm, 'productionStartTime', action.data.createTime)
|
||||||
const coilIds = action.data.remark;
|
const coilIds = action.data.remark;
|
||||||
console.log('coilIds', coilIds)
|
console.log('coilIds', coilIds)
|
||||||
if (!coilIds) {
|
if (!coilIds) {
|
||||||
@@ -461,7 +464,7 @@ export default {
|
|||||||
temperGrade: '',
|
temperGrade: '',
|
||||||
coatingType: '',
|
coatingType: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
productionStartTime: '',
|
productionStartTime: this.currentAction.createTime,
|
||||||
productionEndTime: '',
|
productionEndTime: '',
|
||||||
productionDuration: '',
|
productionDuration: '',
|
||||||
formattedDuration: '',
|
formattedDuration: '',
|
||||||
|
|||||||
@@ -242,7 +242,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getMaterialCoil, splitMaterialCoil } from '@/api/wms/coil';
|
import { getMaterialCoil, splitMaterialCoil } from '@/api/wms/coil';
|
||||||
import { listWarehouse } from '@/api/wms/warehouse';
|
import { listWarehouse } from '@/api/wms/warehouse';
|
||||||
import { completeAction } from '@/api/wms/pendingAction';
|
import { completeAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||||
import ProductSelect from "@/components/KLPService/ProductSelect";
|
import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||||
@@ -318,7 +318,8 @@ export default {
|
|||||||
// 只读模式
|
// 只读模式
|
||||||
readonly: false,
|
readonly: false,
|
||||||
// 待操作ID
|
// 待操作ID
|
||||||
actionId: null
|
actionId: null,
|
||||||
|
currentAction: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -335,6 +336,13 @@ export default {
|
|||||||
const actionId = this.$route.query.actionId;
|
const actionId = this.$route.query.actionId;
|
||||||
const readonly = this.$route.query.readonly;
|
const readonly = this.$route.query.readonly;
|
||||||
|
|
||||||
|
// 获取待操作详情
|
||||||
|
getPendingAction(actionId).then(res => {
|
||||||
|
// 填写生产开始时间
|
||||||
|
this.currentAction = res.data
|
||||||
|
this.$set(this.splitList[0], 'productionStartTime', res.data.createTime)
|
||||||
|
})
|
||||||
|
|
||||||
if (coilId) {
|
if (coilId) {
|
||||||
await this.loadMotherCoil(coilId);
|
await this.loadMotherCoil(coilId);
|
||||||
}
|
}
|
||||||
@@ -490,7 +498,7 @@ export default {
|
|||||||
coatingType: '',
|
coatingType: '',
|
||||||
actualLength: undefined,
|
actualLength: undefined,
|
||||||
actualWidth: undefined,
|
actualWidth: undefined,
|
||||||
productionStartTime: '',
|
productionStartTime: this.currentAction.createTime,
|
||||||
productionEndTime: '',
|
productionEndTime: '',
|
||||||
productionDuration: '',
|
productionDuration: '',
|
||||||
formattedDuration: '',
|
formattedDuration: '',
|
||||||
|
|||||||
@@ -427,6 +427,11 @@ export default {
|
|||||||
const pendingActionRes = await getPendingAction(actionId)
|
const pendingActionRes = await getPendingAction(actionId)
|
||||||
actionType = pendingActionRes.data.actionType
|
actionType = pendingActionRes.data.actionType
|
||||||
|
|
||||||
|
// 填写生产开始时间
|
||||||
|
this.$set(this.updateForm, 'productionStartTime', pendingActionRes.data.createTime)
|
||||||
|
|
||||||
|
this.
|
||||||
|
|
||||||
this.isAcidRolling = actionType == 11
|
this.isAcidRolling = actionType == 11
|
||||||
|
|
||||||
if (this.isAcidRolling) {
|
if (this.isAcidRolling) {
|
||||||
|
|||||||
Reference in New Issue
Block a user