Commit e4184e50 by liuyang

2024-04-26 采购申请优化

parent 2781d5ed
......@@ -180,7 +180,7 @@ public class ServiceHPCG001 extends ServiceEPBase {
hpcg002.setProPlanDate(StringUtil.removeHorizontalLine(DateUtils.date()));
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);
List<HPCG002> list1 = this.dao.query(HPCG002.QUERY,new HashMap<String,Object>(){{
......
......@@ -20,6 +20,17 @@ $(function () {
IPLATUI.EFGrid= {
"result": {
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",
attributes: {
class: "i-input-readonly"
......@@ -217,7 +228,7 @@ $(function () {
}
$("#APPROVE").on("click",function () {
approveFunc();
approveFuncs();
})
downKeyUp();
......@@ -328,7 +339,7 @@ let save = function (btnNode) {
/**
* 提交
*/
function approveFunc() {
function approveFuncs() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
......@@ -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();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", 1);
EiCommunicator.send('HPPZ018', 'updateStatus', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
let eiblock = new EiBlock("result");
let flag = false;
for (var int = 0; int < rows.length; int++) {
if (rows[int].id == id) {
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();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
......
......@@ -25,8 +25,7 @@
</EF:EFSelect>
<EF:EFSelect cname="提交状态" ename="inqu_status-0-proApplyStatus" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
<EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
</EF:EFSelect>
</div>
<%--<div class="row">
......@@ -59,6 +58,7 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<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"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="proApplyNo" cname="采购申请单号" enable="false" width="130" align="center"/>
......@@ -85,8 +85,7 @@
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFOption label="未提交" value="0"/>
<EF:EFOption label="已提交" value="1"/>
<EF:EFCodeOption codeName="hpjx.hpcg.proApplyStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center" hidden="true"/>
</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