Browse Source

add: 添加组盘管理中生成任务

master
yanps 2 months ago
parent
commit
60fe5c8658
  1. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java
  2. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java
  4. 27
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  5. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  6. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java
  7. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java
  8. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java
  9. 116
      lms/nladmin-ui/src/views/wms/sch/group/index.vue
  10. 18
      lms/nladmin-ui/src/views/wms/sch/group/schBaseVehiclematerialgroup.js

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java

@ -141,11 +141,12 @@ public class FabServiceImpl {
pcOperationSMTTask.apply(param); pcOperationSMTTask.apply(param);
break; break;
case "snt": case "snt":
Assert.noNullElements(new Object[]{form.getString("device_code"), form.getString("region_code")}, "参数不能为空!"); Assert.noNullElements(new Object[]{form.getString("device_code")}, "参数不能为空!");
SendVehicleVo sendVehicleVo = form.toJavaObject(SendVehicleVo.class); SendVehicleVo sendVehicleVo = form.toJavaObject(SendVehicleVo.class);
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(sendVehicleVo.getDevice_code()); SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(sendVehicleVo.getDevice_code());
sendVehicleVo.setRegion_code(schBasePoint.getRegion_code());
param.put("device_code", sendVehicleVo.getDevice_code()); param.put("device_code", sendVehicleVo.getDevice_code());
param.put("region_code", sendVehicleVo.getRegion_code()); param.put("region_code", schBasePoint.getRegion_code());
param.put("config_code", "PcOperationSNTTask"); param.put("config_code", "PcOperationSNTTask");
param.put("vehicle_code", schBasePoint.getVehicle_code()); param.put("vehicle_code", schBasePoint.getVehicle_code());
param.put("vehicle_type", schBasePoint.getVehicle_type()); param.put("vehicle_type", schBasePoint.getVehicle_type());

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java

@ -80,4 +80,13 @@ public class SchBaseVehiclematerialgroupController {
public ResponseEntity<Object> selectByVehicleCode(@RequestBody JSONObject entity){ public ResponseEntity<Object> selectByVehicleCode(@RequestBody JSONObject entity){
return new ResponseEntity<>(schBaseVehiclematerialgroupService.selectByVehicleCode(entity), HttpStatus.OK); return new ResponseEntity<>(schBaseVehiclematerialgroupService.selectByVehicleCode(entity), HttpStatus.OK);
} }
@PostMapping("/createTask")
@Log("根据载具物料信息创建任务")
@ApiOperation("根据载具物料信息创建任务")
public ResponseEntity<Object> createTask(@RequestBody JSONObject entity){
return new ResponseEntity<>(schBaseVehiclematerialgroupService.createTask(entity), HttpStatus.OK);
}
} }

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java

@ -87,4 +87,11 @@ public interface ISchBaseVehiclematerialgroupService extends IService<SchBaseVeh
* @return * @return
*/ */
List<SchBaseVehiclematerialgroup> selectByVehicleCode(JSONObject entity); List<SchBaseVehiclematerialgroup> selectByVehicleCode(JSONObject entity);
/**
* 根据载具号创建任务
* @param entity
* @return
*/
Object createTask(JSONObject entity);
} }

27
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -16,10 +16,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.enums.GoodsEnum;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.wms.database.material.service.IMdBaseMaterialService; import org.nl.wms.database.material.service.IMdBaseMaterialService;
import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.fab.service.dto.CallMaterVo;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper; import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
@ -28,6 +30,7 @@ import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.process_flow.service.ProcessFlowService; import org.nl.wms.sch.process_flow.service.ProcessFlowService;
import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task_manage.task.tasks.pcoperation.PcOperationCMTask;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -52,6 +55,10 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
private ProcessFlowService processFlowService; private ProcessFlowService processFlowService;
@Autowired @Autowired
private ISchBasePointService pointService; private ISchBasePointService pointService;
@Autowired
private PcOperationCMTask pcOperationCMTask;
@Autowired
private ISchBasePointService iSchBasePointService;
@Override @Override
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) {
@ -84,6 +91,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
item.setHasChildren(true); item.setHasChildren(true);
item.setChildren(schBaseVehiclematerialgroups); item.setChildren(schBaseVehiclematerialgroups);
} }
item.setHas_work(true);
}); });
return schBaseVehiclematerialgroupIPage; return schBaseVehiclematerialgroupIPage;
} }
@ -181,6 +189,25 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
return schBaseVehiclematerialgroups; return schBaseVehiclematerialgroups;
} }
@Override
public Object createTask(JSONObject entity) {
Assert.noNullElements(new Object[]{entity.get("point_code2"), entity.get("vehicle_code")},"载具号不能为空!");
JSONObject param = new JSONObject();
param.put("device_code", entity.get("point_code2"));
param.put("config_code", "PcOperationCMTask");
param.put("vehicle_code", entity.get("vehicle_code"));
param.put("ext_data", entity);
pcOperationCMTask.apply(param);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, entity.get("point_code2"))
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, true));
vehiclematerialgroupMapper.delete(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, entity.get("vehicle_code")));
return null;
}
private Long getTime(String dateString) { private Long getTime(String dateString) {
String pattern = "yyyy-MM-dd HH:mm:ss"; String pattern = "yyyy-MM-dd HH:mm:ss";
java.util.Date date = DateUtil.parse(dateString, pattern); java.util.Date date = DateUtil.parse(dateString, pattern);

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -261,7 +261,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(SchBasePoint::getIs_used, true)); .eq(SchBasePoint::getIs_used, true));
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) { if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
SchBasePoint schBasePoint = schBasePoints.get(0); SchBasePoint schBasePoint = schBasePoints.get(0);
schBasePoint.setVehicle_code(vehicleCode);
schBasePoint.setIs_lock(true); schBasePoint.setIs_lock(true);
update(Wrappers.lambdaUpdate(SchBasePoint.class) update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())
@ -278,10 +277,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()) .eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
.eq(SchBasePoint::getIs_used, true) .eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())); .eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));
if (CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0) { if (CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0) {
schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));
SchBasePoint schBasePoint = schBasePoints1.get(0); SchBasePoint schBasePoint = schBasePoints1.get(0);
schBasePoint.setVehicle_code(vehicleCode);
schBasePoint.setIs_lock(true); schBasePoint.setIs_lock(true);
update(Wrappers.lambdaUpdate(SchBasePoint.class) update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java

@ -100,6 +100,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
*/ */
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId); SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
JSONArray res = new JSONArray(); JSONArray res = new JSONArray();
if (ObjectUtil.isEmpty(schBaseRegion)) return res;
String pointStatusExplain = schBaseRegion.getPoint_status_explain(); String pointStatusExplain = schBaseRegion.getPoint_status_explain();
if (ObjectUtil.isEmpty(pointStatusExplain)) return res; if (ObjectUtil.isEmpty(pointStatusExplain)) return res;
String[] explain = pointStatusExplain.split(","); String[] explain = pointStatusExplain.split(",");
@ -120,6 +121,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
*/ */
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId); SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
JSONArray res = new JSONArray(); JSONArray res = new JSONArray();
if (ObjectUtil.isEmpty(schBaseRegion)) return res;
String pointTypeExplain = schBaseRegion.getPoint_type_explain(); String pointTypeExplain = schBaseRegion.getPoint_type_explain();
if (ObjectUtil.isEmpty(pointTypeExplain)) return res; if (ObjectUtil.isEmpty(pointTypeExplain)) return res;
String[] explain = pointTypeExplain.split(","); String[] explain = pointTypeExplain.split(",");

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java

@ -132,7 +132,8 @@ public class PcOperationCMTask extends AbstractTask {
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class) pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2) .eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false) .set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())); .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue()));
} }
// 任务完成 // 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); taskObj.setTask_status(TaskStatus.FINISHED.getCode());

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java

@ -132,14 +132,16 @@ public class PcOperationSNTTask extends AbstractTask {
if (ObjectUtil.isNotEmpty(schBasePoint)) { if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint); PointUtils.updateByIngTaskCode(schBasePoint);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)); .set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code,null));
} }
String point_code2 = taskObj.getPoint_code2(); String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) { if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2); PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)); .set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code()));
} }
// 任务完成 // 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); taskObj.setTask_status(TaskStatus.FINISHED.getCode());

116
lms/nladmin-ui/src/views/wms/sch/group/index.vue

@ -81,7 +81,7 @@
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu" :title="crud.status.title" width="800px">
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="115px" label-suffix=":"> <el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="115px" label-suffix=":">
<el-form-item label="载具编码"> <el-form-item label="载具编码">
<el-input v-model="form.vehicle_code" style="width: 240px;" /> <el-input v-model="form.vehicle_code" style="width: 240px;" />
@ -227,6 +227,37 @@
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
title="创建任务"
:visible.sync="dialogVisible"
width="350px"
:style="{ 'max-height': '80vh', overflowY: 'auto' }"
@close="resetForm"
>
<el-form ref="taskForm" :model="newTask" width="200px">
<el-form-item label="目的地" :rules="[{ required: true, message: '请输入目的地', trigger: 'blur' }]">
<el-select
v-model="newTask.point_code2"
size="mini"
placeholder="点位状态"
class="filter-item"
style="width: 240px;"
clearable
>
<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>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitTask"> </el-button>
</span>
</el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table
ref="table" ref="table"
@ -245,26 +276,9 @@
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="group_id" label="组盘编码" :min-width="flexWidth('group_id',crud.data,'组盘编码')" /> <el-table-column v-if="false" prop="group_id" label="组盘编码" :min-width="flexWidth('group_id',crud.data,'组盘编码')" />
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" /> <el-table-column prop="vehicle_code" label="载具编码" width="100" />
<!-- <el-table-column prop="child_vehicle_code" label="子载具编码" :min-width="flexWidth('child_vehicle_code',crud.data,'子载具编码')"/>-->
<!-- <el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',crud.data,'来源载具')" /> -->
<el-table-column prop="region_name" label="下道工序" :min-width="flexWidth('region_name',crud.data,'下道工序')" /> <el-table-column prop="region_name" label="下道工序" :min-width="flexWidth('region_name',crud.data,'下道工序')" />
<!-- <el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" /> -->
<!-- <el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" /> -->
<!-- <el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')">
<template slot-scope="scope">
{{ scope.row.is_full?'是':'否' }}
</template>
</el-table-column> -->
<!-- <el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" /> -->
<el-table-column prop="order_code" label="工单编码" :min-width="flexWidth('order_code',crud.data,'工单编码')" /> <el-table-column prop="order_code" label="工单编码" :min-width="flexWidth('order_code',crud.data,'工单编码')" />
<!-- <el-table-column prop="instorage_time" label="入库时间" :min-width="flexWidth('instorage_time',crud.data,'入库时间')" /> -->
<!-- <el-table-column prop="group_bind_material_status" label="绑定状态" :min-width="flexWidth('group_bind_material_status',crud.data,'入库时间')">
<template slot-scope="scope">
{{ dict.label.group_bind_material_status[scope.row.group_bind_material_status] }}
</template>
</el-table-column>
<el-table-column prop="standing_time" label="静置时间(分钟)" :min-width="flexWidth('standing_time',crud.data,'静置时间(分钟)')" /> -->
<el-table-column v-if="false" prop="material_name" label="物料名称" show-overflow-tooltip :min-width="flexWidth('material_name',crud.data,'物料数量')" /> <el-table-column v-if="false" prop="material_name" label="物料名称" show-overflow-tooltip :min-width="flexWidth('material_name',crud.data,'物料数量')" />
<el-table-column prop="material_id" label="物料编码" show-overflow-tooltip :min-width="flexWidth('material_id',crud.data,'物料编码')" /> <el-table-column prop="material_id" label="物料编码" show-overflow-tooltip :min-width="flexWidth('material_id',crud.data,'物料编码')" />
<el-table-column prop="material_qty" label="物料数量" show-overflow-tooltip :min-width="flexWidth('material_qty',crud.data,'物料数量')" /> <el-table-column prop="material_qty" label="物料数量" show-overflow-tooltip :min-width="flexWidth('material_qty',crud.data,'物料数量')" />
@ -272,31 +286,27 @@
<el-table-column prop="due_date" label="交期时间" show-overflow-tooltip :min-width="flexWidth('due_date',crud.data,'交期时间')" /> <el-table-column prop="due_date" label="交期时间" show-overflow-tooltip :min-width="flexWidth('due_date',crud.data,'交期时间')" />
<el-table-column v-if="false" prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" /> <el-table-column v-if="false" prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'物料规格')" />
<el-table-column prop="theLocation" label="存放点位" :min-width="flexWidth('theLocation',crud.data,'存放点位')" /> <el-table-column prop="theLocation" label="存放点位" :min-width="flexWidth('theLocation',crud.data,'存放点位')" />
<!-- <el-table-column prop="material_qty" label="物料数量" :min-width="flexWidth('material_qty',crud.data,'物料数量')" />
<el-table-column prop="material_weight" label="物料重量" :min-width="flexWidth('material_weight',crud.data,'物料重量')" />
<el-table-column prop="group_number" label="组盘次数" :min-width="flexWidth('group_number',crud.data,'组盘次数')" />
<el-table-column prop="task_code" label="任务编码" :min-width="flexWidth('task_code',crud.data,'任务编码')" /> -->
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')"/>-->
<!-- <el-table-column prop="group_status" label="组盘状态" :min-width="flexWidth('group_status',crud.data,'组盘状态')">
<template slot-scope="scope">
{{ dict.label.group_status[scope.row.group_status] }}
</template>
</el-table-column> -->
<!-- <el-table-column prop="is_first_flow_task" label="是否首个流程任务" :min-width="flexWidth('is_first_flow_task',crud.data,'是否首个流程任务')"/>-->
<!-- <el-table-column prop="flow_code" label="流程编码" :min-width="flexWidth('flow_code',crud.data,'流程编码')"/>-->
<!-- <el-table-column prop="flow_num" label="流程顺序" :min-width="flexWidth('flow_num',crud.data,'流程顺序')"/>-->
<!-- <el-table-column prop="move_way" label="移动途径" :min-width="flexWidth('move_way',crud.data,'移动途径')" /> -->
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" /> <el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" /> <el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> <el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
<el-table-column v-if="false" prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" /> <el-table-column v-if="false" prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
<el-table-column v-if="false" prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" /> <el-table-column v-if="false" prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<udOperation <udOperation
:data="scope.row" :data="scope.row"
:permission="permission" :permission="permission"
/> />
</template> -->
<template slot-scope="scope">
<el-button
v-if="!!scope.row.has_work && scope.row.theLocation != null"
type="text"
icon="el-icon-plus"
@click="createTask(scope.row)"
>
创建任务
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -313,7 +323,6 @@ import crudSchBaseVehiclematerialgroup from './schBaseVehiclematerialgroup'
import CRUD, { crud, form, header, presenter } from '@crud/crud' import CRUD, { crud, form, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop' import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue' import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
@ -356,7 +365,7 @@ const defaultForm = {
export default { export default {
name: 'VehicleMaterialGroup', name: 'VehicleMaterialGroup',
dicts: ['group_status', 'group_bind_material_status'], dicts: ['group_status', 'group_bind_material_status'],
components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation }, components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
@ -388,7 +397,13 @@ export default {
regionList: [], regionList: [],
choose: '物料', choose: '物料',
materialDialog: false, materialDialog: false,
workOrderDialog: false workOrderDialog: false,
dialogVisible: false,
newTask: {
point_code2: '',
vehicle_code: '',
point_code1: ''
}
} }
}, },
created() { created() {
@ -452,6 +467,33 @@ export default {
resolve(res) resolve(res)
}) })
}, 100) }, 100)
},
createTask(tree) {
this.newTask.vehicle_code = tree.vehicle_code
this.dialogVisible = true //
},
resetForm() {
//
this.newTask.point_code2 = ''
},
cleanFrom() {
//
this.newTask.point_code2 = ''
this.dialogVisible = false
},
submitTask() {
this.$refs.taskForm.validate((valid) => {
if (valid) {
crudSchBaseVehiclematerialgroup.createTask(this.newTask).then(res => {
console.log(res)
this.dialogVisible = false //
}).catch(error => {
console.error('任务创建失败:', error)
})
} else {
console.error('表单验证失败')
}
})
} }
} }
} }

18
lms/nladmin-ui/src/views/wms/sch/group/schBaseVehiclematerialgroup.js

@ -32,4 +32,20 @@ export function getGroup(data) {
}) })
} }
export default { add, edit, del, getGroup } export function selectByVehicle(data) {
return request({
url: 'api/schBaseVehiclematerialgroup/selectByVehicleCode',
method: 'post',
data
})
}
export function createTask(data) {
return request({
url: 'api/schBaseVehiclematerialgroup/createTask',
method: 'post',
data
})
}
export default { add, edit, del, getGroup, selectByVehicle, createTask }

Loading…
Cancel
Save