'20240315'
This commit is contained in:
parent
0b18a6f546
commit
09d6670b8e
|
@ -42,7 +42,7 @@ public class CacheController
|
||||||
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
|
||||||
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
|
||||||
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
|
||||||
caches.add(new SysCache(CacheConstants.STORAGE_LOCATION, "车间库位号占用状态"));
|
caches.add(new SysCache(CacheConstants.STORAGE_LOCATION, "车间库位"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
|
|
|
@ -38,13 +38,15 @@ public class storageLocationController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
|
/*===========================================库位设置==========================================================*/
|
||||||
/**
|
/**
|
||||||
* 获取库位信息
|
* 获取库位占用信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(StorageLocation storageLocation)
|
public AjaxResult list(StorageLocation storageLocation)
|
||||||
{
|
{
|
||||||
AjaxResult ajaxResult = new AjaxResult();
|
AjaxResult ajaxResult = new AjaxResult();
|
||||||
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
List<StorageLocation> listA = storageLocationService.selectStorageLocationAList(storageLocation);
|
List<StorageLocation> listA = storageLocationService.selectStorageLocationAList(storageLocation);
|
||||||
List<StorageLocation> listB = storageLocationService.selectStorageLocationBList(storageLocation);
|
List<StorageLocation> listB = storageLocationService.selectStorageLocationBList(storageLocation);
|
||||||
List<StorageLocation> listC = storageLocationService.selectStorageLocationCList(storageLocation);
|
List<StorageLocation> listC = storageLocationService.selectStorageLocationCList(storageLocation);
|
||||||
|
@ -52,6 +54,38 @@ public class storageLocationController extends BaseController
|
||||||
ajaxResult.put("materialDetailA",listA);
|
ajaxResult.put("materialDetailA",listA);
|
||||||
ajaxResult.put("materialDetailB",listB);
|
ajaxResult.put("materialDetailB",listB);
|
||||||
ajaxResult.put("materialDetailC",listC);
|
ajaxResult.put("materialDetailC",listC);
|
||||||
|
|
||||||
|
//根据库位状态 同步更新库位占用缓存-刷新页面时用
|
||||||
|
for(StorageLocation sl:listA){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
|
if("0".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationZyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(StorageLocation sl:listB){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
|
if("0".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationZyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(StorageLocation sl:listC){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
|
if("0".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationZyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,13 +99,13 @@ public class storageLocationController extends BaseController
|
||||||
String user_name = getLoginUser().getUsername();//当前登陆者
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
String materialBh = storageLocation.getMaterialBh();
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
String kw_user_name = redisCache.getCacheObject(getCacheKey(materialBh));
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
if(StringUtils.isNull(kw_user_name)){
|
if(StringUtils.isNull(kw_user_name)){
|
||||||
return error("已超过有效录入信息时间,请关闭重新录入!");
|
return error("已超过有效录入信息时间,请关闭重新录入!");
|
||||||
}else if(!user_name.equals(kw_user_name)){
|
}else if(!user_name.equals(kw_user_name)){
|
||||||
return error("已超过有效录入信息时间,当前库位有人正在操作!");
|
return error("已超过有效录入信息时间,当前库位有人正在操作!");
|
||||||
}else{
|
}else{
|
||||||
redisCache.setCacheObject(getCacheKey(materialBh),user_name);
|
redisCache.setCacheObject(getLocationZyCacheKey(materialBh),user_name);
|
||||||
return toAjax(storageLocationService.addStorageLocation(storageLocation));
|
return toAjax(storageLocationService.addStorageLocation(storageLocation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,11 +123,11 @@ public class storageLocationController extends BaseController
|
||||||
String user_name = getLoginUser().getUsername();//当前登陆者
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
String materialBh = storageLocation.getMaterialBh();
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
String kw_user_name = redisCache.getCacheObject(getCacheKey(materialBh));
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
if(StringUtils.isNotNull(kw_user_name)&&!user_name.equals(kw_user_name)){
|
if(StringUtils.isNotNull(kw_user_name)&&!user_name.equals(kw_user_name)){
|
||||||
return error("当前库位有人正在操作,请勿操作!");
|
return error("当前库位有人正在操作,请勿操作!");
|
||||||
}else{
|
}else{
|
||||||
redisCache.setCacheObject(getCacheKey(materialBh),user_name,Integer.valueOf(storageExpire), TimeUnit.SECONDS);
|
redisCache.setCacheObject(getLocationZyCacheKey(materialBh),user_name,Integer.valueOf(storageExpire), TimeUnit.SECONDS);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,22 +142,153 @@ public class storageLocationController extends BaseController
|
||||||
String user_name = getLoginUser().getUsername();//当前登陆者
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
String materialBh = storageLocation.getMaterialBh();
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
String kw_user_name = redisCache.getCacheObject(getCacheKey(materialBh));
|
String kw_user_name = redisCache.getCacheObject(getLocationZyCacheKey(materialBh));
|
||||||
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
redisCache.deleteObject(getCacheKey(materialBh));
|
redisCache.deleteObject(getLocationZyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
/*===========================================库位设置==========================================================*/
|
||||||
|
|
||||||
|
/*===========================================库位领用==========================================================*/
|
||||||
|
/**
|
||||||
|
* 获取库位领用信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/lyList")
|
||||||
|
public AjaxResult lyList(StorageLocation storageLocation)
|
||||||
|
{
|
||||||
|
AjaxResult ajaxResult = new AjaxResult();
|
||||||
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
|
List<StorageLocation> listA = storageLocationService.selectStorageLocationAList(storageLocation);
|
||||||
|
List<StorageLocation> listB = storageLocationService.selectStorageLocationBList(storageLocation);
|
||||||
|
List<StorageLocation> listC = storageLocationService.selectStorageLocationCList(storageLocation);
|
||||||
|
|
||||||
|
ajaxResult.put("materialDetailA",listA);
|
||||||
|
ajaxResult.put("materialDetailB",listB);
|
||||||
|
ajaxResult.put("materialDetailC",listC);
|
||||||
|
|
||||||
|
//根据库位状态 同步更新库位占用缓存-刷新页面时用
|
||||||
|
for(StorageLocation sl:listA){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if("1".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationLyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(StorageLocation sl:listB){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if("1".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationLyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(StorageLocation sl:listC){
|
||||||
|
String materialBh = sl.getMaterialBh();
|
||||||
|
String materialState = sl.getMaterialState();
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if("1".equals(materialState)){
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationLyCacheKey(materialBh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验库位是否被领用
|
||||||
|
*/
|
||||||
|
@Log(title = "校验库位是否被领用", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/checklyStorageLocation")
|
||||||
|
public AjaxResult checklyStorageLocation(@RequestBody StorageLocation storageLocation)
|
||||||
|
{
|
||||||
|
String storageExpire = configService.selectConfigByKey("storage.expire.ly");
|
||||||
|
|
||||||
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&!user_name.equals(kw_user_name)){
|
||||||
|
return error("当前库位有人正在操作,请勿操作!");
|
||||||
|
}else{
|
||||||
|
redisCache.setCacheObject(getLocationLyCacheKey(materialBh),user_name);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除库位领用缓存
|
||||||
|
*/
|
||||||
|
@Log(title = "清除库位领用缓存", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/clearLocationLyCacheKey")
|
||||||
|
public AjaxResult clearLocationLyCacheKey(@RequestBody StorageLocation storageLocation)
|
||||||
|
{
|
||||||
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&user_name.equals(kw_user_name)){
|
||||||
|
redisCache.deleteObject(getLocationLyCacheKey(materialBh));
|
||||||
}
|
}
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库位缓存键名
|
* 确认完成认领
|
||||||
|
*/
|
||||||
|
@Log(title = "确认完成认领", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/confirmStorageLocation")
|
||||||
|
public AjaxResult confirmStorageLocation(@RequestBody String [] materialBhArr)
|
||||||
|
{
|
||||||
|
|
||||||
|
System.out.println(materialBhArr);
|
||||||
|
/* String storageExpire = configService.selectConfigByKey("storage.expire.ly");
|
||||||
|
|
||||||
|
String user_name = getLoginUser().getUsername();//当前登陆者
|
||||||
|
String materialBh = storageLocation.getMaterialBh();
|
||||||
|
|
||||||
|
String kw_user_name = redisCache.getCacheObject(getLocationLyCacheKey(materialBh));
|
||||||
|
if(StringUtils.isNotNull(kw_user_name)&&!user_name.equals(kw_user_name)){
|
||||||
|
return error("当前库位有人正在操作,请勿操作!");
|
||||||
|
}else{
|
||||||
|
redisCache.setCacheObject(getLocationLyCacheKey(materialBh),user_name);
|
||||||
|
return success();
|
||||||
|
}*/
|
||||||
|
storageLocationService.confirmStorageLocation(materialBhArr);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================库位领用==========================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位占用缓存键名
|
||||||
*
|
*
|
||||||
* @param materialBh 库位号
|
* @param materialBh 库位号
|
||||||
* @return 缓存键key
|
* @return 缓存键key
|
||||||
*/
|
*/
|
||||||
private String getCacheKey(String materialBh)
|
private String getLocationZyCacheKey(String materialBh)
|
||||||
{
|
{
|
||||||
return CacheConstants.STORAGE_LOCATION + materialBh;
|
return CacheConstants.STORAGE_LOCATION + materialBh + "-ZY";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位领用缓存键名
|
||||||
|
*
|
||||||
|
* @param materialBh 库位号
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
private String getLocationLyCacheKey(String materialBh)
|
||||||
|
{
|
||||||
|
return CacheConstants.STORAGE_LOCATION + materialBh + "-LY";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,10 @@ public interface StorageLocationMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int addStorageLocation(StorageLocation storageLocation);
|
int addStorageLocation(StorageLocation storageLocation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认完成认领
|
||||||
|
* @param materialBhArr
|
||||||
|
*/
|
||||||
|
void confirmStorageLocation(String[] materialBhArr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,10 @@ public interface StorageLocationService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int addStorageLocation(StorageLocation storageLocation);
|
int addStorageLocation(StorageLocation storageLocation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认完成认领
|
||||||
|
* @param materialBhArr
|
||||||
|
*/
|
||||||
|
void confirmStorageLocation(String[] materialBhArr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,13 @@ public class StorageLocationServiceImpl implements StorageLocationService
|
||||||
public int addStorageLocation(StorageLocation storageLocation) {
|
public int addStorageLocation(StorageLocation storageLocation) {
|
||||||
return storageLocationMapper.addStorageLocation(storageLocation);
|
return storageLocationMapper.addStorageLocation(storageLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认完成认领
|
||||||
|
* @param materialBhArr
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void confirmStorageLocation(String[] materialBhArr) {
|
||||||
|
storageLocationMapper.confirmStorageLocation(materialBhArr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,4 +40,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where materialBh = #{materialBh}
|
where materialBh = #{materialBh}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="confirmStorageLocation">
|
||||||
|
update storageLocation set materialState = '0'
|
||||||
|
<where>
|
||||||
|
materialBh
|
||||||
|
<foreach collection="array" item="materialBh" index="index" open="in (" close=")" separator=",">
|
||||||
|
#{materialBh}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -3,34 +3,34 @@ import request from '@/utils/request'
|
||||||
// 获取库位信息
|
// 获取库位信息
|
||||||
export function listStorageLocation(query) {
|
export function listStorageLocation(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/storageLocation/storageLocation/list',
|
url: '/storageLocation/storageLocation/lyList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 录入库位信息
|
// 校验库位是否被领用
|
||||||
export function addStorageLocation(data) {
|
|
||||||
return request({
|
|
||||||
url: '/storageLocation/storageLocation',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 校验库位是否已占用
|
|
||||||
export function checkStorageLocation(data) {
|
export function checkStorageLocation(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/storageLocation/storageLocation/checkStorageLocation',
|
url: '/storageLocation/storageLocation/checklyStorageLocation',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹窗取消按钮 清除库位缓存
|
// 清除库位领用缓存
|
||||||
export function cancelStorageLocation(data) {
|
export function clearLocationLyCacheKey(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/storageLocation/storageLocation/cancelStorageLocation',
|
url: '/storageLocation/storageLocation/clearLocationLyCacheKey',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认完成认领
|
||||||
|
export function confirmStorageLocation(data) {
|
||||||
|
return request({
|
||||||
|
url: '/storageLocation/storageLocation/confirmStorageLocation',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|
|
@ -27,7 +27,7 @@ export function checkStorageLocation(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹窗取消按钮 清除库位缓存
|
// 弹窗取消按钮 清除库位占用缓存
|
||||||
export function cancelStorageLocation(data) {
|
export function cancelStorageLocation(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/storageLocation/storageLocation/cancelStorageLocation',
|
url: '/storageLocation/storageLocation/cancelStorageLocation',
|
||||||
|
|
|
@ -81,11 +81,11 @@
|
||||||
状态
|
状态
|
||||||
</template>
|
</template>
|
||||||
<span v-if = "item.materialState=='0'">
|
<span v-if = "item.materialState=='0'">
|
||||||
<el-tag size="mini" type="success">空闲</el-tag>
|
<el-tag size="mini" type="success">空闲</el-tag>
|
||||||
</span>
|
</span>
|
||||||
<span v-if = "item.materialState=='1'">
|
<span v-if = "item.materialState=='1'">
|
||||||
<el-tag size="mini" type="danger">占用</el-tag>
|
<el-tag size="mini" type="danger" @click="selectLocation(item)">占用</el-tag>
|
||||||
</span>
|
</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
|
@ -134,11 +134,11 @@
|
||||||
状态
|
状态
|
||||||
</template>
|
</template>
|
||||||
<span v-if = "item.materialState=='0'">
|
<span v-if = "item.materialState=='0'">
|
||||||
<el-tag size="mini" type="success">空闲</el-tag>
|
<el-tag size="mini" type="success">空闲</el-tag>
|
||||||
</span>
|
</span>
|
||||||
<span v-if = "item.materialState=='1'">
|
<span v-if = "item.materialState=='1'">
|
||||||
<el-tag size="mini" type="danger">占用</el-tag>
|
<el-tag size="mini" type="danger" @click="selectLocation(item)">占用</el-tag>
|
||||||
</span>
|
</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
|
@ -221,17 +221,170 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="已选库位" name="locationSelected">
|
<el-tab-pane label="已选库位" name="locationSelected">
|
||||||
<el-row :gutter="10" style="letter-spacing: 5px;">
|
<el-container>
|
||||||
<el-col :span="8">
|
<el-main>
|
||||||
<div class="grid-content bg-purpleA">黄色线芯A区(余{{countA}})</div>
|
<el-row :gutter="10" style="letter-spacing: 5px;">
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<div class="grid-content bg-purpleA">黄色线芯A区</div>
|
||||||
<div class="grid-content bg-purpleB">绿色线芯B区(余{{countB}})</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<div class="grid-content bg-purpleB">绿色线芯B区</div>
|
||||||
<div class="grid-content bg-purpleC">红色线芯C区(余{{countC}})</div>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
</el-row>
|
<div class="grid-content bg-purpleC">红色线芯C区</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card class="box-card scrollable">
|
||||||
|
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :15px'" v-for="(item,index) in selMaterialDetailA" :key="item.materialBh">
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
库位
|
||||||
|
</template>
|
||||||
|
<span class="kw">{{item.materialBh}}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
操作
|
||||||
|
</template>
|
||||||
|
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="del(item)"></el-button>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
指令号
|
||||||
|
</template>
|
||||||
|
{{item.materialZlh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
型号
|
||||||
|
</template>
|
||||||
|
{{item.materialXingh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
规格
|
||||||
|
</template>
|
||||||
|
{{item.materialGuig}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
电压等级
|
||||||
|
</template>
|
||||||
|
{{item.materialDiany}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
米数
|
||||||
|
</template>
|
||||||
|
{{item.materialMs}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card class="box-card scrollable">
|
||||||
|
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in selMaterialDetailB" :key="item.materialBh">
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
库位
|
||||||
|
</template>
|
||||||
|
<span class="kw">{{item.materialBh}}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
操作
|
||||||
|
</template>
|
||||||
|
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="del(item)"></el-button>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
指令号
|
||||||
|
</template>
|
||||||
|
{{item.materialZlh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
型号
|
||||||
|
</template>
|
||||||
|
{{item.materialXingh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
规格
|
||||||
|
</template>
|
||||||
|
{{item.materialGuig}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
电压等级
|
||||||
|
</template>
|
||||||
|
{{item.materialDiany}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
米数
|
||||||
|
</template>
|
||||||
|
{{item.materialMs}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card class="box-card scrollable">
|
||||||
|
<el-descriptions border :column="2" size="small" :style="index==0?'': 'margin-top :12px'" v-for="(item,index) in selMaterialDetailC" :key="item.materialBh">
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
库位
|
||||||
|
</template>
|
||||||
|
<span class="kw">{{item.materialBh}}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
操作
|
||||||
|
</template>
|
||||||
|
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="del(item)"></el-button>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
指令号
|
||||||
|
</template>
|
||||||
|
{{item.materialZlh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
型号
|
||||||
|
</template>
|
||||||
|
{{item.materialXingh}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
规格
|
||||||
|
</template>
|
||||||
|
{{item.materialGuig}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
电压等级
|
||||||
|
</template>
|
||||||
|
{{item.materialDiany}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :contentStyle='contentStyle' :labelStyle='labelStyle'>
|
||||||
|
<template slot="label">
|
||||||
|
米数
|
||||||
|
</template>
|
||||||
|
{{item.materialMs}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
<el-footer style="margin:0 auto;">
|
||||||
|
<el-button type="primary" @click="confirm()">确认</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
|
@ -281,7 +434,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { listStorageLocation, addStorageLocation, checkStorageLocation,cancelStorageLocation } from "@/api/storageLocation/storageLocation";
|
import { listStorageLocation, checkStorageLocation,clearLocationLyCacheKey, confirmStorageLocation } from "@/api/storageLocation/storageConsuming";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "locationConsuming.vue",
|
name: "locationConsuming.vue",
|
||||||
|
@ -314,6 +467,11 @@
|
||||||
materialDetailA:[],
|
materialDetailA:[],
|
||||||
materialDetailB:[],
|
materialDetailB:[],
|
||||||
materialDetailC:[],
|
materialDetailC:[],
|
||||||
|
|
||||||
|
//已选库位信息数据
|
||||||
|
selMaterialDetailA:[],
|
||||||
|
selMaterialDetailB:[],
|
||||||
|
selMaterialDetailC:[],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -430,10 +588,98 @@
|
||||||
showClose: false,//是否显示右上角关闭按钮
|
showClose: false,//是否显示右上角关闭按钮
|
||||||
type: "warning",//提示类型 success/info/warning/error
|
type: "warning",//提示类型 success/info/warning/error
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
//校验库位是否被其他人领用
|
var materialBh = item.materialBh;
|
||||||
|
this.form.materialBh = materialBh;
|
||||||
|
|
||||||
|
//校验是否已选
|
||||||
|
var index = "";
|
||||||
|
if(materialBh.indexOf('A-')==0){
|
||||||
|
index = this.selMaterialDetailA.findIndex(item => item.materialBh === materialBh);
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('B-')==0){
|
||||||
|
index = this.selMaterialDetailB.findIndex(item => item.materialBh === materialBh);
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('C-')==0){
|
||||||
|
index = this.selMaterialDetailC.findIndex(item => item.materialBh === materialBh);
|
||||||
|
}
|
||||||
|
if (index !== -1) {
|
||||||
|
this.$message({
|
||||||
|
message: '该库位 '+ materialBh +' 已选,请勿重复选!',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验库位是否被领用
|
||||||
|
checkStorageLocation(this.form).then(response => {
|
||||||
|
if(materialBh.indexOf('A-')==0){
|
||||||
|
this.selMaterialDetailA.push(item)
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('B-')==0){
|
||||||
|
this.selMaterialDetailB.push(item)
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('C-')==0){
|
||||||
|
this.selMaterialDetailC.push(item)
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
message: '已成功选择库位 '+ materialBh,
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
//取消操作
|
//取消操作
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
//删除已选库位
|
||||||
|
del(item){
|
||||||
|
var materialBh = item.materialBh;
|
||||||
|
this.form.materialBh = materialBh;
|
||||||
|
if(materialBh.indexOf('A-')==0){
|
||||||
|
const index = this.selMaterialDetailA.findIndex(item => item.materialBh === materialBh);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.selMaterialDetailA.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('B-')==0){
|
||||||
|
debugger
|
||||||
|
const index = this.selMaterialDetailB.findIndex(item => item.materialBh === materialBh);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.selMaterialDetailB.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(materialBh.indexOf('C-')==0){
|
||||||
|
const index = this.selMaterialDetailC.findIndex(item => item.materialBh === materialBh);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.selMaterialDetailC.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//清除库位领用缓存
|
||||||
|
clearLocationLyCacheKey(this.form).then(response => {
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//确认完成认领
|
||||||
|
confirm(){
|
||||||
|
var materialBhArr = [];
|
||||||
|
this.selMaterialDetailA.forEach(function(item,index,array) {
|
||||||
|
materialBhArr.push(item.materialBh)
|
||||||
|
})
|
||||||
|
this.selMaterialDetailB.forEach(function(item,index,array) {
|
||||||
|
materialBhArr.push(item.materialBh)
|
||||||
|
})
|
||||||
|
this.selMaterialDetailC.forEach(function(item,index,array) {
|
||||||
|
materialBhArr.push(item.materialBh)
|
||||||
|
})
|
||||||
|
confirmStorageLocation(materialBhArr).then(response => {
|
||||||
|
this.$modal.msgSuccess("领用成功");
|
||||||
|
this.activeName = 'locationShow';
|
||||||
|
this.getStorageLocation();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,11 @@
|
||||||
font-size: 15px;color: black;font-weight: bold
|
font-size: 15px;color: black;font-weight: bold
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 修改标签本身的样式 */
|
||||||
|
.el-tag:hover {
|
||||||
|
cursor: pointer; /* 将鼠标形状改为指针形状 */
|
||||||
|
}
|
||||||
|
|
||||||
/*卡片内容滚动条设置*/
|
/*卡片内容滚动条设置*/
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
display: none; /* Chrome Safari */
|
display: none; /* Chrome Safari */
|
||||||
|
|
Loading…
Reference in New Issue