feat(生产时间): 添加生产开始时间自动填充功能

在卷材操作的各个页面中,自动将待操作任务的创建时间设置为生产开始时间。同时在生产面板中新增生产时间相关字段的显示列
This commit is contained in:
砂糖
2026-03-18 10:24:28 +08:00
parent 3d6391bf32
commit 8e6f89ee55
5 changed files with 46 additions and 8 deletions

View File

@@ -216,14 +216,14 @@
</el-form-item>
</div>
<div class="form-row">
<!-- <div class="form-row"> -->
<el-form-item label="生产开始时间" prop="productionStartTime" class="form-item-half">
<TimeInput v-model="targetCoil.productionStartTime" @input="calculateProductionDuration" :disabled="readonly" />
</el-form-item>
<el-form-item label="生产结束时间" prop="productionEndTime" class="form-item-half">
<TimeInput v-model="targetCoil.productionEndTime" @input="calculateProductionDuration" :disabled="readonly" :show-now-button="true" />
</el-form-item>
</div>
<!-- </div> -->
<div class="form-row">
<el-form-item label="生产耗时" prop="productionDuration" class="form-item-half">
@@ -240,7 +240,7 @@
<script>
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 ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
@@ -329,7 +329,10 @@ export default {
readonly: false,
// 待合卷列表(其他待操作的合卷任务)
pendingMergeList: [],
pendingLoading: false
pendingLoading: false,
// 待操作ID
actionId: null,
currentAction: {}
};
},
computed: {
@@ -377,6 +380,13 @@ export default {
this.actionId = actionId;
}
// 获取待操作详情
getPendingAction(actionId).then(res => {
// 填写生产开始时间
this.currentAction = res.data
this.$set(this.targetCoil, 'productionStartTime', res.data.createTime)
})
// 保存当前页面的待操作类型
if (actionTypeCode) {
this.actionTypeCode = actionTypeCode;

View File

@@ -245,6 +245,18 @@
</template>
</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">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">

View File

@@ -327,6 +327,7 @@ export default {
warehouseId: [{ required: true, message: '请选择所在库位', trigger: 'change' }],
},
buttonLoading: false,
currentAction: {}
}
},
computed: {
@@ -404,6 +405,8 @@ export default {
return
}
const action = await getPendingAction(this.actionId)
this.currentAction = action.data || {}
// this.$set(this.splitForm, 'productionStartTime', action.data.createTime)
const coilIds = action.data.remark;
console.log('coilIds', coilIds)
if (!coilIds) {
@@ -461,7 +464,7 @@ export default {
temperGrade: '',
coatingType: '',
remark: '',
productionStartTime: '',
productionStartTime: this.currentAction.createTime,
productionEndTime: '',
productionDuration: '',
formattedDuration: '',

View File

@@ -242,7 +242,7 @@
<script>
import { getMaterialCoil, splitMaterialCoil } from '@/api/wms/coil';
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 RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
@@ -318,7 +318,8 @@ export default {
// 只读模式
readonly: false,
// 待操作ID
actionId: null
actionId: null,
currentAction: {}
};
},
computed: {
@@ -335,6 +336,13 @@ export default {
const actionId = this.$route.query.actionId;
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) {
await this.loadMotherCoil(coilId);
}
@@ -490,7 +498,7 @@ export default {
coatingType: '',
actualLength: undefined,
actualWidth: undefined,
productionStartTime: '',
productionStartTime: this.currentAction.createTime,
productionEndTime: '',
productionDuration: '',
formattedDuration: '',

View File

@@ -427,6 +427,11 @@ export default {
const pendingActionRes = await getPendingAction(actionId)
actionType = pendingActionRes.data.actionType
// 填写生产开始时间
this.$set(this.updateForm, 'productionStartTime', pendingActionRes.data.createTime)
this.
this.isAcidRolling = actionType == 11
if (this.isAcidRolling) {