Commit e4184e50 by liuyang

2024-04-26 采购申请优化

parent 2781d5ed
...@@ -180,7 +180,7 @@ public class ServiceHPCG001 extends ServiceEPBase { ...@@ -180,7 +180,7 @@ public class ServiceHPCG001 extends ServiceEPBase {
hpcg002.setProPlanDate(StringUtil.removeHorizontalLine(DateUtils.date())); hpcg002.setProPlanDate(StringUtil.removeHorizontalLine(DateUtils.date()));
hpcg002.setInventType(str.toString()); hpcg002.setInventType(str.toString());
//生成采购计划单号 //生成采购计划单号
hpcg002.setProPlanNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PRO_APPLY_NO)); hpcg002.setProPlanNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.PRO_PLAN_NO));
//添加采购计划 //添加采购计划
DaoUtils.insert(HPCG002.INSERT,hpcg002); DaoUtils.insert(HPCG002.INSERT,hpcg002);
List<HPCG002> list1 = this.dao.query(HPCG002.QUERY,new HashMap<String,Object>(){{ List<HPCG002> list1 = this.dao.query(HPCG002.QUERY,new HashMap<String,Object>(){{
......
...@@ -20,6 +20,17 @@ $(function () { ...@@ -20,6 +20,17 @@ $(function () {
IPLATUI.EFGrid= { IPLATUI.EFGrid= {
"result": { "result": {
columns: [{ columns: [{
field: "operator",
template: function (item) {
let template = '';
if (item.proApplyStatus==0){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="approveFunc(' + item.id + ')" >提交</a>';
}
return template;
}
}, {
field: "proApplyDate", field: "proApplyDate",
attributes: { attributes: {
class: "i-input-readonly" class: "i-input-readonly"
...@@ -217,7 +228,7 @@ $(function () { ...@@ -217,7 +228,7 @@ $(function () {
} }
$("#APPROVE").on("click",function () { $("#APPROVE").on("click",function () {
approveFunc(); approveFuncs();
}) })
downKeyUp(); downKeyUp();
...@@ -328,7 +339,7 @@ let save = function (btnNode) { ...@@ -328,7 +339,7 @@ let save = function (btnNode) {
/** /**
* 提交 * 提交
*/ */
function approveFunc() { function approveFuncs() {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据"); message("请选择数据");
...@@ -382,18 +393,40 @@ function deleteFunc() { ...@@ -382,18 +393,40 @@ function deleteFunc() {
} }
} }
function updateStatus(id) { function approveFunc(id) {
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id); let eiblock = new EiBlock("result");
inEiInfo.set("result-0-status", 1); let flag = false;
EiCommunicator.send('HPPZ018', 'updateStatus', inEiInfo, { for (var int = 0; int < rows.length; int++) {
onSuccess(response) { if (rows[int].id == id) {
NotificationUtil(response.msg); for (var key in rows[int].toJSON()) {
var eColumn = new EiColumn(key);
eiblock.getBlockMeta().addMeta(eColumn);
}
var model = rows[int];
eiblock.addRow(eiblock.getMappedArray(model, true));
}
}
var showCount = eiblock.get(EiConstant.SHOW_COUNT) || "true";
eiblock.set(EiConstant.SHOW_COUNT, showCount);
eiblock.set(EiConstant.LIMIT, resultGrid.dataSource['_pageSize']);
// eiblock.set(EiConstant.OFFSET, resultGrid.dataSource['_skip']);
// 默认查询第一页
eiblock.set(EiConstant.OFFSET, 0);
inEiInfo.addBlock(eiblock);
EiCommunicator.send('HPCG001', 'approve', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query(); query();
}, },
onFail(errorMessage, status, e) { onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error"); NotificationUtil("执行失败!", "error");
} }
}, { }, {
async: false async: false
} }
......
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-proApplyStatus" colWidth="3" filter="contains" defultValue=""> <EF:EFSelect cname="提交状态" ename="inqu_status-0-proApplyStatus" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOption label="未提交" value="0"/> <EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<%--<div class="row"> <%--<div class="row">
...@@ -59,6 +58,7 @@ ...@@ -59,6 +58,7 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="110" align="center" editType="date" <EF:EFColumn ename="proApplyDate" cname="采购申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="proApplyNo" cname="采购申请单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="proApplyNo" cname="采购申请单号" enable="false" width="130" align="center"/>
...@@ -85,8 +85,7 @@ ...@@ -85,8 +85,7 @@
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/> <EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/> <EF:EFColumn ename="remark" cname="备注" width="150"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0"> <EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFOption label="未提交" value="0"/> <EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
<EF:EFOption label="已提交" value="1"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center" hidden="true"/> <EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center" hidden="true"/>
</EF:EFGrid> </EF:EFGrid>
......
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