add:产线叫料单
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.pdm_manage.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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_manage.service.IPdmBomCallMaterialService;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
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.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/bomCallMaterial")
|
||||
@Slf4j
|
||||
public class BomCallMaterialController {
|
||||
|
||||
@Autowired
|
||||
private IPdmBomCallMaterialService iPdmBomCallMaterialService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iPdmBomCallMaterialService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增叫料单")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody PdmBomCallMaterial dto) {
|
||||
iPdmBomCallMaterialService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改叫料单")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody PdmBomCallMaterial dto) {
|
||||
iPdmBomCallMaterialService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除叫料单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iPdmBomCallMaterialService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.nl.wms.pdm_manage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.MapOf;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 生产枚举类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BomEnum {
|
||||
|
||||
// 叫料单状态
|
||||
CALL_BOM_STATUS(MapOf.of("生成", "1", "叫料中", "2", "叫料完成", "3"
|
||||
, "退料中", "4", "完成", "5"
|
||||
)),
|
||||
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().get(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String check(String code) {
|
||||
for (Map.Entry<String, String> entry : this.getCode().entrySet())
|
||||
if (entry.getValue().equals("code")) {
|
||||
return entry.getValue();
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.nl.wms.pdm_manage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料单 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
public interface IPdmBomCallMaterialService extends IService<PdmBomCallMaterial> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param whereJson : {查询参数}
|
||||
* @param page : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<PdmBomCallMaterialDto> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增叫料单
|
||||
*
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(PdmBomCallMaterial dto);
|
||||
|
||||
/**
|
||||
* 修改叫料单
|
||||
*
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void update(PdmBomCallMaterial dto);
|
||||
|
||||
/**
|
||||
* 删除叫料单
|
||||
* @param ids id集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.nl.wms.pdm_manage.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料单
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pdm_bom_callmaterial")
|
||||
public class PdmBomCallMaterial implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工单标识
|
||||
*/
|
||||
@TableId(value = "bom_id")
|
||||
private String bom_id;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
/**
|
||||
* 叫料重量
|
||||
*/
|
||||
private BigDecimal call_qty;
|
||||
|
||||
/**
|
||||
* 实际重量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private String bom_status;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.wms.pdm_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料单 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
public interface PdmBomCallMaterialMapper extends BaseMapper<PdmBomCallMaterial> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<PdmBomCallMaterialDto>
|
||||
*/
|
||||
IPage<PdmBomCallMaterialDto> queryAllByPage(Page<PdmBomCallMaterialDto> page, @Param("param") Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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_manage.service.dao.mapper.PdmBomCallMaterialMapper">
|
||||
|
||||
<select id="queryAllByPage" resultType="org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto">
|
||||
SELECT
|
||||
bom.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
pdm_bom_callmaterial bom
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = bom.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
(mater.material_code LIKE #{param.material_code} or
|
||||
mater.material_name LIKE #{param.material_code} )
|
||||
</if>
|
||||
|
||||
<if test="param.device_code != null and param.device_code != ''">
|
||||
AND
|
||||
bom.device_code LIKE #{param.device_code}
|
||||
</if>
|
||||
|
||||
<if test="param.bom_status != null and param.bom_status != ''">
|
||||
AND
|
||||
bom.bom_status = #{param.bom_status}
|
||||
</if>
|
||||
|
||||
|
||||
</where>
|
||||
ORDER BY bom.create_time Desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.pdm_manage.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料单dto
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
public class PdmBomCallMaterialDto extends PdmBomCallMaterial {
|
||||
|
||||
/**
|
||||
* 物料标批次
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.nl.wms.pdm_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pdm_manage.enums.BomEnum;
|
||||
import org.nl.wms.pdm_manage.service.IPdmBomCallMaterialService;
|
||||
import org.nl.wms.pdm_manage.service.dao.PdmBomCallMaterial;
|
||||
import org.nl.wms.pdm_manage.service.dao.mapper.PdmBomCallMaterialMapper;
|
||||
import org.nl.wms.pdm_manage.service.dto.PdmBomCallMaterialDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产线叫料单 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-08-14
|
||||
*/
|
||||
@Service
|
||||
public class PdmBomCallMaterialServiceImpl extends ServiceImpl<PdmBomCallMaterialMapper, PdmBomCallMaterial> implements IPdmBomCallMaterialService {
|
||||
|
||||
@Override
|
||||
public IPage<PdmBomCallMaterialDto> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void create(PdmBomCallMaterial dto) {
|
||||
dto.setBom_id(IdUtil.getStringId());
|
||||
dto.setBom_status(BomEnum.CALL_BOM_STATUS.code("生成"));
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(PdmBomCallMaterial dto) {
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
# 北安新生WMS系统
|
||||
# 徐工汉云WMS系统
|
||||
|
||||
/api/sysMenu/build?systemType=1
|
||||
@@ -2,7 +2,7 @@ export default {
|
||||
'lang': 'zh',
|
||||
// 平台
|
||||
'platform': {
|
||||
'title': '北安新生WMS系统',
|
||||
'title': '徐工汉云WMS系统',
|
||||
'tip1': '用户名不能为空',
|
||||
'tip2': '密码不能为空',
|
||||
'tip3': '验证码不能为空'
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '北安新生WMS系统',
|
||||
title: '徐工汉云WMS系统',
|
||||
logo: Logo,
|
||||
title_param: 'platform'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterial',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
233
wms/nladmin-ui/src/views/wms/pdm/callmaterial/index.vue
Normal file
233
wms/nladmin-ui/src/views/wms/pdm/callmaterial/index.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<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="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机台编码">
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="机台编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单状态">
|
||||
<el-select
|
||||
v-model="query.bom_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.BOM_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="1100px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @change="queryMater" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="机台编码" prop="device_code">
|
||||
<el-input v-model="form.device_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="叫料重量" prop="call_qty">
|
||||
<el-input-number v-model="form.call_qty" :precision="2" :controls="false" :min="1" style="width: 200px" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="bom_status" label="工单状态" :formatter="formattStatus" :min-width="flexWidth('bom_status',crud.data,'工单状态')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="device_code" label="机台编码" :min-width="flexWidth('device_code',crud.data,'机台编码')" />
|
||||
<el-table-column prop="call_qty" label="叫料重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="real_qty" label="实际重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="create_name" label="叫料人" :min-width="flexWidth('create_name',crud.data,'叫料人')" />
|
||||
<el-table-column prop="create_time" label="叫料时间" :min-width="flexWidth('create_time',crud.data,'叫料时间')" />
|
||||
<el-table-column prop="confirm_time" label="结束时间" :min-width="flexWidth('confirm_time',crud.data,'结束时间')" />
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:disabled-dle="scope.row.bom_status !== '1'"
|
||||
:disabled-edit="scope.row.bom_status !== '1'"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudCallMaterial from '@/views/wms/pdm/callmaterial/callmaterial'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudGroup from '@/views/wms/basedata/group/group'
|
||||
|
||||
const defaultForm = {
|
||||
material_spec: null,
|
||||
material_name: null,
|
||||
material_code: null,
|
||||
material_id: null,
|
||||
bom_id: null,
|
||||
device_code: null,
|
||||
call_qty: null,
|
||||
real_qty: null,
|
||||
bom_status: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
confirm_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'CallMaterial',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['BOM_STATUS'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '产线叫料',
|
||||
url: 'api/bomCallMaterial',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'bom_id',
|
||||
sort: 'bom_id,desc',
|
||||
crudMethod: { ...crudCallMaterial }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
rules: {
|
||||
material_code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
device_code: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
call_qty: [
|
||||
{ required: true, message: '叫料重量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
queryMater(value) {
|
||||
crudGroup.queryMater({ 'material_code': value }).then(row => {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
}).catch(() => {
|
||||
this.form.material_spec = ''
|
||||
this.form.material_name = ''
|
||||
this.form.material_code = ''
|
||||
this.form.material_id = ''
|
||||
})
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.BOM_STATUS[row.bom_status]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user