养生A区

This commit is contained in:
lyd
2022-10-18 14:16:58 +08:00
parent 2caca17527
commit 3a6a66677e
7 changed files with 970 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
package org.nl.wms.sch.ysa.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import org.nl.wms.sch.ysa.service.YsapointService;
import org.nl.wms.sch.ysa.service.dto.YsapointDto;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.nl.modules.logging.annotation.Log;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/**
* @author lyd
* @date 2022-10-17
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "养生A区管理")
@RequestMapping("/api/ysapoint")
@Slf4j
public class YsapointController {
private final YsapointService ysapointService;
@GetMapping
@Log("查询养生A区")
@ApiOperation("查询养生A区")
//@SaCheckPermission("@el.check('ysapoint:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(ysapointService.queryAll(whereJson,page),HttpStatus.OK);
}
@PostMapping("/add")
@Log("新增养生A区")
@ApiOperation("新增养生A区")
@SaIgnore
//@SaCheckPermission("@el.check('ysapoint:add')")
public ResponseEntity<Object> create(){
ysapointService.create();
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改养生A区")
@ApiOperation("修改养生A区")
//@SaCheckPermission("@el.check('ysapoint:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody YsapointDto dto){
ysapointService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除养生A区")
@ApiOperation("删除养生A区")
//@SaCheckPermission("@el.check('ysapoint:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
ysapointService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("获取快列排")
@GetMapping("/blockRowCol/tree")
@ApiOperation("获取快列排")
public ResponseEntity<Object> arrangementTree() {
return new ResponseEntity<>(ysapointService.getArrangementTree(), HttpStatus.OK);
}
@Log("启动")
@PostMapping("/changeUsedOn")
@ApiOperation("启动")
public ResponseEntity<Object> changeUsedOn(@RequestBody JSONArray jsonArray) {
ysapointService.changeUsed(jsonArray, 1);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("禁用")
@PostMapping("/changeUsedOff")
@ApiOperation("禁用")
public ResponseEntity<Object> changeUsedOff(@RequestBody JSONArray jsonArray) {
ysapointService.changeUsed(jsonArray, 0);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

View File

@@ -0,0 +1,79 @@
package org.nl.wms.sch.ysa.service;
import com.alibaba.fastjson.JSONArray;
import org.nl.wms.sch.ysa.service.dto.YsapointDto;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @description 服务接口
* @author lyd
* @date 2022-10-17
**/
public interface YsapointService {
/**
* 查询数据分页
* @param whereJson 条件
* @param page 分页参数
* @return Map<String,Object>
*/
Map<String,Object> queryAll(Map whereJson, Pageable page);
/**
* 查询所有数据不分页
* @param whereJson 条件参数
* @return List<YsapointDto>
*/
List<YsapointDto> queryAll(Map whereJson);
/**
* 根据ID查询
* @param point_id ID
* @return Ysapoint
*/
YsapointDto findById(Long point_id);
/**
* 根据编码查询
* @param code code
* @return Ysapoint
*/
YsapointDto findByCode(String code);
/**
* 创建
* @param dto /
*/
void create();
/**
* 编辑
* @param dto /
*/
void update(YsapointDto dto);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Long[] ids);
/**
* 获取块列排树
* @return
*/
JSONArray getArrangementTree();
/**
* 改变启用状态
* @param jsonArray
* @return
*/
void changeUsed(JSONArray jsonArray, Integer flag);
}

View File

@@ -0,0 +1,90 @@
package org.nl.wms.sch.ysa.service.dto;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
/**
* @description /
* @author lyd
* @date 2022-10-17
**/
@Data
public class YsapointDto implements Serializable {
/** 点位标识 */
/** 防止精度丢失 */
@JsonSerialize(using= ToStringSerializer.class)
private Long point_id;
/** 点位编码 */
private String point_code;
/** 批次 */
private String pcsn;
/** 物料标识 */
private Long material_id;
/** 库存数 */
private BigDecimal ivt_qty;
/** 计量单位标识 */
private Long qty_unit_id;
/** 入库时间 */
private String instorage_time;
/** 外部编码 */
private String ext_code;
/** 点位状态 */
private String point_status;
/** 托盘类型 */
private String vehicle_type;
/** 静置时间(分钟) */
private BigDecimal standing_time;
/** 块 */
private BigDecimal block_num;
/** 排 */
private BigDecimal row_num;
/** 列 */
private BigDecimal col_num;
/** 层 */
private BigDecimal layer_num;
/** 备注 */
private String remark;
/** 是否启用 */
private String is_used;
/** 是否锁定 */
private String is_lock;
/** 创建人 */
private Long create_id;
/** 创建人 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private Long update_optid;
/** 修改人 */
private String update_optname;
/** 修改时间 */
private String update_time;
}

View File

@@ -0,0 +1,239 @@
package org.nl.wms.sch.ysa.service.impl;
import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.wms.sch.ysa.service.YsapointService;
import org.nl.wms.sch.ysa.service.dto.YsapointDto;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import lombok.extern.slf4j.Slf4j;
import cn.hutool.core.util.ObjectUtil;
/**
* @description 服务实现
* @author lyd
* @date 2022-10-17
**/
@Service
@RequiredArgsConstructor
@Slf4j
public class YsapointServiceImpl implements YsapointService {
@Override
public Map<String,Object> queryAll(Map whereJson, Pageable page){
JSONObject map = new JSONObject();
map.put("flag", "1");
if (!ObjectUtil.isNull(whereJson.get("point_code"))) {
map.put("point_code", "%" + whereJson.get("point_code") + "%");
}
if (!ObjectUtil.isNull(whereJson.get("locationsOptions"))) {
String locationsOptions = whereJson.get("locationsOptions").toString();
String[] options = locationsOptions.split("/");
map.put("block_num", options[0]);
map.put("row_num", options[1]);
map.put("col_num", options[2]);
}
map.put("is_lock", whereJson.get("is_lock"));
map.put("is_used", whereJson.get("is_used"));
map.put("point_status", whereJson.get("point_status"));
map.put("vehicle_type", whereJson.get("vehicle_type"));
map.put("begin_time", whereJson.get("begin_time"));
map.put("end_time", whereJson.get("end_time"));
JSONObject json = WQL.getWO("SCH_BASE_YSAPOINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc");
return json;
}
@Override
public List<YsapointDto> queryAll(Map whereJson){
WQLObject wo = WQLObject.getWQLObject("sch_base_ysapoint");
JSONArray arr = wo.query().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(YsapointDto.class);
return null;
}
@Override
public YsapointDto findById(Long point_id) {
WQLObject wo = WQLObject.getWQLObject("sch_base_ysapoint");
JSONObject json = wo.query("point_id = '" + point_id + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)){
return json.toJavaObject( YsapointDto.class);
}
return null;
}
@Override
public YsapointDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("sch_base_ysapoint");
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)){
return json.toJavaObject( YsapointDto.class);
}
return null;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create() {
for (int i = 1; i <= 8; i++) {
for (int j = 1; j <= 13; j++) {
String row = "";
if ( j == 13 && ( i == 7 || i == 8 ) ) break;
if ( j < 10) row = "0" + j;
else row = "" + j;
for ( int k = 1; k <= 13; k++ ) {
String col = "";
if ( i < 7 && k > 9) break;
if ( k < 10 ) col = "-" + "0" + k + "-" + "01";
else col = "-" + k + "-" + "01";
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject ysa = new JSONObject();
ysa.put("point_id", IdUtil.getSnowflake(1,1).nextId());
ysa.put("point_code", "2" + i + row + col);
ysa.put("block_num", i);
ysa.put("row_num", j);
ysa.put("col_num", k);
ysa.put("layer_num", 1);
ysa.put("is_used", 1);
ysa.put("is_lock", 0);
ysa.put("standing_time", 0);
ysa.put("create_id", currentUserId);
ysa.put("create_name", nickName);
ysa.put("create_time", now);
ysa.put("update_optid", currentUserId);
ysa.put("update_optname", nickName);
ysa.put("update_time", now);
WQLObject wo = WQLObject.getWQLObject("sch_base_YsaPoint");
wo.insert(ysa);
}
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(YsapointDto dto) {
YsapointDto entity = this.findById(dto.getPoint_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
dto.setUpdate_time(now);
dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName);
WQLObject wo = WQLObject.getWQLObject("sch_base_ysapoint");
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(Long[] ids) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
WQLObject wo = WQLObject.getWQLObject("sch_base_ysapoint");
for (Long point_id: ids) {
JSONObject param = new JSONObject();
param.put("point_id", String.valueOf(point_id));
param.put("is_delete", "1");
param.put("update_optid", currentUserId);
param.put("update_optname", nickName);
param.put("update_time", now);
wo.update(param);
}
}
/**
* 获取块列排树
*
* @return
*/
@Override
public JSONArray getArrangementTree() {
/**
* [{
* label:块
* value:
* children:[{
* label:排
* value
* children:[{
* label:列
* value
* children:[{
*
* }]
* }]
* }]
* }]
*/
JSONArray result = new JSONArray();
// 获取所有的块
for (int i = 1; i <= 8; i++) {
JSONObject block = new JSONObject();
block.put("label", i);
block.put("value", i);
JSONArray rows = new JSONArray();
for (int j = 1; j <= 13; j++) {
if ( j == 13 && ( i == 7 || i == 8 ) ) break;
JSONObject row = new JSONObject();
row.put("label", j);
row.put("value", j);
JSONArray cols = new JSONArray();
for (int k = 1; k <= 13; k++) {
if ( i < 7 && k > 9) break;
JSONObject col = new JSONObject();
col.put("label", k);
col.put("value", k);
cols.add(col);
}
row.put("children", cols);
rows.add(row);
}
block.put("children", rows);
result.add(block);
}
return result;
}
/**
* 改变启用状态
*
* @param jsonArray
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void changeUsed(JSONArray jsonArray, Integer flag) {
WQLObject wo = WQLObject.getWQLObject("sch_base_YsaPoint");
for ( int i = 0; i < jsonArray.size(); i++ ) {
JSONObject object = jsonArray.getJSONObject(i);
if (flag == 1) object.put("is_used", 1);
else object.put("is_used", 0);
wo.update(object);
}
}
}

View File

@@ -0,0 +1,90 @@
[交易说明]
交易名: 养生A区
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.point_code TYPEAS s_string
输入.block_num TYPEAS s_string
输入.row_num TYPEAS s_string
输入.col_num TYPEAS s_string
输入.is_lock TYPEAS s_string
输入.is_used TYPEAS s_string
输入.point_status TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.begin_time TYPEAS s_string
输入.end_time TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
PAGEQUERY
SELECT
YsaPoint.*
FROM
sch_base_YsaPoint YsaPoint
WHERE
1 = 1
OPTION 输入.point_code <> ""
point_code LIKE 输入.point_code
ENDOPTION
OPTION 输入.point_status <> ""
point_status = 输入.point_status
ENDOPTION
OPTION 输入.vehicle_type <> ""
vehicle_type = 输入.vehicle_type
ENDOPTION
OPTION 输入.block_num <> ""
block_num = 输入.block_num
ENDOPTION
OPTION 输入.row_num <> ""
row_num = 输入.row_num
ENDOPTION
OPTION 输入.col_num <> ""
col_num = 输入.col_num
ENDOPTION
OPTION 输入.is_lock <> ""
is_lock = 输入.is_lock
ENDOPTION
OPTION 输入.is_used <> ""
is_used = 输入.is_used
ENDOPTION
OPTION 输入.begin_time <> ""
instorage_time >= 输入.begin_time
ENDOPTION
OPTION 输入.end_time <> ""
instorage_time <= 输入.end_time
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -0,0 +1,331 @@
<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-input
v-model="query.point_code"
clearable
size="mini"
style="width: 185px;"
placeholder="点位编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="块-排-列">
<el-cascader
clearable
v-model="locations"
:options="locationsOptions"
placeholder="请选择标签"
@change="hand"
/>
</el-form-item>
<el-form-item label="点位状态">
<el-select
v-model="query.point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 185px;"
@change="hand"
>
<el-option
v-for="item in dict.sch_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="载具类型">
<el-select
v-model="query.vehicle_type"
clearable
filterable
size="mini"
class="filter-item"
style="width: 185px;"
@change="hand"
>
<el-option
v-for="item in dict.vehicle_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="入库时间">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="是否锁定">
<el-switch
v-model="query.is_lock"
active-value="1"
inactive-value="0"
active-color="#409EFF"
inactive-color="#C0CCDA"
@change="hand"
/>
</el-form-item>
<el-form-item label="是否启用">
<el-switch
v-model="query.is_used"
active-value="0"
inactive-value="1"
active-color="#C0CCDA"
inactive-color="#409EFF"
@change="hand"
/>
</el-form-item>
<rrOperation :crud="crud" />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" >
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-circle-check"
slot="right"
:disabled="crud.selections.length === 0"
@click="changeEnableOn(crud.selections)"
>
启用
</el-button>
<el-button
class="filter-item"
size="mini"
type="danger"
icon="el-icon-circle-close"
slot="right"
:disabled="crud.selections.length === 0"
@click="changeEnableOff(crud.selections)">
禁用
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
<el-form-item label="点位状态">
<el-select
v-model="form.point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 370px;"
>
<el-option
v-for="item in dict.sch_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="托盘类型">
<el-select
v-model="form.vehicle_type"
clearable
filterable
size="mini"
class="filter-item"
style="width: 370px;"
>
<el-option
v-for="item in dict.vehicle_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="静置时间(min)" prop="standing_time">
<el-input v-model="form.standing_time" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否启用" prop="is_used">
<el-switch v-model="form.is_used" active-value="1" inactive-value="0"/>
</el-form-item>
<el-form-item label="是否锁定" prop="is_lock">
<el-switch v-model="form.is_lock" active-value="1" inactive-value="0"/>
</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="point_code" label="点位编码" min-width="100" show-overflow-tooltip/>
<el-table-column prop="pcsn" label="批次" />
<el-table-column prop="ivt_qty" label="库存数" />
<el-table-column prop="instorage_time" label="入库时间" />
<el-table-column prop="ext_code" label="外部编码" />
<el-table-column prop="point_status" label="点位状态" >
<template slot-scope="scope">
{{ dict.label.sch_point_status[scope.row.point_status] }}
</template>
</el-table-column>
<el-table-column prop="vehicle_type" label="托盘类型" min-width="100">
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="standing_time" label="静置时间(min)" min-width="120"/>
<el-table-column prop="block_num" label="" />
<el-table-column prop="row_num" label="" />
<el-table-column prop="col_num" label="" />
<el-table-column prop="layer_num" label="" />
<el-table-column prop="remark" label="备注" />
<el-table-column prop="is_used" label="是否启用" >
<template slot-scope="scope">
{{ scope.row.is_used=='1' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="is_lock" label="是否锁定" >
<template slot-scope="scope">
{{ scope.row.is_lock=='1' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:is-visiable-del="false"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudYsapoint from './ysapoint'
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'
const defaultForm = { point_id: null, point_code: null, pcsn: null, material_id: null, ivt_qty: null, qty_unit_id: null, instorage_time: null, ext_code: null, point_status: null, vehicle_type: null, standing_time: null, block_num: null, row_num: null, col_num: null, layer_num: null, remark: null, is_used: null, is_lock: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
export default {
name: 'Ysapoint',
components: { pagination, crudOperation, rrOperation, udOperation },
dicts: ['sch_point_status', 'vehicle_type', 'is_used'],
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '养生A区',
url: 'api/ysapoint',
idField: 'point_id',
sort: 'point_id,desc',
crudMethod: { ...crudYsapoint },
optShow: {
add: false,
edit: true,
del: false,
download: false,
reset: true
}
})
},
data() {
return {
permission: {
},
rules: {
point_code: [
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
],
standing_time: [
{ required: true, message: '静置时间(min)不能为空', trigger: 'blur' }
],
block_num: [
{ required: true, message: '块不能为空', trigger: 'blur' }
],
row_num: [
{ required: true, message: '排不能为空', trigger: 'blur' }
],
col_num: [
{ required: true, message: '列不能为空', trigger: 'blur' }
],
layer_num: [
{ required: true, message: '层不能为空', trigger: 'blur' }
],
is_used: [
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
],
is_lock: [
{ required: true, message: '是否锁定不能为空', trigger: 'blur' }
]
},
locations: [],
locationsOptions: []
}
},
created() {
this.getLocationsOptions()
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
hand(value) {
// 块排列 的参数整合
if (this.locations.length > 0) {
this.query.locationsOptions = this.locations[0] + '/' + this.locations[1] + '/' + this.locations[2]
}
this.crud.toQuery()
},
getLocationsOptions() {
crudYsapoint.arrangementTree().then(res => {
console.log(res)
this.locationsOptions = res
})
},
changeEnableOn(data) {
console.log(data)
crudYsapoint.changeUsedOn(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
changeEnableOff(data) {
console.log(data)
crudYsapoint.changeUsedOff(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/ysapoint',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/ysapoint/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/ysapoint',
method: 'put',
data
})
}
export function arrangementTree() {
return request({
url: 'api/ysapoint/blockRowCol/tree',
method: 'get'
})
}
export function changeUsedOn(data) {
return request({
url: 'api/ysapoint/changeUsedOn',
method: 'post',
data
})
}
export function changeUsedOff(data) {
return request({
url: 'api/ysapoint/changeUsedOff',
method: 'post',
data
})
}
export default { add, edit, del, arrangementTree, changeUsedOn, changeUsedOff }