This commit is contained in:
2022-09-02 14:08:43 +08:00
parent 86117a04ee
commit ce6ce0717b
22 changed files with 406 additions and 110 deletions

View File

@@ -29,7 +29,7 @@
<el-table
ref="table"
:data="tableData"
size="small"
size="mini"
style="width: 100%;"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@@ -37,26 +37,27 @@
>
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="produceorder_id" label="生产班次工单标识" />
<el-table-column prop="produceorder_code" label="工单编号" width="130px" />
<el-table-column prop="order_status" label="工单状态">
<el-table-column prop="produceorder_code" label="工单编号" min-width="100px" />
<el-table-column prop="order_status" label="工单状态" min-width="100px">
<template slot-scope="scope">
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.order_status] }}
</template>
</el-table-column>
<el-table-column prop="shift_type_scode" label="班次类型">
<el-table-column prop="shift_type_scode" label="班次类型" min-width="90px">
<template slot-scope="scope">
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
</template>
</el-table-column>
<el-table-column v-if="false" prop="workprocedure_id" label="工序标识" />
<el-table-column prop="produce_date" label="生产日期" width="100px" />
<el-table-column prop="plan_qty" label="计划数量" />
<el-table-column prop="report_qty" label="完工数量" />
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
<el-table-column prop="realproducestart_date" label="开始时间" width="150" />
<el-table-column prop="material_code" label="物料编码" min-width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" min-width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" min-width="100" show-overflow-tooltip />
<el-table-column prop="device_name" label="生产设备" min-width="100" show-overflow-tooltip />
<el-table-column prop="plan_qty" label="计划数量" min-width="80px" />
<el-table-column prop="real_qty" label="实际数量" min-width="80px" />
<el-table-column prop="produce_date" label="生产日期" min-width="100px" />
<el-table-column prop="realproducestart_date" label="开始时间" min-width="150" />
</el-table>
<!--分页组件-->
@@ -64,7 +65,7 @@
<el-dialog
title="请绑定设备"
:visible.sync="devicedialogVisible"
width="35%"
width="350px"
:before-close="handleClose">
<el-form :model="deviceForm" status-icon label-width="90px" ref="deviceForm" class="demo-ruleForm">
<el-form-item label="选择设备" prop="device_id">
@@ -95,7 +96,7 @@
:visible.sync="reportdialogVisibler"
width="35%"
:before-close="handleClose">
<el-form :model="reportForm" status-icon ref="reportForm" label-width="90px" class="demo-ruleForm">
<el-form :model="reportForm" status-icon ref="reportForm" label-width="70px" class="demo-ruleForm">
<el-form-item label="生产数量" prop="produce_qty">
<el-input disabled v-model="reportForm.produce_qty" />
</el-form-item>

View File

@@ -162,8 +162,8 @@
type="danger"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="forceFinish(crud.selections[0])"
:disabled="is_finished(crud.selections)"
@click="forceFinish(crud.selections)"
>
强制完成
</el-button>
@@ -266,8 +266,8 @@
style="width: 200px"
clearable
filterable
@change="change"
placeholder="请选择"
@change="change"
>
<el-option
v-for="item in dict.PDM_BI_SHIFTTYPE"
@@ -623,11 +623,24 @@ export default {
}
},
// 强制完成
forceFinish(data) {
forceFinish(rows) {
var i = Number(0)
rows.forEach((item) => {
crudProduceshiftorder.forceFinish({ row: item }).then(res => {
i = i + 1
if (i === rows.length) {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}
})
})
/*
crudProduceshiftorder.forceFinish({ row: data }).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
})*/
},
// 取两位小数点
rounding(row, column) {
@@ -651,6 +664,25 @@ export default {
return true
}
},
// 强制完成禁用条件
is_finished(rows) {
var length = rows.length
if (length > 1) {
var flag = false
for (let i = 0; i < rows.length; i++) {
if (rows[i].order_status === '04') {
flag = true
break
}
}
return flag
} else if (length === 1 && rows[0].order_status !== '04') {
return false
} else {
return true
}
},
// 新增编辑给form表单物料相关信息赋值
setMaterValue(row) {
this.form.material_id = row.material_id
@@ -666,13 +698,17 @@ export default {
},
// 下发
submits(rows) {
var i = Number(0)
rows.forEach((item) => {
var produceorder_id = item.produceorder_id
crudProduceshiftorder.submits({ produceorder_id: produceorder_id }).then(res => {
i = i + 1
if (i === rows.length) {
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}
})
})
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
},
add() {
this.addShow = true