rev: 修改物料、组盘、工单
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.database.material.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||
|
||||
@@ -37,10 +37,12 @@ public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper,
|
||||
@Override
|
||||
public IPage<MdBaseMaterial> queryAll(Map whereJson, PageQuery page){
|
||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||
Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used")) ? Boolean.valueOf(whereJson.get("is_used").toString()) : null;
|
||||
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
||||
LambdaQueryWrapper<MdBaseMaterial> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), MdBaseMaterial::getMaterial_code, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry), l -> l.like(ObjectUtil.isNotEmpty(blurry), MdBaseMaterial::getMaterial_name, blurry))
|
||||
.eq(ObjectUtil.isNotEmpty(is_used), MdBaseMaterial::getIs_used, is_used)
|
||||
.eq(ObjectUtil.isNotEmpty(workshop_code), MdBaseMaterial::getWorkshop_code, workshop_code);
|
||||
IPage<MdBaseMaterial> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
mdBaseMaterialMapper.selectPage(pages, lam);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.pdm.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -29,8 +30,6 @@ public class PdmBdWorkorder implements Serializable {
|
||||
@ApiModelProperty(value = "工单编号")
|
||||
private String workorder_code;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "计划数量")
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
@@ -109,4 +108,13 @@ public class PdmBdWorkorder implements Serializable {
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private String update_time;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String material_name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String material_code;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String material_spec;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.pdm.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
|
||||
/**
|
||||
@@ -9,4 +10,5 @@ import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
||||
**/
|
||||
public interface PdmBdWorkorderMapper extends BaseMapper<PdmBdWorkorder> {
|
||||
|
||||
IPage<PdmBdWorkorder> selectPageLeftJoin(IPage<PdmBdWorkorder> pages, String workorderCode, String pointCode);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.pdm.service.dao.mapper.PdmBdWorkorderMapper">
|
||||
|
||||
<select id="selectPageLeftJoin" resultType="org.nl.wms.pdm.service.dao.PdmBdWorkorder">
|
||||
SELECT wo.*
|
||||
,ma.material_name
|
||||
,ma.material_code
|
||||
,ma.material_spec
|
||||
FROM pdm_bd_workorder wo
|
||||
LEFT JOIN md_base_material ma ON ma.material_id = wo.material_id
|
||||
WHERE 1 = 1
|
||||
<if test="workorderCode != null">
|
||||
AND wo.workorder_code like CONCAT('%', #{workorderCode}, '%')
|
||||
</if>
|
||||
<if test="pointCode != null">
|
||||
AND wo.point_code like CONCAT('%', #{pointCode}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,7 +2,9 @@ package org.nl.wms.pdm.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -33,9 +35,10 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
||||
|
||||
@Override
|
||||
public IPage<PdmBdWorkorder> queryAll(Map whereJson, PageQuery page){
|
||||
LambdaQueryWrapper<PdmBdWorkorder> lam = new LambdaQueryWrapper<>();
|
||||
String workorder_code = ObjectUtil.isNotEmpty(whereJson.get("workorder_code")) ? whereJson.get("workorder_code").toString() : null;
|
||||
String point_code = ObjectUtil.isNotEmpty(whereJson.get("point_code")) ? whereJson.get("point_code").toString() : null;
|
||||
IPage<PdmBdWorkorder> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pdmBdWorkorderMapper.selectPage(pages, lam);
|
||||
pages = pdmBdWorkorderMapper.selectPageLeftJoin(pages, workorder_code, point_code);
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package org.nl.wms.sch.group.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
@@ -30,35 +29,39 @@ import java.util.Set;
|
||||
public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseVehiclematerialgroupMapper, SchBaseVehiclematerialgroup> implements ISchBaseVehiclematerialgroupService {
|
||||
|
||||
@Autowired
|
||||
private SchBaseVehiclematerialgroupMapper schBaseVehiclematerialgroupMapper;
|
||||
private SchBaseVehiclematerialgroupMapper vehiclematerialgroupMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SchBaseVehiclematerialgroup> queryAll(Map whereJson, PageQuery page){
|
||||
LambdaQueryWrapper<SchBaseVehiclematerialgroup> lam = new LambdaQueryWrapper<>();
|
||||
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
schBaseVehiclematerialgroupMapper.selectPage(pages, lam);
|
||||
vehiclematerialgroupMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SchBaseVehiclematerialgroup entity) {
|
||||
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = vehiclematerialgroupMapper.selectOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>()
|
||||
.eq(SchBaseVehiclematerialgroup::getVehicle_code, entity.getVehicle_code())
|
||||
.eq(SchBaseVehiclematerialgroup::getIs_delete, false));
|
||||
Assert.isNull(schBaseVehiclematerialgroup, "载具编码[" + entity.getVehicle_code() + "]已存在");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setVehicle_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
schBaseVehiclematerialgroupMapper.insert(entity);
|
||||
vehiclematerialgroupMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(SchBaseVehiclematerialgroup entity) {
|
||||
SchBaseVehiclematerialgroup dto = schBaseVehiclematerialgroupMapper.selectById(entity.getVehicle_code());
|
||||
SchBaseVehiclematerialgroup dto = vehiclematerialgroupMapper.selectById(entity.getVehicle_code());
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -68,13 +71,13 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
|
||||
schBaseVehiclematerialgroupMapper.updateById(entity);
|
||||
vehiclematerialgroupMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Set<String> ids) {
|
||||
// 真删除
|
||||
schBaseVehiclematerialgroupMapper.deleteBatchIds(ids);
|
||||
vehiclematerialgroupMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
<el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')"/>
|
||||
<el-table-column prop="real_qty" label="实际数量" :min-width="flexWidth('real_qty',crud.data,'实际数量')"/>
|
||||
<el-table-column prop="material_id" label="物料标识" :min-width="flexWidth('material_id',crud.data,'物料标识')"/>
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料标识')"/>
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')"/>
|
||||
<el-table-column prop="planproducestart_date" label="计划开始时间" :min-width="flexWidth('planproducestart_date',crud.data,'计划开始时间')"/>
|
||||
<el-table-column prop="planproduceend_date" label="计划结束时间" :min-width="flexWidth('planproduceend_date',crud.data,'计划结束时间')"/>
|
||||
|
||||
166
nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue
Normal file
166
nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<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.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
/>
|
||||
</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="material_code" label="物料编码" width="160" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
||||
<!-- <el-table-column prop="class_name" label="物料分类" width="140" />-->
|
||||
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
|
||||
<el-table-column prop="update_name" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button 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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'MaterialDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '生产任务',
|
||||
url: 'api/mdBaseMaterial',
|
||||
optShow: {},
|
||||
query: {
|
||||
is_used: true
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
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('tableChanged', 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('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
153
nladmin-ui/src/views/wms/sch/group/WorkOrderDialog.vue
Normal file
153
nladmin-ui/src/views/wms/sch/group/WorkOrderDialog.vue
Normal file
@@ -0,0 +1,153 @@
|
||||
<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.workorder_code"
|
||||
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="workorder_code" label="工单编号" width="120px"/>
|
||||
<el-table-column v-if="false" prop="material_id" label="物料标识" />
|
||||
<el-table-column prop="workshop_code" label="所属车间" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="update_name" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button 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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
name: 'WorkOrderDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used', 'vehicle_type'],
|
||||
cruds() {
|
||||
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorder', optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
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('tableChanged', 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('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,6 +2,32 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属车间">
|
||||
<el-select
|
||||
v-model="query.workshop_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="所属车间"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workShopList"
|
||||
:label="item.workshop_name"
|
||||
:value="item.workshop_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
@@ -23,16 +49,29 @@
|
||||
<el-input v-model="form.point_name" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否满托">
|
||||
<el-input v-model="form.is_full" style="width: 240px;" />
|
||||
<el-radio-group v-model="form.is_full" style="width: 240px">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input v-model="form.pcsn" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间">
|
||||
<el-input v-model="form.instorage_time" style="width: 240px;" />
|
||||
<el-date-picker
|
||||
v-model="form.instorage_time"
|
||||
type="datetime"
|
||||
style="width: 240px;"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="静置时间(分钟)">
|
||||
<el-input v-model="form.standing_time" style="width: 240px;" />
|
||||
<el-input-number
|
||||
v-model.number="form.standing_time"
|
||||
:min="1"
|
||||
:max="999"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料数量">
|
||||
<el-input v-model="form.material_qty" style="width: 240px;" />
|
||||
@@ -43,6 +82,24 @@
|
||||
<el-form-item label="工单编码">
|
||||
<el-input v-model="form.workorder_code" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料来源">
|
||||
<el-radio-group v-model="choose" size="mini" style="width: 240px;">
|
||||
<el-radio-button label="物料" />
|
||||
<el-radio-button label="工单" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料名称">
|
||||
<el-input suffix-icon="el-icon-date" v-model="form.material_id" clearable style="width: 370px;" @focus="getMaterial" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
<el-input @clear="clearMaterial" clearable v-model="form.material_name" style="width: 240px;" @focus="getMaterial" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input v-model="form.material_code" disabled style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组盘次数">
|
||||
<el-input v-model="form.group_number" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
@@ -53,7 +110,20 @@
|
||||
<el-input v-model="form.workshop_code" style="width: 240px;" />
|
||||
</el-form-item>-->
|
||||
<el-form-item label="组盘状态">
|
||||
<el-input v-model="form.group_status" style="width: 240px;" />
|
||||
<el-select
|
||||
v-model="form.group_status"
|
||||
size="mini"
|
||||
placeholder="点位状态"
|
||||
class="filter-item"
|
||||
style="width: 240px;"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.group_status"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="是否首个流程任务">
|
||||
<el-input v-model="form.is_first_flow_task" style="width: 240px;" />
|
||||
@@ -88,7 +158,7 @@
|
||||
<el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',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="point_name" label="所属区域" :min-width="flexWidth('point_name',crud.data,'所属区域')" />
|
||||
<el-table-column prop="region_name" label="所属区域" :min-width="flexWidth('region_name',crud.data,'所属区域')" />
|
||||
<el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')" />
|
||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="workorder_code" label="工单编码" :min-width="flexWidth('workorder_code',crud.data,'工单编码')" />
|
||||
@@ -122,6 +192,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged"/>
|
||||
<WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged="tableChanged"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -132,6 +204,9 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||
import MaterialDialog from '@/views/wms/sch/group/MaterialDialog.vue'
|
||||
import WorkOrderDialog from '@/views/wms/sch/group/WorkOrderDialog.vue'
|
||||
|
||||
const defaultForm = {
|
||||
vehicle_code: null,
|
||||
@@ -140,7 +215,7 @@ const defaultForm = {
|
||||
source_vehicle_code: null,
|
||||
point_code: null,
|
||||
point_name: null,
|
||||
is_full: null,
|
||||
is_full: true,
|
||||
pcsn: null,
|
||||
instorage_time: null,
|
||||
standing_time: null,
|
||||
@@ -172,7 +247,8 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'VehicleMaterialGroup',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
dicts: ['group_status'],
|
||||
components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -190,17 +266,52 @@ export default {
|
||||
crudMethod: { ...crudSchBaseVehiclematerialgroup }
|
||||
})
|
||||
},
|
||||
created() {
|
||||
this.getWorkShopList()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}}
|
||||
},
|
||||
workShopList: [],
|
||||
choose: '物料',
|
||||
materialDialog: false,
|
||||
workOrderDialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getWorkShopList() { // 获取车间列表
|
||||
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||
this.workShopList = res
|
||||
})
|
||||
},
|
||||
getMaterial() {
|
||||
if (this.choose === '物料') {
|
||||
this.materialDialog = true
|
||||
} else {
|
||||
this.workOrderDialog = true
|
||||
}
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_code = row.material_code
|
||||
if (this.choose === '工单') {
|
||||
this.form.workorder_code = row.workorder_code
|
||||
}
|
||||
},
|
||||
clearMaterial() {
|
||||
this.form.material_name = null
|
||||
this.form.material_id = null
|
||||
this.form.material_spec = null
|
||||
this.form.material_code = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user