Commit e77b04a7 authored by 张兴海's avatar 张兴海

物资模块,导入模块,状态修改

parent a6dd5936
...@@ -121,4 +121,30 @@ public class ActSuppliesController extends BaseController ...@@ -121,4 +121,30 @@ public class ActSuppliesController extends BaseController
return toAjax(actSuppliesService.deleteActSuppliesByIds(ids)); return toAjax(actSuppliesService.deleteActSuppliesByIds(ids));
} }
/**
* 启用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('Actsupplies:Actsupplies:enable')")
@GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id)
{
System.out.println("开始处理【启用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesService.setEnable(id);
return AjaxResult.success();
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('Actsupplies:Actsupplies:Disable')")
@GetMapping("/disable/{id}")
public AjaxResult setDisable(@PathVariable("id") Long id)
{
System.out.println("开始处理【禁用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesService.setDisable(id);
return AjaxResult.success();
}
} }
...@@ -126,4 +126,29 @@ public class ActSuppliesDetailsController extends BaseController ...@@ -126,4 +126,29 @@ public class ActSuppliesDetailsController extends BaseController
return toAjax(actSuppliesDetailsService.deleteActSuppliesDetailsByIds(ids)); return toAjax(actSuppliesDetailsService.deleteActSuppliesDetailsByIds(ids));
} }
/**
* 启用物料细分类管理
*/
@PreAuthorize("@ss.hasPermi('ActSuppliesDetails:ActSuppliesDetails:enable')")
@GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id)
{
System.out.println("开始处理【启用物料细分类管理】的请求,参数:{}"+ id);
actSuppliesDetailsService.setEnable(id);
return AjaxResult.success();
}
/**
* 禁用物料细分类管理
*/
@PreAuthorize("@ss.hasPermi('ActSuppliesDetails:ActSuppliesDetails:Disable')")
@GetMapping("/disable/{id}")
public AjaxResult setDisable(@PathVariable("id") Long id)
{
System.out.println("开始处理【禁用物料细分类管理】的请求,参数:{}"+ id);
actSuppliesDetailsService.setDisable(id);
return AjaxResult.success();
}
} }
...@@ -116,4 +116,29 @@ public class ActSuppliesRoleController extends BaseController ...@@ -116,4 +116,29 @@ public class ActSuppliesRoleController extends BaseController
{ {
return toAjax(actSuppliesRoleService.deleteActSuppliesRoleByIds(ids)); return toAjax(actSuppliesRoleService.deleteActSuppliesRoleByIds(ids));
} }
/**
* 启用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('system:suppliesrole:enable')")
@GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id)
{
System.out.println("开始处理【启用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesRoleService.setEnable(id);
return AjaxResult.success();
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('system:suppliesrole:Disable')")
@GetMapping("/disable/{id}")
public AjaxResult setDisable(@PathVariable("id") Long id)
{
System.out.println("开始处理【禁用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesRoleService.setDisable(id);
return AjaxResult.success();
}
} }
...@@ -2,7 +2,7 @@ package com.ruoyi.system.controller; ...@@ -2,7 +2,7 @@ package com.ruoyi.system.controller;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.ActOperation;
import com.ruoyi.system.domain.ActSupplies; import com.ruoyi.system.domain.ActSupplies;
import com.ruoyi.system.domain.ActSuppliesRole; import com.ruoyi.system.domain.ActSuppliesRole;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -126,4 +126,29 @@ public class ActSuppliesRoleDetailController extends BaseController ...@@ -126,4 +126,29 @@ public class ActSuppliesRoleDetailController extends BaseController
{ {
return toAjax(actSuppliesRoleDetailService.deleteActSuppliesRoleDetailByIds(ids)); return toAjax(actSuppliesRoleDetailService.deleteActSuppliesRoleDetailByIds(ids));
} }
/**
* 启用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:enable')")
@GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id)
{
System.out.println("开始处理【启用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesRoleDetailService.setEnable(id);
return AjaxResult.success();
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('system:suppliesroledetail:Disable')")
@GetMapping("/disable/{id}")
public AjaxResult setDisable(@PathVariable("id") Long id)
{
System.out.println("开始处理【禁用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesRoleDetailService.setDisable(id);
return AjaxResult.success();
}
} }
...@@ -115,4 +115,29 @@ public class ActSuppliesTemplateController extends BaseController { ...@@ -115,4 +115,29 @@ public class ActSuppliesTemplateController extends BaseController {
return toAjax(actSuppliesTemplateService.deleteSuppliesTemplateByIds(ids)); return toAjax(actSuppliesTemplateService.deleteSuppliesTemplateByIds(ids));
} }
/**
* 启用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:enable')")
@GetMapping("/enable/{id}")
public AjaxResult setEnable(@PathVariable("id") Long id)
{
System.out.println("开始处理【启用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesTemplateService.setEnable(id);
return AjaxResult.success();
}
/**
* 禁用物料总分类管理
*/
@PreAuthorize("@ss.hasPermi('SuppliesTemplate:SuppliesTemplate:Disable')")
@GetMapping("/disable/{id}")
public AjaxResult setDisable(@PathVariable("id") Long id)
{
System.out.println("开始处理【禁用物料总分类管理】的请求,参数:{}"+ id);
actSuppliesTemplateService.setDisable(id);
return AjaxResult.success();
}
} }
\ No newline at end of file
...@@ -34,7 +34,9 @@ public class ActSupplies extends BaseEntity ...@@ -34,7 +34,9 @@ public class ActSupplies extends BaseEntity
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态")
private Long status; private Integer status;
public String getFname() { public String getFname() {
return fname; return fname;
...@@ -80,12 +82,12 @@ public class ActSupplies extends BaseEntity ...@@ -80,12 +82,12 @@ public class ActSupplies extends BaseEntity
{ {
return orderNum; return orderNum;
} }
public void setStatus(Long status)
{ public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
public Long getStatus() public Integer getStatus()
{ {
return status; return status;
} }
......
...@@ -42,7 +42,7 @@ public class ActSuppliesDetails extends BaseEntity ...@@ -42,7 +42,7 @@ public class ActSuppliesDetails extends BaseEntity
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态")
private Long status; private Integer status;
public void setId(Long id) public void setId(Long id)
{ {
...@@ -80,12 +80,12 @@ public class ActSuppliesDetails extends BaseEntity ...@@ -80,12 +80,12 @@ public class ActSuppliesDetails extends BaseEntity
{ {
return sysclassify; return sysclassify;
} }
public void setStatus(Long status) public void setStatus(Integer status)
{ {
this.status = status; this.status = status;
} }
public Long getStatus() public Integer getStatus()
{ {
return status; return status;
} }
......
...@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity; ...@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 导入规则对象 act_supplies_role * 导入规则对象 act_supplies_role
* *
* @author dongjg * @author dongjg
* @date 2023-07-12 * @date 2023-07-12
*/ */
...@@ -16,7 +16,7 @@ public class ActSuppliesRole extends BaseEntity ...@@ -16,7 +16,7 @@ public class ActSuppliesRole extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** ID */ /** ID */
private Integer id; private Long id;
/** 模板ID */ /** 模板ID */
@Excel(name = "模板ID") @Excel(name = "模板ID")
...@@ -40,39 +40,39 @@ public class ActSuppliesRole extends BaseEntity ...@@ -40,39 +40,39 @@ public class ActSuppliesRole extends BaseEntity
this.templateName = templateName; this.templateName = templateName;
} }
public void setId(Integer id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Integer getId() public Long getId()
{ {
return id; return id;
} }
public void setTempId(Integer tempId) public void setTempId(Integer tempId)
{ {
this.tempId = tempId; this.tempId = tempId;
} }
public Integer getTempId() public Integer getTempId()
{ {
return tempId; return tempId;
} }
public void setRoleName(String roleName) public void setRoleName(String roleName)
{ {
this.roleName = roleName; this.roleName = roleName;
} }
public String getRoleName() public String getRoleName()
{ {
return roleName; return roleName;
} }
public void setStatus(Integer status) public void setStatus(Integer status)
{ {
this.status = status; this.status = status;
} }
public Integer getStatus() public Integer getStatus()
{ {
return status; return status;
} }
...@@ -80,14 +80,14 @@ public class ActSuppliesRole extends BaseEntity ...@@ -80,14 +80,14 @@ public class ActSuppliesRole extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("tempId", getTempId()) .append("tempId", getTempId())
.append("roleName", getRoleName()) .append("roleName", getRoleName())
.append("status", getStatus()) .append("status", getStatus())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.toString(); .toString();
} }
} }
...@@ -16,7 +16,7 @@ public class ActSuppliesRoleDetail extends BaseEntity ...@@ -16,7 +16,7 @@ public class ActSuppliesRoleDetail extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 规则详情ID */ /** 规则详情ID */
private Integer id; private Long id;
/** 导入规则ID */ /** 导入规则ID */
@Excel(name = "导入规则ID") @Excel(name = "导入规则ID")
...@@ -111,12 +111,12 @@ public class ActSuppliesRoleDetail extends BaseEntity ...@@ -111,12 +111,12 @@ public class ActSuppliesRoleDetail extends BaseEntity
this.detailYL = detailYL; this.detailYL = detailYL;
} }
public void setId(Integer id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Integer getId() public Long getId()
{ {
return id; return id;
} }
......
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import jdk.nashorn.internal.objects.annotations.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; ...@@ -11,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author ruoyi * @author ruoyi
* @date 2023-07-05 * @date 2023-07-05
*/ */
public class ActSuppliesTemplate extends BaseEntity public class ActSuppliesTemplate extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -22,14 +25,6 @@ public class ActSuppliesTemplate extends BaseEntity ...@@ -22,14 +25,6 @@ public class ActSuppliesTemplate extends BaseEntity
@Excel(name = "关联ID") @Excel(name = "关联ID")
private Long detId; private Long detId;
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
/** Excel文件名 */ /** Excel文件名 */
@Excel(name = "Excel文件名") @Excel(name = "Excel文件名")
private String templateName; private String templateName;
...@@ -40,7 +35,15 @@ public class ActSuppliesTemplate extends BaseEntity ...@@ -40,7 +35,15 @@ public class ActSuppliesTemplate extends BaseEntity
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态")
private Long status; private Integer status;
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public void setId(Long id) public void setId(Long id)
{ {
...@@ -69,12 +72,12 @@ public class ActSuppliesTemplate extends BaseEntity ...@@ -69,12 +72,12 @@ public class ActSuppliesTemplate extends BaseEntity
this.templateContent = templateContent; this.templateContent = templateContent;
} }
public void setStatus(Long status) public void setStatus(Integer status)
{ {
this.status = status; this.status = status;
} }
public Long getStatus() public Integer getStatus()
{ {
return status; return status;
} }
......
...@@ -2,7 +2,6 @@ package com.ruoyi.system.mapper; ...@@ -2,7 +2,6 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.ActOperation;
import com.ruoyi.system.domain.ActSuppliesRole; import com.ruoyi.system.domain.ActSuppliesRole;
import com.ruoyi.system.domain.ActSuppliesRoleDetail; import com.ruoyi.system.domain.ActSuppliesRoleDetail;
......
...@@ -26,5 +26,19 @@ public interface ActSuppliesTemplateService ...@@ -26,5 +26,19 @@ public interface ActSuppliesTemplateService
List<ActSuppliesTemplate> saveTemplate(Long id); List<ActSuppliesTemplate> saveTemplate(Long id);
List<Integer> findall(); List<Integer> findall();
/**
* 启用物料细分类管理
*
* @param id 尝试启用物料细分类管理的id
* @return
*/
void setEnable(Long id);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void setDisable(Long id);
} }
...@@ -65,4 +65,18 @@ public interface IActSuppliesDetailsService ...@@ -65,4 +65,18 @@ public interface IActSuppliesDetailsService
List<Integer> findall(); List<Integer> findall();
List<ActSupplies> saveSid(); List<ActSupplies> saveSid();
/**
* 启用物料总分类管理
*
* @param id 尝试启用物料总分类管理的id
* @return
*/
void setEnable(Long id);
/**
* 禁用
*
* @param id 尝试禁用物料总分类管理的id
*/
void setDisable(Long id);
} }
...@@ -2,7 +2,7 @@ package com.ruoyi.system.service; ...@@ -2,7 +2,7 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.ActOperation;
import com.ruoyi.system.domain.ActSupplies; import com.ruoyi.system.domain.ActSupplies;
import com.ruoyi.system.domain.ActSuppliesRole; import com.ruoyi.system.domain.ActSuppliesRole;
import com.ruoyi.system.domain.ActSuppliesRoleDetail; import com.ruoyi.system.domain.ActSuppliesRoleDetail;
...@@ -66,4 +66,19 @@ public interface IActSuppliesRoleDetailService ...@@ -66,4 +66,19 @@ public interface IActSuppliesRoleDetailService
List<ActSuppliesRole> saveSid(); List<ActSuppliesRole> saveSid();
// List<ActOperation> saveOperation(); // List<ActOperation> saveOperation();
/**
* 启用物料细分类管理
*
* @param id 尝试启用物料细分类管理的id
* @return
*/
void setEnable(Long id);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void setDisable(Long id);
} }
...@@ -61,5 +61,19 @@ public interface IActSuppliesRoleService ...@@ -61,5 +61,19 @@ public interface IActSuppliesRoleService
public int deleteActSuppliesRoleById(Integer id); public int deleteActSuppliesRoleById(Integer id);
List<ActSuppliesTemplate> saveSid(); List<ActSuppliesTemplate> saveSid();
/**
* 启用物料细分类管理
*
* @param id 尝试启用物料细分类管理的id
* @return
*/
void setEnable(Long id);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void setDisable(Long id);
} }
...@@ -63,4 +63,20 @@ public interface IActSuppliesService ...@@ -63,4 +63,20 @@ public interface IActSuppliesService
List<ActSupplies> options(); List<ActSupplies> options();
List<Integer> findall(); List<Integer> findall();
/**
* 启用物料细分类管理
*
* @param id 尝试启用物料细分类管理的id
* @return
*/
void setEnable(Long id);
/**
* 禁用
*
* @param id 尝试禁用物料细分类管理的id
*/
void setDisable(Long id);
} }
...@@ -106,4 +106,44 @@ public class ActSuppliesDetailsServiceImpl implements IActSuppliesDetailsService ...@@ -106,4 +106,44 @@ public class ActSuppliesDetailsServiceImpl implements IActSuppliesDetailsService
public List<ActSupplies> saveSid() { public List<ActSupplies> saveSid() {
return actSuppliesDetailsMapper.saveSid(); return actSuppliesDetailsMapper.saveSid();
} }
@Override
public void setEnable(Long id) {
updateStatusById(id,0);
}
@Override
public void setDisable(Long id) {
updateStatusById(id,1);
}
private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"};
//判断查询结果是否为空
ActSuppliesDetails queryResult = actSuppliesDetailsMapper.selectActSuppliesDetailsById(id);
if(queryResult ==null) {
String message =statusText[status] + "物料细分类管理失败,尝试访问的数据不存在";
System.out.println(message);
throw new RuntimeException(message);
}
//判断以上查询结果中的status是否与参数status相同
if(queryResult.getStatus().equals(status)){
String message = statusText[status] + "物料细分类管理失败,当前物料细分类管理已经处理" +statusText[status] + "状态!";
System.out.println(message);
throw new RuntimeException(message);
}
ActSuppliesDetails actSuppliesDetails=new ActSuppliesDetails();
actSuppliesDetails.setId(id);
actSuppliesDetails.setStatus(status);
int rows = actSuppliesDetailsMapper.updateActSuppliesDetails(actSuppliesDetails);
if (rows != 1) {
String message = statusText[status] + "物料细分类管理失败,服务器忙请再次重试";
System.out.println(message);
throw new RuntimeException(message);
}
}
} }
...@@ -6,7 +6,6 @@ import java.util.List; ...@@ -6,7 +6,6 @@ import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.ActOperation;
import com.ruoyi.system.domain.ActSuppliesRole; import com.ruoyi.system.domain.ActSuppliesRole;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -131,4 +130,45 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS ...@@ -131,4 +130,45 @@ public class ActSuppliesRoleDetailServiceImpl implements IActSuppliesRoleDetailS
// public List<ActOperation> saveOperation() { // public List<ActOperation> saveOperation() {
// return actSuppliesRoleDetailMapper.saveOperation(); // return actSuppliesRoleDetailMapper.saveOperation();
// } // }
@Override
public void setEnable(Long id) {
updateStatusById(id,0);
}
@Override
public void setDisable(Long id) {
updateStatusById(id,1);
}
private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"};
//判断查询结果是否为空
ActSuppliesRoleDetail queryResult = actSuppliesRoleDetailMapper.selectActSuppliesRoleDetailById(Math.toIntExact(id));
if(queryResult ==null) {
String message =statusText[status] + "物料总分类管理失败,尝试访问的数据不存在";
System.out.println(message);
throw new RuntimeException(message);
}
//判断以上查询结果中的status是否与参数status相同
if(queryResult.getStatus().equals(status)){
String message = statusText[status] + "物料总分类管理失败,当前物料总分类管理已经处理" +statusText[status] + "状态!";
System.out.println(message);
throw new RuntimeException(message);
}
ActSuppliesRoleDetail actSuppliesRoleDetail = new ActSuppliesRoleDetail();
actSuppliesRoleDetail.setId(id);
actSuppliesRoleDetail.setStatus(status);
int rows = actSuppliesRoleDetailMapper.updateActSuppliesRoleDetail(actSuppliesRoleDetail);
if (rows != 1) {
String message = statusText[status] + "物料总分类管理失败,服务器忙请再次重试";
System.out.println(message);
throw new RuntimeException(message);
}
}
} }
...@@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl; ...@@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.ActSupplies;
import com.ruoyi.system.domain.ActSuppliesDetails;
import com.ruoyi.system.domain.ActSuppliesTemplate; import com.ruoyi.system.domain.ActSuppliesTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -99,4 +101,44 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService ...@@ -99,4 +101,44 @@ public class ActSuppliesRoleServiceImpl implements IActSuppliesRoleService
public List<ActSuppliesTemplate> saveSid() { public List<ActSuppliesTemplate> saveSid() {
return actSuppliesRoleMapper.saveSid(); return actSuppliesRoleMapper.saveSid();
} }
@Override
public void setEnable(Long id) {
updateStatusById(id,0);
}
@Override
public void setDisable(Long id) {
updateStatusById(id,1);
}
private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"};
//判断查询结果是否为空
ActSuppliesRole queryResult = actSuppliesRoleMapper.selectActSuppliesRoleById(Math.toIntExact(id));
if(queryResult ==null) {
String message =statusText[status] + "物料总分类管理失败,尝试访问的数据不存在";
System.out.println(message);
throw new RuntimeException(message);
}
//判断以上查询结果中的status是否与参数status相同
if(queryResult.getStatus().equals(status)){
String message = statusText[status] + "物料总分类管理失败,当前物料总分类管理已经处理" +statusText[status] + "状态!";
System.out.println(message);
throw new RuntimeException(message);
}
ActSuppliesRole actSuppliesRole = new ActSuppliesRole();
actSuppliesRole.setId(id);
actSuppliesRole.setStatus(status);
int rows = actSuppliesRoleMapper.updateActSuppliesRole(actSuppliesRole);
if (rows != 1) {
String message = statusText[status] + "物料总分类管理失败,服务器忙请再次重试";
System.out.println(message);
throw new RuntimeException(message);
}
}
} }
...@@ -8,8 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -8,8 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 物料总分类管理Service业务层处理 * 物料总分类管理Service业务层处理
...@@ -104,14 +102,47 @@ public class ActSuppliesServiceImpl implements IActSuppliesService ...@@ -104,14 +102,47 @@ public class ActSuppliesServiceImpl implements IActSuppliesService
@Override @Override
public List<Integer> findall() { public List<Integer> findall() {
return actSuppliesMapper.findall();
}
@Override
public void setEnable(Long id) {
updateStatusById(id,0);
}
List<Integer> findall = actSuppliesMapper.findall(); @Override
List<Integer> allId = actSuppliesMapper.findAllId(); public void setDisable(Long id) {
List<Integer> mergedList = Stream.concat(findall.stream(), allId.stream()).collect(Collectors.toList()); updateStatusById(id,1);
return mergedList;
} }
} private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"};
//判断查询结果是否为空
ActSupplies queryResult = actSuppliesMapper.selectActSuppliesById(id);
if(queryResult ==null) {
String message =statusText[status] + "物料总分类管理失败,尝试访问的数据不存在";
System.out.println(message);
throw new RuntimeException(message);
}
//判断以上查询结果中的status是否与参数status相同
if(queryResult.getStatus().equals(status)){
String message = statusText[status] + "物料总分类管理失败,当前物料总分类管理已经处理" +statusText[status] + "状态!";
System.out.println(message);
throw new RuntimeException(message);
}
ActSupplies actSupplies = new ActSupplies();
actSupplies.setId(id);
actSupplies.setStatus(status);
int rows = actSuppliesMapper.updateActSupplies(actSupplies);
if (rows != 1) {
String message = statusText[status] + "物料总分类管理失败,服务器忙请再次重试";
System.out.println(message);
throw new RuntimeException(message);
}
}
}
...@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; ...@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.ActSupplies;
import com.ruoyi.system.domain.ActSuppliesTemplate; import com.ruoyi.system.domain.ActSuppliesTemplate;
import com.ruoyi.system.mapper.ActSuppliesTemplateMapper; import com.ruoyi.system.mapper.ActSuppliesTemplateMapper;
import com.ruoyi.system.service.ActSuppliesTemplateService; import com.ruoyi.system.service.ActSuppliesTemplateService;
...@@ -69,6 +70,40 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic ...@@ -69,6 +70,40 @@ public class ActSuppliesTemplateServiceImpl implements ActSuppliesTemplateServic
public List<Integer> findall() { public List<Integer> findall() {
return actSuppliesTemplateMapper.findall(); return actSuppliesTemplateMapper.findall();
} }
@Override
public void setEnable(Long id) {
updateStatusById(id,0);
}
@Override
public void setDisable(Long id) {
updateStatusById(id,1);
}
private void updateStatusById(Long id, Integer status){
String[] statusText={"禁用","启用"};
//判断查询结果是否为空
List<ActSuppliesTemplate> queryResult = actSuppliesTemplateMapper.selectSuppliesTemplateById(id);
if(queryResult ==null) {
String message =statusText[status] + "物料总分类管理失败,尝试访问的数据不存在";
System.out.println(message);
throw new RuntimeException(message);
}
//判断以上查询结果中的status是否与参数status相同
ActSuppliesTemplate actSuppliesTemplate = new ActSuppliesTemplate();
actSuppliesTemplate.setId(id);
actSuppliesTemplate.setStatus(status);
int rows = actSuppliesTemplateMapper.updateSuppliesTemplate(actSuppliesTemplate);
if (rows != 1) {
String message = statusText[status] + "物料总分类管理失败,服务器忙请再次重试";
System.out.println(message);
throw new RuntimeException(message);
}
}
} }
package com.ruoyi.system.web;
public enum ServiceCode {
/**
* 成功请求
*/
OK(200),
/**
* 错误请求
*/
ERR_BAD_REQUEST(400),
/**
* 未经授权
*/
ERR_UNAUTHORIZED(401),
/**
* 授权已禁用
*/
ERR_UNAUTHORIZED_DISABLED(402),
/**
* 禁止访问
*/
ERR_FORBIDDEN(403),
/**
* 未找到
*/
ERR_NOT_FOUND(404),
/**
* 冲突
*/
ERR_CONFLICT(409),
/**
* 图形
*/
ERR_CODE(410),
ERR_INSERT(500),
ERR_DELETE(501),
ERR_UPDATE(502),
ERR_SELECT(503),
/**
* 过期
*/
ERR_JWT_EXPIRED(600),
ERR_JWT_MALFORMED(601),
ERR_JWT_SIGNATURE(602),
/**
* 未知
*/
ERR_UNKNOWN(999);
private Integer value;
ServiceCode(Integer value) {
this.value = value;
}
public Integer getValue(){
return value;
}
}
...@@ -59,3 +59,18 @@ export function exportActSuppliesDetails(query) { ...@@ -59,3 +59,18 @@ export function exportActSuppliesDetails(query) {
params: query params: query
}) })
} }
//启用
export function toggleEnable(id) {
return request({
url: '/ActSuppliesDetails/ActSuppliesDetails/enable/' +id,
method: 'get',
})
}
//禁用
export function toggleDisable(id) {
return request({
url: '/ActSuppliesDetails/ActSuppliesDetails/disable/' + id,
method: 'get',
})
}
...@@ -50,6 +50,24 @@ export function delSupplies(id) { ...@@ -50,6 +50,24 @@ export function delSupplies(id) {
method: 'delete' method: 'delete'
}) })
} }
//启用
export function toggleEnable(id) {
return request({
url: '/Actsupplies/Actsupplies/enable/' +id,
method: 'get',
})
}
//禁用
export function toggleDisable(id) {
return request({
url: '/Actsupplies/Actsupplies/disable/' +id,
method: 'get',
})
}
......
...@@ -61,6 +61,22 @@ export function delSuppliesSave(id) { ...@@ -61,6 +61,22 @@ export function delSuppliesSave(id) {
}) })
} }
//启用
export function toggleEnable(id) {
return request({
url: '/SuppliesTemplate/SuppliesTemplate/enable/' +id,
method: 'get',
})
}
//禁用
export function toggleDisable(id) {
return request({
url: '/SuppliesTemplate/SuppliesTemplate/disable/' + id,
method: 'get',
})
}
// 模板转换页面查询规则对应用友物料名称 // 模板转换页面查询规则对应用友物料名称
...@@ -70,6 +86,8 @@ export function getSuppliesName(name) { ...@@ -70,6 +86,8 @@ export function getSuppliesName(name) {
method: 'get' method: 'get'
}) })
} }
// 模板转换页面查询Excel模板列表 // 模板转换页面查询Excel模板列表
export function templateList(query) { export function templateList(query) {
return request({ return request({
...@@ -101,8 +119,6 @@ export function roleListid(id) { ...@@ -101,8 +119,6 @@ export function roleListid(id) {
} }
// 查询规则列表 // 查询规则列表
export function listRule(query) { export function listRule(query) {
return request({ return request({
......
...@@ -59,3 +59,20 @@ export function exportSuppliesrole(query) { ...@@ -59,3 +59,20 @@ export function exportSuppliesrole(query) {
params: query params: query
}) })
} }
//启用
export function toggleEnable(id) {
return request({
url: '/system/suppliesrole/enable/' +id,
method: 'get',
})
}
//禁用
export function toggleDisable(id) {
return request({
url: '/system/suppliesrole/disable/' +id,
method: 'get',
})
}
...@@ -59,3 +59,19 @@ export function exportSuppliesroledetail(query) { ...@@ -59,3 +59,19 @@ export function exportSuppliesroledetail(query) {
params: query params: query
}) })
} }
//启用
export function toggleEnable(id) {
return request({
url: '/system/suppliesroledetail/enable/' +id,
method: 'get',
})
}
//禁用
export function toggleDisable(id) {
return request({
url: '/system/suppliesroledetail/disable/' +id,
method: 'get',
})
}
...@@ -20,8 +20,15 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabelAnd ...@@ -20,8 +20,15 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabelAnd
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
// 自定义表格工具扩展 // 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar" import RightToolbar from "@/components/RightToolbar"
import axios from "axios";
import qs from 'qs';
import * as echarts from "echarts";
// 全局方法挂载 // 全局方法挂载
Vue.prototype.echarts=echarts;
Vue.prototype.qs=qs;
Vue.prototype.axios = axios
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime Vue.prototype.parseTime = parseTime
......
...@@ -107,15 +107,14 @@ ...@@ -107,15 +107,14 @@
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<template v-if="scope.row.status === 0"> <el-switch
启用 @change="toggleEnable(scope.row)"
</template> v-model="scope.row.status"
<template v-else-if="scope.row.status === 1"> :active-value="0"
禁用 :inactive-value="1"
</template> active-color="#13ce66"
<template v-else-if="scope.row.status === 2"> inactive-color="#cccccc">
删除 </el-switch>
</template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -183,7 +182,7 @@ ...@@ -183,7 +182,7 @@
</template> </template>
<script> <script>
import { listActSuppliesDetails, getActSuppliesDetails, delActSuppliesDetails, addActSuppliesDetails, updateActSuppliesDetails, exportActSuppliesDetails,saveSid } from "@/api/ActSuppliesDetails/ActSuppliesDetails"; import { listActSuppliesDetails, toggleEnable,toggleDisable,getActSuppliesDetails, delActSuppliesDetails, addActSuppliesDetails, updateActSuppliesDetails, exportActSuppliesDetails,saveSid } from "@/api/ActSuppliesDetails/ActSuppliesDetails";
export default { export default {
name: "ActSuppliesDetails", name: "ActSuppliesDetails",
...@@ -258,6 +257,41 @@ export default { ...@@ -258,6 +257,41 @@ export default {
return index + 1; return index + 1;
}, },
/**启用 */
toggleEnable(actSuppliesDetails){
console.log('你点击了【' + actSuppliesDetails.detailsName+'】的开关控件,当前开关值:' + actSuppliesDetails.status);
let enableText=['启用','禁用'];
if(actSuppliesDetails.status == 0) {
toggleEnable(actSuppliesDetails.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + actSuppliesDetails.detailsName +'】的状态改为【'+ enableText[actSuppliesDetails.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}else {
toggleDisable(actSuppliesDetails.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + actSuppliesDetails.detailsName +'】的状态改为【'+ enableText[actSuppliesDetails.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}
},
/** 获取上级分类*/ /** 获取上级分类*/
fetchOptions() { fetchOptions() {
saveSid().then(response => { saveSid().then(response => {
......
...@@ -107,15 +107,16 @@ ...@@ -107,15 +107,16 @@
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<template v-if="scope.row.status === 0">
启用 <el-switch
</template> @change="toggleEnable(scope.row)"
<template v-else-if="scope.row.status === 1"> v-model="scope.row.status"
禁用 :active-value="0"
</template> :inactive-value="1"
<template v-else-if="scope.row.status === 2"> active-color="#13ce66"
删除 inactive-color="#cccccc">
</template> </el-switch>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -165,10 +166,7 @@ ...@@ -165,10 +166,7 @@
<el-input v-model="form.suppliesName" placeholder="请输入物料名称" /> <el-input v-model="form.suppliesName" placeholder="请输入物料名称" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option label="启用" :value="0"></el-option>
<el-option label="禁用" :value="1"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -180,7 +178,7 @@ ...@@ -180,7 +178,7 @@
</template> </template>
<script> <script>
import { listSupplies, getSupplies, delSupplies, addSupplies, updateSupplies, exportSupplies ,getPid } from "@/api/Actsupplies/Actsupplies"; import { listSupplies, toggleEnable,toggleDisable,getSupplies, delSupplies, addSupplies, updateSupplies, exportSupplies ,getPid } from "@/api/Actsupplies/Actsupplies";
export default { export default {
name: "Supplies", name: "Supplies",
...@@ -208,11 +206,7 @@ export default { ...@@ -208,11 +206,7 @@ export default {
options: [], // 初始化空数组 options: [], // 初始化空数组
selectedOption: '' ,// 选中的选项 selectedOption: '' ,// 选中的选项
mydict:{
0:'启用',
1:'禁用',
2:'删除'
},
// 弹出层标题 // 弹出层标题
title: "", title: "",
...@@ -227,7 +221,7 @@ export default { ...@@ -227,7 +221,7 @@ export default {
fname:null, fname:null,
suppliesName: null, suppliesName: null,
orderNum: null, orderNum: null,
status: null, status: 0,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -240,9 +234,9 @@ export default { ...@@ -240,9 +234,9 @@ export default {
{ required: true, message: "物料名称不能为空", trigger: "blur" } { required: true, message: "物料名称不能为空", trigger: "blur" }
], ],
}, },
idRules:[ idRules:[
{ pattern: /^\d+$/, message: 'ID只能输入数字', trigger: 'blur' } { pattern: /^\d+$/, message: 'ID只能输入数字', trigger: 'blur' }
] ]
}; };
}, },
created() { created() {
...@@ -260,6 +254,37 @@ export default { ...@@ -260,6 +254,37 @@ export default {
return index + 1; return index + 1;
}, },
/**启用 */
toggleEnable(actSupplies){
console.log('你点击了【' + actSupplies.suppliesName+'】的开关控件,当前开关值:' + actSupplies.status);
let enableText=['启用','禁用'];
if(actSupplies.status == 0) {
toggleEnable(actSupplies.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + actSupplies.suppliesName +'】的状态改为【'+ enableText[actSupplies.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}else {
toggleDisable(actSupplies.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + actSupplies.suppliesName +'】的状态改为【'+ enableText[actSupplies.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}
},
/** 查询上级关联关系*/ /** 查询上级关联关系*/
fetchOptions() { fetchOptions() {
getPid().then(response => { getPid().then(response => {
......
...@@ -69,15 +69,14 @@ ...@@ -69,15 +69,14 @@
<el-table-column label="状态" align="center" prop="status" > <el-table-column label="状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<template v-if="scope.row.status === 0"> <el-switch
启用 @change="toggleEnable(scope.row)"
</template> v-model="scope.row.status"
<template v-else-if="scope.row.status === 1"> :active-value="0"
禁用 :inactive-value="1"
</template> active-color="#13ce66"
<template v-else-if="scope.row.status === 2"> inactive-color="#cccccc">
删除 </el-switch>
</template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -174,6 +173,7 @@ import { ...@@ -174,6 +173,7 @@ import {
delSuppliesTemplate, delSuppliesTemplate,
addSuppliesTemplate, addSuppliesTemplate,
updateSuppliesTemplate, updateSuppliesTemplate,
toggleEnable,toggleDisable,
listSuppliesTemplateId listSuppliesTemplateId
} from "@/api/ruoyi-myLuckyexcel/myluckyexcel"; } from "@/api/ruoyi-myLuckyexcel/myluckyexcel";
import $ from 'jquery'; import $ from 'jquery';
...@@ -235,6 +235,39 @@ export default { ...@@ -235,6 +235,39 @@ export default {
}, },
methods: { methods: {
/**启用 */
toggleEnable(SuppliesTemplate){
console.log('你点击了【' + SuppliesTemplate.s+'】的开关控件,当前开关值:' + SuppliesTemplate.status);
let enableText=['启用','禁用'];
if(SuppliesTemplate.status == 0) {
toggleEnable(SuppliesTemplate.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + SuppliesTemplate.templateName +'】的状态改为【'+ enableText[SuppliesTemplate.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}else {
toggleDisable(SuppliesTemplate.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + SuppliesTemplate.templateName +'】的状态改为【'+ enableText[SuppliesTemplate.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}
},
/**显示序号*/ /**显示序号*/
indexMethod(index){ indexMethod(index){
return index + 1; return index + 1;
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属模板" prop="tempId"> <el-form-item label="所属模板" prop="tempId">
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.tempId"--> <!-- v-model="queryParams.tempId"-->
<!-- placeholder="请输入模板ID"--> <!-- placeholder="请输入模板ID"-->
<!-- clearable--> <!-- clearable-->
<!-- size="small"--> <!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<el-select v-model="queryParams.tempId" filterable clearable placeholder="请选择上级分类" > <el-select v-model="queryParams.tempId" filterable clearable placeholder="请选择上级分类" >
<el-option <el-option
...@@ -95,15 +95,14 @@ ...@@ -95,15 +95,14 @@
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<template v-if="scope.row.status === 0"> <el-switch
启动 @change="toggleEnable(scope.row)"
</template> v-model="scope.row.status"
<template v-else-if="scope.row.status === 1"> :active-value="0"
禁用 :inactive-value="1"
</template> active-color="#13ce66"
<template v-else-if="scope.row.status === 2"> inactive-color="#cccccc">
删除 </el-switch>
</template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -167,7 +166,7 @@ ...@@ -167,7 +166,7 @@
</template> </template>
<script> <script>
import { listSuppliesrole, getSuppliesrole, delSuppliesrole, addSuppliesrole, updateSuppliesrole, exportSuppliesrole,saveSid } from "@/api/system/suppliesrole"; import { listSuppliesrole,toggleEnable,toggleDisable, getSuppliesrole, delSuppliesrole, addSuppliesrole, updateSuppliesrole, exportSuppliesrole,saveSid } from "@/api/system/suppliesrole";
export default { export default {
name: "Suppliesrole", name: "Suppliesrole",
...@@ -220,6 +219,38 @@ export default { ...@@ -220,6 +219,38 @@ export default {
}, },
methods: { methods: {
/**启用 */
toggleEnable(suppliesrole){
console.log('你点击了【' + suppliesrole.s+'】的开关控件,当前开关值:' + suppliesrole.status);
let enableText=['启用','禁用'];
if(suppliesrole.status == 0) {
toggleEnable(suppliesrole.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + suppliesrole.roleName +'】的状态改为【'+ enableText[suppliesrole.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}else {
toggleDisable(suppliesrole.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + suppliesrole.roleName +'】的状态改为【'+ enableText[suppliesrole.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}
},
/**显示序号*/ /**显示序号*/
indexMethod(index){ indexMethod(index){
return index + 1; return index + 1;
......
...@@ -130,15 +130,14 @@ ...@@ -130,15 +130,14 @@
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<template v-if="scope.row.status === 0"> <el-switch
启动 @change="toggleEnable(scope.row)"
</template> v-model="scope.row.status"
<template v-else-if="scope.row.status === 1"> :active-value="0"
禁用 :inactive-value="1"
</template> active-color="#13ce66"
<template v-else-if="scope.row.status === 2"> inactive-color="#cccccc">
删除 </el-switch>
</template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -235,6 +234,8 @@ import { ...@@ -235,6 +234,8 @@ import {
addSuppliesroledetail, addSuppliesroledetail,
updateSuppliesroledetail, updateSuppliesroledetail,
exportSuppliesroledetail, exportSuppliesroledetail,
toggleEnable,
toggleDisable,
saveSid, saveSid,
saveOperation, saveOperation,
} from "@/api/system/suppliesroledetail"; } from "@/api/system/suppliesroledetail";
...@@ -315,6 +316,39 @@ export default { ...@@ -315,6 +316,39 @@ export default {
}, },
methods: { methods: {
/**启用 */
toggleEnable(suppliesroledetail){
console.log('你点击了【' + suppliesroledetail.s+'】的开关控件,当前开关值:' + suppliesroledetail.status);
let enableText=['启用','禁用'];
if(suppliesroledetail.status == 0) {
toggleEnable(suppliesroledetail.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + suppliesroledetail.roleName +'】的状态改为【'+ enableText[suppliesroledetail.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}else {
toggleDisable(suppliesroledetail.id).then((response) =>{
if(response.code == 200){
let message = '操作成功,已经将【' + suppliesroledetail.roleName +'】的状态改为【'+ enableText[suppliesroledetail.status] +'】 !';
this.$message({
message: message,
type:'success'
});
}else {
this.$message.error(response.message);
}
});
}
},
/**显示序号*/ /**显示序号*/
indexMethod(index){ indexMethod(index){
return index + 1; return index + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment