add: 添加区域管理
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
package org.nl.wms.sch.region.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.sch.region.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "区域管理管理")
|
||||||
|
@RequestMapping("/api/schBaseRegion")
|
||||||
|
public class SchBaseRegionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseRegionService schBaseRegionService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询区域管理")
|
||||||
|
@ApiOperation("查询区域管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBaseRegion:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(schBaseRegionService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增区域管理")
|
||||||
|
@ApiOperation("新增区域管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBaseRegion:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody SchBaseRegion entity){
|
||||||
|
schBaseRegionService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改区域管理")
|
||||||
|
@ApiOperation("修改区域管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBaseRegion:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody SchBaseRegion entity){
|
||||||
|
schBaseRegionService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除区域管理")
|
||||||
|
@ApiOperation("删除区域管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBaseRegion:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
schBaseRegionService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package org.nl.wms.sch.region.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务接口
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public interface ISchBaseRegionService extends IService<SchBaseRegion> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<SchBaseRegion>
|
||||||
|
*/
|
||||||
|
IPage<SchBaseRegion> queryAll(Map whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void create(SchBaseRegion entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(SchBaseRegion entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package org.nl.wms.sch.region.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("sch_base_region")
|
||||||
|
public class SchBaseRegion implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "region_code", type = IdType.NONE)
|
||||||
|
@ApiModelProperty(value = "区域编码")
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域名称")
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点位类型说明")
|
||||||
|
private String point_type_explain;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点位状态说明")
|
||||||
|
private String point_status_explain;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否创建工单")
|
||||||
|
private Boolean is_has_workder;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车间编码")
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.sch.region.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public interface SchBaseRegionMapper extends BaseMapper<SchBaseRegion> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.sch.region.service.dao.mapper.SchBaseRegionMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package org.nl.wms.sch.region.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class SchBaseRegionDto implements Serializable {
|
||||||
|
|
||||||
|
/** 区域编码 */
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
/** 区域名称 */
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
/** 点位类型说明 */
|
||||||
|
private String point_type_explain;
|
||||||
|
|
||||||
|
/** 点位状态说明 */
|
||||||
|
private String point_status_explain;
|
||||||
|
|
||||||
|
/** 是否创建工单 */
|
||||||
|
private String is_has_workder;
|
||||||
|
|
||||||
|
/** 车间编码 */
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private Long create_id;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private Long update_id;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
/** 修改时间 */
|
||||||
|
private String update_time;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.sch.region.service.dto;
|
||||||
|
|
||||||
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public class SchBaseRegionQuery extends BaseQuery<SchBaseRegion> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package org.nl.wms.sch.region.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.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;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.sch.region.service.ISchBaseRegionService;
|
||||||
|
import org.nl.wms.sch.region.service.dao.mapper.SchBaseRegionMapper;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @description 服务实现
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, SchBaseRegion> implements ISchBaseRegionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBaseRegionMapper schBaseRegionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<SchBaseRegion> queryAll(Map whereJson, PageQuery page) {
|
||||||
|
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
||||||
|
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||||
|
Boolean is_has_workder = ObjectUtil.isNotEmpty(whereJson.get("is_has_workder")) ? Boolean.valueOf(whereJson.get("is_has_workder").toString()) : null;
|
||||||
|
LambdaQueryWrapper<SchBaseRegion> lam = new LambdaQueryWrapper<>();
|
||||||
|
lam.eq(ObjectUtil.isNotEmpty(workshop_code), SchBaseRegion::getWorkshop_code, workshop_code)
|
||||||
|
.eq(ObjectUtil.isNotEmpty(is_has_workder), SchBaseRegion::getIs_has_workder, is_has_workder)
|
||||||
|
.like(ObjectUtil.isNotEmpty(blurry), SchBaseRegion::getRegion_code, blurry)
|
||||||
|
.or(ObjectUtil.isNotEmpty(blurry), la -> la.like(SchBaseRegion::getRegion_name, blurry));
|
||||||
|
IPage<SchBaseRegion> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
schBaseRegionMapper.selectPage(pages, lam);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(SchBaseRegion entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
entity.setCreate_id(currentUserId);
|
||||||
|
entity.setCreate_name(nickName);
|
||||||
|
entity.setCreate_time(now);
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
schBaseRegionMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(SchBaseRegion entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
|
||||||
|
schBaseRegionMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
schBaseRegionMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
210
nladmin-ui/src/views/wms/sch/region/index.vue
Normal file
210
nladmin-ui/src/views/wms/sch/region/index.vue
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
<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="90px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="query.workshop_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="所属车间"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.workshop_name"
|
||||||
|
:value="item.workshop_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<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_has_workder"
|
||||||
|
active-color="#409EFF"
|
||||||
|
inactive-color="#C0CCDA"
|
||||||
|
@change="hand"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, 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="520px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workshop_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.workshop_name"
|
||||||
|
:value="item.workshop_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域编码">
|
||||||
|
<el-input v-model="form.region_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="区域名称">
|
||||||
|
<el-input v-model="form.region_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位类型说明">
|
||||||
|
<el-input v-model="form.point_type_explain" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态说明">
|
||||||
|
<el-input v-model="form.point_status_explain" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否创建工单">
|
||||||
|
<el-select
|
||||||
|
v-model="form.is_has_workder"
|
||||||
|
size="mini"
|
||||||
|
placeholder="是否创建工单"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.TrueOrFalse"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</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 type="selection" width="55" />
|
||||||
|
<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="point_type_explain" label="点位类型说明" :min-width="flexWidth('point_type_explain',crud.data,'点位类型说明')" />
|
||||||
|
<el-table-column prop="point_status_explain" label="点位状态说明" :min-width="flexWidth('point_status_explain',crud.data,'点位状态说明')" />
|
||||||
|
<el-table-column prop="is_has_workder" label="是否创建工单" :min-width="flexWidth('is_has_workder',crud.data,'是否创建工单')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_has_workder?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||||
|
<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="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
|
<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"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudSchBaseRegion from './schBaseRegion'
|
||||||
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
|
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'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
region_code: null,
|
||||||
|
region_name: null,
|
||||||
|
point_type_explain: null,
|
||||||
|
point_status_explain: null,
|
||||||
|
is_has_workder: 'true',
|
||||||
|
workshop_code: null,
|
||||||
|
remark: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'SchBaseRegion',
|
||||||
|
dicts:['TrueOrFalse'],
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '区域管理',
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
idField: 'region_code',
|
||||||
|
sort: 'region_code,desc',
|
||||||
|
crudMethod: { ...crudSchBaseRegion },
|
||||||
|
query: {
|
||||||
|
is_has_workder: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getWorkShopList()
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
workShopList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeToCU]() {
|
||||||
|
this.form.is_has_workder = this.form.is_has_workder.toString()
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
getWorkShopList() { // 获取车间列表
|
||||||
|
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||||
|
this.workShopList = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
27
nladmin-ui/src/views/wms/sch/region/schBaseRegion.js
Normal file
27
nladmin-ui/src/views/wms/sch/region/schBaseRegion.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
Reference in New Issue
Block a user