From aacecc1202c62d9cf3101ada08145faf6ef1cfb9 Mon Sep 17 00:00:00 2001 From: mzr Date: Fri, 19 Sep 2025 14:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E9=A2=86=E6=96=99-=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mmpac/mmpac/issue/constance/index.js | 229 +- .../issue/list/btnClicks/onList_BtnClicks.js | 1940 ++++++++--------- 2 files changed, 1083 insertions(+), 1086 deletions(-) diff --git a/src/mmpac/mmpac/issue/constance/index.js b/src/mmpac/mmpac/issue/constance/index.js index c93dbd4b..12b3d269 100644 --- a/src/mmpac/mmpac/issue/constance/index.js +++ b/src/mmpac/mmpac/issue/constance/index.js @@ -2,137 +2,140 @@ // 区域ID const AREA = { - //备料计划列表界面区域 - pickmPageArea: '5008010501', - pickmViewTableArea: 'pickm_view', - pickmSearchArea: 'pickm_query', - //备料申请列表界面区域 - reqpickmPageArea: '5008010502', - reqpickmViewTableArea: 'reqpickm_view', - reqpickmSearchArea: 'reqpickm_query', - //直接备料计划列表界面区域 - directTransPageArea: '5008010503', - directTransViewTableArea: 'directtrans_view', - directTransSearchArea: 'directtrans_query', - //存量查拣 - headPageArea: '50080105_onhandhead', - bodyPageArea: '50080105_onhandbody', + //备料计划列表界面区域 + pickmPageArea: '5008010501', + pickmViewTableArea: 'pickm_view', + pickmSearchArea: 'pickm_query', + //备料申请列表界面区域 + reqpickmPageArea: '5008010502', + reqpickmViewTableArea: 'reqpickm_view', + reqpickmSearchArea: 'reqpickm_query', + //直接备料计划列表界面区域 + directTransPageArea: '5008010503', + directTransViewTableArea: 'directtrans_view', + directTransSearchArea: 'directtrans_query', + //存量查拣 + headPageArea: '50080105_onhandhead', + bodyPageArea: '50080105_onhandbody', - dataSource: 'mmpac.mmpac.issue.data', - issueAppcode: '50080105' + dataSource: 'mmpac.mmpac.issue.data', + issueAppcode: '50080105', + nodekey: 'scll01' }; const PK = { - pickmHeadPK: 'cpickmid', - pickmBodyPK: 'cpickm_bid', - reqpickmHeadPK: 'creqpickmid', - reqpickmBodyPK: 'creqpickm_bid' + pickmHeadPK: 'cpickmid', + pickmBodyPK: 'cpickm_bid', + reqpickmHeadPK: 'creqpickmid', + reqpickmBodyPK: 'creqpickm_bid' }; //页面状态 const STATUS = { - browse: 'browse', - edit: 'edit' + browse: 'browse', + edit: 'edit' }; //按钮名称以及区域 const BUTTON = { - list_head: 'header_action', //列表表头区域 - list_inner: 'body_action', //列表行操作区域 - delete: 'Head_Del', //删除 - onhandQuery: 'IssueATPHideShowAction', //存量查拣 - getStockAccountNum: 'IssueObtainStockAccountNumAction',//获取库存量 - destIssue: 'IssueDestIssueAction', //领料 - reserveIssue: 'IssueReserveMaterialAction', //备料 - directTrans: 'IssueDirectTransAction',//直接备料 - downStreamBill: 'DownStreamBill', //下游单据 - cancel: 'PasteCancel', //取消 - pasteThis: 'PasteThis',//粘贴至此 - copy: 'CopyRow', //复制 - deleteLine: 'DelRow', //删行|移除 - refresh: 'Refersh', //刷新 - bodyOnhandQuery: 'BodyIssueATPHideShowAction', //存量查拣 - UnPlaseBtns: ['BodyIssueATPHideShowAction', 'DelRow', 'CopyRow'], - PlaseBtns: ['PasteThis', 'PasteCancel'], + list_head: 'header_action', //列表表头区域 + list_inner: 'body_action', //列表行操作区域 + delete: 'Head_Del', //删除 + onhandQuery: 'IssueATPHideShowAction', //存量查拣 + getStockAccountNum: 'IssueObtainStockAccountNumAction',//获取库存量 + destIssue: 'IssueDestIssueAction', //领料 + reserveIssue: 'IssueReserveMaterialAction', //备料 + directTrans: 'IssueDirectTransAction',//直接备料 + downStreamBill: 'DownStreamBill', //下游单据 + cancel: 'PasteCancel', //取消 + pasteThis: 'PasteThis',//粘贴至此 + copy: 'CopyRow', //复制 + deleteLine: 'DelRow', //删行|移除 + refresh: 'Refersh', //刷新 + Output: 'Output', //输出 + bodyOnhandQuery: 'BodyIssueATPHideShowAction', //存量查拣 + UnPlaseBtns: ['BodyIssueATPHideShowAction', 'DelRow', 'CopyRow'], + PlaseBtns: ['PasteThis', 'PasteCancel'], }; //请求URL地址 const URL = { - querypickm: '/nccloud/mmpac/issue/issuepickmquery.do', - queryIssueObtainStockAccountNum: '/nccloud/mmpac/issue/queryIssueObtainStockAccountNum.do', - queryreqpickm: '/nccloud/mmpac/issue/issuereqpickmquery.do', - issueDestIssue: '/nccloud/mmpac/issue/issueDestIssueAction.do', - issueReserveMaterial: '/nccloud/mmpac/issue/issueReserveMaterialAction.do', - queryDirectTrans: '/nccloud/mmpac/issue/issueDirectTransQuery.do', - issueDirectTrans: '/nccloud/mmpac/issue/issueDirectTransAction.do', - checkIsNccNative:'/nccloud/mmpac/issue/checkIsNccNative.do', - //编辑事件 - issuePickmBeforeEditEvent: '/nccloud/mmpac/issue/issueBeforeEditForPickm.do', - issuePickmAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForPickm.do', - issueReqPickmBeforeEditEvent: '/nccloud/mmpac/issue/issueBeforeEditForReqPickm.do', - issueReqPickmAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForReqPickm.do', - issueOnhandEditEvent: '/nccloud/mmpac/issue/onhandQuery.do',//存量查拣回调事件 - issueDeleteLineEvent: '/nccloud/mmpac/issue/issueDeleteLine.do', - directTransAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForDirectTrans.do', - //跳转请求 - issueQueryFromPickm: '/nccloud/mmpac/issue/issueQueryFromPickm.do', - issueQueryFromReqPickm: '/nccloud/mmpac/issue/isseQueryFromReqPickm.do', - isseQueryFromPutPlan: '/nccloud/mmpac/issue/isseQueryFromPutPlan.do', - isseQueryFromDispatchlist: '/nccloud/mmpac/issue/isseQueryFromDispatchlist.do', - issueQueryFromDirectTrans: '/nccloud/mmpac/issue/issueQueryFromDirectTrans.do', - issueQueryFromPutPlanDirectTrans:'/nccloud/mmpac/issue/issueQueryFromPutPlanDirectTrans.do' + querypickm: '/nccloud/mmpac/issue/issuepickmquery.do', + queryIssueObtainStockAccountNum: '/nccloud/mmpac/issue/queryIssueObtainStockAccountNum.do', + queryreqpickm: '/nccloud/mmpac/issue/issuereqpickmquery.do', + issueDestIssue: '/nccloud/mmpac/issue/issueDestIssueAction.do', + issueReserveMaterial: '/nccloud/mmpac/issue/issueReserveMaterialAction.do', + queryDirectTrans: '/nccloud/mmpac/issue/issueDirectTransQuery.do', + issueDirectTrans: '/nccloud/mmpac/issue/issueDirectTransAction.do', + checkIsNccNative: '/nccloud/mmpac/issue/checkIsNccNative.do', + pickmPrint: '/nccloud/mmpac/issue/printAction.do', + //编辑事件 + issuePickmBeforeEditEvent: '/nccloud/mmpac/issue/issueBeforeEditForPickm.do', + issuePickmAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForPickm.do', + issueReqPickmBeforeEditEvent: '/nccloud/mmpac/issue/issueBeforeEditForReqPickm.do', + issueReqPickmAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForReqPickm.do', + issueOnhandEditEvent: '/nccloud/mmpac/issue/onhandQuery.do',//存量查拣回调事件 + issueDeleteLineEvent: '/nccloud/mmpac/issue/issueDeleteLine.do', + directTransAfterEditEvent: '/nccloud/mmpac/issue/issueAfterEditForDirectTrans.do', + //跳转请求 + issueQueryFromPickm: '/nccloud/mmpac/issue/issueQueryFromPickm.do', + issueQueryFromReqPickm: '/nccloud/mmpac/issue/isseQueryFromReqPickm.do', + isseQueryFromPutPlan: '/nccloud/mmpac/issue/isseQueryFromPutPlan.do', + isseQueryFromDispatchlist: '/nccloud/mmpac/issue/isseQueryFromDispatchlist.do', + issueQueryFromDirectTrans: '/nccloud/mmpac/issue/issueQueryFromDirectTrans.do', + issueQueryFromPutPlanDirectTrans: '/nccloud/mmpac/issue/issueQueryFromPutPlanDirectTrans.do' }; //单据类型 const BILLTYPE = { - pickm: '55A3', - reqpickm: '55AC', - directTrans: 'direct' + pickm: '55A3', + reqpickm: '55AC', + directTrans: 'direct' }; // 参数 const FIELD = { - queryIdInfoByPickm: 'pickmQueryInfo', //缓存-查询条件对应的key-备料计划根据ID - querySchemeInfoByPickm: 'pickmSrcIds', //缓存-查询条件对应的key-备料计划根据查询条件 - queryIdInfoByReqpickm: 'reqpickmQueryInfo', //缓存-查询条件对应的key-备料申请根据ID - querySchemeInfoByReqpickm: 'reqpickmSrcIds', //缓存-查询条件对应的key-备料申请根据查询条件 - undealNumCode: 'onhandshouldnum',//待处理主数量 - thisNumCode: 'nnum',//本次主数量 - isSatisfyCode: 'fulfiltype',//主数量满意度 + queryIdInfoByPickm: 'pickmQueryInfo', //缓存-查询条件对应的key-备料计划根据ID + querySchemeInfoByPickm: 'pickmSrcIds', //缓存-查询条件对应的key-备料计划根据查询条件 + queryIdInfoByReqpickm: 'reqpickmQueryInfo', //缓存-查询条件对应的key-备料申请根据ID + querySchemeInfoByReqpickm: 'reqpickmSrcIds', //缓存-查询条件对应的key-备料申请根据查询条件 + undealNumCode: 'onhandshouldnum',//待处理主数量 + thisNumCode: 'nnum',//本次主数量 + isSatisfyCode: 'fulfiltype',//主数量满意度 }; const issuePickmField = { - head: [ - 'pk_org', 'cpickmid', 'vbillcode', 'vbusitypeid', 'cdeptid', 'cdeptvid' - ], - item: ['pk_org', 'cpickmid', 'cpickm_bid', 'vrowno', 'cbmaterialid', 'cbmaterialvid', 'cbunitid', 'cbastunitid', 'vbchangerate', - 'cbvendorid', 'cbvendorvid','cbproductorid', 'cbprojectid', 'cbcustomerid','cbcustomervid', 'cbqualitylevelid', 'cbffileid', - 'vbfree1', 'vbfree2', 'vbfree3', 'vbfree4', 'vbfree5', 'vbfree6', 'vbfree7', 'vbfree8', 'vbfree9', 'vbfree10', - 'cdeliverorgid', 'cdeliverorgvid', 'coutstockid', 'csupplyorgid', 'csupplyorgvid', 'cinstockid', 'clocationid','cinlocationid', - 'pk_batchcode', 'vbatchcode', 'cstockmanid', 'nbccknum', 'nbcckastnum', 'vbnote', 'boverissue', 'fissueflag', - 'drequiredate','cwkid','nthisarrangenum','nthisarrangeastnum','ctplcustomerid','cvmivenderid', - 'vbdef1', 'vbdef2', 'vbdef3', 'vbdef4', 'vbdef5', 'vbdef6', 'vbdef7', 'vbdef8', 'vbdef9', 'vbdef10', - 'vbdef11', 'vbdef12', 'vbdef13', 'vbdef14', 'vbdef15', 'vbdef16', 'vbdef17', 'vbdef18', 'vbdef19', 'vbdef20', - 'cpickbillid','vpickbillcode', 'vpickbilltype', 'cpickbillrowid','vpickbillrowno','nthisneednum','nthisneedastnum'] + head: [ + 'pk_org', 'cpickmid', 'vbillcode', 'vbusitypeid', 'cdeptid', 'cdeptvid' + ], + item: ['pk_org', 'cpickmid', 'cpickm_bid', 'vrowno', 'cbmaterialid', 'cbmaterialvid', 'cbunitid', 'cbastunitid', 'vbchangerate', + 'cbvendorid', 'cbvendorvid', 'cbproductorid', 'cbprojectid', 'cbcustomerid', 'cbcustomervid', 'cbqualitylevelid', 'cbffileid', + 'vbfree1', 'vbfree2', 'vbfree3', 'vbfree4', 'vbfree5', 'vbfree6', 'vbfree7', 'vbfree8', 'vbfree9', 'vbfree10', + 'cdeliverorgid', 'cdeliverorgvid', 'coutstockid', 'csupplyorgid', 'csupplyorgvid', 'cinstockid', 'clocationid', 'cinlocationid', + 'pk_batchcode', 'vbatchcode', 'cstockmanid', 'nbccknum', 'nbcckastnum', 'vbnote', 'boverissue', 'fissueflag', + 'drequiredate', 'cwkid', 'nthisarrangenum', 'nthisarrangeastnum', 'ctplcustomerid', 'cvmivenderid', + 'vbdef1', 'vbdef2', 'vbdef3', 'vbdef4', 'vbdef5', 'vbdef6', 'vbdef7', 'vbdef8', 'vbdef9', 'vbdef10', + 'vbdef11', 'vbdef12', 'vbdef13', 'vbdef14', 'vbdef15', 'vbdef16', 'vbdef17', 'vbdef18', 'vbdef19', 'vbdef20', + 'cpickbillid', 'vpickbillcode', 'vpickbilltype', 'cpickbillrowid', 'vpickbillrowno', 'nthisneednum', 'nthisneedastnum'] }; //缓存 const CACHE = { - //用于下游单据跳转 - ic4DIds: 'ic4DIds', - ic4kIds: 'ic4kIds', - ic4455Ids: 'ic4455Ids', - ic4kIdsFor55AC: 'ic4kIdsFor55AC', - ic5xIdsFor55AC: 'ic5xIdsFor55AC', - ic4kIdsForDirect: 'ic4kIdsForDirect', - ic5xIdsForDirect: 'ic5xIdsForDirect', - //用于缓存前端数据 - issuePickmCache: 'issuePickmCache', - issueReqPickmCache: 'issueReqPickmCache', - issueDirectTransCache: 'issueDirectTransCache' - + //用于下游单据跳转 + ic4DIds: 'ic4DIds', + ic4kIds: 'ic4kIds', + ic4455Ids: 'ic4455Ids', + ic4kIdsFor55AC: 'ic4kIdsFor55AC', + ic5xIdsFor55AC: 'ic5xIdsFor55AC', + ic4kIdsForDirect: 'ic4kIdsForDirect', + ic5xIdsForDirect: 'ic5xIdsForDirect', + //用于缓存前端数据 + issuePickmCache: 'issuePickmCache', + issueReqPickmCache: 'issueReqPickmCache', + issueDirectTransCache: 'issueDirectTransCache' + } const pickmBodyfixAssts = [ - 'cbvendorid', - 'cbvendorvid', - 'cbproductorid', - 'cbprojectid', - 'cbcustomerid', - 'cbcustomervid' - // 'cbqualitylevelid', - //'cbffileid' + 'cbvendorid', + 'cbvendorvid', + 'cbproductorid', + 'cbprojectid', + 'cbcustomerid', + 'cbcustomervid' + // 'cbqualitylevelid', + //'cbffileid' ]; const pickmBodyCustAndSupFild = { ccustomerid: 'cbcustomerid', @@ -140,6 +143,18 @@ const pickmBodyCustAndSupFild = { cvendorid: 'cbvendorid', cvendorvid: 'cbvendorvid' }; -export { AREA, STATUS, URL, BUTTON, PK, BILLTYPE, FIELD, CACHE, issuePickmField,pickmBodyfixAssts ,pickmBodyCustAndSupFild}; +export { + AREA, + STATUS, + URL, + BUTTON, + PK, + BILLTYPE, + FIELD, + CACHE, + issuePickmField, + pickmBodyfixAssts, + pickmBodyCustAndSupFild +}; /*auVpq9xwZL1gPRSzNVP/w0hBm26YHXsnVMAUlT2iQRQ=*/ \ No newline at end of file diff --git a/src/mmpac/mmpac/issue/list/btnClicks/onList_BtnClicks.js b/src/mmpac/mmpac/issue/list/btnClicks/onList_BtnClicks.js index 97f719c1..478e1f72 100644 --- a/src/mmpac/mmpac/issue/list/btnClicks/onList_BtnClicks.js +++ b/src/mmpac/mmpac/issue/list/btnClicks/onList_BtnClicks.js @@ -1,1029 +1,1011 @@ /*9LNhEcWwOPqFwoyI0rg5Tvi1KVVJuZ+O99DtbZayIQc=*/ -import { serachPickm_btnClick, serachReqpickm_btnClick, serachDirectTrans_btnClick, directTransBtnClick } from './index.js'; -import { ajax, cacheTools } from 'nc-lightapp-front'; -import { BUTTON, BILLTYPE, AREA, URL, CACHE, issuePickmField } from '../../constance'; -import { getLangByResId } from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil'; -import { rowCopyPasteUtils } from '../../../../../mmpub/mmpub/pub/tool/editTableTools/rowCopyPasteUtils'; -import { showSuccessInfo, showWarningInfo, showWarningDialog } from '../../../../../mmpub/mmpub/pub/tool/messageUtil'; -import { getDefData, setDefData } from '../../../../../mmpub/mmpub/pub/cache'; -import { buttonControl } from '../viewController/buttonController'; -import { output} from 'nc-lightapp-front'; +import { + serachPickm_btnClick, + serachReqpickm_btnClick, + serachDirectTrans_btnClick, + directTransBtnClick +} from './index.js'; +import {ajax, cacheTools} from 'nc-lightapp-front'; +import {BUTTON, BILLTYPE, AREA, URL, CACHE, issuePickmField} from '../../constance'; +import {getLangByResId} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil'; +import {rowCopyPasteUtils} from '../../../../../mmpub/mmpub/pub/tool/editTableTools/rowCopyPasteUtils'; +import {showSuccessInfo, showWarningInfo, showWarningDialog} from '../../../../../mmpub/mmpub/pub/tool/messageUtil'; +import {getDefData, setDefData} from '../../../../../mmpub/mmpub/pub/cache'; +import {buttonControl} from '../viewController/buttonController'; +import {output} from 'nc-lightapp-front'; export default function onList_BtnClicks(props, btncode, text, record, index) { - switch (btncode) { - case BUTTON.delete: - delrow.call(this); - break; - case BUTTON.onhandQuery: - onHandBtnClick.call(this); - break; - case BUTTON.getStockAccountNum: - getStockAccountNum.call(this); - break; - case BUTTON.destIssue: - destIssue.call(this, true); - break; - case BUTTON.reserveIssue: - reserveIssue.call(this); - break; - case BUTTON.directTrans: - directTransBtnClick.call(this); - break; - case BUTTON.downStreamBill: - downStreamBill.call(this); - break; - case BUTTON.refresh: - if (this.state.tabType == BILLTYPE.pickm) { - let allData = this.props.editTable.getAllData(AREA.pickmViewTableArea); - if (allData && allData.rows && allData.rows.length > 0) { - /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ - if (this.props.getPageCode().startsWith('5009')) { - showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { - beSureBtnClick: serachPickm_btnClick.bind(this, true) - }); - } else { - showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { - beSureBtnClick: serachPickm_btnClick.bind(this, true) - }); - } + switch (btncode) { + case BUTTON.delete: + delrow.call(this); + break; + case BUTTON.onhandQuery: + onHandBtnClick.call(this); + break; + case BUTTON.getStockAccountNum: + getStockAccountNum.call(this); + break; + case BUTTON.destIssue: + destIssue.call(this, true); + break; + case BUTTON.reserveIssue: + reserveIssue.call(this); + break; + case BUTTON.directTrans: + directTransBtnClick.call(this); + break; + case BUTTON.downStreamBill: + downStreamBill.call(this); + break; + case BUTTON.refresh: + if (this.state.tabType == BILLTYPE.pickm) { + let allData = this.props.editTable.getAllData(AREA.pickmViewTableArea); + if (allData && allData.rows && allData.rows.length > 0) { + /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ + if (this.props.getPageCode().startsWith('5009')) { + showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { + beSureBtnClick: serachPickm_btnClick.bind(this, true) + }); + } else { + showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { + beSureBtnClick: serachPickm_btnClick.bind(this, true) + }); + } - } else { - serachPickm_btnClick.call(this, true) - } - } else if (this.state.tabType == BILLTYPE.reqpickm) { - let allData = this.props.editTable.getAllData(AREA.reqpickmViewTableArea); - if (allData && allData.rows && allData.rows.length > 0) { - /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ - if (this.props.getPageCode().startsWith('5009')) { - showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { - beSureBtnClick: serachReqpickm_btnClick.bind(this, true) - }); - } else { - showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { - beSureBtnClick: serachReqpickm_btnClick.bind(this, true) - }); - } - } else { - serachReqpickm_btnClick.call(this, true) - } - } - else if (this.state.tabType == BILLTYPE.directTrans) { - let allData = this.props.editTable.getAllData(AREA.directTransViewTableArea); - if (allData && allData.rows && allData.rows.length > 0) { - /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ - if (this.props.getPageCode().startsWith('5009')) { - showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { - beSureBtnClick: serachDirectTrans_btnClick.bind(this, true) - }); - } else { - showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { - beSureBtnClick: serachDirectTrans_btnClick.bind(this, true) - }); - } + } else { + serachPickm_btnClick.call(this, true) + } + } else if (this.state.tabType == BILLTYPE.reqpickm) { + let allData = this.props.editTable.getAllData(AREA.reqpickmViewTableArea); + if (allData && allData.rows && allData.rows.length > 0) { + /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ + if (this.props.getPageCode().startsWith('5009')) { + showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { + beSureBtnClick: serachReqpickm_btnClick.bind(this, true) + }); + } else { + showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { + beSureBtnClick: serachReqpickm_btnClick.bind(this, true) + }); + } + } else { + serachReqpickm_btnClick.call(this, true) + } + } else if (this.state.tabType == BILLTYPE.directTrans) { + let allData = this.props.editTable.getAllData(AREA.directTransViewTableArea); + if (allData && allData.rows && allData.rows.length > 0) { + /**国际化:当前单据已有领料数据,重新查询将被清空,您确定继续吗? */ + if (this.props.getPageCode().startsWith('5009')) { + showWarningDialog(getLangByResId(this, '50090105-000019'), getLangByResId(this, '50090105-000018'), { + beSureBtnClick: serachDirectTrans_btnClick.bind(this, true) + }); + } else { + showWarningDialog(getLangByResId(this, '50080105-000019'), getLangByResId(this, '50080105-000018'), { + beSureBtnClick: serachDirectTrans_btnClick.bind(this, true) + }); + } - } else { - serachDirectTrans_btnClick.call(this, true) - } - } - break; - case BUTTON.bodyOnhandQuery: - bodyOnhandQuery.call(this, record, index); - break; - case BUTTON.deleteLine: - delrow.call(this, index); - break; - case BUTTON.copy: - //清空出库数量,主数量 - let newRecord = JSON.parse(JSON.stringify(record));; - if (this.state.tabType == BILLTYPE.pickm) { - newRecord.values['nbcckastnum'].value = 0; - newRecord.values['nbccknum'].value = 0; - } else if (this.state.tabType == BILLTYPE.reqpickm) { - newRecord.values['nthistransastnum'].value = 0; - newRecord.values['nthistransnum'].value = 0; - } else if (this.state.tabType == BILLTYPE.directTrans) { - newRecord.values['nbcckastnum'].value = 0; - newRecord.values['nbccknum'].value = 0; - } - rowCopyPasteUtils.copyRow.call( - this, - props, - getModuleId.call(this), - newRecord, - BUTTON.UnPlaseBtns, - BUTTON.PlaseBtns - ); - break; - case BUTTON.pasteThis: - rowCopyPasteUtils.pasteRowsToIndex.call( - this, - props, - getModuleId.call(this), - index, - BUTTON.UnPlaseBtns, - BUTTON.PlaseBtns - ); - if (this.state.tabType == BILLTYPE.pickm) { - buttonControl.call(this, '0'); - } else if (this.state.tabType == BILLTYPE.reqpickm) { - buttonControl.call(this, '1'); - }else if (this.state.tabType == BILLTYPE.directTrans) { - buttonControl.call(this, '2'); - } + } else { + serachDirectTrans_btnClick.call(this, true) + } + } + break; + case BUTTON.bodyOnhandQuery: + bodyOnhandQuery.call(this, record, index); + break; + case BUTTON.deleteLine: + delrow.call(this, index); + break; + case BUTTON.copy: + //清空出库数量,主数量 + let newRecord = JSON.parse(JSON.stringify(record)); + ; + if (this.state.tabType == BILLTYPE.pickm) { + newRecord.values['nbcckastnum'].value = 0; + newRecord.values['nbccknum'].value = 0; + } else if (this.state.tabType == BILLTYPE.reqpickm) { + newRecord.values['nthistransastnum'].value = 0; + newRecord.values['nthistransnum'].value = 0; + } else if (this.state.tabType == BILLTYPE.directTrans) { + newRecord.values['nbcckastnum'].value = 0; + newRecord.values['nbccknum'].value = 0; + } + rowCopyPasteUtils.copyRow.call( + this, + props, + getModuleId.call(this), + newRecord, + BUTTON.UnPlaseBtns, + BUTTON.PlaseBtns + ); + break; + case BUTTON.pasteThis: + rowCopyPasteUtils.pasteRowsToIndex.call( + this, + props, + getModuleId.call(this), + index, + BUTTON.UnPlaseBtns, + BUTTON.PlaseBtns + ); + if (this.state.tabType == BILLTYPE.pickm) { + buttonControl.call(this, '0'); + } else if (this.state.tabType == BILLTYPE.reqpickm) { + buttonControl.call(this, '1'); + } else if (this.state.tabType == BILLTYPE.directTrans) { + buttonControl.call(this, '2'); + } - break; - case BUTTON.cancel: - rowCopyPasteUtils.cancel.call( - this, - props, - getModuleId.call(this), - BUTTON.UnPlaseBtns, - BUTTON.PlaseBtns - ); - break; - // 输出功能 - case "Output": - - let isAll = false; - let tableData = []; - let oids=[]; - let selectedRow = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea);; - let indexs = []; - if (!selectedRow || selectedRow.length < 1) { - isAll = true; - tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); - }else{ - tableData = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea); - } - tableData.forEach((row) => { - oids.push(row.data.values.cpickm_bid.value); - }); - let printdata={ - funcode: "50080105", - nodekey: "10086", - oids: oids, - outputType: "output", - }; - //小应用编码//小应用编码 - //默认模板分配的key//需要输出的单据主键//输出类型 --默认output - output({ url: "/nccloud/mmpac/issue/printAction.do", data: printdata }); - break; - default: - break; - } + break; + case BUTTON.cancel: + rowCopyPasteUtils.cancel.call( + this, + props, + getModuleId.call(this), + BUTTON.UnPlaseBtns, + BUTTON.PlaseBtns + ); + break; + // 输出功能 + case BUTTON.Output: + let isAll = false; + let tableData = []; + let oids = []; + let selectedRow = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea); + ; + let indexs = []; + if (!selectedRow || selectedRow.length < 1) { + isAll = true; + tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); + } else { + tableData = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea); + } + tableData.forEach((row) => { + oids.push(row.data.values.cpickm_bid.value); + }); + let printdata = { + funcode: AREA.issueAppcode, + nodekey: AREA.nodekey, + oids: oids, + outputType: "output", + }; + //小应用编码//小应用编码 + //默认模板分配的key//需要输出的单据主键//输出类型 --默认output + output({url: URL.pickmPrint, data: printdata}); + break; + default: + break; + } } -// function onOutput() { -// let isAll = false; -// let tableData = []; -// let oids=[]; -// let selectedRow = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea);; -// let indexs = []; -// if (!selectedRow || selectedRow.length < 1) { -// isAll = true; -// tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); -// } -// tableData.forEach((row) => { -// oids.push(row.values.cpickm_bid.value); -// }); -// let printdata={ -// funcode: this.config.moduleId, -// appcode: this.config.moduleId, -// nodekey: nodekey, -// oids: oids, -// outputType: "output", -// }; -// //小应用编码//小应用编码 -// //默认模板分配的key//需要输出的单据主键//输出类型 --默认output -// output({ url: urls['print'], data: printdata }); -// }; - //下游单据 function downStreamBill() { - ajax({ - url: URL.checkIsNccNative, - data: null, - success: (res) => { - let pageType = true; - if (this.props.getPageCode().startsWith('5009')) { - pageType = false; - } - if (this.state.tabType == BILLTYPE.pickm) { - let ic4DIds = getDefData(AREA.dataSource, CACHE.ic4DIds); - let ic4kIds = getDefData(AREA.dataSource, CACHE.ic4kIds); - let ic4455Ids = getDefData(AREA.dataSource, CACHE.ic4455Ids); - let showStatus = true; - if (ic4DIds && ic4DIds instanceof Array && ic4DIds.length > 0) { - //4D - //材料出库 - if (ic4DIds.length == 1) { - this.props.openTo(null, { - billtype: '4D', - appcode: '400801214', - pagecode: '400801214_card', - id: ic4DIds[0] - }); - } else { - let param = { linktype: '4D', linkids: ic4DIds }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400801214', - pagecode: '400801214_list', - iclinkkey: 'param' - }) - } - showStatus = false; - } + ajax({ + url: URL.checkIsNccNative, + data: null, + success: (res) => { + let pageType = true; + if (this.props.getPageCode().startsWith('5009')) { + pageType = false; + } + if (this.state.tabType == BILLTYPE.pickm) { + let ic4DIds = getDefData(AREA.dataSource, CACHE.ic4DIds); + let ic4kIds = getDefData(AREA.dataSource, CACHE.ic4kIds); + let ic4455Ids = getDefData(AREA.dataSource, CACHE.ic4455Ids); + let showStatus = true; + if (ic4DIds && ic4DIds instanceof Array && ic4DIds.length > 0) { + //4D + //材料出库 + if (ic4DIds.length == 1) { + this.props.openTo(null, { + billtype: '4D', + appcode: '400801214', + pagecode: '400801214_card', + id: ic4DIds[0] + }); + } else { + let param = {linktype: '4D', linkids: ic4DIds}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400801214', + pagecode: '400801214_list', + iclinkkey: 'param' + }) + } + showStatus = false; + } - if (ic4kIds && ic4kIds instanceof Array && ic4kIds.length > 0) { - //4K - //转库 - if (ic4kIds.length == 1) { - this.props.openTo(null, { - billtype: '4K', - appcode: '400801606', - pagecode: '400801606_card', - id: ic4kIds[0] - }); - } else { - let param = { linktype: '4K', linkids: ic4kIds }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400801606', - pagecode: '400801606_list', - iclinkkey: 'param' - }) - } - showStatus = false; - } - if (ic4455Ids && ic4455Ids instanceof Array && ic4455Ids.length > 0) { - //4455 - //出库申请单 - if (ic4455Ids.length == 1) { - this.props.openTo(null, { - billtype: '4455', - appcode: '400801200', - pagecode: '400801200_card', - id: ic4455Ids[0] - }); - } else { - let param = { linktype: '4455', linkids: ic4455Ids }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400801200', - pagecode: '400801200_list', - iclinkkey: 'param' - }) - } - showStatus = false; - } - if (showStatus) { - if (pageType) { - showWarningInfo(getLangByResId(this, '50080105-000015')); - } else { - showWarningInfo(getLangByResId(this, '50090105-000015')); - } - } - } else if (this.state.tabType == BILLTYPE.reqpickm) { - let ic4kIdsFor55AC = getDefData(AREA.dataSource, CACHE.ic4kIdsFor55AC); - let ic5xIdsFor55AC = getDefData(AREA.dataSource, CACHE.ic5xIdsFor55AC); - let showStatus = true; - if (ic4kIdsFor55AC && ic4kIdsFor55AC instanceof Array && ic4kIdsFor55AC.length > 0) { - //4K - //转库 - if (ic4kIdsFor55AC.length == 1) { - this.props.openTo(null, { - billtype: '4K', - appcode: '400801606', - pagecode: '400801606_card', - id: ic4kIdsFor55AC[0] - }); - } else { - let param = { linktype: '4K', linkids: ic4kIdsFor55AC }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400801606', - pagecode: '400801606_list', - iclinkkey: 'param' - }) - } - showStatus = false; - } - if (ic5xIdsFor55AC && ic5xIdsFor55AC instanceof Array && ic5xIdsFor55AC.length > 0) { - //5X - //调拨订单 - if (ic5xIdsFor55AC.length == 1) { - this.props.openTo(null, { - billtype: '5X', - appcode: '400900800', - pagecode: '400900800_card', - status: 'browse', - id: ic5xIdsFor55AC[0] - }); - } else { - let param = { linktype: '5X', linkids: ic5xIdsFor55AC }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400900800', - pagecode: '400900800_list', - tolinkkey: 'param' - }) - } - showStatus = false; - } - if (showStatus) { - if (pageType) { - showWarningInfo(getLangByResId(this, '50080105-000015')); - } else { - showWarningInfo(getLangByResId(this, '50090105-000015')); - } - } - } else if (this.state.tabType == BILLTYPE.directTrans) { - let ic4kIdsForDirect = getDefData(AREA.dataSource, CACHE.ic4kIdsForDirect); - let ic5xIdsForDirect = getDefData(AREA.dataSource, CACHE.ic5xIdsForDirect); - let showStatus = true; - if (ic4kIdsForDirect && ic4kIdsForDirect instanceof Array && ic4kIdsForDirect.length > 0) { - //4K - //转库 - if (ic4kIdsForDirect.length == 1) { - this.props.openTo(null, { - billtype: '4K', - appcode: '400801606', - pagecode: '400801606_card', - id: ic4kIdsForDirect[0] - }); - } else { - let param = { linktype: '4K', linkids: ic4kIdsForDirect }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400801606', - pagecode: '400801606_list', - iclinkkey: 'param' - }) - } - showStatus = false; - } - if (ic5xIdsForDirect && ic5xIdsForDirect instanceof Array && ic5xIdsForDirect.length > 0) { - //5X - //调拨订单 - if (ic5xIdsForDirect.length == 1) { - this.props.openTo(null, { - billtype: '5X', - appcode: '400900800', - pagecode: '400900800_card', - status: 'browse', - id: ic5xIdsForDirect[0] - }); - } else { - let param = { linktype: '5X', linkids: ic5xIdsForDirect }; - cacheTools.set('param', param); - this.props.openTo(null, { - appcode: '400900800', - pagecode: '400900800_list', - tolinkkey: 'param' - }) - } - showStatus = false; - } - if (showStatus) { - if (pageType) { - showWarningInfo(getLangByResId(this, '50080105-000015')); - } else { - showWarningInfo(getLangByResId(this, '50090105-000015')); - } - } - } - } - }); + if (ic4kIds && ic4kIds instanceof Array && ic4kIds.length > 0) { + //4K + //转库 + if (ic4kIds.length == 1) { + this.props.openTo(null, { + billtype: '4K', + appcode: '400801606', + pagecode: '400801606_card', + id: ic4kIds[0] + }); + } else { + let param = {linktype: '4K', linkids: ic4kIds}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400801606', + pagecode: '400801606_list', + iclinkkey: 'param' + }) + } + showStatus = false; + } + if (ic4455Ids && ic4455Ids instanceof Array && ic4455Ids.length > 0) { + //4455 + //出库申请单 + if (ic4455Ids.length == 1) { + this.props.openTo(null, { + billtype: '4455', + appcode: '400801200', + pagecode: '400801200_card', + id: ic4455Ids[0] + }); + } else { + let param = {linktype: '4455', linkids: ic4455Ids}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400801200', + pagecode: '400801200_list', + iclinkkey: 'param' + }) + } + showStatus = false; + } + if (showStatus) { + if (pageType) { + showWarningInfo(getLangByResId(this, '50080105-000015')); + } else { + showWarningInfo(getLangByResId(this, '50090105-000015')); + } + } + } else if (this.state.tabType == BILLTYPE.reqpickm) { + let ic4kIdsFor55AC = getDefData(AREA.dataSource, CACHE.ic4kIdsFor55AC); + let ic5xIdsFor55AC = getDefData(AREA.dataSource, CACHE.ic5xIdsFor55AC); + let showStatus = true; + if (ic4kIdsFor55AC && ic4kIdsFor55AC instanceof Array && ic4kIdsFor55AC.length > 0) { + //4K + //转库 + if (ic4kIdsFor55AC.length == 1) { + this.props.openTo(null, { + billtype: '4K', + appcode: '400801606', + pagecode: '400801606_card', + id: ic4kIdsFor55AC[0] + }); + } else { + let param = {linktype: '4K', linkids: ic4kIdsFor55AC}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400801606', + pagecode: '400801606_list', + iclinkkey: 'param' + }) + } + showStatus = false; + } + if (ic5xIdsFor55AC && ic5xIdsFor55AC instanceof Array && ic5xIdsFor55AC.length > 0) { + //5X + //调拨订单 + if (ic5xIdsFor55AC.length == 1) { + this.props.openTo(null, { + billtype: '5X', + appcode: '400900800', + pagecode: '400900800_card', + status: 'browse', + id: ic5xIdsFor55AC[0] + }); + } else { + let param = {linktype: '5X', linkids: ic5xIdsFor55AC}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400900800', + pagecode: '400900800_list', + tolinkkey: 'param' + }) + } + showStatus = false; + } + if (showStatus) { + if (pageType) { + showWarningInfo(getLangByResId(this, '50080105-000015')); + } else { + showWarningInfo(getLangByResId(this, '50090105-000015')); + } + } + } else if (this.state.tabType == BILLTYPE.directTrans) { + let ic4kIdsForDirect = getDefData(AREA.dataSource, CACHE.ic4kIdsForDirect); + let ic5xIdsForDirect = getDefData(AREA.dataSource, CACHE.ic5xIdsForDirect); + let showStatus = true; + if (ic4kIdsForDirect && ic4kIdsForDirect instanceof Array && ic4kIdsForDirect.length > 0) { + //4K + //转库 + if (ic4kIdsForDirect.length == 1) { + this.props.openTo(null, { + billtype: '4K', + appcode: '400801606', + pagecode: '400801606_card', + id: ic4kIdsForDirect[0] + }); + } else { + let param = {linktype: '4K', linkids: ic4kIdsForDirect}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400801606', + pagecode: '400801606_list', + iclinkkey: 'param' + }) + } + showStatus = false; + } + if (ic5xIdsForDirect && ic5xIdsForDirect instanceof Array && ic5xIdsForDirect.length > 0) { + //5X + //调拨订单 + if (ic5xIdsForDirect.length == 1) { + this.props.openTo(null, { + billtype: '5X', + appcode: '400900800', + pagecode: '400900800_card', + status: 'browse', + id: ic5xIdsForDirect[0] + }); + } else { + let param = {linktype: '5X', linkids: ic5xIdsForDirect}; + cacheTools.set('param', param); + this.props.openTo(null, { + appcode: '400900800', + pagecode: '400900800_list', + tolinkkey: 'param' + }) + } + showStatus = false; + } + if (showStatus) { + if (pageType) { + showWarningInfo(getLangByResId(this, '50080105-000015')); + } else { + showWarningInfo(getLangByResId(this, '50090105-000015')); + } + } + } + } + }); } //备料 async function reserveIssue() { - let isAll = false; - let tableData = []; - let selectedRow = getSelectRows.call(this); - let indexs = []; - if (!selectedRow || selectedRow.length < 1) { - isAll = true; - tableData = this.props.editTable.getAllRows(AREA.reqpickmViewTableArea); - } - else { - selectedRow.map((item) => { - tableData.push(item.data); - indexs.push(item.index); - }); - } - let checkErr = this.props.editTable.checkRequired(AREA.reqpickmViewTableArea, tableData); - if (!checkErr) { - return; - } - //let tableData = this.props.editTable.getAllRows(AREA.reqpickmViewTableArea); - let requestData = {}; - let pageCode = AREA.reqpickmPageArea; - let resId = '50080105-000013'; - if (this.props.getPageCode().startsWith('5009')) { - pageCode = pageCode.replace('5008', '5009'); - resId = '50090105-000013'; - } - requestData.tabType = 1; - requestData.grid = { - pageid: pageCode, - model: { - areaType: "table", - pageinfo: null, - rows: tableData, - areacode: AREA.reqpickmViewTableArea - } - }; - ajax({ - url: URL.issueReserveMaterial, - data: requestData, - success: (res) => { - if (res.success) { - if (res.data) { - //设置缓存数据 - if (res.data.userjson) { - let userjson = JSON.parse(res.data.userjson); - if (userjson) { - setDefData(AREA.dataSource, CACHE.ic4kIdsFor55AC, userjson[CACHE.ic4kIdsFor55AC]); - setDefData(AREA.dataSource, CACHE.ic5xIdsFor55AC, userjson[CACHE.ic5xIdsFor55AC]); - } - } - if (isAll) { - this.props.editTable.setTableData(AREA.reqpickmViewTableArea, res.data[AREA.reqpickmViewTableArea]); - } - else { - let updateArray = []; - let rows = res.data[AREA.reqpickmViewTableArea].rows; - for (let j = 0; j < rows.length; j++) { - let row = rows[j]; - let obj = { index: indexs[j], data: row }; - updateArray.push(obj); - } - if (updateArray.length > 0) { - this.props.editTable.updateDataByIndexs(AREA.reqpickmViewTableArea, updateArray); - } - } - showSuccessInfo(getLangByResId(this, resId)); - } - } - } - }); + let isAll = false; + let tableData = []; + let selectedRow = getSelectRows.call(this); + let indexs = []; + if (!selectedRow || selectedRow.length < 1) { + isAll = true; + tableData = this.props.editTable.getAllRows(AREA.reqpickmViewTableArea); + } else { + selectedRow.map((item) => { + tableData.push(item.data); + indexs.push(item.index); + }); + } + let checkErr = this.props.editTable.checkRequired(AREA.reqpickmViewTableArea, tableData); + if (!checkErr) { + return; + } + //let tableData = this.props.editTable.getAllRows(AREA.reqpickmViewTableArea); + let requestData = {}; + let pageCode = AREA.reqpickmPageArea; + let resId = '50080105-000013'; + if (this.props.getPageCode().startsWith('5009')) { + pageCode = pageCode.replace('5008', '5009'); + resId = '50090105-000013'; + } + requestData.tabType = 1; + requestData.grid = { + pageid: pageCode, + model: { + areaType: "table", + pageinfo: null, + rows: tableData, + areacode: AREA.reqpickmViewTableArea + } + }; + ajax({ + url: URL.issueReserveMaterial, + data: requestData, + success: (res) => { + if (res.success) { + if (res.data) { + //设置缓存数据 + if (res.data.userjson) { + let userjson = JSON.parse(res.data.userjson); + if (userjson) { + setDefData(AREA.dataSource, CACHE.ic4kIdsFor55AC, userjson[CACHE.ic4kIdsFor55AC]); + setDefData(AREA.dataSource, CACHE.ic5xIdsFor55AC, userjson[CACHE.ic5xIdsFor55AC]); + } + } + if (isAll) { + this.props.editTable.setTableData(AREA.reqpickmViewTableArea, res.data[AREA.reqpickmViewTableArea]); + } else { + let updateArray = []; + let rows = res.data[AREA.reqpickmViewTableArea].rows; + for (let j = 0; j < rows.length; j++) { + let row = rows[j]; + let obj = {index: indexs[j], data: row}; + updateArray.push(obj); + } + if (updateArray.length > 0) { + this.props.editTable.updateDataByIndexs(AREA.reqpickmViewTableArea, updateArray); + } + } + showSuccessInfo(getLangByResId(this, resId)); + } + } + } + }); } //领料 async function destIssue(flag) { - debugger; - let isAll = false; - let tableData = []; - let selectedRow = getSelectRows.call(this); - let indexMap = new Map(); - let indexs = []; - if (!selectedRow || selectedRow.length < 1) { - isAll = true; - tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); - } - else { - selectedRow.map((item) => { - tableData.push(item.data); - indexMap.set(item.data.values.cpickm_bid.value, item.index); - indexs.push(item.index); - }); - } - let checkErr = this.props.editTable.checkRequired(AREA.pickmViewTableArea, tableData); - if (!checkErr) { - return; - } - //let tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); - let issueParams = []; - let head = {}; - let item = {}; - tableData.forEach((row) => { - head = {}; - item = {}; - issuePickmField.head.forEach((feild) => { - head[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; - }); - issuePickmField.item.forEach((feild) => { - item[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; - }); - issueParams.push({ headValue: head, itemValue: item }); - }); - let requestData = {}; - let pageCode = AREA.pickmPageArea; - let pageType = true; - if (this.props.getPageCode().startsWith('5009')) { - pageCode = pageCode.replace('5008', '5009'); - pageType = false; - } - requestData.flag = flag; - requestData.tabType = 0; - requestData.issuePickmDatas = issueParams; - requestData.pageid = pageCode; - //requestData.grid = { - // pageid: pageCode, - // model: { - // areaType: "table", - // pageinfo: null, - // rows: tableData, - // areacode: AREA.pickmViewTableArea - // } - //}; - ajax({ - url: URL.issueDestIssue, - data: requestData, - success: (res) => { - if (res.success) { - if (res.data) { - if (!res.data[AREA.pickmViewTableArea] && res.data.userjson) { - /**国际化:以下单据的材料出库维度与预留维度不一致,是否解除预留? */ - if (pageType) { - showWarningDialog(getLangByResId(this, '50080105-000017'), res.data.userjson, { - beSureBtnClick: destIssue.bind(this, false) - }); - } else { - showWarningDialog(getLangByResId(this, '50090105-000017'), res.data.userjson, { - beSureBtnClick: destIssue.bind(this, false) - }); - } + debugger; + let isAll = false; + let tableData = []; + let selectedRow = getSelectRows.call(this); + let indexMap = new Map(); + let indexs = []; + if (!selectedRow || selectedRow.length < 1) { + isAll = true; + tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); + } else { + selectedRow.map((item) => { + tableData.push(item.data); + indexMap.set(item.data.values.cpickm_bid.value, item.index); + indexs.push(item.index); + }); + } + let checkErr = this.props.editTable.checkRequired(AREA.pickmViewTableArea, tableData); + if (!checkErr) { + return; + } + //let tableData = this.props.editTable.getAllRows(AREA.pickmViewTableArea); + let issueParams = []; + let head = {}; + let item = {}; + tableData.forEach((row) => { + head = {}; + item = {}; + issuePickmField.head.forEach((feild) => { + head[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; + }); + issuePickmField.item.forEach((feild) => { + item[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; + }); + issueParams.push({headValue: head, itemValue: item}); + }); + let requestData = {}; + let pageCode = AREA.pickmPageArea; + let pageType = true; + if (this.props.getPageCode().startsWith('5009')) { + pageCode = pageCode.replace('5008', '5009'); + pageType = false; + } + requestData.flag = flag; + requestData.tabType = 0; + requestData.issuePickmDatas = issueParams; + requestData.pageid = pageCode; + //requestData.grid = { + // pageid: pageCode, + // model: { + // areaType: "table", + // pageinfo: null, + // rows: tableData, + // areacode: AREA.pickmViewTableArea + // } + //}; + ajax({ + url: URL.issueDestIssue, + data: requestData, + success: (res) => { + if (res.success) { + if (res.data) { + if (!res.data[AREA.pickmViewTableArea] && res.data.userjson) { + /**国际化:以下单据的材料出库维度与预留维度不一致,是否解除预留? */ + if (pageType) { + showWarningDialog(getLangByResId(this, '50080105-000017'), res.data.userjson, { + beSureBtnClick: destIssue.bind(this, false) + }); + } else { + showWarningDialog(getLangByResId(this, '50090105-000017'), res.data.userjson, { + beSureBtnClick: destIssue.bind(this, false) + }); + } - } else if (res.data[AREA.pickmViewTableArea]) { - //设置缓存数据 - if (res.data.userjson) { - let userjson = JSON.parse(res.data.userjson); - if (userjson) { - setDefData(AREA.dataSource, CACHE.ic4DIds, userjson[CACHE.ic4DIds]); - setDefData(AREA.dataSource, CACHE.ic4kIds, userjson[CACHE.ic4kIds]); - setDefData(AREA.dataSource, CACHE.ic4455Ids, userjson[CACHE.ic4455Ids]); - } - } - if (isAll) { - this.props.editTable.setTableData(AREA.pickmViewTableArea, res.data[AREA.pickmViewTableArea]); - } - else { - let delArray = []; - let updateArray = []; - let rows = res.data[AREA.pickmViewTableArea].rows; - for (let j = 0; j < rows.length; j++) { - let row = rows[j]; - if (indexMap.has(row.values.cpickm_bid.value)) { - let ii = indexMap.get(row.values.cpickm_bid.value); - let obj = { index: ii, data: row }; - updateArray.push(obj); - let i = indexs.indexOf(ii); - indexs.splice(i, 1); - } - } - if (updateArray.length > 0) { - this.props.editTable.updateDataByIndexs(AREA.pickmViewTableArea, updateArray); - } - if (indexs.length > 0) { - this.props.editTable.deleteTableRowsByIndex(AREA.pickmViewTableArea, indexs, true); - } - } - if (pageType) { - showSuccessInfo(getLangByResId(this, '50080105-000013')); - } else { - showSuccessInfo(getLangByResId(this, '50090105-000013')); - } + } else if (res.data[AREA.pickmViewTableArea]) { + //设置缓存数据 + if (res.data.userjson) { + let userjson = JSON.parse(res.data.userjson); + if (userjson) { + setDefData(AREA.dataSource, CACHE.ic4DIds, userjson[CACHE.ic4DIds]); + setDefData(AREA.dataSource, CACHE.ic4kIds, userjson[CACHE.ic4kIds]); + setDefData(AREA.dataSource, CACHE.ic4455Ids, userjson[CACHE.ic4455Ids]); + } + } + if (isAll) { + this.props.editTable.setTableData(AREA.pickmViewTableArea, res.data[AREA.pickmViewTableArea]); + } else { + let delArray = []; + let updateArray = []; + let rows = res.data[AREA.pickmViewTableArea].rows; + for (let j = 0; j < rows.length; j++) { + let row = rows[j]; + if (indexMap.has(row.values.cpickm_bid.value)) { + let ii = indexMap.get(row.values.cpickm_bid.value); + let obj = {index: ii, data: row}; + updateArray.push(obj); + let i = indexs.indexOf(ii); + indexs.splice(i, 1); + } + } + if (updateArray.length > 0) { + this.props.editTable.updateDataByIndexs(AREA.pickmViewTableArea, updateArray); + } + if (indexs.length > 0) { + this.props.editTable.deleteTableRowsByIndex(AREA.pickmViewTableArea, indexs, true); + } + } + if (pageType) { + showSuccessInfo(getLangByResId(this, '50080105-000013')); + } else { + showSuccessInfo(getLangByResId(this, '50090105-000013')); + } - } - } - } - } - }); + } + } + } + } + }); } //删行 async function delrow(index) { - let rowparam = []; - if (index == undefined) { - let selectedRow = getSelectRows.call(this); - selectedRow.map((item) => { - rowparam.push(item.index); - }); - } else { - rowparam.push(index); - } - let requestData = {}; - let pageCode = ""; - requestData.indexs = rowparam; - let tableData = this.props.editTable.getAllRows(getModuleId.call(this)); - let pageType = true; - if (this.props.getPageCode().startsWith('5009')) { - pageType = false; - } - if (this.state.tabType == BILLTYPE.pickm) { - pageCode = AREA.pickmPageArea; - if (!pageType) { - pageCode = pageCode.replace('5008', '5009'); - } - requestData.tabType = 0; - } else if (this.state.tabType == BILLTYPE.reqpickm) { - pageCode = AREA.reqpickmPageArea; - if (!pageType) { - pageCode = pageCode.replace('5008', '5009'); - } - requestData.tabType = 1; - } else if (this.state.tabType == BILLTYPE.directTrans) { - pageCode = AREA.directTransPageArea; - if (!pageType) { - pageCode = pageCode.replace('5008', '5009'); - } - requestData.tabType = 2; - this.props.editTable.deleteTableRowsByIndex(AREA.directTransViewTableArea, rowparam, true); - this.onSelected(); - return; - } - tableData.forEach((row) => { - for (let field in row.values) { - if (field.startsWith('n') || field.startsWith('N')) { - row.values[field].display = ''; - } - } - }); - requestData.grid = { - pageid: pageCode, - model: { - areaType: "table", - pageinfo: null, - rows: tableData, - areacode: getModuleId.call(this) - } - }; - ajax({ - url: URL.issueDeleteLineEvent, - data: requestData, - success: (res) => { - if (res.success) { - if (res.data) { - this.props.editTable.setTableData(getModuleId.call(this), res.data[getModuleId.call(this)]); - this.onSelected(); - } - } - } - }) + let rowparam = []; + if (index == undefined) { + let selectedRow = getSelectRows.call(this); + selectedRow.map((item) => { + rowparam.push(item.index); + }); + } else { + rowparam.push(index); + } + let requestData = {}; + let pageCode = ""; + requestData.indexs = rowparam; + let tableData = this.props.editTable.getAllRows(getModuleId.call(this)); + let pageType = true; + if (this.props.getPageCode().startsWith('5009')) { + pageType = false; + } + if (this.state.tabType == BILLTYPE.pickm) { + pageCode = AREA.pickmPageArea; + if (!pageType) { + pageCode = pageCode.replace('5008', '5009'); + } + requestData.tabType = 0; + } else if (this.state.tabType == BILLTYPE.reqpickm) { + pageCode = AREA.reqpickmPageArea; + if (!pageType) { + pageCode = pageCode.replace('5008', '5009'); + } + requestData.tabType = 1; + } else if (this.state.tabType == BILLTYPE.directTrans) { + pageCode = AREA.directTransPageArea; + if (!pageType) { + pageCode = pageCode.replace('5008', '5009'); + } + requestData.tabType = 2; + this.props.editTable.deleteTableRowsByIndex(AREA.directTransViewTableArea, rowparam, true); + this.onSelected(); + return; + } + tableData.forEach((row) => { + for (let field in row.values) { + if (field.startsWith('n') || field.startsWith('N')) { + row.values[field].display = ''; + } + } + }); + requestData.grid = { + pageid: pageCode, + model: { + areaType: "table", + pageinfo: null, + rows: tableData, + areacode: getModuleId.call(this) + } + }; + ajax({ + url: URL.issueDeleteLineEvent, + data: requestData, + success: (res) => { + if (res.success) { + if (res.data) { + this.props.editTable.setTableData(getModuleId.call(this), res.data[getModuleId.call(this)]); + this.onSelected(); + } + } + } + }) } + //存量查拣 function onHandBtnClick() { - let selectData = getSelectRows.call(this); - let realRows = []; - //过滤掉物料为空的行 - if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { - selectData.forEach((item) => { - if (item.data && item.data.values && item.data.values.cbmaterialvid && item.data.values.cbmaterialvid.value) { - realRows.push(item.data); - } - }); - } else if (this.state.tabType == BILLTYPE.reqpickm) { - selectData.forEach((item) => { - if (item.data && item.data.values && item.data.values.cmaterialvid && item.data.values.cmaterialvid.value) { - realRows.push(item.data); - } - }); - } - let onHandRows = getOnHandData.call(this, realRows); - this.setState({ - headRows: { rows: onHandRows } - }); - this.toggleOnhandShow(); + let selectData = getSelectRows.call(this); + let realRows = []; + //过滤掉物料为空的行 + if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { + selectData.forEach((item) => { + if (item.data && item.data.values && item.data.values.cbmaterialvid && item.data.values.cbmaterialvid.value) { + realRows.push(item.data); + } + }); + } else if (this.state.tabType == BILLTYPE.reqpickm) { + selectData.forEach((item) => { + if (item.data && item.data.values && item.data.values.cmaterialvid && item.data.values.cmaterialvid.value) { + realRows.push(item.data); + } + }); + } + let onHandRows = getOnHandData.call(this, realRows); + this.setState({ + headRows: {rows: onHandRows} + }); + this.toggleOnhandShow(); } function bodyOnhandQuery(record, index) { - let realRows = []; - //过滤掉物料为空的行 - if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { - if (record.values && record.values.cbmaterialvid && record.values.cbmaterialvid.value) { - realRows.push(record); - } else { - return; - } - } else if (this.state.tabType == BILLTYPE.reqpickm) { - if (record.values && record.values.cmaterialvid && record.values.cmaterialvid.value) { - realRows.push(record); - } else { - return; - } - } - let onHandRows = getOnHandData.call(this, realRows); - this.setState({ - headRows: { rows: onHandRows }, - onhandRecord: index - }); - this.toggleOnhandShow(); + let realRows = []; + //过滤掉物料为空的行 + if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { + if (record.values && record.values.cbmaterialvid && record.values.cbmaterialvid.value) { + realRows.push(record); + } else { + return; + } + } else if (this.state.tabType == BILLTYPE.reqpickm) { + if (record.values && record.values.cmaterialvid && record.values.cmaterialvid.value) { + realRows.push(record); + } else { + return; + } + } + let onHandRows = getOnHandData.call(this, realRows); + this.setState({ + headRows: {rows: onHandRows}, + onhandRecord: index + }); + this.toggleOnhandShow(); } //获取库存总量 function getStockAccountNum() { - //let tableData = this.props.editTable.getAllRows(getModuleId.call(this)); - let isAll = false; - let tableData = []; - let selectedRow = getSelectRows.call(this); - if (!selectedRow || selectedRow.length < 1) { - isAll = true; - tableData = this.props.editTable.getAllRows(getModuleId.call(this)); - } - else { - selectedRow.map((item) => { - tableData.push(item.data); - }); - } - let requestData = {}; - let pageCode = null; - let pageType = true; - if (this.props.getPageCode().startsWith('5009')) { - pageType = false; - } - if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { - requestData.tabType = 0; - if (this.state.tabType == BILLTYPE.pickm) { - pageCode = AREA.pickmPageArea; - } - else { - pageCode = AREA.directTransPageArea; - } - if (!pageType) { - pageCode = pageCode.replace('5008', '5009'); - } - let issueParams = []; - let head = {}; - let item = {}; - let isautombc; - let iscmrow; - tableData.forEach((row) => { - head = {}; - item = {}; - issuePickmField.head.forEach((feild) => { - head[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; - }); - issuePickmField.item.forEach((feild) => { - item[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; - }); - isautombc = row.values[isautombc] && row.values[isautombc].value ? row.values[isautombc].value : null; - iscmrow = row.values[iscmrow] && row.values[iscmrow].value ? row.values[iscmrow].value : null - issueParams.push({ headValue: head, itemValue: item, isautombc: isautombc, iscmrow: iscmrow }); - }); - requestData.tabType = 0; - requestData.issuePickmDatas = issueParams; - requestData.pageid = pageCode; - } else if (this.state.tabType == BILLTYPE.reqpickm) { - requestData.tabType = 1; - pageCode = AREA.reqpickmPageArea; - if (!pageType) { - pageCode = pageCode.replace('5008', '5009'); - } - requestData.grid = { - pageid: pageCode, - model: { - areaType: "table", - pageinfo: null, - rows: tableData, - areacode: getModuleId.call(this) - } - } - }; - ajax({ - url: URL.queryIssueObtainStockAccountNum, - data: requestData, - success: (res) => { - if (res.success) { - if (res.data && res.data[getModuleId.call(this)]) { - let rows = res.data[getModuleId.call(this)].rows; - let updateArray = []; - //if (this.state.tabType == BILLTYPE.pickm) { - for (let j = 0; j < rows.length; j++) { - tableData[j].values['deliverystocknum'] = rows[j].values.deliverystocknum; - tableData[j].values['deliverystockastnum'] = rows[j].values.deliverystockastnum; - tableData[j].values['instocknum'] = rows[j].values.instocknum; - tableData[j].values['instockastnum'] = rows[j].values.instockastnum; - tableData[j].values['sumstocknum'] = rows[j].values.sumstocknum; - tableData[j].values['sumstockastnum'] = rows[j].values.sumstockastnum; - let obj = { index: j, data: tableData[j] }; - updateArray.push(obj); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'deliverystocknum', rows[j].values.deliverystocknum); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'deliverystockastnum', rows[j].values.deliverystockastnum); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'instocknum', rows[j].values.instocknum); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'instockastnum', rows[j].values.instockastnum); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'sumstocknum', rows[j].values.sumstocknum); - //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'sumstockastnum', rows[j].values.sumstockastnum); - } + //let tableData = this.props.editTable.getAllRows(getModuleId.call(this)); + let isAll = false; + let tableData = []; + let selectedRow = getSelectRows.call(this); + if (!selectedRow || selectedRow.length < 1) { + isAll = true; + tableData = this.props.editTable.getAllRows(getModuleId.call(this)); + } else { + selectedRow.map((item) => { + tableData.push(item.data); + }); + } + let requestData = {}; + let pageCode = null; + let pageType = true; + if (this.props.getPageCode().startsWith('5009')) { + pageType = false; + } + if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { + requestData.tabType = 0; + if (this.state.tabType == BILLTYPE.pickm) { + pageCode = AREA.pickmPageArea; + } else { + pageCode = AREA.directTransPageArea; + } + if (!pageType) { + pageCode = pageCode.replace('5008', '5009'); + } + let issueParams = []; + let head = {}; + let item = {}; + let isautombc; + let iscmrow; + tableData.forEach((row) => { + head = {}; + item = {}; + issuePickmField.head.forEach((feild) => { + head[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; + }); + issuePickmField.item.forEach((feild) => { + item[feild] = row.values[feild] && row.values[feild].value ? row.values[feild].value : null; + }); + isautombc = row.values[isautombc] && row.values[isautombc].value ? row.values[isautombc].value : null; + iscmrow = row.values[iscmrow] && row.values[iscmrow].value ? row.values[iscmrow].value : null + issueParams.push({headValue: head, itemValue: item, isautombc: isautombc, iscmrow: iscmrow}); + }); + requestData.tabType = 0; + requestData.issuePickmDatas = issueParams; + requestData.pageid = pageCode; + } else if (this.state.tabType == BILLTYPE.reqpickm) { + requestData.tabType = 1; + pageCode = AREA.reqpickmPageArea; + if (!pageType) { + pageCode = pageCode.replace('5008', '5009'); + } + requestData.grid = { + pageid: pageCode, + model: { + areaType: "table", + pageinfo: null, + rows: tableData, + areacode: getModuleId.call(this) + } + } + } + ; + ajax({ + url: URL.queryIssueObtainStockAccountNum, + data: requestData, + success: (res) => { + if (res.success) { + if (res.data && res.data[getModuleId.call(this)]) { + let rows = res.data[getModuleId.call(this)].rows; + let updateArray = []; + //if (this.state.tabType == BILLTYPE.pickm) { + for (let j = 0; j < rows.length; j++) { + tableData[j].values['deliverystocknum'] = rows[j].values.deliverystocknum; + tableData[j].values['deliverystockastnum'] = rows[j].values.deliverystockastnum; + tableData[j].values['instocknum'] = rows[j].values.instocknum; + tableData[j].values['instockastnum'] = rows[j].values.instockastnum; + tableData[j].values['sumstocknum'] = rows[j].values.sumstocknum; + tableData[j].values['sumstockastnum'] = rows[j].values.sumstockastnum; + let obj = {index: j, data: tableData[j]}; + updateArray.push(obj); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'deliverystocknum', rows[j].values.deliverystocknum); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'deliverystockastnum', rows[j].values.deliverystockastnum); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'instocknum', rows[j].values.instocknum); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'instockastnum', rows[j].values.instockastnum); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'sumstocknum', rows[j].values.sumstocknum); + //this.props.editTable.setValByKeyAndIndex(getModuleId.call(this), j, 'sumstockastnum', rows[j].values.sumstockastnum); + } - //} else { - // for (let j = 0; j < rows.length; j++) { - // let obj = { index: j, data: rows[j] }; - // updateArray.push(obj); - // } - //} - if (updateArray.length > 0) { - this.props.editTable.updateDataByIndexs(getModuleId.call(this), updateArray); - } - if (pageType) { - showSuccessInfo(getLangByResId(this, '50080105-000007')); - } - else { - showSuccessInfo(getLangByResId(this, '50090105-000007')); - } - } - } - } - }); + //} else { + // for (let j = 0; j < rows.length; j++) { + // let obj = { index: j, data: rows[j] }; + // updateArray.push(obj); + // } + //} + if (updateArray.length > 0) { + this.props.editTable.updateDataByIndexs(getModuleId.call(this), updateArray); + } + if (pageType) { + showSuccessInfo(getLangByResId(this, '50080105-000007')); + } else { + showSuccessInfo(getLangByResId(this, '50090105-000007')); + } + } + } + } + }); } function getSelectRows() { - let selectData = []; - if (this.state.tabType == BILLTYPE.pickm) { - selectData = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea); - } else if (this.state.tabType == BILLTYPE.reqpickm) { - selectData = this.props.editTable.getCheckedRows(AREA.reqpickmViewTableArea); - } else if (this.state.tabType == BILLTYPE.directTrans) { - selectData = this.props.editTable.getCheckedRows(AREA.directTransViewTableArea); - } - return selectData; + let selectData = []; + if (this.state.tabType == BILLTYPE.pickm) { + selectData = this.props.editTable.getCheckedRows(AREA.pickmViewTableArea); + } else if (this.state.tabType == BILLTYPE.reqpickm) { + selectData = this.props.editTable.getCheckedRows(AREA.reqpickmViewTableArea); + } else if (this.state.tabType == BILLTYPE.directTrans) { + selectData = this.props.editTable.getCheckedRows(AREA.directTransViewTableArea); + } + return selectData; } function getModuleId() { - if (this.state.tabType == BILLTYPE.pickm) { - return AREA.pickmViewTableArea; - } else if (this.state.tabType == BILLTYPE.reqpickm) { - return AREA.reqpickmViewTableArea; - } else if (this.state.tabType == BILLTYPE.directTrans) { - return AREA.directTransViewTableArea; - } + if (this.state.tabType == BILLTYPE.pickm) { + return AREA.pickmViewTableArea; + } else if (this.state.tabType == BILLTYPE.reqpickm) { + return AREA.reqpickmViewTableArea; + } else if (this.state.tabType == BILLTYPE.directTrans) { + return AREA.directTransViewTableArea; + } } //组装维度数据 function getOnHandData(selectData) { - let realRows = []; - let pageType = true; - if (this.props.getPageCode().startsWith('5009')) { - pageType = false; - } - if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { - let cache = getDefData(AREA.dataSource, CACHE.issuePickmCache); - selectData.forEach((item) => { - let onhandDim = { values: {} }; - //集团 - onhandDim.values.pk_group = item.values.pk_group; - // 物料ID - onhandDim.values.cmaterialvid = item.values.cbmaterialvid; - onhandDim.values['cmaterialvid.name'] = item.values['cbmaterialvid.name']; - onhandDim.values['cmaterialvid.pk_measdoc'] = item.values.cbunitid; - // 物料VID - onhandDim.values.cmaterialoid = item.values.cbmaterialid; - // 单位 - onhandDim.values.castunitid = item.values.cbastunitid; - // 换算率 - onhandDim.values.vchangerate = item.values.vbchangerate; - // 批次号 - onhandDim.values.vbatchcode = item.values.vbatchcode; - onhandDim.values.pk_batchcode = item.values.pk_batchcode; - // 货位 - onhandDim.values.clocationid = item.values.clocationid; - // 特征码 - onhandDim.values.cffileid = item.values.cbffileid; - //组织和仓库 - //判断是否为委外 - if ((this.state.tabType == BILLTYPE.directTrans) || (cache.isWWMap && item.values.vbusitypeid && cache.isWWMap[item.values.vbusitypeid.value])) { - onhandDim.values.pk_org = item.values.csupplyorgid; - onhandDim.values.cwarehouseid = item.values.cinstockid; - } else { - onhandDim.values.pk_org = item.values.cdeliverorgid; - onhandDim.values.cwarehouseid = item.values.coutstockid; - } - //设置行号 - onhandDim.values.crowno = item.values.vrowno; - // 待处理主数量 - if (item.values.nthisneednum && item.values.nthisneednum.value) { - onhandDim.values.onhandshouldnum = parseFloat(item.values.nthisneednum.value) > 0 ? item.values.nthisneednum : { value: '0', scale: '2' }; - } - //待处理数量 - if (item.values.nthisneedastnum && item.values.nthisneedastnum.value) { - onhandDim.values.onhandshouldassnum = parseFloat(item.values.nthisneedastnum.value) > 0 ? item.values.nthisneedastnum : { value: '0', scale: '2' }; - } - //物料辅助属性 - onhandDim.values.cproductorid = item.values.cbproductorid; - onhandDim.values.cprojectid = item.values.cbprojectid; - onhandDim.values.cvendorid = item.values.cbvendorid; - onhandDim.values.casscustid = item.values.cbcustomerid; - //自定义项 - onhandDim.values.vfree1 = item.values.vbfree1; - onhandDim.values.vfree2 = item.values.vbfree2; - onhandDim.values.vfree3 = item.values.vbfree3; - onhandDim.values.vfree4 = item.values.vbfree4; - onhandDim.values.vfree5 = item.values.vbfree5; - onhandDim.values.vfree6 = item.values.vbfree6; - onhandDim.values.vfree7 = item.values.vbfree7; - onhandDim.values.vfree8 = item.values.vbfree8; - onhandDim.values.vfree9 = item.values.vbfree9; - onhandDim.values.vfree10 = item.values.vbfree10; - //主数量满意度 - if (item.values.nnum && item.values.nnum.value && item.values.onhandshouldnum && item.values.onhandshouldnum.value) { - if (parseFloat(item.values.nnum.value) > parseFloat(item.values.onhandshouldnum.value)) { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000003') }; /* 国际化处理: 已超出*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000003') }; /* 国际化处理: 已超出*/ - } - } else if (parseFloat(item.values.nnum.value) == parseFloat(item.values.onhandshouldnum.value)) { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000004') }; /* 国际化处理: 已满足*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000004') }; /* 国际化处理: 已满足*/ - } - } else { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000005') }; /* 国际化处理: 未满足*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000005') }; /* 国际化处理: 未满足*/ - } - } - } else { - item.values.fulfiltype = { value: '' }; - } - realRows.push(onhandDim); - }); - } else if (this.state.tabType == BILLTYPE.reqpickm) { - selectData.forEach((item) => { - let onhandDim = { values: {} }; - //集团 - onhandDim.values.pk_group = item.values.pk_group; - // 库存组织 - if (!item.values.csupplyorgid || JSON.stringify(item.values.csupplyorgid) == "{}" - || !item.values.csupplyorgid.value || item.values.csupplyorgid.value == "") { - onhandDim.values.pk_org = item.values.pk_org; - } else { - onhandDim.values.pk_org = item.values.csupplyorgid; - } - // 物料ID - onhandDim.values.cmaterialvid = item.values.cmaterialvid; - onhandDim.values['cmaterialvid.name'] = item.values['cmaterialvid.name']; - onhandDim.values['cmaterialvid.pk_measdoc'] = item.values.cunitid; - // 物料VID - onhandDim.values.cmaterialoid = item.values.cmaterialid; - // 单位 - onhandDim.values.castunitid = item.values.castunitid; - // 仓库 - onhandDim.values.cwarehouseid = item.values.cinstockid; - // 换算率 - onhandDim.values.vchangerate = item.values.vchangerate; - // 批次号 - onhandDim.values.vbatchcode = item.values.vsstockbatchcode; - onhandDim.values.pk_batchcode = item.values.vstockbatchid; - // 货位 - onhandDim.values.clocationid = item.values.clocationid; - // 特征码 - onhandDim.values.cffileid = item.values.cffileid; - //设置行号 - onhandDim.values.crowno = item.values.vrowno; - // 待处理主数量 - onhandDim.values.onhandshouldnum = item.values.nthistransnum; - //待处理数量 - onhandDim.values.onhandshouldassnum = item.values.nthistransastnum; - //物料辅助属性 - onhandDim.values.cproductorid = item.values.cbproductorid; - onhandDim.values.cprojectid = item.values.cbprojectid; - onhandDim.values.cvendorid = item.values.cbvendorid; - onhandDim.values.casscustid = item.values.cbcustomerid; - //自定义项 - onhandDim.values.vfree1 = item.values.vfree1; - onhandDim.values.vfree2 = item.values.vfree2; - onhandDim.values.vfree3 = item.values.vfree3; - onhandDim.values.vfree4 = item.values.vfree4; - onhandDim.values.vfree5 = item.values.vfree5; - onhandDim.values.vfree6 = item.values.vfree6; - onhandDim.values.vfree7 = item.values.vfree7; - onhandDim.values.vfree8 = item.values.vfree8; - onhandDim.values.vfree9 = item.values.vfree9; - onhandDim.values.vfree10 = item.values.vfree10; - //主数量满意度 - if (item.values.nnum && item.values.nnum.value && item.values.onhandshouldnum && item.values.onhandshouldnum.value) { - if (parseFloat(item.values.nnum.value) > parseFloat(item.values.onhandshouldnum.value)) { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000003') }; /* 国际化处理: 已超出*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000003') }; /* 国际化处理: 已超出*/ - } + let realRows = []; + let pageType = true; + if (this.props.getPageCode().startsWith('5009')) { + pageType = false; + } + if (this.state.tabType == BILLTYPE.pickm || this.state.tabType == BILLTYPE.directTrans) { + let cache = getDefData(AREA.dataSource, CACHE.issuePickmCache); + selectData.forEach((item) => { + let onhandDim = {values: {}}; + //集团 + onhandDim.values.pk_group = item.values.pk_group; + // 物料ID + onhandDim.values.cmaterialvid = item.values.cbmaterialvid; + onhandDim.values['cmaterialvid.name'] = item.values['cbmaterialvid.name']; + onhandDim.values['cmaterialvid.pk_measdoc'] = item.values.cbunitid; + // 物料VID + onhandDim.values.cmaterialoid = item.values.cbmaterialid; + // 单位 + onhandDim.values.castunitid = item.values.cbastunitid; + // 换算率 + onhandDim.values.vchangerate = item.values.vbchangerate; + // 批次号 + onhandDim.values.vbatchcode = item.values.vbatchcode; + onhandDim.values.pk_batchcode = item.values.pk_batchcode; + // 货位 + onhandDim.values.clocationid = item.values.clocationid; + // 特征码 + onhandDim.values.cffileid = item.values.cbffileid; + //组织和仓库 + //判断是否为委外 + if ((this.state.tabType == BILLTYPE.directTrans) || (cache.isWWMap && item.values.vbusitypeid && cache.isWWMap[item.values.vbusitypeid.value])) { + onhandDim.values.pk_org = item.values.csupplyorgid; + onhandDim.values.cwarehouseid = item.values.cinstockid; + } else { + onhandDim.values.pk_org = item.values.cdeliverorgid; + onhandDim.values.cwarehouseid = item.values.coutstockid; + } + //设置行号 + onhandDim.values.crowno = item.values.vrowno; + // 待处理主数量 + if (item.values.nthisneednum && item.values.nthisneednum.value) { + onhandDim.values.onhandshouldnum = parseFloat(item.values.nthisneednum.value) > 0 ? item.values.nthisneednum : { + value: '0', + scale: '2' + }; + } + //待处理数量 + if (item.values.nthisneedastnum && item.values.nthisneedastnum.value) { + onhandDim.values.onhandshouldassnum = parseFloat(item.values.nthisneedastnum.value) > 0 ? item.values.nthisneedastnum : { + value: '0', + scale: '2' + }; + } + //物料辅助属性 + onhandDim.values.cproductorid = item.values.cbproductorid; + onhandDim.values.cprojectid = item.values.cbprojectid; + onhandDim.values.cvendorid = item.values.cbvendorid; + onhandDim.values.casscustid = item.values.cbcustomerid; + //自定义项 + onhandDim.values.vfree1 = item.values.vbfree1; + onhandDim.values.vfree2 = item.values.vbfree2; + onhandDim.values.vfree3 = item.values.vbfree3; + onhandDim.values.vfree4 = item.values.vbfree4; + onhandDim.values.vfree5 = item.values.vbfree5; + onhandDim.values.vfree6 = item.values.vbfree6; + onhandDim.values.vfree7 = item.values.vbfree7; + onhandDim.values.vfree8 = item.values.vbfree8; + onhandDim.values.vfree9 = item.values.vbfree9; + onhandDim.values.vfree10 = item.values.vbfree10; + //主数量满意度 + if (item.values.nnum && item.values.nnum.value && item.values.onhandshouldnum && item.values.onhandshouldnum.value) { + if (parseFloat(item.values.nnum.value) > parseFloat(item.values.onhandshouldnum.value)) { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000003')}; /* 国际化处理: 已超出*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000003')}; /* 国际化处理: 已超出*/ + } + } else if (parseFloat(item.values.nnum.value) == parseFloat(item.values.onhandshouldnum.value)) { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000004')}; /* 国际化处理: 已满足*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000004')}; /* 国际化处理: 已满足*/ + } + } else { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000005')}; /* 国际化处理: 未满足*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000005')}; /* 国际化处理: 未满足*/ + } + } + } else { + item.values.fulfiltype = {value: ''}; + } + realRows.push(onhandDim); + }); + } else if (this.state.tabType == BILLTYPE.reqpickm) { + selectData.forEach((item) => { + let onhandDim = {values: {}}; + //集团 + onhandDim.values.pk_group = item.values.pk_group; + // 库存组织 + if (!item.values.csupplyorgid || JSON.stringify(item.values.csupplyorgid) == "{}" + || !item.values.csupplyorgid.value || item.values.csupplyorgid.value == "") { + onhandDim.values.pk_org = item.values.pk_org; + } else { + onhandDim.values.pk_org = item.values.csupplyorgid; + } + // 物料ID + onhandDim.values.cmaterialvid = item.values.cmaterialvid; + onhandDim.values['cmaterialvid.name'] = item.values['cmaterialvid.name']; + onhandDim.values['cmaterialvid.pk_measdoc'] = item.values.cunitid; + // 物料VID + onhandDim.values.cmaterialoid = item.values.cmaterialid; + // 单位 + onhandDim.values.castunitid = item.values.castunitid; + // 仓库 + onhandDim.values.cwarehouseid = item.values.cinstockid; + // 换算率 + onhandDim.values.vchangerate = item.values.vchangerate; + // 批次号 + onhandDim.values.vbatchcode = item.values.vsstockbatchcode; + onhandDim.values.pk_batchcode = item.values.vstockbatchid; + // 货位 + onhandDim.values.clocationid = item.values.clocationid; + // 特征码 + onhandDim.values.cffileid = item.values.cffileid; + //设置行号 + onhandDim.values.crowno = item.values.vrowno; + // 待处理主数量 + onhandDim.values.onhandshouldnum = item.values.nthistransnum; + //待处理数量 + onhandDim.values.onhandshouldassnum = item.values.nthistransastnum; + //物料辅助属性 + onhandDim.values.cproductorid = item.values.cbproductorid; + onhandDim.values.cprojectid = item.values.cbprojectid; + onhandDim.values.cvendorid = item.values.cbvendorid; + onhandDim.values.casscustid = item.values.cbcustomerid; + //自定义项 + onhandDim.values.vfree1 = item.values.vfree1; + onhandDim.values.vfree2 = item.values.vfree2; + onhandDim.values.vfree3 = item.values.vfree3; + onhandDim.values.vfree4 = item.values.vfree4; + onhandDim.values.vfree5 = item.values.vfree5; + onhandDim.values.vfree6 = item.values.vfree6; + onhandDim.values.vfree7 = item.values.vfree7; + onhandDim.values.vfree8 = item.values.vfree8; + onhandDim.values.vfree9 = item.values.vfree9; + onhandDim.values.vfree10 = item.values.vfree10; + //主数量满意度 + if (item.values.nnum && item.values.nnum.value && item.values.onhandshouldnum && item.values.onhandshouldnum.value) { + if (parseFloat(item.values.nnum.value) > parseFloat(item.values.onhandshouldnum.value)) { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000003')}; /* 国际化处理: 已超出*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000003')}; /* 国际化处理: 已超出*/ + } - } else if (parseFloat(item.values.nnum.value) == parseFloat(item.values.onhandshouldnum.value)) { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000004') }; /* 国际化处理: 已满足*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000004') }; /* 国际化处理: 已满足*/ - } - } else { - if (pageType) { - item.values.fulfiltype = { value: getLangByResId(this, '50080105-000005') }; /* 国际化处理: 未满足*/ - } else { - item.values.fulfiltype = { value: getLangByResId(this, '50090105-000005') }; /* 国际化处理: 未满足*/ - } - } - } else { - item.values.fulfiltype = { value: '' }; - } - realRows.push(onhandDim); - }); - } - return realRows; + } else if (parseFloat(item.values.nnum.value) == parseFloat(item.values.onhandshouldnum.value)) { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000004')}; /* 国际化处理: 已满足*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000004')}; /* 国际化处理: 已满足*/ + } + } else { + if (pageType) { + item.values.fulfiltype = {value: getLangByResId(this, '50080105-000005')}; /* 国际化处理: 未满足*/ + } else { + item.values.fulfiltype = {value: getLangByResId(this, '50090105-000005')}; /* 国际化处理: 未满足*/ + } + } + } else { + item.values.fulfiltype = {value: ''}; + } + realRows.push(onhandDim); + }); + } + return realRows; } + /*9LNhEcWwOPqFwoyI0rg5Tvi1KVVJuZ+O99DtbZayIQc=*/ \ No newline at end of file