组盘
This commit is contained in:
@@ -71,4 +71,11 @@ public class VehicleController {
|
||||
JSONObject json = mdPbVehicleService.getVehicle(code);
|
||||
return new ResponseEntity<>(json,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getVehicleByType")
|
||||
@Log("选择载具")
|
||||
@ApiOperation("选择载具")
|
||||
public ResponseEntity<Object> getVehicleByType(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(mdPbVehicleService.getVehicleByType(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,4 +68,11 @@ public interface VehicleService {
|
||||
*/
|
||||
JSONObject getVehicle(String code);
|
||||
|
||||
/**
|
||||
* 组盘信息选择载具查询
|
||||
* @param whereJson
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
Map<String,Object> getVehicleByType(Map whereJson, Pageable page);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.database.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
@@ -11,6 +12,7 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.wms.database.service.VehicleService;
|
||||
import org.nl.wms.database.service.dto.VehicleDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -241,5 +243,19 @@ public class MdPbVehicleServiceImpl implements VehicleService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVehicleByType(Map whereJson, Pageable page) {
|
||||
String where = "";
|
||||
WQLObject wo = WQLObject.getWQLObject("md_pb_vehicle");
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
if (!StrUtil.isEmpty(search)) {
|
||||
where = " AND (vehicle_code like '%" + search + "%' OR vehicle_name like '%" + search + "%' ) ";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "is_delete= '0' " + where + " AND vehicle_type = '02'" , "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
if (json.isEmpty()) return null; // 空值定义
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.nl.wms.st.buss.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.nl.wms.st.buss.service.VehicleGroupService;
|
||||
import org.nl.wms.st.buss.service.dto.VehicleGrouplDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2022-07-07 10:33
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "组盘管理")
|
||||
@RequestMapping("/api/stBussVehicleGroup")
|
||||
@Slf4j
|
||||
public class VehicleGroupController {
|
||||
|
||||
private final VehicleGroupService vehicleGroupService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询组盘")
|
||||
@ApiOperation("查询组盘")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(vehicleGroupService.queryAll(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增组盘")
|
||||
@ApiOperation("新增组盘")
|
||||
//@PreAuthorize("@el.check('mdMeMaterial:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody VehicleGrouplDto dto){
|
||||
log.info("dto:{}",dto);
|
||||
System.out.println(dto.toString());
|
||||
vehicleGroupService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改组盘")
|
||||
@ApiOperation("修改组盘")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody VehicleGrouplDto dto){
|
||||
vehicleGroupService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除组盘")
|
||||
@ApiOperation("删除组盘")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
vehicleGroupService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.nl.wms.st.buss.service;
|
||||
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.nl.wms.st.buss.service.dto.VehicleGrouplDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 组盘信息服务接口
|
||||
* @Date: 2022-07-07 10:35
|
||||
*/
|
||||
public interface VehicleGroupService {
|
||||
/**
|
||||
* 添加组盘信息
|
||||
* @param dto
|
||||
*/
|
||||
void create(VehicleGrouplDto dto);
|
||||
|
||||
/**
|
||||
* 分页获取组盘数据
|
||||
* @param whereJson
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 修改组盘数据
|
||||
* @param dto
|
||||
*/
|
||||
void update(VehicleGrouplDto dto);
|
||||
|
||||
/**
|
||||
* 根据id查找对象
|
||||
* @param group_id
|
||||
* @return
|
||||
*/
|
||||
VehicleGrouplDto findById(Long group_id);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.nl.wms.st.buss.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2022-07-07 10:37
|
||||
*/
|
||||
@Data
|
||||
public class VehicleGrouplDto implements Serializable {
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long group_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Long material_id;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料名
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.nl.wms.st.buss.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.database.service.dto.MaterialDto;
|
||||
import org.nl.wms.st.buss.service.VehicleGroupService;
|
||||
import org.nl.wms.st.buss.service.dto.VehicleGrouplDto;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 组盘管理实现类
|
||||
* @Date: 2022-07-07 10:35
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class VehicleGroupServiceImpl implements VehicleGroupService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(VehicleGrouplDto dto) {
|
||||
//获取当前用户信息以及时间
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
//赋值准备参数
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setCreate_time(now);
|
||||
dto.setGroup_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
//获取表对象
|
||||
WQLObject st_buss_vehiclegroup = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
st_buss_vehiclegroup.insert(jsonObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
String name = (String) whereJson.get("name");
|
||||
String sql = "1=1";
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
sql = " (vehicle_code like '%"+name+"%')";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), sql + " and is_delete='0'", "create_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
log.info("json:{}",json);
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(VehicleGrouplDto dto) {
|
||||
System.out.println(dto);
|
||||
//判断你是否存在
|
||||
VehicleGrouplDto vg = this.findById(dto.getGroup_id());
|
||||
if (vg == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
WQLObject wo = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleGrouplDto findById(Long group_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
JSONObject json = wo.query("group_id = '" + group_id + "' and is_delete='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) {
|
||||
return json.toJavaObject(VehicleGrouplDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
for (Long group_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("group_id", String.valueOf(group_id));
|
||||
param.put("is_delete", "1");
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
wms/qd/src/api/wms/st/buss/stBussVehicleGroup.js
Normal file
27
wms/qd/src/api/wms/st/buss/stBussVehicleGroup.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -59,13 +59,13 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="外部标识">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -200,7 +200,8 @@ export default {
|
||||
stewing_time: [
|
||||
{ required: true, message: '静止时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -247,7 +248,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudMdMeMaterial.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.notify((val === 1 ? '切换人工打包' : '切换机器打包') + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
debugger
|
||||
if (data.is_manmade === '0') {
|
||||
|
||||
148
wms/qd/src/views/wms/st/buss/vehiclegroup/VehicleDialog.vue
Normal file
148
wms/qd/src/views/wms/st/buss/vehiclegroup/VehicleDialog.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!--工具栏-->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="vehicle_code" label="托盘编码" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_name" label="托盘名称" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudMdPbVehicle from '@/api/wms/database/mdPbVehicle'
|
||||
export default {
|
||||
name: 'VehicleDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '载具', url: 'api/mdPbVehicle/getVehicleByType', crudMethod: { ...crudMdPbVehicle }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
vehicleOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged4', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选托盘')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged4', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,7 @@
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label" />
|
||||
<el-input v-model="query.name" clearable placeholder="输入名称或编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.name" clearable placeholder="输入托盘编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
@@ -14,7 +14,7 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="托盘编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" />
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @focus="getVehicle" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料id">
|
||||
<el-input v-model="form.material_id" style="width: 370px;" />
|
||||
@@ -36,12 +36,33 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button size="mini" type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MaterDialog :dialog-show.sync="materDialog" :dialog-matertype="materType" @tableChanged3="tableChanged3" />
|
||||
<VehicleDialog :dialog-show.sync="vehicleDialog" :dialog-vehicletype="vehicleType" @tableChanged4="tableChanged4" />
|
||||
</div>
|
||||
<!--表格-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="group_id" label="组盘标识" />
|
||||
<el-table-column prop="vehicle_code" label="托盘编码" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="material_name" label="物料名称 " />
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="qty" label="数量" />
|
||||
<el-table-column prop="create_name" label="组盘人" />
|
||||
<el-table-column prop="create_time" label="组盘时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
@@ -52,8 +73,10 @@ import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudMdMeMaterial from '@/api/wms/database/mdMeMaterial'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import crudStBussVehicleGroup from '@/api/wms/st/buss/stBussVehicleGroup'
|
||||
import MaterDialog from '../../in/MaterDialog'
|
||||
import VehicleDialog from '@/views/wms/st/buss/vehiclegroup/VehicleDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
@@ -62,36 +85,43 @@ const defaultForm = {
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
pcsn: null,
|
||||
qty: null
|
||||
qty: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Vehiclegroup',
|
||||
components: { pagination, crudOperation, rrOperation, MaterDialog },
|
||||
components: { VehicleDialog, pagination, crudOperation, rrOperation, MaterDialog, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/mdMeMaterial', idField: 'material_id', sort: 'material_id,desc', crudMethod: { ...crudMdMeMaterial },
|
||||
// 拿数据,改成组盘信息
|
||||
return CRUD({ title: '组盘', url: 'api/stBussVehicleGroup', idField: 'group_id', sort: 'group_id,desc', crudMethod: { ...crudStBussVehicleGroup },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
vehicle_code: [
|
||||
{ required: true, message: '托盘编码不能为空', trigger: 'blur' }
|
||||
{ required: true, message: '托盘编码不能为空', trigger: 'change' }
|
||||
],
|
||||
material_name: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
materDialog: false,
|
||||
materType: ''
|
||||
materType: '',
|
||||
vehicleDialog: false,
|
||||
vehicleType: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -108,6 +138,14 @@ export default {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_name = row.material_name
|
||||
},
|
||||
tableChanged4(row) {
|
||||
console.log(row)
|
||||
this.form.vehicle_code = row.vehicle_code
|
||||
},
|
||||
// 打开选择托盘对话框
|
||||
getVehicle() {
|
||||
this.vehicleDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user