16 changed files with 663 additions and 26 deletions
@ -0,0 +1,66 @@ |
|||
package org.nl.wms.pdm.controller; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.nl.common.base.TableDataInfo; |
|||
import org.nl.common.domain.query.PageQuery; |
|||
import org.nl.common.logging.annotation.Log; |
|||
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|||
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
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.Set; |
|||
/** |
|||
* @author lyd |
|||
* @date 2023-05-05 |
|||
**/ |
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "工单管理管理") |
|||
@RequestMapping("/api/pdmBdWorkorder") |
|||
public class PdmBdWorkorderController { |
|||
|
|||
@Autowired |
|||
private IPdmBdWorkorderService pdmBdWorkorderService; |
|||
|
|||
@GetMapping |
|||
@Log("查询工单管理") |
|||
@ApiOperation("查询工单管理") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
|
|||
public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){ |
|||
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAll(query,page)),HttpStatus.OK); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Log("新增工单管理") |
|||
@ApiOperation("新增工单管理") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:add')")
|
|||
public ResponseEntity<Object> create(@Validated @RequestBody PdmBdWorkorder entity){ |
|||
pdmBdWorkorderService.create(entity); |
|||
return new ResponseEntity<>(HttpStatus.CREATED); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Log("修改工单管理") |
|||
@ApiOperation("修改工单管理") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:edit')")
|
|||
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdWorkorder entity){ |
|||
pdmBdWorkorderService.update(entity); |
|||
return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
|||
} |
|||
|
|||
@Log("删除工单管理") |
|||
@ApiOperation("删除工单管理") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:del')")
|
|||
@DeleteMapping |
|||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) { |
|||
pdmBdWorkorderService.deleteAll(ids); |
|||
return new ResponseEntity<>(HttpStatus.OK); |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
package org.nl.wms.pdm.controller; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.nl.common.base.TableDataInfo; |
|||
import org.nl.common.domain.query.PageQuery; |
|||
import org.nl.common.logging.annotation.Log; |
|||
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|||
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|||
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; |
|||
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
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.Set; |
|||
|
|||
|
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "工单详情管理") |
|||
@RequestMapping("/api/pdmBdWorkorderDetail") |
|||
public class PdmBdWorkorderDetailController { |
|||
|
|||
@Autowired |
|||
private IPdmBdWorkorderService pdmBdWorkorderService; |
|||
|
|||
@GetMapping |
|||
@Log("查询工单详情管理") |
|||
@ApiOperation("查询工单详情管理") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
|
|||
public ResponseEntity<Object> query(PdmBdWorkorderQuery query, PageQuery page){ |
|||
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAllDetail(query,page)),HttpStatus.OK); |
|||
} |
|||
|
|||
@GetMapping |
|||
@Log("根据物料查询点位库存") |
|||
@ApiOperation("根据物料查询点位库存") |
|||
//@SaCheckPermission("@el.check('pdmBdWorkorder:list')")
|
|||
public ResponseEntity<Object> queryPointDetail(String PalletSN, PageQuery page){ |
|||
return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryPointDetail(PalletSN,page)),HttpStatus.OK); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package org.nl.wms.pdm.service.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("sch_base_material") |
|||
public class PdmBdWorkorderDetail implements Serializable { |
|||
|
|||
/** 工单编号 */ |
|||
private String workorder_code; |
|||
/** 实际数量 */ |
|||
private BigDecimal real_qty; |
|||
/** 订单行项目编号 **/ |
|||
private String POSNR; |
|||
/** 预留行项目编号 **/ |
|||
private String RSPOS; |
|||
/** 移动类型 **/ |
|||
private String BWART; |
|||
/** 物料编码 **/ |
|||
private String MATNR; |
|||
/** 物料名称 **/ |
|||
private String MAKTX; |
|||
/** 产品类别 **/ |
|||
private String MTYPE; |
|||
/** 产品类别描述 **/ |
|||
private String MTYTXT; |
|||
/** 数量 **/ |
|||
private String BDMNG; |
|||
/** 计量单位 **/ |
|||
private String MEINS; |
|||
/** 物料供应标识 **/ |
|||
private String BEIKZ; |
|||
/** 预留字段11 **/ |
|||
private String ZRSV11; |
|||
/** 预留字段12 **/ |
|||
private String ZRSV12; |
|||
/** 预留字段13 **/ |
|||
private String ZRSV13; |
|||
/** 预留字段14 **/ |
|||
private String ZRSV14; |
|||
/** 预留字段15 **/ |
|||
private String ZRSV15; |
|||
|
|||
} |
@ -0,0 +1,2 @@ |
|||
package org.nl.wms.pdm.service.dao;public class PointDetail { |
|||
} |
@ -0,0 +1,11 @@ |
|||
package org.nl.wms.pdm.service.dao; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class PointDetail { |
|||
private String point_code; |
|||
private String productName; |
|||
private String PalletSN; |
|||
private String qty; |
|||
} |
@ -0,0 +1,13 @@ |
|||
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; |
|||
import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; |
|||
import org.nl.wms.pdm.service.dao.PointDetail; |
|||
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; |
|||
|
|||
public interface PdmBdWorkorderDetailMapper extends BaseMapper<PdmBdWorkorderDetail> { |
|||
|
|||
IPage<PointDetail> selectPointDetail(IPage<PointDetail> pages, String productname); |
|||
} |
@ -0,0 +1,10 @@ |
|||
<?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.PdmBdWorkorderDetailMapper"> |
|||
<select id="selectPointDetail" resultType="org.nl.wms.pdm.service.dao.PointDetail"> |
|||
select p.point_code,productName,PalletSN,qty from sch_base_point p left join |
|||
(select productName,PalletSN,sum(qty) as qty from sch_base_material GROUP BY productName,PalletSN ) m |
|||
on p.vehicle_code2=m.PalletSN |
|||
where p.region_code='YL' and p.ing_task_code is not null and m.productname=#{productname} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,219 @@ |
|||
<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.productname" |
|||
clearable |
|||
size="mini" |
|||
placeholder="物料编码" |
|||
disabled="false" |
|||
@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'}" |
|||
@selection-change="crud.selectionChangeHandler" |
|||
> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="point_code" label="所在点位" width="120px" /> |
|||
<el-table-column prop="productName" label="物料编码" /> |
|||
<el-table-column prop="palletSN" label="子托盘号" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="qty" label="数量" width="100" show-overflow-tooltip /> |
|||
</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-button |
|||
type="primary" |
|||
@click="submitSelectedRows"> |
|||
原材料出库 |
|||
</el-button> |
|||
</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' |
|||
import { mount } from 'sortablejs' |
|||
|
|||
export default { |
|||
name: 'WorkOrderDetailDialog', |
|||
components: { rrOperation, pagination }, |
|||
dicts: ['is_used', 'vehicle_type'], |
|||
cruds() { |
|||
return CRUD({ title: '点位详情', url: 'api/pointDetail', optShow: {}}) |
|||
}, |
|||
mixins: [presenter(), header()], |
|||
props: { |
|||
dialogShow: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isSingle: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
productname: { |
|||
type: String, |
|||
default: '' |
|||
},workorder_code: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
tableRadio: null, |
|||
tableData: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
dialogShow: { |
|||
handler(newValue) { |
|||
this.dialogVisible = newValue |
|||
} |
|||
}, |
|||
productname(newVal) { |
|||
// 监听传递的值变化,并在变化时执行赋值操作 |
|||
this.query.productname = newVal; |
|||
this.executeQuery(); |
|||
}, |
|||
workorder_code(newVal) { |
|||
// 监听传递的值变化,并在变化时执行赋值操作 |
|||
this.workorder_code = newVal; |
|||
} |
|||
}, |
|||
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) |
|||
},executeQuery() { |
|||
this.crud.toQuery(); |
|||
},submitSelectedRows() { |
|||
const selectedRows = this.$refs.table.selection; |
|||
if (selectedRows.length === 0) { |
|||
this.$message.error('请至少选择一行数据'); |
|||
return; |
|||
} |
|||
|
|||
// 获取选中行的 point_code |
|||
const pointCodes = selectedRows.map(row => row.point_code); |
|||
|
|||
// 弹出输入回温时间和回温模式的对话框 |
|||
this.$prompt('请输入回温时间', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
inputPattern: /\d+/, |
|||
inputErrorMessage: '回温时间必须为数字' |
|||
}).then(({ value: time }) => { |
|||
this.$prompt('请输入回温模式(0-普通模式,1-快速模式)', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消' |
|||
}).then(({ value: mode }) => { |
|||
// 提交数据给后台接口 |
|||
this.$axios.post('/api/pointDetail/add', { |
|||
pointCodes, |
|||
time, |
|||
mode, |
|||
workorder_code: this.workorder_code // 使用workorder_code属性 |
|||
}).then(response => { |
|||
// 提交成功处理 |
|||
this.$message.success('提交成功!'); |
|||
// 关闭当前对话框 |
|||
this.dialogVisible = false; |
|||
}).catch(error => { |
|||
// 提交失败处理 |
|||
this.$message.error('提交失败,请重试'); |
|||
}); |
|||
}).catch(() => { |
|||
// 用户点击了取消按钮 |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消提交操作' |
|||
}); |
|||
}); |
|||
}).catch(() => { |
|||
// 用户点击了取消按钮 |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消提交操作' |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
} |
|||
</script> |
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
::v-deep .el-dialog__body { |
|||
padding-top: 0px; |
|||
} |
|||
</style> |
|||
|
|||
|
@ -0,0 +1,183 @@ |
|||
<template> |
|||
<div> |
|||
<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="工单编号" |
|||
disabled="false" |
|||
@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 prop="workorder_code" label="工单编号" width="120px" /> |
|||
<el-table-column prop="matnr" label="物料编码" /> |
|||
<el-table-column prop="maktx" label="物料名称" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="mtype" label="产品类别" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="mtytxt" label="产品类别描述" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="bdmng" label="数量" width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="meins" label="计量单位" width="100" show-overflow-tooltip /> |
|||
<!-- <el-table-column prop="real_qty" label="实际数量" width="100" show-overflow-tooltip /> --> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
type="text" |
|||
icon="el-icon-add" |
|||
@click="doOperate(scope.row)" |
|||
>原材料出库</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</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> |
|||
<PointDetailDialog :dialog-show.sync="pointDetailDialog" :workorder_code="workorder_code" :productname="productname" @tableChanged="tableChanged" /> |
|||
</div> |
|||
</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' |
|||
import PointDetailDialog from '@/views/wms/pdm/workerorder/PointDetailDialog.vue' |
|||
import { mount } from 'sortablejs' |
|||
|
|||
export default { |
|||
name: 'WorkOrderDetailDialog', |
|||
components: { PointDetailDialog,rrOperation, pagination }, |
|||
dicts: ['is_used', 'vehicle_type'], |
|||
cruds() { |
|||
return CRUD({ title: '生产工单', url: 'api/pdmBdWorkorderDetail', optShow: {}}) |
|||
}, |
|||
mixins: [presenter(), header()], |
|||
props: { |
|||
dialogShow: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isSingle: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
message: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
tableRadio: null, |
|||
tableData: [], |
|||
workorder_code:null, |
|||
pointDetailDialog:false, |
|||
productname: null, |
|||
workorder_code: null |
|||
} |
|||
}, |
|||
watch: { |
|||
dialogShow: { |
|||
handler(newValue) { |
|||
this.dialogVisible = newValue |
|||
} |
|||
}, |
|||
message(newVal) { |
|||
// 监听传递的值变化,并在变化时执行赋值操作 |
|||
this.query.workorder_code = newVal; |
|||
this.executeQuery(); |
|||
} |
|||
}, |
|||
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) |
|||
},executeQuery() { |
|||
this.crud.toQuery(); |
|||
}, |
|||
doOperate(row) { |
|||
this.productname=row.matnr |
|||
this.workorder_code=row.workorder_code |
|||
this.pointDetailDialog = true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style rel="stylesheet/scss" lang="scss" scoped> |
|||
::v-deep .el-dialog__body { |
|||
padding-top: 0px; |
|||
} |
|||
</style> |
|||
|
|||
|
Loading…
Reference in new issue