rev:半成品出库优化
This commit is contained in:
@@ -47,36 +47,34 @@ import java.util.function.Consumer;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
public static Map<AcsTaskEnum, AbstractAcsTask> Task_Collent = new HashMap<>();
|
||||
@Autowired
|
||||
@Lazy
|
||||
private TaskService taskService;
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private CacheLineHandService cacheLineHandService;
|
||||
private CacheLineHandService cacheLineHandService;
|
||||
@Autowired
|
||||
private IPdmProduceWorkorderService workorderService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> apply(JSONObject param) {
|
||||
Assert.notNull(param,"请求参数不能为空");
|
||||
Assert.notNull(param, "请求参数不能为空");
|
||||
Map result = MapOf.of("status", HttpStatus.OK.value(), "message", "ACS向WMS申请任务成功!");
|
||||
AcsTaskEnum taskEnum = AcsTaskEnum.getType(param.getString("type"), "REQUEST_");
|
||||
|
||||
try {
|
||||
RedissonUtils.lock(()->{
|
||||
RedissonUtils.lock(() -> {
|
||||
//业务处理
|
||||
Task_Collent.get(taskEnum).createTask(param);
|
||||
|
||||
},param.getString("type"),5);
|
||||
}catch (Exception ex){
|
||||
log.error("acs申请任务失败:ex:{}",ex.getMessage());
|
||||
}, param.getString("type"), 5);
|
||||
} catch (Exception ex) {
|
||||
log.error("acs申请任务失败:ex:{}", ex.getMessage());
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message",ex.getMessage());
|
||||
result.put("message", ex.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -85,12 +83,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
/**
|
||||
* 更新缓存线的点位实时任务信息
|
||||
* ACS给WMS发送缓存线的实时任务编号
|
||||
*
|
||||
* @param jsonObject position_code:缓存线点位编码 task_code:任务编号
|
||||
*/
|
||||
@Override
|
||||
public JSONObject receiveTaskIdToCacheLine(JSONObject jsonObject) {
|
||||
JSONObject result = new JSONObject();
|
||||
HashMap<String,String> json = new HashMap<>(2);
|
||||
HashMap<String, String> json = new HashMap<>(2);
|
||||
try {
|
||||
String task_code = jsonObject.getString("task_code");
|
||||
String positionCode = jsonObject.getString("position_code");
|
||||
@@ -100,8 +99,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
json.put("task_code", task_code);
|
||||
//更新缓存线的点位实时任务信息
|
||||
positionTab.update(json);
|
||||
}
|
||||
catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
}
|
||||
@@ -139,6 +137,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
.build();
|
||||
BussEventMulticaster.Publish(event);
|
||||
|
||||
if (status.equals(AcsTaskEnum.STATUS_CANNEL.getCode())) {
|
||||
taskDto.setIs_delete("1");
|
||||
taskService.update(taskDto);
|
||||
}
|
||||
|
||||
/*AbstractAcsTask taskHandler = (AbstractAcsTask)SpringContextHolder.getBean(Class.forName(processing_class));
|
||||
taskHandler.updateTaskStatus(row,status);*/
|
||||
} catch (Exception e) {
|
||||
@@ -182,8 +185,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
public Map<String, Object> washOrderFinish(JSONObject param) {
|
||||
JSONObject result = new JSONObject();
|
||||
try {
|
||||
SpringContextHolder.getBean(WashMachineryTask.class).updateTaskStatus(param,StatusEnum.TASK_FINISH.getCode());
|
||||
} catch (Exception e){
|
||||
SpringContextHolder.getBean(WashMachineryTask.class).updateTaskStatus(param, StatusEnum.TASK_FINISH.getCode());
|
||||
} catch (Exception e) {
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
return result;
|
||||
@@ -200,18 +203,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
PdmProduceWorkorder workorder = new PdmProduceWorkorder();
|
||||
workorder.setWorkorder_id(orderJson.getString("workorder_id"));
|
||||
workorder.setWorkorder_status(orderJson.getString("status"));
|
||||
if (orderJson.getBigDecimal("real_qty") != null){
|
||||
if (orderJson.getBigDecimal("real_qty") != null) {
|
||||
workorder.setDq_real_qty(orderJson.getBigDecimal("real_qty"));
|
||||
}
|
||||
if (orderJson.getString("status").equals(WorkerOrderEnum.PRODUCTING.getCode())){
|
||||
if (orderJson.getString("status").equals(WorkerOrderEnum.PRODUCTING.getCode())) {
|
||||
workorder.setRealproducestart_date(DateUtil.now());
|
||||
}
|
||||
if (orderJson.getString("status").equals(WorkerOrderEnum.COMPLETE.getCode())){
|
||||
if (orderJson.getString("status").equals(WorkerOrderEnum.COMPLETE.getCode())) {
|
||||
workorder.setWorkorder_status(WorkerOrderEnum.AUTO_COMPLETE.getCode());
|
||||
workorder.setRealproduceend_date(DateUtil.now());
|
||||
}
|
||||
workorderService.updateById(workorder);
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
log.error("工单状态更新失败:{}", e.getMessage());
|
||||
result.put("status", 400);
|
||||
result.put("message", e.getMessage());
|
||||
@@ -235,11 +238,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
String start_time = param.getString("start_time");
|
||||
String err_status_id = param.getString("error_code");//关联pdm_bi_devicerunerrorlink获取异常信息
|
||||
JSONObject lastRecord = devRecordTab.query("device_code = '" + device_code + "' order by order_num desc limit 1").uniqueResult(0);
|
||||
if (lastRecord!=null){
|
||||
lastRecord.put("end_time",DateUtil.now());
|
||||
if (lastRecord != null) {
|
||||
lastRecord.put("end_time", DateUtil.now());
|
||||
devRecordTab.update(lastRecord);
|
||||
}
|
||||
devRecordTab.insert(MapOf.of("record_id", IdUtil.getStringId(),"device_code",device_code,"status_type",status_type,"start_time",start_time,"err_status_id",err_status_id));
|
||||
devRecordTab.insert(MapOf.of("record_id", IdUtil.getStringId(), "device_code", device_code, "status_type", status_type, "start_time", start_time, "err_status_id", err_status_id));
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "设备状态反馈成功");
|
||||
return result;
|
||||
@@ -249,15 +252,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
@Async
|
||||
public void feedDevQty(Map param) {
|
||||
WQLObject deviceTab = WQLObject.getWQLObject("pdm_bi_device");
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
if (CollectionUtils.isEmpty(param)) {
|
||||
return;
|
||||
}
|
||||
Iterator iterator = param.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
String deviceCode = (String)iterator.next();
|
||||
if (!StringUtils.isEmpty(deviceCode)){
|
||||
while (iterator.hasNext()) {
|
||||
String deviceCode = (String) iterator.next();
|
||||
if (!StringUtils.isEmpty(deviceCode)) {
|
||||
String qty = String.valueOf(param.get(deviceCode));
|
||||
deviceTab.update(MapOf.of("deviceinstor_qty",qty),"device_code = '"+deviceCode+"'");
|
||||
deviceTab.update(MapOf.of("deviceinstor_qty", qty), "device_code = '" + deviceCode + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,7 +268,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
@Override
|
||||
public void feedcachelineVe(JSONObject param) {
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
|
||||
if (param == null|| StringUtils.isBlank(param.getString("device_code")) || StringUtils.isBlank(param.getString("vehicle_code"))){
|
||||
if (param == null || StringUtils.isBlank(param.getString("device_code")) || StringUtils.isBlank(param.getString("vehicle_code"))) {
|
||||
return;
|
||||
}
|
||||
String cachelineCode = param.getString("device_code");
|
||||
@@ -273,17 +276,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
String[] collect = cacheVehicle.split(",");
|
||||
//order by layer_num,order_no ASC
|
||||
JSONArray cachePositions = positionTab.query("cacheLine_code = '" + cachelineCode + "' order by layer_num,order_no ASC").getResultJSONArray(0);
|
||||
if (cachePositions.size() != collect.length){
|
||||
if (cachePositions.size() != collect.length) {
|
||||
throw new BadRequestException("缓存线位置数量与acs返回数量不一致");
|
||||
}
|
||||
for (int i = 0; i < cachePositions.size(); i++) {
|
||||
JSONObject cachePosition = (JSONObject) cachePositions.get(i);
|
||||
String vehicleCode = collect[i];
|
||||
cachePosition.put("vehicle_code",vehicleCode.equals("0")?"": vehicleCode);
|
||||
if (vehicleCode.equals("99999")){
|
||||
cachePosition.put("vehicle_code", vehicleCode.equals("0") ? "" : vehicleCode);
|
||||
if (vehicleCode.equals("99999")) {
|
||||
cachePosition.put("err_type", StatusEnum.CACHE_POINT_ERROR.getCode());
|
||||
}
|
||||
positionTab.update(cachePosition,"position_code = '"+cachePosition.getString("position_code")+"'");
|
||||
positionTab.update(cachePosition, "position_code = '" + cachePosition.getString("position_code") + "'");
|
||||
}
|
||||
//更新缓存线及缓存线载具表对应关系
|
||||
cacheLineHandService.cacheLineMaterSync(param.getString("cacheline_code"));
|
||||
@@ -293,14 +296,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
@Async
|
||||
public void feedOrderRealQty(JSONObject param) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_produce_workorder");
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
if (CollectionUtils.isEmpty(param)) {
|
||||
return;
|
||||
}
|
||||
Iterator<String> iterator = param.keySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
while (iterator.hasNext()) {
|
||||
String workorderCode = iterator.next();
|
||||
String real_qty = param.getString(workorderCode);
|
||||
wo.update(MapOf.of("real_qty",real_qty),"workorder_code = '"+workorderCode+"'");
|
||||
wo.update(MapOf.of("real_qty", real_qty), "workorder_code = '" + workorderCode + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ public class DivRuleCpServiceImpl implements DivRuleCpService {
|
||||
.eq(StIvtStructattr::getStor_id, stor_id)
|
||||
.eq(StIvtStructattr::getSect_id, sect_id)
|
||||
.isNull(StIvtStructattr::getStoragevehicle_code)
|
||||
.ne(StIvtStructattr::getStoragevehicle_code,"")
|
||||
.eq(StIvtStructattr::getIs_used, "1") //TODO 暂时写死
|
||||
.eq(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.orderByAsc(StIvtStructattr::getStruct_code)
|
||||
|
||||
@@ -153,8 +153,7 @@ public class StIvtCheckdtlBcp implements Serializable {
|
||||
* 处理时间
|
||||
*/
|
||||
private String process_time;
|
||||
|
||||
private String task_id;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname
|
||||
user1.person_name AS process_optname,
|
||||
ivt.unit_weight
|
||||
FROM
|
||||
st_ivt_checkdtl_bcp CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN st_ivt_structivt_bcp ivt ON ivt.struct_id = struct.struct_id
|
||||
<where>
|
||||
1=1
|
||||
<if test="map.check_id != '' and map.check_id != null">
|
||||
|
||||
@@ -78,7 +78,8 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
|
||||
@Override
|
||||
public Object pageQuery(CheckQuery query, PageQuery page) {
|
||||
// 查询条件
|
||||
page.setSort("check_code");
|
||||
page.setSort("check_code,desc");
|
||||
page.setIsAsc(true);
|
||||
// 分页查询
|
||||
Page<StIvtCheckmstBcp> pageQuery = this.page(page.build(), query.build());
|
||||
TableDataInfo<StIvtCheckmstBcp> build = TableDataInfo.build(pageQuery);
|
||||
@@ -271,9 +272,14 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
|
||||
public void issueTask(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("checkdtl_id")}, "请求参数不能为空");
|
||||
|
||||
StIvtCheckdtlBcp dtl = checkdtlBcpService.getById(form.getString("checkdtl_id"));
|
||||
|
||||
if (dtl.getIs_down().equals("1")) {
|
||||
throw new BadRequestException("当前仓位的盘点移出任务已经下发!");
|
||||
}
|
||||
|
||||
//查询可用的半成品移出点位
|
||||
String point_code = "PD01";
|
||||
StIvtCheckdtlBcp dtl = checkdtlBcpService.getById(form.getString("checkdtl_id"));
|
||||
|
||||
StIvtCheckmstBcp mst = this.getById(dtl.getCheck_id());
|
||||
|
||||
@@ -285,7 +291,6 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
|
||||
.point_code2(point_code)
|
||||
.vehicle_code(dtl.getStoragevehicle_code())
|
||||
.product_area(mst.getWorkshop_id())
|
||||
.callback((Consumer<String>) task_id -> dtl.setTask_id(task_id))
|
||||
.build();
|
||||
|
||||
BussEventMulticaster.Publish(event);
|
||||
@@ -296,6 +301,9 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
|
||||
.set("status", CHECKEnum.DTL_STATUS.code("盘点中"))
|
||||
.eq("struct_id", dtl.getStruct_id())
|
||||
.eq("check_id", dtl.getCheck_id()));
|
||||
|
||||
mst.setStatus(CHECKEnum.BILL_STATUS.code("盘点中"));
|
||||
this.updateById(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -267,14 +267,19 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
String status = form.getString("status");
|
||||
StIvtIostorinvBcp mst = this.getOne(new QueryWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id));
|
||||
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||
//完成
|
||||
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("完成")));
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
mst_jo.put("iostorinv_id", mst.getIostorinv_id());
|
||||
this.confirm(mst_jo);
|
||||
} else {
|
||||
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())){
|
||||
//执行中
|
||||
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("执行中")));
|
||||
}else {
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,21 +67,8 @@ export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
getType,
|
||||
insertDtl,
|
||||
getIODtl,
|
||||
commit,
|
||||
checkVehicle,
|
||||
confirmvehicle,
|
||||
getDisDtl,
|
||||
divStruct,
|
||||
unDivStruct,
|
||||
divPoint,
|
||||
delDis,
|
||||
queryBoxMater,
|
||||
bucketDtl,
|
||||
updateTask,
|
||||
confirmTask,
|
||||
confirm,
|
||||
queryStor,
|
||||
getDisTask
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
v-model="form.biz_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
align="center"
|
||||
style="width: 210px"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="crud.status.view > 0"
|
||||
@@ -236,7 +237,6 @@
|
||||
<BillDtl
|
||||
:dialog-show.sync="billShow"
|
||||
:is-single="false"
|
||||
:mater-opt-code="materType"
|
||||
@setMaterValue="tableChanged"
|
||||
/>
|
||||
|
||||
@@ -287,11 +287,9 @@ export default {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
billShow: false,
|
||||
dtlShow: false,
|
||||
struct_id: '',
|
||||
sect_id: '',
|
||||
opendtlParam: null,
|
||||
materType: '03', // 关键成品
|
||||
storlist: [],
|
||||
sects: [],
|
||||
billtypelist: [],
|
||||
|
||||
@@ -1,526 +0,0 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
|
||||
<span slot="title" class="dialog-footer">
|
||||
<div class="crud-opts2">
|
||||
<span class="el-dialog__title2">入库分配</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">入库明细项</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="dtl_table"
|
||||
:data="this.openParam"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
highlight-current-row
|
||||
:row-class-name="tableRowClassName"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@row-click="clcikRow"
|
||||
>
|
||||
<el-table-column prop="bill_status" label="状态" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.bill_status"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
|
||||
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
|
||||
<el-form-item label="入库点" prop="point_code">
|
||||
<el-select
|
||||
v-model="form.point_code"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointlist"
|
||||
:key="item.point_code"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">载具物料明细</span>
|
||||
<div class="crud-opts-form">
|
||||
<el-form ref="form" :inline="true" :model="form" size="mini">
|
||||
<el-form-item label="区域" prop="gender5">
|
||||
<el-cascader
|
||||
placeholder="请选择"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="checked">
|
||||
<el-checkbox v-model="form.checked">自动分配货位</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="confirmvehicle()"
|
||||
>
|
||||
组盘确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
:loading="divBtn"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="divStruct()"
|
||||
>
|
||||
分配货位
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="unDivStruct()"
|
||||
>
|
||||
取消分配
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="divPoint()"
|
||||
>
|
||||
设置起点
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="dis_table"
|
||||
:data="form.tableMater"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@row-click="clcikRowDis"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="订单号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="form.tableMater[scope.$index].storagevehicle_code"
|
||||
clearable
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="overstruct_type" label="载具超限" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="form.tableMater[scope.$index].overstruct_type"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 100px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.MD_OVERSTRUCT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" :sect-prop="sectProp" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
|
||||
import crudPoint from '@/views/wms/scheduler_manage/point/point'
|
||||
import crudRegion from '@/views/wms/scheduler_manage/region/region'
|
||||
|
||||
export default {
|
||||
name: 'DivDialog',
|
||||
components: {},
|
||||
mixins: [crud()],
|
||||
dicts: ['IO_BILL_STATUS', 'MD_OVERSTRUCT_TYPE'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
billType: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
storId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
stor_id: '',
|
||||
sect_id: '',
|
||||
sectProp: null,
|
||||
bucketProp: {},
|
||||
structShow: false,
|
||||
bucketObj: null,
|
||||
divBtn: false,
|
||||
bucketShow: false,
|
||||
sects: [],
|
||||
sect_val: null,
|
||||
dis_row: null,
|
||||
form: {
|
||||
dtl_row: null,
|
||||
storage_qty: '',
|
||||
sect_id: '',
|
||||
stor_id: '',
|
||||
point_code: null,
|
||||
checked: true,
|
||||
tableMater: []
|
||||
},
|
||||
storlist: [],
|
||||
pointlist: [],
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudRegion.getRegionSelect({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
const area_type = 'A1_RK01'
|
||||
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
|
||||
this.pointlist = res
|
||||
})
|
||||
},
|
||||
toDelete(data) {
|
||||
data.pop = true
|
||||
},
|
||||
close() {
|
||||
this.form.tableMater = []
|
||||
this.form.dtl_row = null
|
||||
this.sectProp = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('AddChanged')
|
||||
this.crud.refresh()
|
||||
this.$refs['form2'].resetFields()
|
||||
},
|
||||
clcikRow(row, column, event) {
|
||||
this.form.dtl_row = row
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.dtl_row = res[row.index]
|
||||
})
|
||||
crudProductIn.getDisDtl(row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
},
|
||||
clcikRowDis(row, column, event) {
|
||||
this.dis_row = row
|
||||
},
|
||||
vehicleCheck() {
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.form.storagevehicle_code = ''
|
||||
return
|
||||
}
|
||||
crudProductIn.checkVehicle({
|
||||
'storagevehicle_code': this.form.storagevehicle_code,
|
||||
'dis_num': this.form.tableMater.length,
|
||||
'iostorinv_id': this.form.dtl_row.iostorinv_id
|
||||
}).then(res => {
|
||||
|
||||
}).catch(err => {
|
||||
this.form.storagevehicle_code = ''
|
||||
})
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
insertvehicle() {
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (!this.form.storagevehicle_code) {
|
||||
this.crud.notify('请输入托盘号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 判断是否选择了桶号
|
||||
if (this.bucketObj) {
|
||||
if (!(this.bucketObj.status === '01')) {
|
||||
this.crud.notify('请校验桶状态!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const dis_dtl = JSON.parse(JSON.stringify(this.bucketObj))
|
||||
// 判断选择的桶是否已经被选过
|
||||
const flag = this.form.tableMater.some(mater => mater.bucketunique === dis_dtl.bucketunique)
|
||||
if (!flag) {
|
||||
const flag = this.form.tableMater.some(mater => mater.storagevehicle_code !== this.form.storagevehicle_code)
|
||||
if (flag) {
|
||||
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
dis_dtl.storagevehicle_code = this.form.storagevehicle_code
|
||||
dis_dtl.pop = false
|
||||
this.form.tableMater.splice(this.form.tableMater.length, 0, dis_dtl)
|
||||
if (this.form.dtl_row.assign_qty) {
|
||||
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) + parseFloat(this.form.storage_qty)
|
||||
} else {
|
||||
this.form.dtl_row.assign_qty = parseFloat(this.form.storage_qty)
|
||||
}
|
||||
if (parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty) > 0) {
|
||||
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty)
|
||||
} else {
|
||||
this.form.dtl_row.unassign_qty = 0
|
||||
}
|
||||
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
|
||||
}
|
||||
if (flag) {
|
||||
this.crud.notify('该桶已被加入明细中', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
} else {
|
||||
this.crud.notify('请选择桶号', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
},
|
||||
confirmvehicle() {
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.overstruct_type === '') {
|
||||
this.crud.notify('载具超限不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.confirmvehicle(this.dis_row).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
if (val.length === 1) {
|
||||
this.stor_id = val[0]
|
||||
this.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.sect_id = ''
|
||||
this.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.stor_id = val[0]
|
||||
this.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.sect_id = this.sect_id
|
||||
this.form.stor_id = this.stor_id
|
||||
// 新增一行物料时,给行进行赋值
|
||||
for (let i = 0; i < this.form.tableMater.length; i++) {
|
||||
this.form.tableMater[i].struct_id = row.point_id
|
||||
this.form.tableMater[i].struct_code = row.point_code
|
||||
this.form.tableMater[i].struct_name = row.point_name
|
||||
this.form.tableMater[i].region_code = row.region_code
|
||||
this.form.tableMater[i].region_name = row.region_name
|
||||
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
crudProductIn.divStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
this.form.tableMater = []
|
||||
})
|
||||
},
|
||||
divPoint() {
|
||||
if (!this.form.point_code) {
|
||||
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.form.tableMater.length === 0) {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.divPoint(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('设置起点成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
divStruct() {
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
if (this.form.checked) {
|
||||
if (!this.sect_id) {
|
||||
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.divBtn = true
|
||||
this.form.sect_id = this.sect_id
|
||||
this.form.stor_id = this.stor_id
|
||||
this.form.is_pc = '1'
|
||||
crudProductIn.divStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.divBtn = false
|
||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}).finally(() => {
|
||||
this.divBtn = false
|
||||
})
|
||||
} else {
|
||||
this.structShow = true
|
||||
this.$refs.child.getMsg(false)
|
||||
}
|
||||
},
|
||||
unDivStruct() {
|
||||
if (this.form.tableMater.length <= 0) {
|
||||
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const flag = this.form.tableMater.some(mater => !mater.struct_code)
|
||||
if (flag) {
|
||||
this.crud.notify('明细存在未分配货位!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
crudProductIn.unDivStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size: 20px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span {
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-form {
|
||||
padding: 10px 0px 0px 20px;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -75,6 +75,7 @@
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
align="center"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
@@ -204,7 +205,6 @@
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<DivDialog :dialog-show.sync="divShow" :stor-id="storId" :open-param="openParam" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -218,17 +218,16 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/AddDialog'
|
||||
import DivDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/DivDialog'
|
||||
import ViewDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/ViewDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
|
||||
export default {
|
||||
name: 'RawProductOut',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
title: '原材料出库',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'iostorinv_id',
|
||||
url: '/api/out/stIvtIostorinvYl',
|
||||
@@ -243,16 +242,12 @@ export default {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
dis_flag: true,
|
||||
confirm_flag: true,
|
||||
disShow: false,
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
divShow: false,
|
||||
openParam: [],
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
storId: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -305,7 +300,6 @@ export default {
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.dis_flag = true
|
||||
this.confirm_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
@@ -330,15 +324,6 @@ export default {
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
divOpen() {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.currentRow.bill_code, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
debugger
|
||||
this.storId = this.currentRow.product_code
|
||||
this.billType = this.currentRow.bill_type
|
||||
this.divShow = true
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
|
||||
@@ -386,7 +386,21 @@ export default {
|
||||
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
check.issueTask(this.nowrow)
|
||||
check.issueTask(this.nowrow).then(res => {
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
check.getCheckDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
const row = this.tableData[i]
|
||||
this.$set(row,'edit',false)
|
||||
if (row.status > '04') {
|
||||
row.edit = true
|
||||
}
|
||||
this.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
saveCheck() {
|
||||
if (this.tableData.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user