新增工单页面批量选择工单物料进行出库
This commit is contained in:
@@ -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>
|
||||
@@ -3,7 +3,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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -13,6 +15,9 @@ import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
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.dao.PointDetail;
|
||||
import org.nl.wms.pdm.service.dao.mapper.PdmBdWorkorderDetailMapper;
|
||||
import org.nl.wms.pdm.service.dao.mapper.PdmBdWorkorderMapper;
|
||||
import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -32,6 +37,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
||||
|
||||
@Autowired
|
||||
private PdmBdWorkorderMapper pdmBdWorkorderMapper;
|
||||
@Autowired
|
||||
private PdmBdWorkorderDetailMapper pdmBdWorkorderDetailMapper;
|
||||
|
||||
@Override
|
||||
public IPage<PdmBdWorkorder> queryAll(PdmBdWorkorderQuery query, PageQuery page){
|
||||
@@ -82,4 +89,23 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
||||
pdmBdWorkorderMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDetail(PdmBdWorkorderDetail entity) {
|
||||
pdmBdWorkorderDetailMapper.insert(entity);
|
||||
}
|
||||
@Override
|
||||
public IPage<PdmBdWorkorderDetail> queryAllDetail(PdmBdWorkorderQuery query, PageQuery page){
|
||||
IPage<PdmBdWorkorderDetail> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
LambdaQueryWrapper<PdmBdWorkorderDetail> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PdmBdWorkorderDetail::getWorkorder_code,query.getWorkorder_code());
|
||||
pages = pdmBdWorkorderDetailMapper.selectPage(pages,wrapper);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<PointDetail> queryPointDetail(String productname, PageQuery page){
|
||||
IPage<PointDetail> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = pdmBdWorkorderDetailMapper.selectPointDetail(pages, productname);
|
||||
return pages;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class KJRKTask extends AbstractTask {
|
||||
vehiclematerialgroupService.save(groupEntity);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setGroup_id(groupEntity.getGroup_id());
|
||||
taskObj.setGroup_id(ObjectUtil.isNotEmpty(groupEntity)?groupEntity.getGroup_id():null);
|
||||
taskObj.setRemark("任务完成");
|
||||
try {
|
||||
//todo 入库成功后上报mes
|
||||
|
||||
@@ -189,7 +189,7 @@ public class POINTTask extends AbstractTask {
|
||||
pointService.updateById(startPointObj);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setGroup_id(one.getGroup_id());
|
||||
taskObj.setGroup_id(ObjectUtil.isNotEmpty(one)?one.getGroup_id():null);
|
||||
taskObj.setRemark("任务完成");
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) { // 取消
|
||||
|
||||
@@ -197,7 +197,7 @@ public class SSXBKJTask extends AbstractTask {
|
||||
vehiclematerialgroupService.save(groupEntity);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setGroup_id(groupEntity.getGroup_id());
|
||||
taskObj.setGroup_id(ObjectUtil.isNotEmpty(groupEntity)?groupEntity.getGroup_id():null);
|
||||
taskObj.setRemark("任务完成");
|
||||
try {
|
||||
//todo 入库成功后上报mes
|
||||
|
||||
@@ -114,10 +114,10 @@ public class YCLCKTask extends AbstractTask {
|
||||
taskService.update(task);
|
||||
|
||||
//发起任务时先把点位占用,防止发起重复任务
|
||||
// point.setIng_task_code(task.getTask_code());
|
||||
point.setIng_task_code(task.getTask_code());
|
||||
// point.setVehicle_qty(point.getVehicle_qty() - 1);
|
||||
// point.setVehicle_type(materialType);
|
||||
// pointService.update(point);
|
||||
pointService.update(point);
|
||||
|
||||
//下发
|
||||
this.renotifyAcs(task);
|
||||
@@ -224,7 +224,7 @@ public class YCLCKTask extends AbstractTask {
|
||||
pointService.updateById(startPointObj);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setGroup_id(one.getGroup_id());
|
||||
taskObj.setGroup_id(ObjectUtil.isNotEmpty(one)?one.getGroup_id():null);
|
||||
taskObj.setRemark("任务完成");
|
||||
try {
|
||||
//todo 待确认具体传值
|
||||
|
||||
@@ -201,7 +201,7 @@ public class YCLRKTask extends AbstractTask {
|
||||
vehiclematerialgroupService.save(groupEntity);
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setGroup_id(groupEntity.getGroup_id());
|
||||
taskObj.setGroup_id(ObjectUtil.isNotEmpty(groupEntity)?groupEntity.getGroup_id():null);
|
||||
taskObj.setRemark("任务完成");
|
||||
try {
|
||||
//todo 待确认具体传值
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -263,17 +263,17 @@
|
||||
<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="region_code" label="区域编码" :min-width="flexWidth('region_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="material_code" label="物料编码" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
|
||||
<el-table-column prop="point_name" label="设备名称" :min-width="flexWidth('point_name',crud.data,'设备名称')" /> -->
|
||||
<!-- <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
|
||||
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_name',crud.data,'物料标识')" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">
|
||||
<template slot-scope="scope">
|
||||
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_name',crud.data,'物料标识')" /> -->
|
||||
<!-- <el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)"> -->
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="planproducestart_date"
|
||||
label="计划开始时间"
|
||||
@@ -294,21 +294,21 @@
|
||||
label="实际结束时间"
|
||||
:min-width="flexWidth('realproduceend_date',crud.data,'实际结束时间')"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="standing_time"
|
||||
label="回温时间(小时)"
|
||||
:min-width="flexWidth('standing_time',crud.data,'回温时间(小时)')"
|
||||
/>
|
||||
<el-table-column prop="is_needmove" label="是否自动搬运" :min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')">
|
||||
/> -->
|
||||
<!-- <el-table-column prop="is_needmove" label="是否自动搬运" :min-width="flexWidth('is_needmove',crud.data,'是否自动搬运')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_needmove ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_urgent ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="workorder_type" label="工单类型" :min-width="flexWidth('workorder_type',crud.data,'工单类型')" />-->
|
||||
<!--<el-table-column
|
||||
prop="passback_status"
|
||||
@@ -322,10 +322,12 @@
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-add"
|
||||
:disabled="scope.row.workorder_status!=='1'"
|
||||
@click="doOperate(scope.row)"
|
||||
>原材料出库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -333,6 +335,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />
|
||||
<WorkOrderDetailDialog :dialog-show.sync="workOrderDetailDialog" :message="message" @tableChanged="tableChanged" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -347,6 +350,7 @@ 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 WorkOrderDetailDialog from '@/views/wms/pdm/workerorder/WorkOrderDetailDialog.vue'
|
||||
import item from '@/layout/components/Sidebar/Item.vue'
|
||||
|
||||
const defaultForm = {
|
||||
@@ -380,7 +384,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'PdmBdWorkorder',
|
||||
dicts: ['vehicle_type', 'pdm_workorder_status'],
|
||||
components: { MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { WorkOrderDetailDialog,MaterialDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -425,7 +429,9 @@ export default {
|
||||
regionList: [],
|
||||
pointList: [],
|
||||
regionCodeParam: null,
|
||||
materialDialog: false
|
||||
materialDialog: false,
|
||||
workOrderDetailDialog: false,
|
||||
message: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -492,6 +498,10 @@ export default {
|
||||
this.crud.query.more_order_status = value.toString()
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
doOperate(row) {
|
||||
this.message=row.workorder_code
|
||||
this.workOrderDetailDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user