add:新增pc工单暂停页面,添加物料筐数量
This commit is contained in:
@@ -35,6 +35,7 @@ public class MaterialbaseDto implements Serializable{
|
||||
private String base_unit_name;
|
||||
private String approve_fileno;
|
||||
private String print_no;
|
||||
private Integer limit_qty;
|
||||
/**
|
||||
* 物料分类
|
||||
*/
|
||||
|
||||
@@ -159,4 +159,8 @@ public class MdMeMaterialbase implements Serializable{
|
||||
*/
|
||||
@ApiModelProperty(value = "/**产品系列名称*/")
|
||||
private String product_series_name;
|
||||
/**
|
||||
* 每框数量
|
||||
*/
|
||||
private Integer limit_qty;
|
||||
}
|
||||
|
||||
@@ -351,7 +351,12 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService{
|
||||
form.put("workorder_id", workOrder.get("workorder_id"));
|
||||
form.put("workorder_code", workOrder.get("workorder_code"));
|
||||
form.put("qty", workOrder.getString("plan_qty"));
|
||||
form.put("outupperlimit_qty", device_code.getString("outupperlimit_qty"));
|
||||
Integer limit_qty = material.getInteger("limit_qty");
|
||||
form.put("outupperlimit_qty", material.get(limit_qty));
|
||||
if (limit_qty == null || limit_qty<1){
|
||||
form.put("outupperlimit_qty", device_code.getString("outupperlimit_qty"));
|
||||
|
||||
}
|
||||
form.put("material_id", workOrder.get("material_id"));
|
||||
form.put("material_name", material.get("material_name"));
|
||||
form.put("material_code", material.get("material_code"));
|
||||
|
||||
@@ -72,10 +72,10 @@ public class PdmProduceWorkorder implements Serializable{
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 物料单重
|
||||
*/
|
||||
private BigDecimal material_weight;
|
||||
// /**
|
||||
// * 物料单重
|
||||
// */
|
||||
// private BigDecimal material_weight;
|
||||
/**
|
||||
* 计划生产开始时间
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
material.material_code,
|
||||
material.material_spec,
|
||||
material.net_weight AS material_weight,
|
||||
device.outupperlimit_qty,
|
||||
IF(material.limit_qty=0,device.outupperlimit_qty,material.limit_qty) as outupperlimit_qty,
|
||||
pro.workprocedure_code,
|
||||
pro.workprocedure_name,
|
||||
users.person_name AS current_produce_person_name
|
||||
@@ -58,10 +58,10 @@
|
||||
and ShiftOrder.realproduceend_date <= #{query.end_time}
|
||||
</if>
|
||||
<if test="query.plan_start_time != null and query.plan_start_time != ''">
|
||||
and STR_TO_DATE(ShiftOrder.planproducestart_date, '%Y/%m/%d %H:%i:%s') >= #{query.plan_start_time}
|
||||
and ShiftOrder.planproducestart_date >= #{query.plan_start_time}
|
||||
</if>
|
||||
<if test="query.plan_end_time != null and query.plan_end_time != ''">
|
||||
and STR_TO_DATE(ShiftOrder.planproduceend_date, '%Y/%m/%d %H:%i:%s') <= #{query.plan_end_time}
|
||||
and ShiftOrder.planproducestart_date <= #{query.plan_end_time}
|
||||
</if>
|
||||
<if test="query.sale_id != null and query.sale_id != ''">
|
||||
and ShiftOrder.sale_id like '%${query.sale_id}%'
|
||||
|
||||
@@ -162,7 +162,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
Assert.notNull(form, "参数不能为空");
|
||||
PdmProduceWorkorder one = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", form.getString("workorder_id")).in("workorder_status", "1", "2", "4"));
|
||||
if(one == null) {
|
||||
throw new BadRequestException("工单状态非生产状态下不允许修改");
|
||||
throw new BadRequestException("工单生产状态下不允许修改");
|
||||
}
|
||||
PdmProduceWorkorder entity = form.toJavaObject(PdmProduceWorkorder.class);
|
||||
entity.setDown_time(DateUtil.now());
|
||||
@@ -304,6 +304,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
return one.getMacoperate_id();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> queryExistWorkOrder() {
|
||||
return pdmProduceWorkorderMapper.queryExistWorkOrder();
|
||||
@@ -425,7 +426,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if(j == 7) {
|
||||
//单重
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(col) * 1000);
|
||||
workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||
// workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||
}
|
||||
if(j == 8) {
|
||||
persons.add(col);
|
||||
@@ -552,7 +553,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if(j == 9) {
|
||||
//单重
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(col.equals("#N/A") ? "0.05" : col) * 1000);
|
||||
workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||
// workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||
}
|
||||
if(j == 10) {
|
||||
persons.add(col);
|
||||
@@ -744,7 +745,11 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
form.put("workorder_id", workOrder.getWorkorder_id());
|
||||
form.put("workorder_code", workOrder.getWorkorder_code());
|
||||
form.put("qty", workOrder.getPlan_qty());
|
||||
form.put("outupperlimit_qty", device.getOutupperlimit_qty());
|
||||
Integer limit_qty = material.getLimit_qty();
|
||||
form.put("outupperlimit_qty", limit_qty);
|
||||
if (limit_qty == null || limit_qty<1){
|
||||
form.put("outupperlimit_qty", device.getOutupperlimit_qty());
|
||||
}
|
||||
form.put("material_id", workOrder.getMaterial_id());
|
||||
form.put("material_name", material.getMaterial_name());
|
||||
form.put("material_code", material.getMaterial_code());
|
||||
|
||||
@@ -8,7 +8,9 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWebApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
@@ -16,6 +18,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Order(100)
|
||||
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "prod")
|
||||
public class JobRunner implements ApplicationRunner {
|
||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||
private final ISysQuartzJobService quartzJobService;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料类别"">
|
||||
<el-form-item label="物料类别">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadChildNodes"
|
||||
@@ -125,7 +125,12 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="每筐数量" prop="material_code">
|
||||
<el-input-number v-model="form.limit_qty" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-switch
|
||||
v-model="form.is_used"
|
||||
@@ -157,6 +162,7 @@
|
||||
<el-table-column prop="class_name" label="物料分类" width="140"/>
|
||||
<el-table-column prop="unit_name" label="计量单位"/>
|
||||
<el-table-column prop="net_weight" label="单重(g)"/>
|
||||
<el-table-column prop="limit_qty" label="每筐数量"/>
|
||||
<el-table-column prop="product_series_name" label="系列"/>
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
@@ -224,6 +230,7 @@ const defaultForm = {
|
||||
length: null,
|
||||
width: null,
|
||||
height: null,
|
||||
limit_qty: null,
|
||||
weight_unit_id: null,
|
||||
gross_weight: null,
|
||||
net_weight: null,
|
||||
|
||||
@@ -240,6 +240,17 @@
|
||||
>
|
||||
开工
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
:disabled="is_suspend(crud.selections)"
|
||||
class="filter-item"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="suspend(crud.selections)"
|
||||
>
|
||||
暂停
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -262,6 +273,22 @@
|
||||
强制完成
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="reportVisible"
|
||||
title="报工数量"
|
||||
width="540px"
|
||||
>
|
||||
<el-form ref="form" :model="reportForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="报工数量" prop="vehicle_weight">
|
||||
<el-input-number v-model="reportForm.report_qty" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="reportCancel()">取消</el-button>
|
||||
<el-button type="primary" @click="suspendreq(crud.selections)">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--新增,修改弹窗-->
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
@@ -686,6 +713,12 @@
|
||||
label="实际结束时间"
|
||||
prop="realproduceend_date"
|
||||
/>
|
||||
<el-table-column
|
||||
width="160"
|
||||
:formatter="dateformat"
|
||||
label="修改时间"
|
||||
prop="update_time"
|
||||
/>
|
||||
<el-table-column
|
||||
:formatter="formatBoolean"
|
||||
label="允许修改报工数"
|
||||
@@ -860,7 +893,11 @@ export default {
|
||||
classes3: [],
|
||||
materType: '01',
|
||||
materialShow: false,
|
||||
reportVisible: false,
|
||||
addShow: false,
|
||||
reportForm: {
|
||||
"report_qty":0
|
||||
},
|
||||
replaceShow: false,
|
||||
uploadShow: false,
|
||||
userList: [],
|
||||
@@ -912,8 +949,40 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
dateformat(row, column){
|
||||
if (row.update_time == undefined){
|
||||
return "";
|
||||
}
|
||||
return new Date(row.update_time).toLocaleString();
|
||||
},
|
||||
reportCancel(){
|
||||
this.reportVisible = false
|
||||
this.reportForm.report_qty = 0
|
||||
},
|
||||
suspend(row) {
|
||||
this.reportVisible = true
|
||||
this.reportForm.report_qty = row[0].dq_real_qty
|
||||
},
|
||||
suspendreq(rows) {
|
||||
rows[0].report_qty = this.reportForm.report_qty
|
||||
crudProduceshiftorder.report(rows[0]).then(res => {
|
||||
this.crud.notify('暂停成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
is_suspend(rows) {
|
||||
var length = rows.length
|
||||
if (length === 1) {
|
||||
if (rows[0].workorder_status === '3') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
},
|
||||
databaseUploadApi() {
|
||||
|
||||
},
|
||||
changeEvent1(device) {
|
||||
if (device == 'A1_BZJ_1') {
|
||||
@@ -1115,7 +1184,7 @@ export default {
|
||||
is_disopen(rows) {
|
||||
var length = rows.length
|
||||
if (length === 1) {
|
||||
if (rows[0].workorder_status === '2') {
|
||||
if (rows[0].workorder_status === '2' || rows[0].workorder_status === '4') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
@@ -1124,6 +1193,7 @@ export default {
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
@@ -1194,6 +1264,7 @@ export default {
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
|
||||
add() {
|
||||
this.addShow = true
|
||||
},
|
||||
|
||||
@@ -79,6 +79,14 @@ export function saveReport(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function report(data) {
|
||||
return request({
|
||||
url: 'api/produceWorkorder/report',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function finish(data) {
|
||||
return request({
|
||||
url: 'api/produceWorkorder/finish',
|
||||
@@ -151,4 +159,4 @@ export function reportApprove(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, addRows, edit, del, submits, reportApprove, unSubmits, getTable, openStart, saveReport, finish, getReportWork, forceFinish, reportQuery, reportQuery3, excelImport, getNotWorkDeviceByWorkproceduceId, replaceDevice }
|
||||
export default { add, addRows, edit, del, submits, reportApprove, unSubmits, getTable, openStart, report, saveReport, finish, getReportWork, forceFinish, reportQuery, reportQuery3, excelImport, getNotWorkDeviceByWorkproceduceId, replaceDevice }
|
||||
|
||||
Reference in New Issue
Block a user