Commit 93968561 by 江和松

采购入库批量提交

parent b101face
...@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC001; ...@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC003; import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -24,6 +26,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -24,6 +26,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* @author:songx * @author:songx
...@@ -123,7 +127,13 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -123,7 +127,13 @@ public class ServiceHGKC001 extends ServiceBase {
* @param dbCg004Map * @param dbCg004Map
*/ */
private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) { private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) {
List<String> whCodeList = fCg004s.stream().map(HGKC001::getWhCode).collect(Collectors.toList());
Map<String, HGPZ007> whMap = HGPZTools.HgPz007.map(whCodeList);
for (HGKC001 fCg004 : fCg004s) { for (HGKC001 fCg004 : fCg004s) {
HGPZ007 wh = whMap.get(fCg004.getWhCode());
if(Objects.nonNull(wh)){
fCg004.setWhName(wh.getWhName());
}
DaoUtils.update(HGKC001.UPDATE_WH_CODE, fCg004); DaoUtils.update(HGKC001.UPDATE_WH_CODE, fCg004);
} }
} }
......
...@@ -38,6 +38,7 @@ $(function () { ...@@ -38,6 +38,7 @@ $(function () {
loadComplete: function (grid) { loadComplete: function (grid) {
// 确认 // 确认
$("#CONFIRM").on("click", confirm); $("#CONFIRM").on("click", confirm);
// change事件 // change事件
grid.dataSource.bind("change", function (e) { grid.dataSource.bind("change", function (e) {
supCodeChange(e); supCodeChange(e);
...@@ -59,8 +60,7 @@ $(function () { ...@@ -59,8 +60,7 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 选择收货 $("#BTN_SUBMIT").on("click",batchUpdateSubmitStatus);
$("#SELECT_RECEIVE").on("click", selectReceive);
downKeyUp(); downKeyUp();
}); });
...@@ -229,3 +229,25 @@ function updateSubmitStatus(id) { ...@@ -229,3 +229,25 @@ function updateSubmitStatus(id) {
}); });
} }
/**
* 保存
*/
let batchUpdateSubmitStatus = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['submitStatus'] != 0) {
message("勾选的第" + (i + 1) + "行提交状态不是未提交");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "updateSubmitStatus", true);
}
});
}
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