Commit 500cf1dc by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

parents bb12b72a 18257c7a
...@@ -11,9 +11,11 @@ import com.baosight.hggp.hg.cg.utils.HGCGUtils; ...@@ -11,9 +11,11 @@ import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC009; import com.baosight.hggp.hg.sc.domain.HGSC009;
import com.baosight.hggp.hg.sj.domain.HGSJ002; import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -50,6 +52,13 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -50,6 +52,13 @@ public class ServiceHGCG003 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
Map qarma = new HashMap();
Map userCompany = HGSBTools.getUserCompany();
qarma.put(HGSC009.FIELD_COMPANY_CODE,userCompany.get(HGSC009.FIELD_COMPANY_CODE));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID),qarma);
qarma.clear();
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class); EiInfoUtils.addBlock(inInfo,"userByCompany", HGXSTools.XsUser.listAll(UserSessionUtils.getAccountCode()), User.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
......
...@@ -271,6 +271,8 @@ ...@@ -271,6 +271,8 @@
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 --> RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
AMOUNT = #amount#, <!-- 金额 --> AMOUNT = #amount#, <!-- 金额 -->
RECEIVE_DATE = REPLACE(#receiveDate#, '-', ''), <!-- 收货日期 --> RECEIVE_DATE = REPLACE(#receiveDate#, '-', ''), <!-- 收货日期 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE WHERE
ID = #id# ID = #id#
......
...@@ -402,6 +402,6 @@ public class HGConstant { ...@@ -402,6 +402,6 @@ public class HGConstant {
// 待审核 // 待审核
public static final Integer S_0 = 0; public static final Integer S_0 = 0;
// 已审核 // 已审核
public static final Integer S_1 = 2; public static final Integer S_1 = 1;
} }
} }
...@@ -368,6 +368,8 @@ public class HGKCTools { ...@@ -368,6 +368,8 @@ public class HGKCTools {
hgkc003.setPrdtWidth(hgpz005.getWidth()); hgkc003.setPrdtWidth(hgpz005.getWidth());
hgkc003.setPrdtThick(hgpz005.getThick()); hgkc003.setPrdtThick(hgpz005.getThick());
hgkc003.setInventTypeDetail(hgpz005.getInventTypeDetail()); hgkc003.setInventTypeDetail(hgpz005.getInventTypeDetail());
AssertUtils.isNull(hgpz005.getInventTypeDetail(), "存货:"+hgpz005.getInventCode()+", 未维护存货大类!");
//获取仓库信息 //获取仓库信息
HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == hgpz005.getInventTypeDetail()).findAny().orElse(null); HGPZ007 hgpz007 = hgpz007List.stream().filter(wh->wh.getInventTypeDetail() != null && wh.getInventTypeDetail().intValue() == hgpz005.getInventTypeDetail()).findAny().orElse(null);
if(Objects.nonNull(hgpz007)){ if(Objects.nonNull(hgpz007)){
......
...@@ -146,6 +146,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -146,6 +146,8 @@ public class ServiceHGPZ005 extends ServiceBase {
params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode()); params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode());
List list = DaoBase.getInstance().query(HGPZ005.QUERY, params); List list = DaoBase.getInstance().query(HGPZ005.QUERY, params);
AssertUtils.isNotEmpty(list, String.format("存货编码[%s]已存在", hgpz005.getInventCode())); AssertUtils.isNotEmpty(list, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
HGPZ004 hgpz004 = HGPZTools.hgpz004.getByCode(hgpz005.getInventType());
hgpz005.setInventTypeDetail(Integer.valueOf(hgpz004.getInventTypeDetail()));
DaoUtils.insert(HGPZ005.INSERT, hgpz005); DaoUtils.insert(HGPZ005.INSERT, hgpz005);
} }
...@@ -155,6 +157,8 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -155,6 +157,8 @@ public class ServiceHGPZ005 extends ServiceBase {
* @param hgpz005 * @param hgpz005
*/ */
private void modify(HGPZ005 hgpz005) { private void modify(HGPZ005 hgpz005) {
HGPZ004 hgpz004 = HGPZTools.hgpz004.getByCode(hgpz005.getInventType());
hgpz005.setInventTypeDetail(Integer.valueOf(hgpz004.getInventTypeDetail()));
DaoUtils.update(HGPZ005.UPDATE, hgpz005); DaoUtils.update(HGPZ005.UPDATE, hgpz005);
} }
......
...@@ -89,20 +89,20 @@ public class HGPZTools { ...@@ -89,20 +89,20 @@ public class HGPZTools {
public static class hgpz004 { public static class hgpz004 {
/** /**
* 查询存货 * 查询存货类型
* *
* @param inventCode * @param inventType
* @return * @return
*/ */
public static HGPZ004 getByCode(String inventCode) { public static HGPZ004 getByCode(String inventType) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空"); AssertUtils.isEmpty(inventType, "存货类型编码不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode); queryMap.put("inventType", inventType);
List<HGPZ004> pz004s = DaoBase.getInstance().query(HGPZ004.QUERY, queryMap); List<HGPZ004> pz004s = DaoBase.getInstance().query(HGPZ004.QUERY, queryMap);
if(pz004s!=null&&pz004s.size()==0){ if(pz004s!=null&&pz004s.size()==0){
pz004s = null; pz004s = null;
} }
AssertUtils.isEmpty(pz004s, String.format("存货编码[%s]不存在", inventCode)); AssertUtils.isEmpty(pz004s, String.format("存货类型编码[%s]不存在", inventType));
return pz004s.get(0); return pz004s.get(0);
} }
......
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
</delete> </delete>
<update id="deleteFlag"> <update id="deleteFlag">
UPDATE ${hggpSchema}.HGSB005 UPDATE ${hggpSchema}.HGSB005A
SET SET
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
......
...@@ -61,6 +61,8 @@ public class HGSC004A extends DaoEPBase { ...@@ -61,6 +61,8 @@ public class HGSC004A extends DaoEPBase {
public static final String FIELD_MATERIAL = "material"; /* 材质*/ public static final String FIELD_MATERIAL = "material"; /* 材质*/
public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/ public static final String FIELD_COEFFICIENT = "coefficient"; /* 系数*/
public static final String FIELD_UNIT = "unit"; /* 单位*/ public static final String FIELD_UNIT = "unit"; /* 单位*/
public static final String FIELD_proj_code_prefix = "projCodePrefix"; /* 项目编码前缀*/
public static final String FIELD_proj_name_prefix = "projNamePrefix"; /* 项目名称前缀*/
public static final String COL_id = "id"; /* 主键*/ public static final String COL_id = "id"; /* 主键*/
public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/ public static final String COL_company_code = "company_code"; /* 公司编码(预留)*/
...@@ -167,6 +169,10 @@ public class HGSC004A extends DaoEPBase { ...@@ -167,6 +169,10 @@ public class HGSC004A extends DaoEPBase {
private Long techFlowId = new Long(0); /* 工艺流程id*/ private Long techFlowId = new Long(0); /* 工艺流程id*/
private String finishDate = " "; /* 完工日期*/ private String finishDate = " "; /* 完工日期*/
@ExcelAnno(index = 14)
private String projCodePrefix = " "; /*项目前缀*/
@ExcelAnno(index = 15)
private String projNamePrefix = " ";
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -382,6 +388,18 @@ public class HGSC004A extends DaoEPBase { ...@@ -382,6 +388,18 @@ public class HGSC004A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_UNIT); eiColumn = new EiColumn(FIELD_UNIT);
eiColumn.setDescName("单位"); eiColumn.setDescName("单位");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code_prefix);
eiColumn.setDescName("项目前缀");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_code_prefix);
eiColumn.setDescName("项目字母缩写");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_proj_name_prefix);
eiColumn.setDescName("项目名称缩写");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -911,6 +929,35 @@ public class HGSC004A extends DaoEPBase { ...@@ -911,6 +929,35 @@ public class HGSC004A extends DaoEPBase {
public void setUnit(String unit) { public void setUnit(String unit) {
this.unit = unit; this.unit = unit;
} }
/**
* get the projCodePrefix - 项目字母前缀.
* @return the projCodePrefix
*/
public String getProjCodePrefix() {
return projCodePrefix;
}
/**
* set the projCodePrefix - 项目字母前缀.
*
* @param projCodePrefix - 项目字母前缀
*/
public void setProjCodePrefix(String projCodePrefix) {
this.projCodePrefix = projCodePrefix;
}
/**
* get the projCodePrefix - 项目名称前缀.
* @return the projCodePrefix
*/
public String getProjNamePrefix() {
return projNamePrefix;
}
/**
* set the projNamePrefix - 项目名称前缀.
* @return the projNamePrefix
*/
public void setProjNamePrefix(String projNamePrefix) {
this.projNamePrefix = projNamePrefix;
}
/** /**
* get the value from Map. * get the value from Map.
...@@ -958,6 +1005,8 @@ public class HGSC004A extends DaoEPBase { ...@@ -958,6 +1005,8 @@ public class HGSC004A extends DaoEPBase {
setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material)); setMaterial(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MATERIAL)), material));
setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient)); setCoefficient(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COEFFICIENT)), coefficient));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit)); setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setProjCodePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code_prefix)), projCodePrefix));
setProjNamePrefix(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name_prefix)), projNamePrefix));
} }
/** /**
...@@ -1005,6 +1054,8 @@ public class HGSC004A extends DaoEPBase { ...@@ -1005,6 +1054,8 @@ public class HGSC004A extends DaoEPBase {
map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL))); map.put(FIELD_MATERIAL, StringUtils.toString(material, eiMetadata.getMeta(FIELD_MATERIAL)));
map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT))); map.put(FIELD_COEFFICIENT, StringUtils.toString(coefficient, eiMetadata.getMeta(FIELD_COEFFICIENT)));
map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT))); map.put(FIELD_UNIT, StringUtils.toString(unit, eiMetadata.getMeta(FIELD_UNIT)));
map.put(FIELD_proj_code_prefix, StringUtils.toString(projCodePrefix, eiMetadata.getMeta(FIELD_proj_code_prefix)));
map.put(FIELD_proj_name_prefix, StringUtils.toString(projNamePrefix, eiMetadata.getMeta(FIELD_proj_name_prefix)));
return map; return map;
} }
} }
...@@ -127,8 +127,9 @@ public class ServiceHGSC009A extends ServiceBase { ...@@ -127,8 +127,9 @@ public class ServiceHGSC009A extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGSC009A hgsc009A = new HGSC009A(); HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(resultRows.get(i)); hgsc009A.fromMap(resultRows.get(i));
AssertUtils.isTrue(hgsc009A.getGrossAmount().compareTo(BigDecimal.ZERO) <= 0, "重量不能小于等于0"); AssertUtils.isTrue(hgsc009A.getGrossAmount().compareTo(BigDecimal.ZERO) <= 0
AssertUtils.isTrue(hgsc009A.getQuantity().compareTo(BigDecimal.ZERO) <= 0, "数量不能小于等于0"); && hgsc009A.getQuantity().compareTo(BigDecimal.ZERO) <= 0, "数量、重量必须有一项大于0");
// AssertUtils.isTrue(hgsc009A.getQuantity().compareTo(BigDecimal.ZERO) <= 0, "数量不能小于等于0");
} }
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<sqlMap namespace="HGSC005A"> <sqlMap namespace="HGSC005A">
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
......
...@@ -331,6 +331,8 @@ public class HGSCTools { ...@@ -331,6 +331,8 @@ public class HGSCTools {
hgsc004a.setCompanyName(results.get(0).getCompanyName()); hgsc004a.setCompanyName(results.get(0).getCompanyName());
hgsc004a.setDepCode(results.get(0).getDepCode()); hgsc004a.setDepCode(results.get(0).getDepCode());
hgsc004a.setDepName(results.get(0).getDepName()); hgsc004a.setDepName(results.get(0).getDepName());
hgsc004a.setProductCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getProductCode()));
hgsc004a.setProductName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getProductName()));
if (hgsc004a.getParentProdCode().trim().isEmpty()){ if (hgsc004a.getParentProdCode().trim().isEmpty()){
hgsc004a.setParentProdCode(results.get(0).getProjCode()); hgsc004a.setParentProdCode(results.get(0).getProjCode());
hgsc004a.setParentProdName(results.get(0).getProjName()); hgsc004a.setParentProdName(results.get(0).getProjName());
...@@ -341,11 +343,13 @@ public class HGSCTools { ...@@ -341,11 +343,13 @@ public class HGSCTools {
paramMap.put("companyCode", hgsc004a.getCompanyCode()); paramMap.put("companyCode", hgsc004a.getCompanyCode());
paramMap.put("projCode", hgsc004a.getProjCode()); paramMap.put("projCode", hgsc004a.getProjCode());
paramMap.put("lv", 3); paramMap.put("lv", 3);
paramMap.put("productCode", hgsc004a.getParentProdCode()); paramMap.put("productCode", hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
List<HGSC004A> hgsc004aList = list(paramMap); List<HGSC004A> hgsc004aList = list(paramMap);
AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getParentProdCode())); AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode())));
hgsc004a.setMaterialId(results.get(0).getId()); hgsc004a.setMaterialId(results.get(0).getId());
hgsc004a.setLv(4); hgsc004a.setLv(4);
hgsc004a.setParentProdCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
hgsc004a.setParentProdName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getParentProdName()));
} }
checkSaveData(hgsc004a); checkSaveData(hgsc004a);
addEntity(hgsc004a); addEntity(hgsc004a);
...@@ -575,6 +579,7 @@ public class HGSCTools { ...@@ -575,6 +579,7 @@ public class HGSCTools {
List<String> inventCodes = hgsc005aList.stream().map(HGSC005A::getProductCode).distinct().collect(Collectors.toList()); List<String> inventCodes = hgsc005aList.stream().map(HGSC005A::getProductCode).distinct().collect(Collectors.toList());
//通过存货档案编码查询存货档案工序 //通过存货档案编码查询存货档案工序
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes); List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCodes(inventCodes);
AssertUtils.isEmpty(hgpz005AList, String.format("产品[%s]工序不存在,请先到存货档案配置产品工序!",inventCodes));
List<HGSC005A> hgsc005AList = new ArrayList<>(); List<HGSC005A> hgsc005AList = new ArrayList<>();
hgsc005aList.forEach(hgsc005a->{ hgsc005aList.forEach(hgsc005a->{
List<HGPZ005A> filterHgpz005a = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgsc005a.getProductCode())).collect(Collectors.toList()); List<HGPZ005A> filterHgpz005a = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgsc005a.getProductCode())).collect(Collectors.toList());
......
...@@ -147,7 +147,10 @@ let submit = function () { ...@@ -147,7 +147,10 @@ let submit = function () {
} }
}); });
} }
function windowCallback() {
query();
JSColorbox.close();
}
/** /**
* 显示详情 * 显示详情
...@@ -158,6 +161,7 @@ function showDetail(id,status) { ...@@ -158,6 +161,7 @@ function showDetail(id,status) {
title: "<div style='text-align: center;'>详情</div>", title: "<div style='text-align: center;'>详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
callbackName: windowCallback
}); });
} }
......
...@@ -105,7 +105,14 @@ let save = function () { ...@@ -105,7 +105,14 @@ let save = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG001A", "save", true); JSUtils.submitGridsData("result", "HGCG001A", "save",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
...@@ -126,7 +133,14 @@ let remove = function () { ...@@ -126,7 +133,14 @@ let remove = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG001A", "remove", true); JSUtils.submitGridsData("result", "HGCG001A", "remove",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
......
...@@ -298,5 +298,11 @@ function showDetail(id,status) { ...@@ -298,5 +298,11 @@ function showDetail(id,status) {
title: "<div style='text-align: center;'>详情</div>", title: "<div style='text-align: center;'>详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
callbackName: windowCallback
}); });
} }
function windowCallback() {
query();
JSColorbox.close();
}
...@@ -191,7 +191,14 @@ let save = function () { ...@@ -191,7 +191,14 @@ let save = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG002B", "save", true); JSUtils.submitGridsData("result", save, "remove",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
...@@ -207,8 +214,17 @@ let remove = function () { ...@@ -207,8 +214,17 @@ let remove = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG002B", "remove", true); JSUtils.submitGridsData("result", "HGCG002B", "remove",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows(); var userByCompany = __eiInfo.getBlock("userByCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
exportGrid: false, // 隐藏右侧自定义导出按钮 exportGrid: false, // 隐藏右侧自定义导出按钮
...@@ -76,13 +77,53 @@ $(function () { ...@@ -76,13 +77,53 @@ $(function () {
filter: "contains" filter: "contains"
}); });
} }
}, {
field: "projCode",
title: "项目编码",
template: function (dataItem) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['valueField'];
}
}
return dataItem["projCode"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#",
filter: "contains"
});
}
} }
], ],
beforeEdit: function (e) { beforeEdit: function (e) {
let item = e.model; let item = e.model;
//只有合同生成的不能编辑 //只有合同生成的不能编辑
if(item.source === '0'){ if(item.source === '0'){
//选择收货的指定列可以修改 //选择收货的指定列不让修改
for (let i = 0; i < e.sender.columns.length; i++) { for (let i = 0; i < e.sender.columns.length; i++) {
//指定的列不让修改 //指定的列不让修改
if (e.sender.columns[i]["name"] === "companyCode") { if (e.sender.columns[i]["name"] === "companyCode") {
...@@ -97,6 +138,31 @@ $(function () { ...@@ -97,6 +138,31 @@ $(function () {
e.sender.columns[i]["enable"] = false; e.sender.columns[i]["enable"] = false;
e.sender.columns[i]["readonly"] = true; e.sender.columns[i]["readonly"] = true;
} }
if (e.sender.columns[i]["name"] === "projCode") {
e.sender.columns[i]["enable"] = false;
e.sender.columns[i]["readonly"] = true;
}
}
}else{
//手动添加的需要修改
for (let i = 0; i < e.sender.columns.length; i++) {
//指定的列不让修改
if (e.sender.columns[i]["name"] === "companyCode") {
e.sender.columns[i]["enable"] = true;
e.sender.columns[i]["readonly"] = false;
}
if (e.sender.columns[i]["name"] === "supCode") {
e.sender.columns[i]["enable"] = true;
e.sender.columns[i]["readonly"] = false;
}
if (e.sender.columns[i]["name"] === "purUserName") {
e.sender.columns[i]["enable"] = true;
e.sender.columns[i]["readonly"] = false;
}
if (e.sender.columns[i]["name"] === "projCode") {
e.sender.columns[i]["enable"] = true;
e.sender.columns[i]["readonly"] = false;
}
} }
} }
}, },
...@@ -113,6 +179,13 @@ $(function () { ...@@ -113,6 +179,13 @@ $(function () {
} }
} }
} }
if (e.field == "projCode") {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === e.items[0]['projCode']) {
resultGrid.setCellValue(e.items[0],"projName",projCodeBox[i]['textField']);
}
}
}
}); });
}, },
onSave: function (e) { onSave: function (e) {
...@@ -294,8 +367,13 @@ function showDetail(id,status,source) { ...@@ -294,8 +367,13 @@ function showDetail(id,status,source) {
title: "<div style='text-align: center;'>详情</div>", title: "<div style='text-align: center;'>详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
callbackName: windowCallback
}); });
} }
function windowCallback() {
query();
JSColorbox.close();
}
function updateStatus(id,status) { function updateStatus(id,status) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="receiveDate" cname="收货日期" width="100" align="center" editType="date" <EF:EFColumn ename="receiveDate" cname="收货日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/> <EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
......
...@@ -45,7 +45,7 @@ $(function () { ...@@ -45,7 +45,7 @@ $(function () {
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#",
template: "[#:valueField#]#:textField#", template: "[#:valueField#]#:textField#|#:param4Field#",
filter: "contains" filter: "contains"
}); });
} }
...@@ -104,6 +104,7 @@ $(function () { ...@@ -104,6 +104,7 @@ $(function () {
if (inventRecordBoxBlockId[i]['valueField'] === e.items[0].inventCode) { if (inventRecordBoxBlockId[i]['valueField'] === e.items[0].inventCode) {
resultGrid.setCellValue(e.items[0], 'inventName', inventRecordBoxBlockId[i]['textField']) resultGrid.setCellValue(e.items[0], 'inventName', inventRecordBoxBlockId[i]['textField'])
resultGrid.setCellValue(e.items[0], 'inventTypeDetail', inventRecordBoxBlockId[i]['param1Field']) resultGrid.setCellValue(e.items[0], 'inventTypeDetail', inventRecordBoxBlockId[i]['param1Field'])
resultGrid.setCellValue(e.items[0], 'inventType', inventRecordBoxBlockId[i]['param3Field'])
resultGrid.setCellValue(e.items[0], 'spec', inventRecordBoxBlockId[i]['param4Field']) resultGrid.setCellValue(e.items[0], 'spec', inventRecordBoxBlockId[i]['param4Field'])
resultGrid.setCellValue(e.items[0], 'material', inventRecordBoxBlockId[i]['param5Field']) resultGrid.setCellValue(e.items[0], 'material', inventRecordBoxBlockId[i]['param5Field'])
resultGrid.setCellValue(e.items[0], 'unit', inventRecordBoxBlockId[i]['param6Field']) resultGrid.setCellValue(e.items[0], 'unit', inventRecordBoxBlockId[i]['param6Field'])
...@@ -212,7 +213,14 @@ let save = function () { ...@@ -212,7 +213,14 @@ let save = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG003B", "save", true); JSUtils.submitGridsData("result", "HGCG003B", "save",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
...@@ -228,7 +236,14 @@ let remove = function () { ...@@ -228,7 +236,14 @@ let remove = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGCG003B", "remove", true); JSUtils.submitGridsData("result", "HGCG003B", "remove",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
} }
}); });
} }
......
...@@ -45,15 +45,15 @@ $(function() { ...@@ -45,15 +45,15 @@ $(function() {
if (e.field == "entityAmount") { if (e.field == "entityAmount") {
if(item.bookAmount && item.entityAmount){ if(item.bookAmount && item.entityAmount){
let diffAmount = item.entityAmount - item.bookAmount; let diffAmount = item.entityAmount - item.bookAmount;
resultGrid.setCellValue(item, 'diffAmount', diffAmount) resultGrid.setCellValue(item, 'diffAmount', diffAmount.toFixed(3))
} }
if(item.bookUnitWeight && item.entityAmount && item.bookWeight){ if(item.bookUnitWeight && item.entityAmount && item.bookWeight){
//实物重量=单重*数量 //实物重量=单重*数量
let entityWeight = item.bookUnitWeight * item.entityAmount; let entityWeight = item.bookUnitWeight * item.entityAmount;
resultGrid.setCellValue(item, 'entityWeight', entityWeight) resultGrid.setCellValue(item, 'entityWeight', entityWeight.toFixed(3))
//差异重量=实物重量-账面重量 //差异重量=实物重量-账面重量
let diffWeight = entityWeight - item.bookWeight; let diffWeight = entityWeight - item.bookWeight;
resultGrid.setCellValue(item, 'diffWeight', diffWeight) resultGrid.setCellValue(item, 'diffWeight', diffWeight.toFixed(3))
} }
} }
}); });
......
...@@ -537,7 +537,7 @@ $(function () { ...@@ -537,7 +537,7 @@ $(function () {
} }
} }
grush.downloadFile(`${ctx}\\common\\template\\SC\\HGSC004A_物料清单.xls`); grush.downloadFile(`${ctx}\\common\\template\\SC\\HGSC004A_产品清单.xls`);
//产品类型下拉联动 //产品类型下拉联动
$('input[name="inqu_status-0-prdtType"]').change(function () { $('input[name="inqu_status-0-prdtType"]').change(function () {
......
...@@ -188,9 +188,12 @@ let save = function () { ...@@ -188,9 +188,12 @@ let save = function () {
return; return;
} }
let flag = true; let flag = true;
let quantityMsg = "";
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let inventCode= item.get("inventCode"); let inventCode= item.get("inventCode");
let spec= item.get("spec"); let spec= item.get("spec");
let quantity= item.get("quantity");
let grossAmount= item.get("grossAmount");
if(isBlank(inventCode)){ if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货编号\",不能为空!"); message("选中的第"+(index+1)+"行\"存货编号\",不能为空!");
flag = false; flag = false;
...@@ -201,13 +204,32 @@ let save = function () { ...@@ -201,13 +204,32 @@ let save = function () {
flag = false; flag = false;
return false; return false;
} }
if((isBlank(quantity) || parseInt(quantity) <= 0) && (isBlank(grossAmount) || parseInt(grossAmount) <= 0)){
message("选中的第" + (index + 1) + "行\"数量、重量\",必须有一项大于0!");
flag = false;
return false;
}
if(isBlank(quantity) || parseInt(quantity) <= 0){
quantityMsg = "选中的第" + (index + 1) + "行\"数量\",小于等于0!\n";
}
if(isBlank(grossAmount) || parseInt(grossAmount) <= 0){
quantityMsg = "选中的第" + (index + 1) + "行\"重量\",小于等于0!\n";
}
}); });
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { if(!isBlank(quantityMsg)){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? 其中:"+quantityMsg, {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSC009A", "save", true); JSUtils.submitGridsData("result", "HGSC009A", "save", true);
} }
}); });
}else{
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC009A", "save", true);
}
});
}
} }
} }
......
...@@ -46,13 +46,13 @@ $(function () { ...@@ -46,13 +46,13 @@ $(function () {
if (e.field == "qualifyQty") { if (e.field == "qualifyQty") {
if(item.qualifyQty && item.receiveQty){ if(item.qualifyQty && item.receiveQty){
let unqualifyQty = item.receiveQty - item.qualifyQty; let unqualifyQty = item.receiveQty - item.qualifyQty;
resultGrid.setCellValue(item, 'unqualifyQty', unqualifyQty) resultGrid.setCellValue(item, 'unqualifyQty', unqualifyQty.toFixed(3))
} }
} }
if (e.field == "unqualifyQty") { if (e.field == "unqualifyQty") {
if(item.unqualifyQty && item.receiveQty){ if(item.unqualifyQty && item.receiveQty){
let qualifyQty = item.receiveQty - item.unqualifyQty; let qualifyQty = item.receiveQty - item.unqualifyQty;
resultGrid.setCellValue(item, 'qualifyQty', qualifyQty) resultGrid.setCellValue(item, 'qualifyQty', qualifyQty.toFixed(3))
} }
} }
}); });
......
...@@ -40,7 +40,7 @@ $(function () { ...@@ -40,7 +40,7 @@ $(function () {
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity']; var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity); resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity.toFixed(3));
} }
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
......
...@@ -90,7 +90,7 @@ $(function () { ...@@ -90,7 +90,7 @@ $(function () {
if (e.field == "unpassQuantity") { if (e.field == "unpassQuantity") {
// loadChange(grid,e,"passQuantity"); // loadChange(grid,e,"passQuantity");
var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity']; var passQuantity = e.items[0]['quantity'] - e.items[0]['unpassQuantity'];
resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity); resultGrid.setCellValue(e.items[0],"passQuantity",passQuantity.toFixed(3));
} }
if (e.field == "workBy") { if (e.field == "workBy") {
......
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