优化单据中的仓库信息

This commit is contained in:
季圣华
2020-02-20 16:13:51 +08:00
parent e1e133d9fd
commit 6b68f70ff6
2 changed files with 46 additions and 42 deletions

View File

@@ -132,7 +132,7 @@
currentPage: 1,
pageSize: 100
}),
async: false,
async: false, //设置为同步
success: function (res) {
if (res && res.code === 200) {
if(res.data && res.data.page) {
@@ -152,6 +152,26 @@
return info;
}
//初始化系统基础信息
function getSystemDepot(){
var depotList = null;
$.ajax({
type:"get",
url: "/depot/getAllList",
async:false, //设置为同步
dataType: "json",
success: function (res) {
if(res && res.code === 200) {
depotList = res.data;
} else {
$.messager.alert('提示', '查找系统基础信息异常,请与管理员联系!', 'error');
return;
}
}
});
return depotList;
}
/**
* js生成唯一ID值 32位值随机值
* @returns 生成的字符串

View File

@@ -171,48 +171,32 @@
}
});
}
//初始化系统基础信息
//初始化系统仓库信息
function initSystemData_depot(){
$.ajax({
type:"get",
url: "/depot/getAllList",
//设置为同步
async:false,
dataType: "json",
success: function (res) {
if(res && res.code === 200){
depotList = res.data;
if(depotList !=null) {
for(var i = 0 ;i < depotList.length;i++) {
var depot = depotList[i];
var config = getSystemConfig();
if(config && config.depotFlag == "1") {
if(userdepot!=null) {
if(userdepot.indexOf("["+depot.id+"]")!=-1) {
if(depot.isDefault){
defDepotId = depot.id;
}
depotString = depotString + depot.id + ",";
}
}
} else {
if(depot.isDefault){
defDepotId = depot.id;
}
depotString = depotString + depot.id + ",";
}
if(depot.type === 1){
depotString = depotString + depot.id + ",";
}
}
depotString = depotString.substring(0, depotString.length-1);
}
} else {
$.messager.alert('提示', '查找系统基础信息异常,请与管理员联系', 'error');
return;
}
}
});
var config = getSystemConfig();
var depotList = getSystemDepot();
if(depotList !=null) {
for(var i = 0 ;i < depotList.length;i++) {
var depot = depotList[i];
if(config && config.depotFlag == "1") {
if(userdepot!=null) {
if(userdepot.indexOf("["+depot.id+"]")!=-1) {
if(depot.isDefault){
defDepotId = depot.id;
}
depotString = depotString + depot.id + ",";
}
}
} else {
if(depot.isDefault){
defDepotId = depot.id;
}
depotString = depotString + ",";
}
}
depotString = depotString.substring(0, depotString.length-1);
}
}
//初始化供应商、客户、散户信息
function initSupplier(){