Compare commits
4 Commits
feature/vo
...
featrue_in
| Author | SHA1 | Date | |
|---|---|---|---|
| bc70318571 | |||
|
|
aba35e4c31 | ||
|
|
b68a029c4b | ||
|
|
08f052231d |
@@ -17,7 +17,6 @@ package org.nl.common.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.language.I18nManagerService;
|
||||
|
||||
public class I18nUtil {
|
||||
private static I18nManagerService i18nManagerService = SpringContextHolder.getBean(I18nManagerService.class);
|
||||
|
||||
public static String msg(String key,String...args) {
|
||||
if(StringUtils.isBlank(key)){
|
||||
return "";
|
||||
}
|
||||
String msg = i18nManagerService.getCurrentMessage(key);
|
||||
for(String arg: args){
|
||||
msg += arg;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package org.nl.config.language;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
@Service
|
||||
public class I18nManagerService implements InitializingBean, DisposableBean {
|
||||
private final I18nProperties properties;
|
||||
private final Map<String, JSONObject> langCache = new HashMap<>();
|
||||
private final Map<String, Long> lastModifiedTimes = new HashMap<>();
|
||||
private final Map<String, String> filePaths = new HashMap<>();
|
||||
private ScheduledExecutorService scheduler;
|
||||
// 默认语言(从配置中获取)
|
||||
private String defaultLang;
|
||||
|
||||
public I18nManagerService(I18nProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
// 初始化默认语言
|
||||
if (!properties.getSupportedLanguages().isEmpty()) {
|
||||
defaultLang = properties.getSupportedLanguages().get(0);
|
||||
}
|
||||
|
||||
// 加载所有语言文件
|
||||
for (String lang : properties.getSupportedLanguages()) {
|
||||
loadLangFile(lang);
|
||||
}
|
||||
|
||||
// startRefreshScheduler();
|
||||
}
|
||||
|
||||
// 新增:不带语言参数的方法,从上下文获取当前语言
|
||||
public JSONObject getCurrentLangConfig() {
|
||||
String lang = LangContextHolder.getLangOrDefault(defaultLang);
|
||||
return getLangConfig(lang);
|
||||
}
|
||||
|
||||
// 新增:不带语言参数的方法,从上下文获取当前语言
|
||||
public String getCurrentMessage(String key) {
|
||||
String lang = LangContextHolder.getLangOrDefault(defaultLang);
|
||||
return getMessage(lang, key);
|
||||
}
|
||||
|
||||
// 以下为原有方法(保持不变)
|
||||
private void loadLangFile(String lang) throws IOException {
|
||||
String fileName = lang + ".js";
|
||||
String fullPath = properties.getLocation() + fileName;
|
||||
Resource resource = getResource(fullPath);
|
||||
|
||||
if (!resource.exists() && properties.isFallbackToClasspath()) {
|
||||
fullPath = "language/i18n/lang_" + fileName;
|
||||
resource = new ClassPathResource(fullPath);
|
||||
}
|
||||
|
||||
if (!resource.exists()) {
|
||||
throw new IOException("Language file not found: " + fullPath);
|
||||
}
|
||||
|
||||
String content = new String(Files.readAllBytes(Paths.get(resource.getURI())),
|
||||
StandardCharsets.UTF_8);
|
||||
JSONObject config = parseJsConfig(content);
|
||||
|
||||
langCache.put(lang, config);
|
||||
lastModifiedTimes.put(lang, getLastModifiedTime(resource));
|
||||
filePaths.put(lang, fullPath);
|
||||
}
|
||||
|
||||
private Resource getResource(String path) {
|
||||
if (path.startsWith("file:")) {
|
||||
return new FileSystemResource(path.substring("file:".length()));
|
||||
} else if (path.startsWith("classpath:")) {
|
||||
return new ClassPathResource(path.substring("classpath:".length()));
|
||||
} else {
|
||||
return new FileSystemResource(path);
|
||||
}
|
||||
}
|
||||
|
||||
private long getLastModifiedTime(Resource resource) throws IOException {
|
||||
if (resource instanceof FileSystemResource) {
|
||||
return ((FileSystemResource) resource).getFile().lastModified();
|
||||
} else if (resource instanceof ClassPathResource) {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private JSONObject parseJsConfig(String jsContent) {
|
||||
String jsonStr = jsContent.replace("var config = ","").trim();
|
||||
return JSON.parseObject(jsonStr);
|
||||
}
|
||||
|
||||
public JSONObject getLangConfig(String lang) {
|
||||
if (!langCache.containsKey(lang)) {
|
||||
lang = defaultLang;
|
||||
}
|
||||
return langCache.get(lang);
|
||||
}
|
||||
|
||||
public String getMessage(String lang, String key) {
|
||||
JSONObject config = getLangConfig(lang);
|
||||
if (config == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] keyParts = key.split("\\.");
|
||||
JSONObject current = config;
|
||||
|
||||
for (int i = 0; i < keyParts.length; i++) {
|
||||
if (i == keyParts.length - 1) {
|
||||
return StringUtils.isEmpty(current.getString(keyParts[i])) ? key : current.getString(keyParts[i]);
|
||||
}
|
||||
current = current.getJSONObject(keyParts[i]);
|
||||
if (current == null) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
// private void startRefreshScheduler() {
|
||||
// scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
// scheduler.scheduleAtFixedRate(() -> {
|
||||
// try {
|
||||
// checkAndRefreshFiles();
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("Error checking for language file updates: " + e.getMessage());
|
||||
// }
|
||||
// }, 0, properties.getRefreshInterval(), TimeUnit.SECONDS);
|
||||
// }
|
||||
|
||||
// private void checkAndRefreshFiles() throws IOException {
|
||||
// for (String lang : properties.getSupportedLanguages()) {
|
||||
// String fullPath = filePaths.get(lang);
|
||||
// if (StringUtils.isEmpty(fullPath)) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// Resource resource = getResource(fullPath);
|
||||
// if (!resource.exists()) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// long currentLastModified = getLastModifiedTime(resource);
|
||||
// if (currentLastModified > lastModifiedTimes.getOrDefault(lang, 0L)) {
|
||||
// loadLangFile(lang);
|
||||
// System.out.println("Language file updated: " + lang + " (" + fullPath + ")");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (scheduler != null) {
|
||||
scheduler.shutdown();
|
||||
}
|
||||
langCache.clear();
|
||||
lastModifiedTimes.clear();
|
||||
filePaths.clear();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.nl.config.language;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "i18n")
|
||||
public class I18nProperties {
|
||||
// 语言文件存放路径,可以是外部路径或classpath
|
||||
private String location = "D:\\i18n\\";
|
||||
// 热更新检查间隔(秒)
|
||||
private long refreshInterval = 60;
|
||||
// 支持的语言列表
|
||||
private List<String> supportedLanguages = Arrays.asList("en", "zh", "ja");
|
||||
// 当外部文件不存在时,是否回退到classpath中的默认文件
|
||||
private boolean fallbackToClasspath = true;
|
||||
|
||||
// getter和setter方法
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public long getRefreshInterval() {
|
||||
return refreshInterval;
|
||||
}
|
||||
|
||||
public void setRefreshInterval(long refreshInterval) {
|
||||
this.refreshInterval = refreshInterval;
|
||||
}
|
||||
|
||||
public List<String> getSupportedLanguages() {
|
||||
return supportedLanguages;
|
||||
}
|
||||
|
||||
public void setSupportedLanguages(List<String> supportedLanguages) {
|
||||
this.supportedLanguages = supportedLanguages;
|
||||
}
|
||||
|
||||
public boolean isFallbackToClasspath() {
|
||||
return fallbackToClasspath;
|
||||
}
|
||||
|
||||
public void setFallbackToClasspath(boolean fallbackToClasspath) {
|
||||
this.fallbackToClasspath = fallbackToClasspath;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.config.language;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
public class LangContextHolder {
|
||||
// 线程本地变量,存储当前线程的语言标识
|
||||
private static final ThreadLocal<String> LANG_HOLDER = new ThreadLocal<>();
|
||||
|
||||
// 设置当前线程的语言
|
||||
public static void setLang(String lang) {
|
||||
LANG_HOLDER.set(lang);
|
||||
}
|
||||
|
||||
// 获取当前线程的语言
|
||||
public static String getLang() {
|
||||
return LANG_HOLDER.get();
|
||||
}
|
||||
|
||||
// 清除当前线程的语言设置(防止内存泄漏)
|
||||
public static void clear() {
|
||||
LANG_HOLDER.remove();
|
||||
}
|
||||
|
||||
// 获取当前语言,如果未设置则返回默认语言
|
||||
public static String getLangOrDefault(String defaultLang) {
|
||||
String lang = getLang();
|
||||
return StringUtils.hasText(lang) ? lang : defaultLang;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.nl.config.language;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@Component
|
||||
public class LangInterceptor implements HandlerInterceptor {
|
||||
|
||||
// 支持的语言列表(实际项目中可从配置获取)
|
||||
private final I18nProperties properties;
|
||||
|
||||
public LangInterceptor(I18nProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
// 1. 从请求参数获取语言(如 ?lang=zh)
|
||||
String lang = request.getParameter("lang");
|
||||
|
||||
// 2. 如果参数不存在,可从Header获取(如 Accept-Language)
|
||||
if (lang == null || lang.isEmpty()) {
|
||||
lang = request.getHeader("Accept-Language");
|
||||
// 简单处理,只取前两位(如 zh-CN -> zh)
|
||||
if (lang != null && lang.length() >= 2) {
|
||||
lang = lang.substring(0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 验证语言是否在支持的列表中
|
||||
if (lang != null && properties.getSupportedLanguages().contains(lang)) {
|
||||
LangContextHolder.setLang(lang);
|
||||
} else {
|
||||
// 不支持的语言使用默认语言
|
||||
LangContextHolder.setLang(properties.getSupportedLanguages().get(0));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler, Exception ex) {
|
||||
// 清除线程变量,防止内存泄漏
|
||||
LangContextHolder.clear();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.config.language;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
private final LangInterceptor langInterceptor;
|
||||
|
||||
public WebConfig(LangInterceptor langInterceptor) {
|
||||
this.langInterceptor = langInterceptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 对所有请求生效
|
||||
registry.addInterceptor(langInterceptor).addPathPatterns("/**");
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,12 @@ public class SectattrController {
|
||||
return new ResponseEntity<>(iSectattrService.getSect(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSectCode")
|
||||
@Log("查询库区下拉框")
|
||||
public ResponseEntity<Object> querySectCode(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iSectattrService.getSectCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改库区状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public interface ISectattrService extends IService<Sectattr> {
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
JSONObject getSect(Map whereJson);
|
||||
JSONObject getSectCode(Map whereJson);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
|
||||
@@ -179,7 +179,68 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
stor_cas.put("label", stor_jo.getStor_name());
|
||||
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.select(Sectattr::getSect_code,Sectattr::getSect_name)
|
||||
.select(Sectattr::getSect_code,Sectattr::getSect_id,Sectattr::getSect_name)
|
||||
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_id,stor_jo.getStor_id())
|
||||
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
||||
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(Sectattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
);
|
||||
|
||||
if (!sectattrList.isEmpty()) {
|
||||
JSONArray sect_ja = new JSONArray();
|
||||
for (int j = 0; j < sectattrList.size(); j++) {
|
||||
Sectattr sect_jo = sectattrList.get(j);
|
||||
JSONObject sect_cas = new JSONObject();
|
||||
sect_cas.put("value", sect_jo.getSect_id());
|
||||
sect_cas.put("label", sect_jo.getSect_name());
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
stor_cas.put("children", sect_ja);
|
||||
}
|
||||
new_ja.add(stor_cas);
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", new_ja);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getSectCode(Map whereJson) {
|
||||
JSONArray new_ja = new JSONArray();
|
||||
|
||||
String is_materialstore = (String) whereJson.get("is_materialstore");
|
||||
String is_virtualstore = (String) whereJson.get("is_virtualstore");
|
||||
String is_semi_finished = (String) whereJson.get("is_semi_finished");
|
||||
String is_productstore = (String) whereJson.get("is_productstore");
|
||||
String is_attachment = (String) whereJson.get("is_attachment");
|
||||
String is_reversed = (String) whereJson.get("is_reversed");
|
||||
String sect_type_attr = (String) whereJson.get("sect_type_attr");
|
||||
String stor_id = (String) whereJson.get("stor_id");
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.select(BsrealStorattr::getStor_id, BsrealStorattr::getStor_code, BsrealStorattr::getStor_name)
|
||||
.eq(StrUtil.isNotEmpty(is_materialstore),BsrealStorattr::getIs_materialstore,is_materialstore)
|
||||
.eq(StrUtil.isNotEmpty(is_virtualstore),BsrealStorattr::getIs_virtualstore,is_virtualstore)
|
||||
.eq(StrUtil.isNotEmpty(is_semi_finished),BsrealStorattr::getIs_materialstore,is_semi_finished)
|
||||
.eq(StrUtil.isNotEmpty(is_productstore),BsrealStorattr::getIs_materialstore,is_productstore)
|
||||
.eq(StrUtil.isNotEmpty(is_attachment),BsrealStorattr::getIs_materialstore,is_attachment)
|
||||
.eq(StrUtil.isNotEmpty(is_reversed),BsrealStorattr::getIs_materialstore,is_reversed)
|
||||
.eq(StrUtil.isNotEmpty(stor_id),BsrealStorattr::getStor_id,stor_id)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")
|
||||
);
|
||||
|
||||
List<BsrealStorattr> bsrealStorattrList = iBsrealStorattrService.list(queryWrapper);
|
||||
|
||||
for (int i = 0; i < bsrealStorattrList.size(); i++) {
|
||||
BsrealStorattr stor_jo = bsrealStorattrList.get(i);
|
||||
JSONObject stor_cas = new JSONObject();
|
||||
stor_cas.put("value", stor_jo.getStor_code());
|
||||
stor_cas.put("label", stor_jo.getStor_name());
|
||||
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.select(Sectattr::getSect_code,Sectattr::getSect_id,Sectattr::getSect_name)
|
||||
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_id,stor_jo.getStor_id())
|
||||
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
||||
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
|
||||
@@ -54,7 +54,6 @@ public class ForewarningTask {
|
||||
|
||||
//定时任务
|
||||
@SneakyThrows
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void run() {
|
||||
RLock lock = redissonClient.getLock(this.getClass().getName());
|
||||
boolean tryLock = lock.tryLock(2, TimeUnit.SECONDS);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class UpdateIvtUtils {
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateAddCanuseInsertIvt(JSONObject where) {
|
||||
throw new BadRequestException("当前载具已存在库存物料,请检查数据!");
|
||||
// throw new BadRequestException("当前载具已存在库存物料,请检查数据!");
|
||||
// 判断当前载具是否有物料
|
||||
// MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
// new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
@@ -197,7 +197,7 @@ public class UpdateIvtUtils {
|
||||
}
|
||||
// 如果可用数和冻结数都为零则删除数据
|
||||
if (frozen_qty == 0 && extDao.getQty().doubleValue() == 0) {
|
||||
iMdPbStoragevehicleextService.removeById(extDao);
|
||||
// iMdPbStoragevehicleextService.removeById(extDao);
|
||||
} else {
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
|
||||
@@ -12,7 +12,7 @@ spring:
|
||||
url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:wms_standardv1}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:P@ssw0rd.}
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
# 最小连接数
|
||||
|
||||
@@ -36,6 +36,20 @@ login:
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
|
||||
i18n:
|
||||
# 语言文件存放路径(支持外部路径和classpath)
|
||||
location: D:/i18n/lang_
|
||||
# 热更新检查间隔(秒)
|
||||
refresh-interval: 30
|
||||
# 支持的语言列表
|
||||
supported-languages:
|
||||
- zh
|
||||
- en
|
||||
- in
|
||||
- ja
|
||||
# 当外部文件不存在时,是否回退到classpath中的默认文件
|
||||
fallback-to-classpath: true
|
||||
|
||||
#密码加密传输,前端公钥加密,后端私钥解密
|
||||
rsa:
|
||||
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
var config = {
|
||||
"lang": "English222",
|
||||
"platform": {
|
||||
"title": "NOBLELIFT Platform",
|
||||
"tip1": "The user name cannot be empty",
|
||||
"tip2": "The password cannot be empty",
|
||||
"tip3": "当前语言,111111英语"
|
||||
},
|
||||
"common": {
|
||||
"home": "Dashboard",
|
||||
"Layout_setting": "Layout Setting"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var config = {
|
||||
"lang": "English222",
|
||||
"platform": {
|
||||
"title": "NOBLELIFT Platform",
|
||||
"tip1": "The user name cannot be empty",
|
||||
"tip2": "The password cannot be empty",
|
||||
"tip3": "当前语言,1111印度尼西3333333亚语"
|
||||
},
|
||||
"common": {
|
||||
"home": "Dashboard",
|
||||
"Layout_setting": "Layout Setting"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var config = {
|
||||
"lang": "English222",
|
||||
"platform": {
|
||||
"title": "NOBLELIFT Platform",
|
||||
"tip1": "The user name cannot be empty",
|
||||
"tip2": "The password cannot be empty",
|
||||
"tip3": "The verification code cannot be empty"
|
||||
},
|
||||
"common": {
|
||||
"home": "Dashboard",
|
||||
"Layout_setting": "Layout Setting"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var config = {
|
||||
"lang": "English222",
|
||||
"platform": {
|
||||
"title": "NOBLELIFT Platform",
|
||||
"tip1": "The user name cannot be empty",
|
||||
"tip2": "The password cannot be empty",
|
||||
"tip3": "当前语言中文"
|
||||
},
|
||||
"common": {
|
||||
"home": "Dashboard",
|
||||
"Layout_setting": "Layout Setting"
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code" >
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -102,9 +102,9 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="material_code" label="物料编码" width="160" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
||||
<el-table-column prop="material_model" label="物料型号" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="material_model" label="物料型号" width="680" show-overflow-tooltip />
|
||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
@@ -138,7 +138,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<UploadDialog :dialog-show.sync="uploadShow"/>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -32,6 +32,14 @@ export function getSect(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getSectCode(params) {
|
||||
return request({
|
||||
url: 'api/sectattr/getSectCode',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/sectattr/changeActive',
|
||||
@@ -40,4 +48,4 @@ export function changeActive(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getSect, changeActive }
|
||||
export default { add, edit, del, getSect, getSectCode, changeActive }
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
@@ -67,30 +67,34 @@
|
||||
>
|
||||
<el-form ref="form" :model="materialForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.vehicle_code" disabled style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="materialForm.material_code" clearable style="width: 370px"
|
||||
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''">
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater"/>
|
||||
<el-input
|
||||
v-model="materialForm.material_code"
|
||||
clearable
|
||||
style="width: 370px"
|
||||
@clear="materialForm.material_id='',materialForm.material_code='',materialForm.material_name='',materialForm.material_spec=''"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryMater" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料规格" prop="material_spec">
|
||||
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.material_spec" disabled style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批 次" prop="pcsn">
|
||||
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.pcsn" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料数量" prop="qty">
|
||||
<el-input v-model="materialForm.qty" clearable style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.qty" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="冻结数量" prop="frozen_qty">
|
||||
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.frozen_qty" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例" prop="proc_inst_id">
|
||||
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;"/>
|
||||
<el-input v-model="materialForm.proc_inst_id" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -108,11 +112,11 @@
|
||||
<el-form ref="form" :model="updateForm" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="载具编号" prop="vehicle_code">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="updateForm.vehicle_code" clearable/>
|
||||
<el-input v-model="updateForm.vehicle_code" clearable />
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量(g)" prop="vehicle_weight">
|
||||
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;"/>
|
||||
<el-input-number v-model="updateForm.vehicle_weight" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -129,22 +133,22 @@
|
||||
>
|
||||
<el-form ref="form" :model="printForm" size="mini" label-width="150px">
|
||||
<el-form-item label="纸张高度(mm)" prop="pageh">
|
||||
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pageh" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纸张宽度(mm)" prop="pagew">
|
||||
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pagew" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距top(mm)" prop="pagetop">
|
||||
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pagetop" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距right(mm)" prop="pageright">
|
||||
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pageright" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距down(mm)" prop="pagedown">
|
||||
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pagedown" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页边距left(mm)" prop="pageleft">
|
||||
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;"/>
|
||||
<el-input v-model="printForm.pageleft" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<br>
|
||||
</el-form>
|
||||
@@ -180,22 +184,22 @@
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="起始载具号" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;"/>
|
||||
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="载具数量" prop="num">
|
||||
<el-input-number v-model="form.num" :precision="0" style="width: 150px;"/>
|
||||
<el-input-number v-model="form.num" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="高度(mm)" prop="h">
|
||||
<el-input-number v-model="form.h" :precision="0" style="width: 150px;"/>
|
||||
<el-input-number v-model="form.h" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="宽度(mm)" prop="w">
|
||||
<el-input-number v-model="form.w" :precision="0" style="width: 150px;"/>
|
||||
<el-input-number v-model="form.w" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="深度(mm)" prop="l">
|
||||
<el-input-number v-model="form.l" :precision="0" style="width: 150px;"/>
|
||||
<el-input-number v-model="form.l" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量(g)" prop="weight">
|
||||
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;"/>
|
||||
<el-input-number v-model="form.weight" :precision="0" style="width: 150px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
@@ -236,8 +240,8 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人"/>
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px"/>
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column
|
||||
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
|
||||
label="操作"
|
||||
@@ -249,12 +253,13 @@
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件-->
|
||||
<pagination/>
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materialShow"
|
||||
@@ -275,7 +280,6 @@ import pagination from '@crud/Pagination'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
import MaterDtl from '@/views/wms/basedata/material/MaterialDialog'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
vehicle_code: null,
|
||||
vehicle_name: null,
|
||||
@@ -298,7 +302,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Storagevehicleinfo',
|
||||
dicts: ['storagevehicle_type', "VEHICLE_OVER_TYPE"],
|
||||
dicts: ['storagevehicle_type', 'VEHICLE_OVER_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -347,23 +351,23 @@ export default {
|
||||
permission: {},
|
||||
rules: {
|
||||
vehicle_code: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
vehicle_type: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
overstruct_type: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
num: [
|
||||
{required: true, message: '不能为空', trigger: 'blur'},
|
||||
{validator: numberOne}
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,16 +93,16 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="openOneCreate"-->
|
||||
<!-- >-->
|
||||
<!-- 一键生成-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="openOneCreate"-->
|
||||
<!-- >-->
|
||||
<!-- 一键生成-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
|
||||
<!--表单组件-->
|
||||
@@ -272,16 +272,17 @@
|
||||
{{ dict.label.placement_type[scope.row.placement_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="是否启用" align="center" prop="is_used">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- :value="format_is_used(scope.row.is_used)"-->
|
||||
<!-- active-color="#409EFF"-->
|
||||
<!-- inactive-color="#F56C6C"-->
|
||||
<!-- @change="changeEnabled(scope.row, scope.row.is_used)"-->
|
||||
<!-- />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="is_used" label="是否启用" />-->
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
|
||||
@@ -305,7 +306,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<!-- <OneCreateDialog :dialog-show.sync="openOneCreateDialog" />-->
|
||||
<!-- <OneCreateDialog :dialog-show.sync="openOneCreateDialog" />-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -255,7 +255,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ export default {
|
||||
sects: [],
|
||||
pointList: [],
|
||||
rules: {
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -320,7 +320,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||
crudSectattr.getSectCode({ 'stor_id': this.storId }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user