diff --git a/src/arap/paybill/paybill/card/constants.js b/src/arap/paybill/paybill/card/constants.js
index df7bb62..7c1e758 100644
--- a/src/arap/paybill/paybill/card/constants.js
+++ b/src/arap/paybill/paybill/card/constants.js
@@ -1,4 +1,4 @@
-/*kHr1VQMdEU42oXEu346enLE2PHnzHrFdr/OxPw9YGIc=*/
+/*kHr1VQMdEU42oXEu346enGx+6rXJ4OFHE2VimKRgjU4=*/
/**
* 表头区域
@@ -55,4 +55,4 @@ export const pkname = 'pk_paybill';
* 列表联查页面pageId
*/
export const linkPageId = '20080EBM_LIST_LINK';
-/*kHr1VQMdEU42oXEu346enLE2PHnzHrFdr/OxPw9YGIc=*/
\ No newline at end of file
+/*kHr1VQMdEU42oXEu346enGx+6rXJ4OFHE2VimKRgjU4=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/events/afterEvent.js b/src/arap/paybill/paybill/card/events/afterEvent.js
new file mode 100644
index 0000000..b759826
--- /dev/null
+++ b/src/arap/paybill/paybill/card/events/afterEvent.js
@@ -0,0 +1,421 @@
+/*DncIqBreQz6WZRX+v7OzgRW7fkbxk12M9r3MB9P+hwI=*/
+import { ajax, promptBox, toast } from 'nc-lightapp-front';
+import { currentTypeAfterFormEvents } from '../../../../public/components/pubUtils/currentTypeAfterEvent';
+import { autoAddLineKeys } from '../../../../public/components/pubUtils/billPubInfo';
+import { checknoDisplayAfterEvent, checktypeAfterEvent,isbillrangeEdit } from '../../../../public/components/pubUtils/specialFieldAfterEvent.js';
+import { formulamsgHint, renderData, headAfterEventRenderData, bodyAfterEventRenderData, errorDeal } from '../../../../public/components/afterEventPub/afterEventPubDeal';
+import { getColvalues, getRowIds } from '../../../../public/components/pubUtils/billPubUtil';
+import { moneyAndRateFields } from '../../../../public/components/pubUtils/specialFieldAfterEvent.js';
+import { isExistsTopBill } from '../../../../public/components/pubUtils/billPubUtil.js';
+import {afterEventFor36S3} from '../../../../public/components/pubUtils/arap436s3utils';
+import { setAllocField } from '../../../../public/components/allocation.js';
+import {refreshSmartCard} from '../../../../public/components/arapSmartCard.js';
+export default function afterEvent(props, moduleId, key, value, changedrows, i, record, g) {
+ if (changedrows instanceof Array) {
+ if (changedrows[0].newvalue.value == changedrows[0].oldvalue.value) {
+ return;
+ }
+ }
+ let pagecode = this.getPagecode();
+ let index = 0;
+ if (moduleId == this.formId) {
+ index = 0;
+ } else if (moduleId == this.tableId) {
+ index = i;
+ }
+ if(this.props.getUrlParam("src")=="36S3"){
+ afterEventFor36S3(this,props, moduleId, key, value, changedrows, i, record, g);
+ return;
+ }
+ refreshSmartCard({props,key,moduleId, attrcode:key, record});//更新智能区
+ //表头编辑后事件
+ if (moduleId == this.formId) {
+ let data = null;
+ switch (key) {
+ case 'pk_org_v':
+ if (value.value == null || value.value == '') {
+ //清空财务组织
+ if (this.props.getUrlParam('type') === 'transfer') {
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000018'] /* 国际化处理: 确认修改*/,
+ content: this.state.json['paybill-000053'] /* 国际化处理: 来源于上游的单据不允许清空财务组织!*/,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ noCancelBtn: true,
+ beSureBtnClick: () => {
+ this.props.form.setFormItemsValue(this.formId, { pk_org_v: changedrows });
+ },
+ closeByClickBackDrop: false
+ });
+ } else {
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000018'] /* 国际化处理: 确认修改*/,
+ content: this.state.json['paybill-000019'] /* 国际化处理: 确定修改组织,这样会清空您录入的信息?*/,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () => {
+ this.props.form.setFormItemsValue("allocobjrule", { "allocobjrule": { value: '', display: '' } });
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.initAdd(true);
+ },
+ cancelBtnClick: () => {
+ this.props.form.setFormItemsValue(this.formId, { pk_org_v: changedrows });
+ },
+ closeByClickBackDrop: false
+ });
+ }
+ } else if (changedrows.value != null && changedrows.value != '') {
+ //切换组织
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000018'] /* 国际化处理: 确认修改*/,
+ content: this.state.json['paybill-000019'] /* 国际化处理: 确定修改组织,这样会清空您录入的信息?*/,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () => {
+ this.props.form.setFormItemsValue("allocobjrule", { "allocobjrule": { value: '', display: '' } });
+ ajax({
+ url: '/nccloud/arap/paybill/cardheadafteredit.do',
+ data: {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ },
+ async: false,
+ success: (res) => {
+ //渲染数据
+ renderData(this, res);
+ //编辑公式提示
+ formulamsgHint(this, res);
+ },
+ error: (res) => {
+ errorDeal(this, res, changedrows, key);
+ }
+ });
+ },
+ cancelBtnClick: () => {
+ this.props.form.setFormItemsValue(this.formId, { pk_org_v: changedrows });
+ },
+ closeByClickBackDrop: false
+ });
+ } else {
+ data = {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ }
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ }
+ break;
+ case 'supplier_v':
+ data = {
+ pageId: pagecode,
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ colValues: getColvalues(this.props, this.tableId, ['pk_org','pk_org_v', 'payaccount', 'recaccount','pk_currtype', 'supplier','supplier_v', 'buysellflag',
+ 'objtype', "direction", "pk_billtype", "top_billtype", "pk_payterm", "pk_psndoc", "pk_deptid", "pk_deptid_v",'pk_ratetype','ratedate','ordercubasdoc','ordercubasdoc_v'].concat(moneyAndRateFields)),
+ rowids: getRowIds(this.props, this.tableId),
+ uiState: this.props.getUrlParam('status')
+ };
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ break;
+ case 'payaccount':
+ data = {
+ pageId: pagecode,
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ colValues: getColvalues(this.props, this.tableId, ['pk_org','pk_org_v', 'payaccount', 'pk_currtype', 'supplier', 'supplier_v', 'buysellflag',
+ 'objtype', "direction", "pk_billtype"].concat(moneyAndRateFields)),
+ rowids: getRowIds(this.props, this.tableId),
+ uiState: this.props.getUrlParam('status')
+ };
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ break;
+ case 'pk_deptid_v':
+ data = {
+ pageId: pagecode,
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ colValues: getColvalues(this.props, this.tableId, ['pk_org','pk_org_v', 'pk_deptid', 'pk_deptid_v', 'pk_currtype', 'supplier','supplier_v', 'taxtype', 'buysellflag', 'objtype', "direction",'pk_psndoc','pk_pcorg','pk_pcorg_v', 'costcenter', 'billdate']),
+ rowids: getRowIds(this.props, this.tableId),
+ uiState: this.props.getUrlParam('status')
+ };
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ break;
+ case 'pk_psndoc':
+ data = {
+ pageId: pagecode,
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ colValues: getColvalues(this.props, this.tableId, ['pk_org','pk_org_v', 'pk_psndoc', 'payaccount', 'recaccount', 'pk_deptid', 'pk_deptid_v', 'isrefused', 'prepay', 'isdiscount', 'objtype', 'direction', 'agentreceivelocal','buysellflag','pk_pcorg','pk_pcorg_v','costcenter']),
+ rowids: getRowIds(this.props, this.tableId),
+ uiState: this.props.getUrlParam('status')
+ };
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ break;
+ case 'pk_currtype':
+ data = {
+ pageId: pagecode,
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ colValues: getColvalues(this.props, this.tableId, ["pk_org","pk_org_v","pk_group","pk_currtype","pk_billtype","billdate","rate","grouprate","globalrate",
+ "buysellflag","taxprice","local_taxprice","taxrate","occupationmny","money_bal","local_money_bal",
+ "globaldebit","globalnotax_de","globaltax_de","groupdebit","groupnotax_de", "recaccount",
+ "grouptax_de","local_money_de","local_notax_de","local_tax_de","money_de","notax_de","quantity_de","direction","settlecurr","settlemoney","pk_ratetype","ratedate","top_billtype","settlemoney","settlecurr",'supplier','supplier_v']),
+ rowids: getRowIds(this.props, this.tableId),
+ uiState: this.props.getUrlParam('status')
+ }
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ //币种事件发送完要判断汇率
+ //v2111 汇率控制发生变化,都走编辑前进行控制 currentTypeAfterFormEvents(this.formId, props, key);
+ break;
+ case 'subjcode':
+ data = {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ }
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ this.props.form.setFormItemsValue(this.formId, { 'subjcode': { value: value.refpk, display: value.dispname } });
+ break;
+ case 'pk_ratetype':
+ data = {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ }
+ if (value.value == null || value.value == '') {
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000058'] /* 国际化处理: 确认清空*/,
+ content: this.state.json['paybill-000059'] /* 国际化处理: 确定清空汇率类型,这样会清空金额相关的信息!*/,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () => {
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ },
+ cancelBtnClick: () => {
+ this.props.form.setFormItemsValue(this.formId, { pk_ratetype: changedrows });
+ },
+ closeByClickBackDrop: false
+ });
+ } else {
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ }
+ break;
+ case 'pk_periodrule':
+ data = {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ }
+ headFieldAfterRequest.call(this, data, key, changedrows);
+ setAllocField(this);
+ break;
+ default:
+ if(key=='startdate'&&value.value){
+ value.value = value.value.substr(0, 10)+' 00:00:00';
+ this.props.form.setFormItemsValue(this.formId, { key: value });
+ }else if(key=='enddate'&&value.value){
+ value.value = value.value.substr(0, 10)+' 23:59:59';
+ this.props.form.setFormItemsValue(this.formId, { key: value });
+ }
+ data = {
+ pageId: pagecode,
+ event: this.props.createHeadAfterEventData(pagecode, this.formId, this.tableId, moduleId, key, value),
+ uiState: this.props.getUrlParam('status')
+ }
+ headFieldAfterRequest.call(this, data, key, changedrows)
+ break;
+ }
+ }
+
+ //表体编辑后事件
+ if (moduleId == this.tableId) {
+ //票据类型
+ if (key == 'checktype') {
+ checktypeAfterEvent(this.props, this.tableId, key, value, i);
+ }
+ if (key == 'direct_checkno') {
+ let checkno = this.props.cardTable.getValByKeyAndIndex(this.tableId, i, "checkno");
+ let checknovalue = checkno?checkno.value:null;
+ if(value=="N"&&isbillrangeEdit(checknovalue,value)){
+ this.props.cardTable.setEditableByIndex(this.tableId, i, ['billrangestart','billrangeend'], true);
+ }else{
+ this.props.cardTable.setEditableByIndex(this.tableId, i, ['billrangestart','billrangeend'], false);
+ }
+ }
+ //非元数据字段,票据号
+ if (key == 'checkno_display') {
+ checknoDisplayAfterEvent(this.props, this.tableId, key, value, i);
+ key = 'checkno';
+ let billtypecode = value.values.pk_billtypecode.value;
+ let subcontractcirculation = value.values.subcontractcirculation.value;
+ if(billtypecode=="36H2"){
+ this.isEditbillrangge = false;
+ }else if(billtypecode=="36H1"){
+ if(subcontractcirculation=="Y"){
+ this.isEditbillrangge = true;
+ }else{
+ this.isEditbillrangge = false;
+ }
+ }
+ }
+ //科目字段特殊拼接1121\应收票据
+ if(key == "subjcode"){
+ // this.props.cardTable.setValByKeyAndIndex(this.tableId, i, 'subjcode', { value: value.refpk, display: value.dispname })
+ }
+ if(key=='startdate'&&value){
+ value = value.substr(0, 10)+' 00:00:00';
+ this.props.cardTable.setValByKeyAndIndex(this.tableId, i , key , {value: value});
+ }else if(key=='enddate'&&value){
+ value = value.substr(0, 10)+' 23:59:59';
+ this.props.cardTable.setValByKeyAndIndex(this.tableId, i , key , {value: value});
+ }
+ ajax({
+ url: '/nccloud/arap/paybill/cardbodyafteredit.do',
+ data: {
+ rowindex: 0,
+ editindex: index,
+ pageId: pagecode,
+ changedrows: changedrows,
+ tableId:this.tableId,
+ body: props.cardTable.getDataByIndex(this.tableId, index),
+ formEvent: props.createFormAfterEventData(pagecode, this.formId, this.tableId, key, value),
+ uiState: this.props.getUrlParam('status')
+ },
+ loading:false,
+ async: false,
+ success: (res) => {
+ //渲染数据
+ bodyAfterEventRenderData(this, res, index);
+ if (this.props.getUrlParam('type') == 'transfer') {
+ this.synTransferData();
+ }
+ //表体改变表头税率编辑性
+ if (i == 0 && key == 'pk_currtype') {
+ //v2111 汇率控制发生变化,都走编辑前进行控制 currentTypeAfterFormEvents(this.formId, props, 'pk_currtype');
+ }
+ //编辑公式提示
+ formulamsgHint(this, res);
+ },
+ error: (res) => {
+ let str = res.message;
+ if (str.substring(0,16) == 'convertException') {
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000000'] /* 国际化处理: 折算误差*/,
+ content: str.substring(16, str.length),
+ closeByClickBackDrop: false,
+ beSureBtnClick: () => {
+ afterTableEvent(this, props, i, pagecode, moduleId, key, changedrows, 'sure', index,value);
+ },
+ cancelBtnClick: () => {
+ afterTableEvent(this, props, i, pagecode, moduleId, key, changedrows, 'cancel', index,value);
+ }
+ });
+ } else {
+ if (key == 'startdate' || key == 'enddate'||key=='firstallocdate') {
+ this.props.cardTable.setValByKeyAndRowId(this.tableId, changedrows[0].rowid, key, { value: changedrows[0].oldvalue.value, display: changedrows[0].oldvalue.display });
+ } else {
+ this.props.cardTable.setValByKeyAndRowId(this.tableId, i, key, changedrows);
+ }
+ toast({ color: 'danger', content: str});;
+ }
+ }
+ });
+
+ //自动增行
+ autoAddline.call(this, moduleId, pagecode, key, i)
+ }
+}
+
+function afterTableEvent(that, props, i, pagecode, moduleId, key, changedrows, isCalculateConvert, index,value) {
+
+ ajax({
+ url: '/nccloud/arap/paybill/cardbodyafteredit.do',
+ data: {
+ rowindex: 0,
+ editindex: index,
+ pageId: pagecode,
+ changedrows: changedrows,
+ tableId:that.tableId,
+ body: props.cardTable.getDataByIndex(that.tableId, index),
+ formEvent: props.createFormAfterEventData(pagecode, that.formId, that.tableId, key, value),
+ uiState: that.props.getUrlParam('status'),
+ isCalculateConvert: isCalculateConvert
+ },
+ async: false,
+ success: (res) => {
+ //渲染数据
+ bodyAfterEventRenderData(that, res);
+ if (that.props.getUrlParam('type') == 'transfer') {
+ that.synTransferData();
+ }
+ //表体改变表头税率编辑性
+ if (i == 0 && key == 'pk_currtype') {
+ //v2111 汇率控制发生变化,都走编辑前进行控制 currentTypeAfterFormEvents(that.formId, props, 'pk_currtype');
+ }
+ //编辑公式提示
+ formulamsgHint(that, res);
+ }
+ });
+}
+
+export function headFieldAfterRequest(requestData, key, changedrows) {
+ ajax({
+ url: '/nccloud/arap/paybill/cardheadafteredit.do',
+ data: requestData,
+ async: false,
+ success: (res) => {
+ //渲染数据
+ headAfterEventRenderData(this, res);
+ //编辑公式提示
+ formulamsgHint(this, res);
+
+ if (key == 'pk_org_v') {
+ let pk_org_v = this.props.form.getFormItemsValue(this.formId, 'pk_org_v').value;
+ if (pk_org_v) {
+ this.props.resMetaAfterPkorgEdit();
+ this.state.buttonfalg = true;
+ } else {
+ this.state.buttonfalg = null;
+ }
+ this.toggleShow();
+ this.props.cardTable.setColValue(this.tableId,'prepay', { display:this.prepay.display,value: this.prepay.value});
+ }
+
+ if (this.props.getUrlParam('type') == 'transfer') {
+ this.synTransferData();
+ }
+ },
+ error: (res) => {
+ errorDeal(this, res, changedrows, key);
+ }
+ });
+}
+
+export function autoAddline(moduleId, pagecode, key, i) {
+ //自动增行
+ let allRowsNumber = this.props.cardTable.getNumberOfRows(this.tableId);
+ if (moduleId == this.tableId && allRowsNumber == i + 1 && autoAddLineKeys.indexOf(key) != -1 && !isExistsTopBill(this)) {
+ let data = this.props.createMasterChildData(pagecode, this.formId, this.tableId);
+ //清空cardData的表体
+ data.body[this.tableId].rows = [];
+ ajax({
+ url: '/nccloud/arap/paybillpub/addline.do',
+ data: data,
+ loading:false,
+ async: false,
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.addRow(this.tableId, allRowsNumber, res.data.body[this.tableId].rows[0].values, false);
+ this.props.cardTable.setValByKeyAndIndex(this.tableId, allRowsNumber, 'prepay', { display:this.prepay.display,value:this.prepay.value});
+ }
+ }
+ }
+ });
+ }
+}
+/*DncIqBreQz6WZRX+v7OzgRW7fkbxk12M9r3MB9P+hwI=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/events/buttonClick.js b/src/arap/paybill/paybill/card/events/buttonClick.js
new file mode 100644
index 0000000..441350d
--- /dev/null
+++ b/src/arap/paybill/paybill/card/events/buttonClick.js
@@ -0,0 +1,1007 @@
+/*q2LCmxM8POvl78IL0LiydiXQT6yFM8mpfFEU8+B79Fw=*/
+import { ajax, toast, cardCache, promptBox,metaCache} from 'nc-lightapp-front';
+import { headButton,innerButton, bodyButton } from '../../../../public/components/pubUtils/buttonName';
+import {
+ delLine,
+ copyLine,
+ pasteLine,
+ pasteToEndLine, generate, sendSpAndCancelSenSPPubFun, delBlankLine
+} from '../../../../public/components/pubUtils/billPubUtil.js';
+import { imageScan, imageView } from 'sscrp/rppub/components/image';
+import { tableId, formId, billType, dataSource, pkname } from '../constants';
+import { cardBodyControl } from '../../../../public/components/pubUtils/buttonvisible.js';
+import { getTransferInfo } from '../../../../public/components/pubUtils/transferButtonUtil.js';
+import initTemplate from './initTemplate';
+import { BodyVerify, WholeVerify } from '../../../../public/components/pubUtils/arapVerifyCheck';
+import arapLinkReport from '../../../../public/components/arapBillLinkReport.js';
+import linkvouchar from '../../../../public/components/linkvouchar.js';
+import madeBill from '../../../../public/components/madeBill.js';
+import { copyBill } from '../../../../public/components/pubUtils/CopyBill/arapCopyBill';
+import {
+ objtypeEditable,
+ dealCommisionPayField,
+ billEditProperties,
+ dealCommisionPayFieldBack,
+ cardFieldsEditableWithResetProxy,
+ checkRedType
+} from '../../../../public/components/pubUtils/billFieldEditableUtil.js';
+import { getContext, loginContextKeys } from '../../../../public/components/arapInitInfo/loginContext';
+import { moduleEnable, IMAG, SSCIVM } from '../../../../public/components/moduleEnable.js';
+import { throwSagaErrorAgency } from '../../../../public/components/pubUtils/MicroServiceSocket.js';
+import { buttonClick4cmp36S3 } from '../../../../public/components/pubUtils/arap436s3utils.js';
+import IndependentSettleUtil from 'sp/pub/utils/IndependentSettleUtil';
+import { allocperiodruleLinkQuery,showAllocation,setAllocField,ctrAllocBtn,dealBtnVisibleForApprovalCenter} from '../../../../public/components/allocation.js';
+import {refreshSmartCard} from '../../../../public/components/arapSmartCard.js';
+let { getDefData, setDefData, updateCache, deleteCacheById } = cardCache;
+import {updateCacheTss} from '../../../../public/components/updateTableDataTs';
+export function buttonClick(props, id) {
+ const { openToIndepSettle } = IndependentSettleUtil;
+ let code = getContext(loginContextKeys.transtype);
+ let pagecode = this.getPagecode();
+ this.dataInSaga.butncode = id;
+ if (this.props.getUrlParam("src") == "36S3") {
+ buttonClick4cmp36S3(this, props, id);
+ return;
+ }
+ // if(id!=headButton.Refresh){
+ // refreshSmartCard({props,key:''});//更新智能区
+ // }
+ if(id==headButton.Cancel||id==headButton.Save||id==headButton.SaveAndCommit||id==headButton.Add||id==headButton.Copy){//保存/保存提交/取消
+ this.checknoArray = [];
+ }
+ switch (id) {
+ case headButton.Commit: //提交
+ this.Info.tipUrl = '/nccloud/arap/arappub/commit.do';
+ this.commitAndUncommit();
+ break;
+ case headButton.Uncommit: //收回
+ this.Info.tipUrl = '/nccloud/arap/arappub/uncommit.do';
+ this.commitAndUncommit();
+ break;
+ case headButton.Generate://生成
+ generate(this)
+ break;
+ case headButton.SendSP://传结算
+ sendSpAndCancelSenSPPubFun(this, 1)
+ break;
+ case headButton.CancelSendSP://取消传结算
+ sendSpAndCancelSenSPPubFun(this, 2)
+ break;
+ case headButton.LinkAprv: //审批详情
+ this.setState({ showApproveDetail: true });
+ break;
+ case headButton.Save:
+ saveBillClick(this, '/nccloud/arap/arappub/save.do')
+ // this.saveBill('/nccloud/arap/arappub/save.do');
+ break;
+ case headButton.TempSave:
+ this.saveBill('/nccloud/arap/arappub/tempsave.do');
+ break;
+ case headButton.SaveAndCommit:
+ saveBillClick(this, '/nccloud/arap/arappub/saveandcommit.do')
+ // this.saveBill('/nccloud/arap/arappub/saveandcommit.do');
+ break;
+ case headButton.Add:
+ //卡片新增时,将浏览态的单据主键缓存,点击取消时重新查询该主键单据
+ pagecode = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ pagecode = code;
+ } else if (!pagecode) {
+ pagecode = this.getPagecode();
+ }
+ //缓存中的交易类型和链接中交易类型不一样的话,重新加载模板
+ props.setUrlParam({ status: 'add', pagecode: pagecode });
+ if (pagecode != this.getPagecode()) {
+
+ if (this.props.getUrlParam('srcbilltype')) {
+ this.props.setUrlParam({ srcbilltype: '' });
+ }
+ initTemplate.call(this, this.props);
+ }
+ if(this.props.getUrlParam("src")){
+ let src = this.props.getUrlParam('src') == 'settlement';
+ if(src){
+ dealCommisionPayFieldBack(this.props, this.formId, this.tableId);
+ }
+
+ initTemplate.call(this, this.props);
+ }
+ if (checkRedType(this)){
+ cardFieldsEditableWithResetProxy(this);
+ }
+ //新增清空 来源src
+ props.setUrlParam({ src: '' });
+ this.initAdd();
+ break;
+ case headButton.Edit:
+ cardBillEdit.call(this)
+ break;
+ case headButton.Copy:
+ if (checkRedType(this)){
+ cardFieldsEditableWithResetProxy(this);
+ }
+ copyBill(this, this.getPagecode());
+ break;
+ case headButton.Delete:
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000002'] /* 国际化处理: 删除*/,
+ content: this.state.json['paybill-000006'] /* 国际化处理: 确定要删除吗?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: this.delConfirm
+ });
+ break;
+ case headButton.Cancel:
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ content: this.state.json['paybill-000003'] /* 国际化处理: 确定要取消吗?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: this.cancel
+ });
+ break;
+ case headButton.Pausetrans: //挂起操作
+ this.pause('/nccloud/arap/arappub/pause.do');
+ break;
+ case headButton.Cancelpause: //取消挂起操作
+ this.pause('/nccloud/arap/arappub/cancelpause.do');
+ break;
+ case headButton.PrePay: //预收付
+ let prePayDatas = this.props.cardTable.getCheckedRows(this.tableId);
+ if (prePayDatas.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000033'] }); /* 国际化处理: 请选择表体行!*/
+ return;
+ }
+ let prePayDatasObj = [];
+ prePayDatas.forEach((val) => {
+ prePayDatasObj.push(val.data.values.pk_payitem.value);
+ });
+ let prePayDatasdata = {
+ pk_items: prePayDatasObj,
+ pk_bill: this.props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ pageId: this.getPagecode(),
+ billType: this.billType
+ };
+ ajax({
+ url: '/nccloud/arap/arappub/prepay.do',
+ data: Object.assign(prePayDatasdata, this.dataInSaga),
+ success: (res) => {
+ toast({ color: 'success', content: this.state.json['paybill-000034'] }); /* 国际化处理: 预收付成功*/
+
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ this.onSelected();
+ }
+ });
+ break;
+ case headButton.RedBack: //红冲操作
+ let writebackData = {
+ pk_bill: this.props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ pageId: this.getPagecode(),
+ billType: this.billType,
+ tradeType: this.getPagecode()
+ };
+ ajax({
+ url: '/nccloud/arap/arappub/redback.do',
+ data: Object.assign(writebackData, this.dataInSaga),
+ success: (res) => {
+ let data = res.data;
+ if ('Hyperlink' == data) {
+ let mess = this.state.json['paybill-000067'];
+ let content = this.state.json['paybill-000062'];
+ let flagMess= this.state.json['paybill-000063'];
+ let div =
< a href="javascript:void(0)" title={flagMess}>{mess}
;
+ toast({ content: content, color: 'warning', groupOperation: true, customBtnBeforeClose: div });
+ } else {
+ this.props.beforeUpdatePage(); //打开开关
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ props.setUrlParam({ status: 'add', id: this.props.getUrlParam('id'), type: 'redBack' });
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.form.setFormItemsDisabled(this.formId, { pk_org_v: true });
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.toggleShow();
+ this.props.button.setButtonVisible([headButton.TempSave], false);
+ //红冲不允许改币种
+ this.props.form.setFormItemsDisabled(formId, { pk_currtype: true });
+ this.props.cardTable.setColEditableByKey(tableId, ['pk_currtype'], true);
+ }
+ },
+ error: (res) => {
+ if (!res.success) {
+ toast({ color: 'danger', content: res.message });
+ }
+ }
+ });
+ break;
+ case headButton.CommisionPay: //承付
+ ajax({
+ url: '/nccloud/arap/arappub/commisionpay.do',
+ data: Object.assign({
+ pk_bill: this.props.getUrlParam('id'),
+ billType: this.billType,
+ pageId: this.getPagecode()
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.data) {
+ this.props.beforeUpdatePage(); //打开开关
+ this.props.setUrlParam({ status: 'edit' });
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ this.props.form.setFormItemsDisabled(this.formId, { pk_org_v: true });
+ //处理承付字段的编辑性
+ dealCommisionPayField(this.props, this.formId, this.tableId);
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.toggleShow();
+ }
+ }
+ });
+ break;
+ case headButton.CancelCommisionPay: //取消承付
+ ajax({
+ url: '/nccloud/arap/arappub/cancelcommisionpay.do',
+ data: Object.assign({
+ pk_bill: this.props.getUrlParam('id'),
+ billType: this.billType,
+ pageId: this.getPagecode()
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.data) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ this.state.buttonfalg = true;
+ this.toggleShow();
+ toast({
+ color: 'success',
+ content: this.state.json['paybill-000057']
+ }); /* 国际化处理: 取消承付成功!*/
+ }
+ }
+ });
+ break;
+ case headButton.MadeBill: //制单
+ let madeData = [
+ {
+ pk_bill: props.form.getFormItemsValue(formId, 'pk_paybill').value,
+ billType: this.billType,
+ tradeType: props.form.getFormItemsValue(formId, 'pk_tradetype').value
+ }
+ ];
+ madeBill(this, props, madeData, '', props.getSearchParam('c'));
+ break;
+ case headButton.BillLinkQuery: //联查单据
+ this.setState({ showBillTrack: true });
+ break;
+ case headButton.ConnectSettleInfo: //关联结算信息
+ ajax({
+ url: '/nccloud/arap/arappub/validatecmp.do',
+ data: null,
+ success: (res) => {
+ if (res.success) {
+ pagecode = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ pagecode = code;
+ } else if (!pagecode) {
+ pagecode = this.getPagecode();
+ }
+ openToIndepSettle({
+ props,
+ direction: "1",
+ pk_billtypecode:"F3",
+ rollbackAppcode: props.getSearchParam('c'),
+ rollbackPageCode: pagecode
+ })
+ }
+ }
+ });
+
+ break;
+ case headButton.LinkInformer: //到账通知
+ ajax({
+ url: '/nccloud/arap/arappub/linkinformer.do',
+ data: Object.assign({
+ pk_bill: this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ billType: this.billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success && res.data) {
+ let length = res.data.length;
+ if (length == 1) {
+ props.openTo('/nccloud/resources/cmp/informer/LinkBill/card/index.html', {
+ appcode: '36070AISC',
+ pagecode: '36070AILLINK',
+ status: 'browse',
+ id: res.data[0]
+ });
+ } else {
+ props.openTo('/nccloud/resources/cmp/informer/LinkBill/list/index.html', {
+ appcode: '36070AISC',
+ pagecode: '36070AICLINK',
+ status: 'browse',
+ ids: res.data
+ });
+ }
+ }
+ }
+ });
+ break;
+ case headButton.LinkBal: //联查余额表
+ arapLinkReport(
+ this.props,
+ this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ this.billType,
+ this.props.form.getFormItemsValue(this.formId, 'objtype').value,
+ this.props.form.getFormItemsValue(this.formId, 'pk_org_v')
+ );
+ break;
+ case headButton.LinkDeal: //联查处理情况
+ ajax({
+ url: '/nccloud/arap/arappub/linkdeal.do',
+ data: Object.assign({
+ pk_bill: this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ billType: this.billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success) {
+ //打开处理情况模态框
+ let data = res.data;
+ this.Info.combinedExaminationData = data;
+ this.handleCombined();
+ }
+ }
+ });
+ break;
+ case headButton.LinkVouchar: //联查凭证
+ linkvouchar(
+ this,
+ props,
+ this.props.form.getAllFormValue(this.formId),
+ this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ this.props.getSearchParam('c')
+ );
+ break;
+ case headButton.LinkConfer: //联查协同单据
+ ajax({
+ url: '/nccloud/arap/arappub/linkconfer.do',
+ async: false,
+ data: Object.assign({
+ pk_bill: this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ billType: this.billType
+ }, this.dataInSaga),
+ success: (res) => {
+ let data = res.data;
+ if (data) {
+ props.openTo(data.url, data.condition);
+ }
+ }
+ });
+ break;
+ case headButton.LinkTbb: //联查计划预算
+ ajax({
+ url: '/nccloud/arap/arappub/linktbb.do',
+ data: Object.assign({
+ pk_bill: this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value,
+ billType: this.billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success) {
+ this.Info.tbbLinkSourceData = res.data;
+ this.setState({
+ isTbbLinkshow: true
+ });
+ }
+ }
+ });
+ break;
+ case headButton.LinkInvoice: //发票查看
+ if (!moduleEnable(this, SSCIVM)) { //校验关联模块是否启用
+ return;
+ }
+ invoiceLink(this);
+ break;
+ case headButton.InvoiceUploader: //上传电子发票
+ if (!moduleEnable(this, SSCIVM)) { //校验关联模块是否启用
+ return;
+ }
+ ajax({
+ url: '/nccloud/arap/arappub/sendeleinvoice.do',
+ data: {
+ pk_org: 'GLOBLE00000000000000',
+ eleinvoice: 'IV0001' //电子发票initcode
+ },
+ success: (res) => {
+ if (res.success) {
+ if (res.data == '2') {
+ const billId = props.getUrlParam('id');
+ const billtype = this.props.form.getFormItemsValue(this.formId, 'pk_billtype').value;
+ const billCode = this.props.form.getFormItemsValue(this.formId, 'billno').value;
+ const pk_org = this.props.form.getFormItemsValue(this.formId, 'pk_org').value;
+ const tradetype = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ const random = new Date().getTime();
+
+ this.setState({
+ sscivmInvoiceData: { billId, billtype, billCode, pk_org, tradetype, random },
+ isLink:false
+ });
+ } else {
+ toast({
+ color: 'warning',
+ content: this.state.json['paybill-000054']
+ }); /* 国际化处理: 没有使用税务管理系统,该功能无法使用!*/
+ }
+ }
+ }
+ });
+
+ break;
+ case headButton.Refresh: //刷新
+ ajax({
+ url: '/nccloud/arap/arappub/cardRefresh.do',
+ data: Object.assign({
+ pk_bill: this.props.getUrlParam('id'),
+ pageId: this.getPagecode(),
+ billType: this.billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.data) {
+ toast({ color: 'success', title: this.state.json['paybill-000051'] }); /* 国际化处理: 刷新成功*/
+ updateCache(pkname, this.props.getUrlParam('id'), res.data, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ } else {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ }
+ this.toggleShow('', res);
+ throwSagaErrorAgency.call(this, res)
+ },
+ error: (res) => {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ deleteCacheById(pkname, this.props.getUrlParam('id'), dataSource);
+ this.toggleShow('', res);
+ let str = res.message;
+ toast({ color: 'danger', content: str });;
+ }
+ });
+ break;
+ case headButton.BodyVerify: //按表体核销
+ BodyVerify(props, this.formId, this.tableId, 'pk_paybill', 'pk_payitem', this);
+ break;
+ case headButton.WholeVerify: //按整单核销
+ WholeVerify(props, this.formId, this.tableId, 'pk_paybill', this);
+ break;
+ case headButton.ReceiptCheck: //影像查看pk_tradetype
+ if (!moduleEnable(this, IMAG)) { //校验关联模块是否启用
+ return;
+ }
+ if (props.getUrlParam('status') == 'add') {
+ toast({ color: 'warning', content: this.state.json['paybill-000035'] }); /* 国际化处理: 单据未暂存!*/
+ return;
+ }
+ // let pk_tradetype = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value
+ // let showData = props.createMasterChildData(pk_tradetype, formId, tableId);
+ // let openShowbillid = props.getUrlParam('id');
+ // imageView(showData, openShowbillid, pk_tradetype, 'iweb');
+ var billInfoMap = {};
+
+ //基础字段 单据pk,单据类型,交易类型,单据的组织
+ billInfoMap.pk_billid = this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value;
+ billInfoMap.pk_billtype = this.props.form.getFormItemsValue(this.formId, 'pk_billtype').value;
+ billInfoMap.pk_tradetype = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ billInfoMap.pk_org = this.props.form.getFormItemsValue(this.formId, 'pk_org').value;
+ imageView(billInfoMap, 'iweb');
+
+ break;
+ case headButton.ReceiptScan: //影像扫描
+ if (!moduleEnable(this, IMAG)) { //校验关联模块是否启用
+ return;
+ }
+ if (props.getUrlParam('status') == 'add') {
+ toast({ color: 'warning', content: this.state.json['paybill-000036'] }); /* 国际化处理: 请先 <暂存> 单据再扫描影像!*/
+ return;
+ }
+ let tradeType = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ let allData = props.createMasterChildData(tradeType, formId, tableId);
+ // let openbillid = props.getUrlParam('id');
+ // imageScan(allData, openbillid, tradetype, 'iweb');
+
+ var billInfoMap = {};
+ //基础字段 单据pk,单据类型,交易类型,单据的组织
+ billInfoMap.pk_billid = allData.head.head.rows[0].values.pk_paybill.value;
+ billInfoMap.pk_billtype = allData.head.head.rows[0].values.pk_billtype.value;
+ billInfoMap.pk_tradetype = allData.head.head.rows[0].values.pk_tradetype.value;
+ billInfoMap.pk_org = allData.head.head.rows[0].values.pk_org.value;
+
+ //影像所需 FieldMap
+ billInfoMap.BillType = allData.head.head.rows[0].values.pk_tradetype.value;
+ billInfoMap.BillDate = allData.head.head.rows[0].values.creationtime.value;
+ billInfoMap.Busi_Serial_No = allData.head.head.rows[0].values.pk_paybill.value;
+ billInfoMap.pk_billtype = allData.head.head.rows[0].values.pk_billtype.value;
+ billInfoMap.OrgNo = allData.head.head.rows[0].values.pk_org.value;
+ billInfoMap.BillCode = allData.head.head.rows[0].values.billno.value == undefined ? '' : allData.head.head.rows[0].values.billno.value;
+ billInfoMap.OrgName = allData.head.head.rows[0].values.pk_org_v.display;
+ billInfoMap.Cash = allData.head.head.rows[0].values.money.value;
+ //校验制单人和操作人是否为同一人
+
+ imageScan(billInfoMap, 'iweb');
+
+ break;
+ case 'Print': //打印
+ this.onPrint();
+ break;
+ case 'Preview': //预览
+ this.print();
+ break;
+ case headButton.OfficalPrint: //正式打印
+ this.officalPrintOutput();
+ break;
+ case headButton.CancelPrint: //取消正式打印
+ this.cancelPrintOutput();
+ break;
+ case headButton.Output: //输出
+ this.printOutput();
+ break;
+ case headButton.ExportData: //导出
+ let outbillid = props.getUrlParam('id');
+ let pk_bills = [];
+ pk_bills.push(outbillid);
+ this.Info.selectedPKS = pk_bills; //传递主键数组,之前nc需要导出的加主键
+ this.props.modal.show('exportFileModal'); //不需要导出的只执行这行代码
+ if (this.state.forceRender) {
+ this.setState({ forceRender: false })
+ }
+ break;
+ case headButton.AttachManage:
+ let flag = props.getUrlParam('status');
+ if (
+ flag == 'add' ||
+ props.getUrlParam('copyFlag') == 'copy' ||
+ props.getUrlParam('writebackFlag') == 'redBack'
+ ) {
+ toast({ color: 'warning', content: this.state.json['paybill-000022'] }); /* 国际化处理: 请保存后再进行上传附件!*/
+ return;
+ }
+ //设置附件左侧分组
+ setBillConfig(this);
+ this.setState({
+ showUploader: true,
+ target: null
+ });
+ break;
+ case headButton.AllocperiodruleLinkQuery:
+ //联查期间分摊
+ allocperiodruleLinkQuery(this);
+ break;
+ //表体肩部的按钮操作
+ case bodyButton.AddLine:
+ if (this.props.form.getFormItemsValue(this.formId, 'pk_org_v').value != null) {
+ let rowNum = props.cardTable.getNumberOfRows(this.tableId);
+ ajax({
+ url: '/nccloud/arap/paybillpub/addline.do',
+ data: this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId),
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.addRow(this.tableId,rowNum,res.data.body[this.tableId].rows[0].values);
+ this.props.cardTable.setValByKeyAndIndex(this.tableId, rowNum, 'prepay', { display:this.prepay.display,value:this.prepay.value})
+ }
+ }
+ }
+ });
+ }
+ break;
+ case bodyButton.DelLine: //删除
+ let redBackType = this.props.form.getFormItemsValue(this.formId, 'redbacktype');
+ if (redBackType && redBackType.value == 3) {
+ toast({ color: 'warning', content: this.state.json['paybill-000060'] }); /* 国际化处理:取消核销并红冲生成的单据不可逆操作*/
+ }
+ delLine(this);
+ //删行之后控制肩部按钮
+ this.onSelected();
+ break;
+ case bodyButton.CopyLine: //复制行
+ if (copyLine(this, dataSource)) {
+ this.setState(
+ {
+ buttonfalg: false
+ },
+ () => {
+ cardBodyControl(props, this.state.buttonfalg, this);
+ let isrefund = props.form.getFormItemsValue(this.formId, 'isrefund') ? props.form.getFormItemsValue(this.formId, 'isrefund').value : false
+ if (isrefund) {
+ props.button.setButtonVisible(['AddLine', 'Insert_inner'], false);
+ }
+ }
+ );
+ }
+ break;
+ case bodyButton.PasteLine: //粘贴行
+ pasteLine(this);
+ break;
+ case bodyButton.PasteToEndLine: //粘贴行到末尾
+ pasteToEndLine(this, dataSource);
+ break;
+ case bodyButton.CancelLine: //行取消
+ this.setState(
+ {
+ buttonfalg: true
+ },
+ () => {
+ cardBodyControl(props, this.state.buttonfalg, this);
+ let isrefund = props.form.getFormItemsValue(this.formId, 'isrefund') ? props.form.getFormItemsValue(this.formId, 'isrefund').value : false
+ if (isrefund) {
+ props.button.setButtonVisible(['AddLine', 'Insert_inner'], false);
+ }
+ }
+ );
+ //取消之后控制肩部按钮
+ this.onSelected();
+ break;
+ case bodyButton.Allocate:
+ showAllocation(this);
+ break;
+ default:
+ let transferInfo = getTransferInfo(this, id);
+ if (transferInfo) {
+ ajax({
+ url: '/nccloud/arap/arappub/queryrelatedapp.do',
+ data: {
+ billType: transferInfo.src_billtype,
+ transTypes: transferInfo.transtypes
+ },
+ success: (res) => {
+ if (res) {
+ //将业务流程放入缓存
+ setDefData(
+ transferInfo.src_billtype + transferInfo.transtypes[0],
+ 'transfer.dataSource',
+ transferInfo.busitypes
+ );
+ let dest_tradetype = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ dest_tradetype = code;
+ } else if (!dest_tradetype) {
+ dest_tradetype = this.getPagecode();
+ }
+ let url = '/' + transferInfo.src_billtype;
+ props.pushTo(url, {
+ src_appcode: res.data.appcode,
+ src_tradetype: transferInfo.transtypes[0], //来源交易类型
+ dest_billtype: this.billType,
+ dest_tradetype: dest_tradetype
+ });
+ }
+ }
+ });
+ }
+ break;
+ }
+ //控制单据联查期间分摊按钮显示
+ ctrAllocBtn(this);
+}
+
+function saveBillClick(that, url) {
+ //删除空白行
+ let checkCardData = that.props.createMasterChildData(that.getPagecode(), that.formId, that.tableId);
+ delBlankLine(that, that.tableId, that.billType, checkCardData, null);
+
+ let result = that.props.validatePageToToast([
+ {
+ name: that.formId,
+ type: "form",
+ },
+ {
+ name: that.tableId,
+ type: "cardTable",
+ }
+ ]);
+ if (result && !result.allPassed) {
+ return;
+ }
+
+ let allRows = that.props.cardTable.getVisibleRows(that.tableId);
+ let noTop = false;
+ let haveTop = false;
+ let rowno = [];
+ for (let i = 0; i < allRows.length; i++) {
+ let row = allRows[i];
+ if(row.values.top_billid && row.values.top_billid.value){
+ haveTop = true;
+ }else{
+ rowno.push(i + 1);
+ noTop = true;
+ }
+ }
+ if(noTop && haveTop){
+ promptBox({
+ color: 'warning',
+ title: url.includes('saveandcommit') ? that.state.json['public-000293'] : that.state.json['public-000279'] /* 国际化处理: 保存*/,
+ content: that.state.inlt.get('public-000280', {1: rowno.join(',')}) /* 国际化处理: 第{1}行是手工增补行,与上游系统无关联,是否继续保存?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: that.state.json['public-000076'] /* 国际化处理: 确定*/,
+ cancelBtnName: that.state.json['public-000077'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () =>{
+ that.saveBill(url)
+ }
+ });
+ }else{
+ that.saveBill(url);
+ }
+};
+
+//联查发票
+let invoiceLink = function (that) {
+ const billId = that.props.getUrlParam('id');
+ const billtype = that.props.form.getFormItemsValue(that.formId, 'pk_billtype').value;
+ const billCode = that.props.form.getFormItemsValue(that.formId, 'billno').value;
+ const pk_org = that.props.form.getFormItemsValue(that.formId, 'pk_org').value;
+ const tradetype = that.props.form.getFormItemsValue(that.formId, 'pk_tradetype').value;
+ const viewRandom = new Date().getTime();
+
+ that.setState({
+ sscivmInvoiceLinkData: { billId, billtype, billCode, pk_org, tradetype, viewRandom },
+ isLink:true
+ });
+};
+
+export function cardBillEdit() {
+ this.props.cardTable.selectAllRows(this.tableId, false);
+ let sceneType = 0;
+ let scene = this.props.getUrlParam('scene');
+ //获取单据编号
+ let djbh = this.props.form.getFormItemsValue(this.formId, 'billno').value;
+ let pk_payill = this.props.form.getFormItemsValue(this.formId, 'pk_payill').value;
+ let redBackType = this.props.form.getFormItemsValue(this.formId, 'redbacktype');
+ let canEdit = true;
+ //来源于审批中心
+ if (scene == 'approve' || scene == 'approvesce') {
+ sceneType = 1;
+ //判断单据是否是当前用户待审批
+ ajax({
+ url: '/nccloud/riart/message/list.do',
+ async: false,
+ data: {
+ //billno: djbh,
+ billid:pk_payill,
+ isread: 'N'
+ },
+ success: (result) => {
+ if (result.data) {
+ if (result.data.total < 1) {
+ toast({
+ content: this.state.json['paybill-000031'],
+ color: 'warning'
+ }); /* 国际化处理: 当前单据未在审批流程中,不可进行修改操作!*/
+ canEdit = false;
+ }
+ }
+ }
+ });
+ }
+ //来源于我的作业
+ if (scene == 'zycl') {
+ sceneType = 2;
+ //判断单据是否是当前用户待处理
+ ajax({
+ url: '/nccloud/ssctp/sscbd/SSCTaskHandlePendingNumAction.do',
+ async: false,
+ data: {
+ billno: djbh
+ },
+ success: (result) => {
+ if (result.data) {
+ if (result.data.total < 1) {
+ toast({
+ content: this.state.json['paybill-000032'],
+ color: 'warning'
+ }); /* 国际化处理: 当前单据已处理,不可进行修改操作!*/
+ canEdit = false;
+ }
+ }
+ }
+ });
+ }
+ if (!canEdit) {
+ return;
+ }
+ let editData = {
+ pk_bill: this.props.getUrlParam('id'),
+ billType: this.billType,
+ sence: sceneType,
+ ts:this.props.form.getFormItemsValue(this.formId, 'ts')?this.props.form.getFormItemsValue(this.formId, 'ts').value:null
+ };
+ ajax({
+ url: '/nccloud/arap/arappub/edit.do',
+ data: editData,
+ success: (res) => {
+ if (res.success) {
+ this.props.beforeUpdatePage(); //打开开关
+ this.props.controlAutoFocus(true);//修改时不要日期聚焦
+ this.props.setUrlParam({ status: 'edit' });
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.resMetaAfterPkorgEdit();
+ //处理承付字段的编辑性
+ dealCommisionPayField(this.props, this.formId, this.tableId);
+ //处理往来对象的可编辑性
+ objtypeEditable(this.props, this.formId, this.tableId);
+ if (res.data && res.data.head) {
+ this.props.form.setFormItemsDisabled(this.formId, res.data.head);
+ this.headBack = res.data.headBack
+ }
+ if (res.data && res.data.body) {
+ this.props.cardTable.setColEditableByKey(this.tableId, res.data.body, true)
+ this.bodyBack = res.data.body
+ }
+ if (this.headBack && !res.data) {
+ this.props.form.setFormItemsDisabled(this.formId, this.headBack);
+ this.props.cardTable.setColEditableByKey(this.tableId, this.bodyBack, false)
+ }
+ if (res.data.bodyBack) {
+ this.props.cardTable.setColEditableByKey(this.tableId, res.data.bodyBack, true)
+ }
+ this.props.form.setFormItemsDisabled(this.formId, { pk_org_v: true });
+ if (redBackType && redBackType.value == 3) {
+ let keys = ['money_de', 'local_money_de', 'groupdebit', 'globaldebit','pk_currtype'];
+ this.props.cardTable.setColEditableByKey(this.tableId, keys, true);
+ this.props.form.setFormItemsDisabled(formId, { pk_currtype: true });
+
+ this.props.button.setButtonVisible(['CopyLine', 'DelLine'], false);
+ }
+ let checknoObj = this.props.cardTable.getColValue(this.tableId,'checkno');
+ for(let i = 0;i {
+ let upBillInfo = res.data;
+ let upBillIdList = [];
+ let upBillTypeMap = new Map();
+ let upBillTypeNameMap = new Map();
+ let upBillnoMap = new Map();
+ let upForwardMap = new Map();
+ if (upBillInfo != null && upBillInfo.length > 0) {
+ for (let i = 0; i < upBillInfo.length; i++) {
+ let isForward = upBillInfo[i].isForward;
+ let billId = upBillInfo[i].lightBillVO.billID;
+ let billTypeName = upBillInfo[i].lightBillVO.billTypeName;
+ let billType = upBillInfo[i].lightBillVO.billType;
+ let billno= upBillInfo[i].lightBillVO.billCode;
+ if (billId != null&&billPK!=billId&&isForward<0) {
+ upBillIdList.push(billId);
+ upBillTypeMap.set(billId, billType);
+ upBillTypeNameMap.set(billId, billTypeName);
+ upBillnoMap.set(billId,billno);
+ upForwardMap.set(isForward);
+ }
+ }
+ }
+ if (upBillIdList != null && upBillIdList.length > 0) {
+ for(let j=0;j{
+ if(item.attrcode=='startdate'||item.attrcode=='enddate'||item.attrcode=='firstallocdate'){
+ item.isconverttimezones="2";//不转时区
+ }
+ })
+ meta[tableId].status = status;
+ meta[tableId].items.map((item,index)=>{
+ if(item.attrcode=='subjcode'){
+ item.fieldDisplayed='dispname';
+ }else if(item.attrcode=='startdate'||item.attrcode=='enddate'||item.attrcode=='firstallocdate'){
+ item.isconverttimezones="2";//不转时区
+ }else if(item.attrcode=='prepay'&&item.initialvalue){
+ that.prepay.display= item.initialvalue.display;
+ that.prepay.value= item.initialvalue.value;
+ }
+ })
+ //添加操作列
+ meta[tableId].items.push({
+ label: that.state.json['paybill-000007'],/* 国际化处理: 操作*/
+ itemtype: 'customer',
+ attrcode: 'opr',
+ width: OperationColumn,
+ visible: true,
+ fixed: 'right',
+ render: (text, record, index) => {
+ let trueBtn = cardBodyAndInnerButtonVisible(that, that.state.buttonfalg, record.expandRowStatus, record, index);
+ return props.button.createOprationButton(trueBtn, {
+ area: "card_inner",
+ buttonLimit: 3,
+ onButtonClick: (props, key) => tableButtonClick(that, props, key, text, record, index)
+ });
+ }
+ });
+ // //设置表头分摊相关字段
+ // let pk_periodrule = that.props.form.getFormItemsValue(that.formId, 'pk_periodrule').value;
+ // meta[formId].items.map((item,index)=>{
+ // if(item.attrcode=='startdate'||item.attrcode=='enddate'){
+ // if(pk_periodrule){
+ // item.required = true;
+ // }else{
+ // item.required = false;
+ // }
+ // }
+ // })
+
+ return meta;
+}
+
+
+
+//处理外系统推付款单
+export function dealOutToPaybill(props, appcode, pagecode) {
+ let url = "";
+ let data = {};
+ let srcbilltype = this.props.getUrlParam('srcbilltype')
+ if (srcbilltype == '21') {//采购订单订单付款
+ url = "/nccloud/arap/paybill/putopaybill.do";
+ data = {
+ pk_bills: cacheTools.get('21ToF3Pks'),
+ pageId: pagecode
+ }
+ } else if (srcbilltype == 'FCT1') {//付款合同付款
+ url = "/nccloud/arap/paybill/fct1topaybill.do";
+ data = {
+ pk_bills: cacheTools.get('fct1ToF3Pks'),
+ pageId: pagecode
+ }
+ } else if (srcbilltype == 'Z2') {//采购合同付款
+ url = "/nccloud/arap/paybill/z2topaybill.do";
+ data = {
+ pk_bills: cacheTools.get('Z2TOD3Pks'),
+ pageId: pagecode
+ }
+ }
+ ajax({
+ url: url,
+ data: data,
+ success: (res) => {
+ if (res.data) {
+ if(Array.isArray(res.data)){
+ pagecode = res.data[0].head[this.formId].rows[0].values.pk_tradetype.value;
+ }else{
+ pagecode = res.data.head[this.formId].rows[0].values.pk_tradetype.value;
+ }
+
+ this.data = res.data
+ init(this, props, appcode, pagecode, this.initShow)
+ } else {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ }
+ }
+ })
+}
+
+/*pmFWCFu5nhKkBzYmrkBakYqb4t+QDKrWy/miWT3MDKY=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/events/pageInfoClick.js b/src/arap/paybill/paybill/card/events/pageInfoClick.js
new file mode 100644
index 0000000..91202d9
--- /dev/null
+++ b/src/arap/paybill/paybill/card/events/pageInfoClick.js
@@ -0,0 +1,67 @@
+/*j07c8riwYnz20MYibuDbtKRzyoQHuVaQOXRyHJYcGsY=*/
+import {ajax,cardCache, clearToast} from 'nc-lightapp-front';
+import { formId ,dataSource,pkname} from '../constants';
+import initTemplate from './initTemplate';
+import {throwSagaErrorAgency} from '../../../../public/components/pubUtils/MicroServiceSocket.js';
+let { getCacheById, updateCache, setDefData } = cardCache;
+import {updateCacheTss} from '../../../../public/components/updateTableDataTs';
+export default function (props, pk) {
+ if(!pk){//如果刷新了浏览器,那么pk将不会存在,如果pk不存在,return
+ return;
+ }
+ let cardData = getCacheById(pk, dataSource);
+ let tradeType = this.getPagecode();
+ if(cardData){
+ if(!props.getUrlParam("scene")){
+ let pagecode = cardData.head[this.formId].rows[0].values.pk_tradetype.value;
+ //更新url中的pagecode是为了切换模板,重新查询按钮
+ props.setUrlParam({status:'browse',id:pk,pagecode:pagecode})
+ //点击上一张下一张单据时,要将单据的交易类型放入缓存(和切换交易类型一致),下次点击新增自制时,取缓存中的交易类型
+ setDefData('sessionTradeType', dataSource, pagecode);
+ if(tradeType !=pagecode){
+ initTemplate.call(this, this.props);
+ }
+ } else{
+ props.setUrlParam({id:pk})
+ }
+ props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
+ props.cardTable.setTableData(this.tableId, cardData.body[this.tableId],null, null, true,false,{ resetSort: true });
+ this.toggleShow('',cardData);
+ throwSagaErrorAgency.call(this,cardData)
+ }else{
+ let data = {
+ pk_bill: pk
+ };
+ ajax({
+ url: '/nccloud/arap/paybill/querycard.do',
+ data: data,
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId],null, null, true,false,{ resetSort: true });
+ }
+ updateCache(pkname,pk,res.data,this.formId,dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ if(!props.getUrlParam("scene")){
+ let pagecode = res.data.head[formId].rows[0].values.pk_tradetype.value;
+ props.setUrlParam({id:pk,pagecode:pagecode})
+ setDefData('sessionTradeType', dataSource, pagecode);
+ if(tradeType !=pagecode){
+ initTemplate.call(this, this.props);
+ }
+ }else{
+ props.setUrlParam({id:pk})
+ }
+ this.toggleShow('',res);
+ throwSagaErrorAgency.call(this,res)
+ }
+ }
+ });
+ }
+ clearToast();
+}
+
+/*j07c8riwYnz20MYibuDbtKRzyoQHuVaQOXRyHJYcGsY=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/events/tableButtonClick.js b/src/arap/paybill/paybill/card/events/tableButtonClick.js
new file mode 100644
index 0000000..cf091da
--- /dev/null
+++ b/src/arap/paybill/paybill/card/events/tableButtonClick.js
@@ -0,0 +1,88 @@
+/*0GI1xcoeligdpMeXoHBphrnqLawXs2pmyhj4kEvBMik=*/
+import { ajax, base, toast, cardCache } from 'nc-lightapp-front';
+import { tableId, dataSource, formId } from '../constants';
+import { innerButton } from '../../../../public/components/pubUtils/buttonName.js';
+import { copyInner, deleteInner, pasteInner } from '../../../../public/components/pubUtils/billPubUtil.js';
+import { cardBodyControl } from '../../../../public/components/pubUtils/buttonvisible.js';
+import { modifyChecknoItemtype } from '../../../../public/components/pubUtils/specialFieldAfterEvent.js';
+
+export default function (that, props, key, text, record, index) {
+ switch (key) {
+ // 表格操修改
+ case innerButton.open_browse://展开
+ props.cardTable.toggleRowView(that.tableId, record);
+ break;
+ case innerButton.Close_browse://收起
+ props.cardTable.toggleRowView(that.tableId, record);
+ break;
+ case innerButton.open_edit:
+ let ishideAdd = false
+ let cardData = that.props.createMasterChildData(that.getPagecode(), that.formId, that.tableId);
+ if(cardData && cardData.body && cardData.body[that.tableId] && cardData.body[that.tableId].rows){
+ let bodyrows= cardData.body[that.tableId].rows;
+ for(let i=0;i {
+ cardBodyControl(props, that.state.buttonfalg);
+ let isrefund = props.form.getFormItemsValue(that.formId, 'isrefund')?props.form.getFormItemsValue(that.formId, 'isrefund').value : false
+ if(isrefund){
+ props.button.setButtonVisible(['AddLine', 'Insert_inner'], false);
+ }
+ })
+ break;
+ case innerButton.Insert_inner://插入行
+ let data = props.createMasterChildData(that.getPagecode(), formId, tableId);
+ //清空cardData的表体
+ data.body[tableId].rows = [];
+ ajax({
+ url: '/nccloud/arap/paybillpub/addline.do',
+ data: data,
+ success: (res) => {
+ let rowindex = index;
+ if (res.data && res.data.body) {
+ props.cardTable.addRow(tableId, index, res.data.body[tableId].rows[0].values);
+ } else {
+ props.cardTable.addRow(tableId);
+ rowindex = that.props.cardTable.getNumberOfRows(that.tableId);
+ }
+ that.props.cardTable.setValByKeyAndIndex(that.tableId, rowindex, 'prepay', { display:that.prepay.display,value:that.prepay.value})
+ }
+ });
+
+ break;
+ case innerButton.Delete_inner://删行
+ deleteInner(that, props, tableId, index);
+ //删行之后控制肩部按钮
+ that.onSelected();
+ break;
+ case innerButton.Paste_inner://粘贴至此
+ pasteInner(that, props, dataSource, tableId, index)
+ break;
+ default:
+ break;
+ }
+};
+
+/*0GI1xcoeligdpMeXoHBphrnqLawXs2pmyhj4kEvBMik=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/events/transferButtonClick.js b/src/arap/paybill/paybill/card/events/transferButtonClick.js
new file mode 100644
index 0000000..d99d0db
--- /dev/null
+++ b/src/arap/paybill/paybill/card/events/transferButtonClick.js
@@ -0,0 +1,182 @@
+/*Zqktha8lwfXAWZRCgtFOTNdNqMZuNDDIjwAwoTnhGJE=*/
+import { ajax, base, toast, cardCache, promptBox } from 'nc-lightapp-front';
+import { tableId, formId, leftarea, dataSource, pkname } from '../constants';
+import { buttonClick } from './buttonClick';
+import {toggleBtnStatus,throwSagaErrorAgency} from '../../../../public/components/pubUtils/MicroServiceSocket.js';
+let { setDefData, getDefData, addCache, deleteCacheById, getCacheById, updateCache, } = cardCache;
+import {updateCacheTss} from '../../../../public/components/updateTableDataTs';
+export default function transferButtonClick(props, id) {
+ let that = this
+ let amount = props.transferTable.getTransformFormAmount(leftarea)
+ if (amount == 1) {
+ buttonClick.call(this, props, id);
+ return
+ }
+ switch (id) {
+ case 'Cancel':
+ {
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000037'],/* 国际化处理: 请注意*/
+ content: this.state.json['paybill-000003'],/* 国际化处理: 确定要取消吗?*/
+ beSureBtnName: this.state.json['paybill-000039'],/* 国际化处理: 是*/
+ cancelBtnName: this.state.json['paybill-000040'],/* 国际化处理: 否*/
+ beSureBtnClick: () => {
+ if(this.props.getUrlParam('id')){
+ this.props.setUrlParam({ status: 'browse' });
+ let id = this.props.getUrlParam('id');
+ let cardData = getCacheById(id, dataSource);
+ if (cardData) {
+ this.props.beforeUpdatePage();//打开开关
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, cardData.body[this.tableId]);
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId);//关闭开关
+ this.toggleShow();
+ }
+
+ }else {
+ props.transferTable.setTransformFormStatus(leftarea, {
+ status: false,
+ onChange: (current, next) => {
+ // toast({ color: 'success', content: '取消成功' });
+ }
+ })
+ }
+ }
+ })
+ }
+ break;
+ case 'Delete':
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000002'] /* 国际化处理: 删除*/,
+ content: this.state.json['paybill-000006'] /* 国际化处理: 确定要删除吗?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () => {
+ ajax({
+ url: '/nccloud/arap/arappub/delete.do',
+ data: [{
+ pk_bill: this.props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ billType: this.billType
+ }],
+ success: function (res) {
+ if (props.transferTable.getTransformFormAmount(leftarea) == 1) {
+ history.go(-1);
+ } else {
+ deleteCacheById(pkname, props.getUrlParam('id'), dataSource);
+ props.transferTable.setTransformFormStatus(leftarea, {
+ status: false,
+ onChange: (current, next) => {
+ toast({ color: 'success', content: that.state.json['paybill-000009'] });/* 国际化处理: 删除成功*/
+ }
+ })
+ }
+ }
+ })
+ }
+ });
+ break;
+ case 'Copy':
+ ajax({
+ url: '/nccloud/arap/arappub/copy.do',
+ data: {
+ pk_bill: props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ pageId: this.getPagecode(),
+ billType: this.billType,
+ tradeType: this.getPagecode(),
+ },
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ this.props.setUrlParam({ status: 'add' })
+ this.props.addUrlParam({ operFlag: 'copy' })
+ this.state.buttonfalg = true;
+ props.resMetaAfterPkorgEdit();
+ this.props.form.setFormItemsDisabled(this.formId, { 'pk_org_v': false });
+ this.toggleShow()
+ }
+ });
+ break;
+ default:
+ buttonClick.call(this, props, id);
+ break;
+ }
+}
+
+export function setValue(props, res) {
+ this.props.beforeUpdatePage();//打开开关
+ if(res){
+ toggleBtnStatus.call(this,res,'card_head');
+ }
+ if (res.data.head && res.data.head[formId]) {
+ props.form.setAllFormValue({ [formId]: res.data.head[formId] });
+ }
+ if (res.data.body && res.data.body[tableId]) {
+ props.cardTable.updateDataByRowId(this.tableId, res.data.body[this.tableId]);
+ }
+ let pk_paybill = this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value
+ let newCardData = this.props.createMasterChildData(
+ this.getPagecode(),
+ this.formId,
+ this.tableId
+ );
+
+ let pkvalues = [];
+ let amount = this.props.cardTable.getNumberOfRows(this.tableId) * 1
+ for(var i =0 ; i< amount; i++){
+ let top_itemid = this.props.cardTable.getValByKeyAndIndex(this.tableId, i, 'top_itemid').value;
+ let top_termch = this.props.cardTable.getValByKeyAndIndex(this.tableId, 0, 'top_termch');
+ if(top_termch && top_termch.value){
+ top_itemid = top_itemid + '@' + top_termch.value;
+ }
+ pkvalues.push(top_itemid);
+ // pkvalues.push(this.props.cardTable.getValByKeyAndIndex(this.tableId, i, 'top_itemid').value);
+ }
+ /**
+ * 保存转单上游选中表体pks到转单的dataSource中
+ */
+ props.transferTable.savePk(props.getUrlParam("dataSource"), pkvalues);
+ /**
+ * 将新增单据数据保存到dataSource
+ */
+ if (props.getUrlParam('status') == 'add') {
+ addCache(pk_paybill, newCardData, formId, dataSource)
+ }else {
+ updateCache(pkname, pk_paybill, newCardData, formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ }
+ this.props.updatePage(this.formId, this.tableId);//关闭开关
+ this.props.transferTable.setTransformFormStatus(leftarea, {
+ status: true
+ //onChange: (current, next, currentIndex) => {
+ // // toast({ color: 'success', content: this.state.json['paybill-000026'] });/* 国际化处理: 操作成功*/
+ // this.transferIndex = currentIndex + 1;
+ // this.Info.isNeedSelect = true
+ // props.transferTable.setTransferListValueByIndex(
+ // leftarea,
+ // newCardData,
+ // currentIndex
+ // )
+ //}
+ })
+ throwSagaErrorAgency.call(this,res)
+}
+
+/*Zqktha8lwfXAWZRCgtFOTNdNqMZuNDDIjwAwoTnhGJE=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/card/index.js b/src/arap/paybill/paybill/card/index.js
new file mode 100644
index 0000000..2bd77dc
--- /dev/null
+++ b/src/arap/paybill/paybill/card/index.js
@@ -0,0 +1,2540 @@
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
+//主子表卡片
+import React, { Component } from 'react';
+import { createPage, ajax, base, toast, high, print, cardCache, getMultiLang,DragLayoutCom, promptBox } from 'nc-lightapp-front';
+import { buttonClick, initTemplate, afterEvent, pageInfoClick, transferButtonClick } from './events';
+import { setValue } from './events/transferButtonClick';
+import {
+ buttonVisible,
+ getButtonsKey,
+ dealTranferBtns,
+ dealRefundBtns,
+ initCardBodyEditControl,
+ onSelectedCardBodyEditControl,
+ initCardBodybrowseControl,
+ dealSrcProjectBtns,
+ addAndDelBtninModule,
+ cardPullButtonControl
+} from '../../../public/components/pubUtils/buttonvisible.js';
+import { tableId, formId, billType, leftarea, dataSource, pkname, linkPageId, tradeType,allocation } from './constants';
+import CombinedExaminationModel from '../../../public/components/combinedExaminationModel'; //联查处理情况
+import { bodyBeforeEvent } from '../../../public/components/pubUtils/arapTableRefFilter';
+import { formBeforeEvent } from '../../../public/components/pubUtils/arapFormRefFilter';
+import linkSourceCard from '../../../public/components/linkSourceCard.js';
+import { calculateHeadMoney, delBlankLine ,getPopupContainer} from '../../../public/components/pubUtils/billPubUtil.js';
+import { billEditProperties, cardFieldsEditableWithProxy } from '../../../public/components/pubUtils/billFieldEditableUtil.js';
+import { onBatchChange } from '../../../public/components/pubUtils/onBatchChange';
+import { updatePandC } from '../../../public/components/pubUtils/updatePandC';
+import Inspection from 'epmp/exports/components/Inspection';
+import ApproveDetail from 'uap/common/components/ApproveDetail';
+import NCUploader from 'uap/common/components/NCUploader';
+import { setBillDef } from '../../../public/components/pubUtils/CopyBill/arapCopyBill';
+let { BillTrack, PrintOutput } = high;
+let { NCButton, NCDiv, NCAffix,NCTooltip } = base;
+let {
+ setDefData,
+ getDefData,
+ addCache,
+ getNextId,
+ deleteCacheById,
+ getCacheById,
+ updateCache,
+ getCurrentLastId
+} = cardCache;
+import { getContext, loginContextKeys } from '../../../public/components/arapInitInfo/loginContext';
+import TradeTypeButton from '../../../public/components/tradetype'; //交易类型按钮
+import { modifyChecknoItemtype } from '../../../public/components/pubUtils/specialFieldAfterEvent.js';
+import { dealCardData, delCardDataForVailData,checkScommet } from '../../../public/components/pubUtils/dealCardData';
+import {
+ objtypeEditable,
+ dealCommisionPayField,
+ F0ToF3FieldsEditable,
+ applyToF3FieldsEditable,
+ fctToArapFieldEditable,
+ puToArapFieldEditable,
+ dealCommisionPayFieldBack
+} from '../../../public/components/pubUtils/billFieldEditableUtil.js';
+import '../../../public/less/tradetype.less';
+import InvoiceUploader from 'sscivm/ivmpub/components/invoice-uploader';
+import InvoiceLink from 'sscivm/ivmpub/components/invoice-link';
+import { headButton, innerButton, bodyButton } from '../../../public/components/pubUtils/buttonName';
+import { fieldVisable } from '../../../public/components/pubUtils/arap436s3utils.js';
+import ExcelOutput from 'uap/common/components/ExcelOutput';
+import ApprovalTrans from 'uap/common/components/approvalTrans';
+import { cardSocketConnect, cardSocketErrorFlag, toggleBtnStatus, throwSagaErrorAgency } from '../../../public/components/pubUtils/MicroServiceSocket.js';
+import {cancelAllocation,beSureAllocation,setAllocField,ctrAllocBtn} from '../../../public/components/allocation.js';
+import {dealSmartCard,triggerEventListener,getStoreExpandFlag,disabledVisibleCache,smartCardArea} from '../../../public/components/arapSmartCard.js';
+import {updateCacheTss} from '../../../public/components/updateTableDataTs';
+import poc from 'uap/common/components/printOnClient';
+const {printPreview, printOnClient, PubSub, printerView, printOnClientByMoreTem} = poc;
+
+class Card extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ showExpandBtn:false,//智能区侧拉按钮显示
+ // horExpandFlag:false,//智能区默认收起
+ isCombinedExaminationModelShow: false, //联查处理情况模态框
+ isTbbLinkshow: false, //控制联查执行预算的模态框
+ showUploader: false, //附件管理
+ target: null,
+ showBillTrack: false, //单据追溯模态框显示的状态
+ showApproveDetail: false, //审批详情
+ buttonfalg: null, //卡片态点击肩部按钮和表体行按钮改变该值控制按钮状态
+ compositedisplay: false, //指派信息弹框
+ hideAdd: false,//是否隐藏展开中的增行按钮
+ json: {},
+ forceRender: true,//导出模板懒加载,true为不加载,false为加载
+ sscivmInvoiceData: {} ,//电子发票上传
+ sscivmInvoiceLinkData: {}, //联查发票
+ isLink:false,
+ inlt:null
+ };
+ this.printData = {
+ billtype: billType, //单据类型
+ appcode: this.props.getSearchParam('c'), //功能节点编码,即模板编码
+ funcode: props.getSearchParam('c'),
+ nodekey: props.getSearchParam('p'), //模板节点标识 =交易类型
+ oids: [this.props.getUrlParam('id')], // 功能节点的数据主键 oids含有多个元素(['1001A41000000000A9LR','1001A410000000009JDD'])时为批量打印,
+ userjson: billType //单据类型
+ };
+ this.outputData = {
+ billtype: billType, //单据类型
+ funcode: this.props.getSearchParam('c'), //功能节点编码,即模板编码
+ appcode: this.props.getSearchParam('c'), //功能节点编码,即模板编码
+ nodekey: props.getSearchParam('p'), //模板节点标识 =交易类型
+ oids: [this.props.getUrlParam('id')], // 功能节点的数据主键 oids含有多个元素(['1001A41000000000A9LR','1001A410000000009JDD'])时为批量打印,
+ userjson: billType, //单据类型
+ outputType: 'output'
+ };
+ this.cardId='';
+ this.smartCardConfig={};
+ this.smartCardUrl='/nccloud/arap/paybill/queryintellectcard.do';
+ this.data = null; //推单单据数据缓存
+ this.formId = formId;
+ this.tableId = tableId;
+ this.allocation = allocation;
+ this.billType = billType;
+ this.leftarea = leftarea;
+ this.transferIndex = 0; //转单时左侧选择的数据序号
+ this.dataSource = dataSource;
+ this.pkname = pkname;
+ this.Info = {
+ allButtonsKey: [], //保存所有头部按钮和肩部按钮
+ combinedExaminationData: [], //联查处理情况模态框表格数据
+ tbbLinkSourceData: null, //联查执行预算的数据
+ selectedPKS: [], //导出数据的主键pk
+ billCode: '', // 发票号
+ tipContent: null, //提示框Content
+ tipUrl: null, //提示框二次交互的url
+ exType: null, //异常类型,现为三种(1,2,3)
+ flag: false, //提交收回异常交互参数值,默认为false
+ pk_bill: null, //提示框二次交互时后台传入前台主键
+ ts: null,
+ billCard: null, //保存提交后,返回的保存单据
+ compositedata: null, //指派信息数据
+ isModelSave: false, //是否是整单保存,默认为false
+ saveflag: false//判断走的是保存提交还是先保存后提交
+ };
+ this.dataInSaga = { //用于saga里面的busiinfo
+ appcode: props.getSearchParam('c') ? props.getSearchParam('c') : null,
+ pagecode: props.getSearchParam('p') ? props.getSearchParam('p') : null,
+ butncode: null
+ }
+ this.appcode = this.props.getSearchParam('c')
+ this.pagecode = this.props.getSearchParam("p");
+ this.tradetype = this.props.getUrlParam("billtype")
+ this.pkName = 'pk_paybill';
+ this.transferIndex = 0; //转单时左侧选择的数据序号
+ this.billinfo = {
+ billtype: 'card',
+ pagecode: props.getSearchParam('p') ? props.getSearchParam('p') : null,
+ headcode: formId,
+ bodycode: tableId
+ }
+ this.Config = {
+ billConfig: []
+ }
+ this.isEditbillrangge = false;
+ this.horExpandFlag=false;//智能区默认收起
+ this.checknoArray = [];//票据号数组,用于存储票据
+ this.prepay = {display:null,value:null};
+ props.use.cardTable(tableId);
+ props.use.form(formId);
+ props.use.form(allocation);
+ }
+
+ //关闭、刷新弹窗时
+ componentWillMount() {
+ if (this.props.getSearchParam('c') == '20082002' && this.props.getSearchParam('scene') != 'approvesce') {
+ updatePandC(this);
+ }
+ let callback = (json, status, inlt) => {
+ this.setState({ json: json, inlt }, () => {
+ window.onbeforeunload = () => {
+ let status = this.props.getUrlParam('status');
+ if (status == 'edit' || status == 'add') {
+ return '';
+ }
+ };
+ this.props.setRelationItemBillinfo(this.billinfo);
+ initTemplate.call(this, this.props, this.initShow);
+ });
+ };
+ getMultiLang({ moduleId: ['paybill', 'public'], domainName: 'arap', currentLocale: 'simpchn', callback });
+ }
+
+ componentWillUnmount() {
+ window.onbeforeunload=null;
+ }
+
+ componentWillReceiveProps(nextProps) { }
+ // 附件的关闭点击
+ onHideUploader = () => {
+ this.setState({
+ showUploader: false
+ });
+ };
+ componentDidMount() {
+ if (this.props.getUrlParam('scene')) {
+ let scene = this.props.getUrlParam('scene');
+ setDefData('scene', dataSource, scene);
+ let pagecode = this.getPagecode();
+ setDefData('pagecode', dataSource, pagecode);
+ }
+ getStoreExpandFlag.call(this);//获取缓存里面的展开收起值
+ let smartCardAreaArr=Object.keys(smartCardArea);
+ smartCardAreaArr.forEach((item,index)=>{
+ this.smartCardConfig[item]={};
+ this.smartCardConfig[item].onRefresh=dealSmartCard.bind(this,{cardId:this.cardId,url:this.smartCardUrl});
+ this.smartCardConfig[item].forceVisible=false;
+ if(item.includes('SmartCardWallet')){//嵌入式分析去掉刷新
+ this.smartCardConfig[item].showRefresh=false;
+ }
+ if(item=='SmartCardWallet_supplier'){
+ this.smartCardConfig[item].className="arap-SmartCardWallet-customer";
+ this.smartCardConfig[item].headerCenter=()=>{
+ return(
+ {this.state.json["public-000272"]}
{this.state.json["public-000276"]}} trigger="hover" placement="top">
+
+
+
+
+ )
+ }
+ }else if(item=="SmartCardWallet_customer"){//客户
+ this.smartCardConfig[item].className="arap-SmartCardWallet-customer";
+ this.smartCardConfig[item].headerCenter=()=>{
+ return(
+ {this.state.json["public-000273"]}
{this.state.json["public-000277"]}} trigger="hover" placement="top">
+
+
+
+
+ )
+ }
+ }
+ })
+ }
+
+ getPagecode = () => {
+ let pagecode = this.props.getUrlParam('pagecode');
+ if (!pagecode) {
+ pagecode = this.props.getSearchParam('p');
+ }
+ if (pagecode == '20080EBM_CARD_LINK' && !this.props.getUrlParam('scene')) {
+ //浏览器的刷新可能导致场景丢失,这里自己塞一次
+ this.props.setUrlParam({ scene: 'linksce' });
+ }
+ return pagecode;
+ };
+ getExportPageCode = () => {
+ let pagecode = "20080EBM_CARD";
+ if (this.props.getUrlParam('scene')) {
+ pagecode = "20080EBM_CARD_LINK";
+ }
+ if (pagecode == '20080EBM_CARD_LINK' && !this.props.getUrlParam('scene')) {
+ //浏览器的刷新可能导致场景丢失,这里自己塞一次
+ this.props.setUrlParam({ scene: 'linksce' });
+ }
+ return pagecode;
+
+ }
+
+ //页面初始化
+ initShow = () => {
+ this.props.controlAutoFocus(true);//修改时不要日期聚焦
+ cardPullButtonControl(this);
+ if (this.props.getUrlParam('type') === 'transfer' && this.props.getUrlParam('status') != 'browse' && !this.props.getUrlParam('srcbilltype')) {
+ let transferIds = this.props.transferTable.getTransferTableSelectedId();
+ this.getTransferValue(transferIds);
+ } else if (this.props.getUrlParam('scene') && this.props.getUrlParam('scene') == 'fip') {
+ linkSourceCard(this.props, linkPageId, 'pk_paybill', this.formId, this.tableId, pkname, dataSource, this);
+ } else if (this.props.getUrlParam('type') === 'copy') {
+ //复制的情况
+ this.dataInSaga.butncode = 'Copy'
+ ajax({
+ url: '/nccloud/arap/arappub/copy.do',
+ data: Object.assign({
+ pk_bill: this.props.getUrlParam('id'),
+ pageId: this.getPagecode(),
+ billType: this.billType,
+ type: 1,
+ tradeType: this.getPagecode()
+ }, this.dataInSaga),
+ success: (res) => {
+ this.props.beforeUpdatePage(); //打开开关
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ setBillDef(this, this.getPagecode());//设置挂起字段默认值
+ this.props.resMetaAfterPkorgEdit();
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ //设置分摊字段属性
+ setAllocField(this);
+ this.toggleShow();
+ },
+ error: (res) => {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.toggleShow();
+ let str = res.message;
+ toast({ color: 'danger', content: str });;
+ }
+ });
+ } else if (this.props.getUrlParam('status') == 'edit' || this.props.getUrlParam('status') == 'browse') {
+ let pk_bill = this.props.getUrlParam('id');
+ if (!pk_bill) {
+ this.toggleShow();
+ return;
+ }
+ let pageId = this.props.getSearchParam('p');
+ ajax({
+ url: '/nccloud/arap/paybill/querycard.do',
+ data: { pk_bill: pk_bill,pageId:pageId},
+ success: (res) => {
+ this.props.beforeUpdatePage(); //打开开关
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ if (this.props.getUrlParam('status') == 'edit') {
+ objtypeEditable(this.props, this.formId, this.tableId);
+ //处理承付字段的编辑性
+ dealCommisionPayField(this.props, this.formId, this.tableId);
+ billEditProperties(this, this.props.getUrlParam('id'), this.billType, this.props.getSearchParam('c'))
+ } else {
+ this.state.buttonfalg = null;
+ }
+ if (!this.props.getUrlParam('scene')) {
+ this.props.setUrlParam({
+ pagecode: res.data.head[this.formId].rows[0].values.pk_tradetype.value
+ });
+ }
+
+ let status = this.props.getUrlParam('status');
+ this.props.cardTable.setStatus(this.tableId, status);
+ this.props.form.setFormStatus(this.formId, status);
+ throwSagaErrorAgency.call(this, res)
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ updateCache(pkname, this.props.getUrlParam('id'), res.data, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ //设置分摊字段属性
+ if (this.props.getUrlParam('status') == 'edit'){
+ setAllocField(this);
+ }
+ this.toggleShow('', res);
+ },
+ error: (res) => {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.setUrlParam({ id: null });
+ deleteCacheById(pkname, pk_bill, dataSource);
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.toggleShow();
+ let str = res.message;
+ toast({ color: 'danger', content: str });;
+ }
+ });
+ } else if (this.props.getUrlParam('status') == 'add' && this.props.getUrlParam('src') == 'settlement') {
+ //资金,关联结算信息
+ if (!this.props.getUrlParam('pk_settle')) {
+ toast({ color: 'danger', content: this.state.json['paybill-000041'] }); /* 国际化处理: 数据异常,请重新操作!*/
+ }
+ ajax({
+ url: '/nccloud/arap/arappub/associatesettinfo.do',
+ data: {
+ pk_bill: this.props.getUrlParam('pk_settle'),
+ pageId: this.getPagecode(),
+ billType: this.billType
+ },
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ this.props.beforeUpdatePage(); //打开开关
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ setAllocField(this);
+ this.toggleShow('', res);
+ }
+ });
+ } else if (this.props.getUrlParam('status') == 'add' && this.props.getUrlParam('srcbilltype')) {
+ //推单新增时在inittemplate里处理
+ this.props.beforeUpdatePage(); //打开开关
+ if (this.data) {
+ if (this.props.getUrlParam('type') === 'transfer') {
+ //跳入转单页面,设置转单页面数据
+ this.props.transferTable.setTransferListValue(this.leftarea, this.data);
+ this.props.button.setButtonDisabled("", false);
+ } else {
+ //普通页面
+ let billdata = this.data;
+ if (Array.isArray(this.data)) {
+ billdata = this.data[0];
+ }
+ if (billdata.head) {
+ this.props.form.setAllFormValue({ [this.formId]: billdata.head[this.formId] });
+ }
+ if (billdata.body) {
+ this.props.cardTable.setTableData(this.tableId, billdata.body[this.tableId]);
+ }
+ }
+ }
+
+ this.state.buttonfalg = true;
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.form.setFormStatus(this.formId, 'edit');
+ fctToArapFieldEditable(this.props, this.formId, this.tableId);
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ if (this.props.getUrlParam('srcbilltype') == '21') {
+ puToArapFieldEditable(this.props, this.formId, this.tableId);
+ }
+ setAllocField(this);
+ this.toggleShow();
+ } else if (this.props.getUrlParam('status') == 'add' && this.props.getUrlParam('src') != '36S3') {
+ //状态为add时请求显示默认值
+ this.initAdd();
+ setAllocField(this);
+ } else if (this.props.getUrlParam('src') === '36S3') {
+ let ids = this.props.getUrlParam('pks');
+ let source = this.props.getUrlParam('source');
+ let from36S3pagecode = this.tradetype;
+ fieldVisable(this, formId, tableId, "F3")
+ if (ids) {
+ let data = {
+ appcode: this.appcode,
+ pk_bill: ids,
+ pageId: from36S3pagecode ? from36S3pagecode : this.pagecode,
+ billType: this.tradetype,
+ source: source
+ };
+ ajax({
+ url: '/nccloud/arap/arappub/releasetoarap.do',
+ data: data,
+ success: (res) => {
+ if (res && res.data) {
+ this.props.transferTable.setTransferListValue(
+ this.leftarea,
+ res.data
+ )
+ }
+ if (source && source == 'refund') {
+ if (res.data) {
+ this.props.form.setFormItemsDisabled(this.formId, {
+ pk_currtype: true,
+ rate: true,
+ globalrate: true,
+ grouprate: true,
+ objtype: true
+ });
+ setTimeout(() => {
+ this.props.cardTable.setColEditableByKey(this.tableId, brr, true);
+ }, 500);
+ }
+ }
+
+ this.toggeleShow436S3(res);
+ }
+ })
+ } else {
+ this.props.transferTable.setTransferListValue(this.leftarea, []);
+ }
+ }
+ else {
+ this.toggleShow();
+ }
+ let checknoObj = this.props.cardTable.getColValue(this.tableId, 'checkno');
+ for (let i = 0; i < checknoObj.length; i++) {
+ if (checknoObj[i]) {
+ if(checknoObj[i].value ==""||checknoObj[i].value==null||!checknoObj[i].value){
+ continue;
+ }
+ this.checknoArray.push(checknoObj[i].value);
+ }
+ }
+ };
+
+ getTransferValue = (ids) => {
+ if (ids) {
+ let srcDataSource = this.props.getUrlParam('dataSource');
+ let transferValues = this.props.transferTable.getTransferTableCache(srcDataSource);
+ let childSelData = transferValues.allSelected.selectedData.childSelData;
+ let masterSelData = transferValues.allSelected.selectedData.masterSelData;
+ let currentDealMny = new Map();
+ for(var masterKey in masterSelData) {
+ let childData = childSelData[masterKey];
+ for(var childKey in childData) {
+ if(childData[childKey].data.values){
+ if(childData[childKey].data.values.currentDealMny){
+ currentDealMny.set(childKey, childData[childKey].data.values.currentDealMny.value);
+ }
+ }else if(childData[childKey].data){
+ if(childData[childKey].data.currentDealMny){
+ currentDealMny.set(childKey, childData[childKey].data.currentDealMny.value);
+ }
+ }
+ }
+ }
+
+ let generationType = 'detail';
+ if(this.props.getUrlParam('generationType')){
+ generationType = this.props.getUrlParam('generationType');
+ }
+ let data = {
+ data: ids,
+ pageId: this.getPagecode(),
+ destTradetype: this.getPagecode(),
+ srcBilltype: this.props.getUrlParam('srcBilltype'),
+ generationType: generationType,
+ currentDealMny: currentDealMny
+ };
+ ajax({
+ url: '/nccloud/arap/arappub/transfer.do',
+ data: data,
+ success: (res) => {
+ if (res && res.data) {
+ this.props.transferTable.setTransferListValue(this.leftarea, res.data);
+ if (this.props.getUrlParam('srcBilltype') == 'F0') {
+ //付款单拉红字应收单部分字段不可编辑
+ F0ToF3FieldsEditable(this.props, this.formId, this.tableId);
+ } else if (this.props.getUrlParam('srcBilltype') == '36D1') {
+ // 付款单拉付款申请特殊字段编辑性
+ applyToF3FieldsEditable(this.props, this.formId, this.tableId);
+ } else if (this.props.getUrlParam('srcBilltype') == 'F1') {
+ //退款情况下付款单拉客户应付单部分字段不可编辑
+ objtypeEditable(this.props, this.formId, this.tableId);
+ }
+ }
+ this.toggleShow('', res);
+ },
+ error:(res)=>{
+ let status = this.props.getUrlParam('status');
+ if (status != 'browse') {
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.toggleShow();
+ };
+ toast({ color: 'danger', content: res.message });
+ }
+ });
+ } else {
+ this.props.transferTable.setTransferListValue(this.leftarea, []);
+ }
+ };
+
+ //同步单据信息到转单控件
+ synTransferData = () => {
+ //重取界面现有数据赋值到转单中
+ let amount = this.props.transferTable.getTransformFormAmount(this.leftarea);
+ if (amount != 1) {
+ let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ this.props.transferTable.setTransferListValueByIndex(this.leftarea, cardData, this.transferIndex);
+ }
+ };
+
+ //单据新增
+ initAdd = (isClearPKorg) => {
+ if (!isClearPKorg) {
+ //isClearPKorg如果未未定义等,就取值为false
+ isClearPKorg = false;
+ }
+ let pk_org = this.props.form.getFormItemsValue(this.formId, 'pk_org').value;
+ let pk_org_v = this.props.form.getFormItemsValue(this.formId, 'pk_org_v').value;
+ ajax({
+ url: '/nccloud/arap/paybill/defvalue.do',
+ data: Object.assign({
+ isClearPKorg: isClearPKorg,
+ appcode: this.props.getSearchParam('c'),
+ pageId: this.getPagecode(),
+ tradeType: this.getPagecode(),
+ pk_org: pk_org,
+ pk_org_v: pk_org_v
+ }, this.dataInSaga),
+ // async: false,
+ success: (res) => {
+ if (res.data) {
+ this.props.beforeUpdatePage(); //打开开关
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ let cell_pk_org_v = res.data.head[this.formId].rows[0].values.pk_org_v;
+ if (pk_org_v || (cell_pk_org_v&&cell_pk_org_v.value)) {
+ this.props.resMetaAfterPkorgEdit();
+ this.props.form.setFormItemsDisabled(this.formId, { pk_org_v: false });
+ this.state.buttonfalg = true;
+ } else {
+ this.state.buttonfalg = null;
+ if (
+ !this.props.getUrlParam('type') &&
+ !this.props.getUrlParam('srcbilltype') &&
+ !this.props.getUrlParam('src')
+ ) {
+ this.props.initMetaByPkorg('pk_org_v');
+ }
+ }
+ this.props.form.setFormStatus(this.formId, 'edit');
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.props.form.setFormItemFocus(this.formId, 'pk_org_v');
+ this.props.cardTable.setColValue(this.tableId,'prepay', { display:this.prepay.display,value: this.prepay.value});
+ }
+ this.toggleShow('', res);
+ },
+ error: (res) => {//主要控制列表进卡片抛出错误
+ let str = res.message;
+ let status = this.props.getUrlParam('status');
+ if (status != 'browse') {
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.toggleShow();
+ }
+ ;
+ toast({ color: 'danger', content: str });;
+ }
+ });
+ };
+
+ //切换页面状态
+ toggleShow = (headData, res) => {
+ if (res) {
+ toggleBtnStatus.call(this, res, 'card_head');
+ }
+ cardFieldsEditableWithProxy(this);
+ if(this.props.getUrlParam('status') == 'add' && this.props.getUrlParam('src') == 'settlement'){
+ dealCommisionPayField(this.props, this.formId, this.tableId);//来源关联独立结算信息的控制校验后移动
+ }
+ let status = this.props.getUrlParam('status');
+ if (!status) {
+ status = 'browse';
+ }
+ let cardhead = {};
+ if (headData) {
+ cardhead = headData.rows[0].values;
+ } else {
+ let head = this.props.form.getAllFormValue(this.formId);
+ if (head) {
+ cardhead = head.rows[0].values;
+ }
+ }
+ if (status != 'browse') {
+ this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
+ this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: false });
+ if (this.refs.tradetypeBtn && !getContext(loginContextKeys.transtype)) {
+ this.refs.tradetypeBtn.setVisible(false); //设置交易类型是否显示
+ }
+ } else {
+ if (!(cardhead.pk_tradetype ? cardhead.pk_tradetype.value : null)) {
+ this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
+ } else {
+ this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', true);
+ }
+ this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: true });
+ if (this.refs.tradetypeBtn && !getContext(loginContextKeys.transtype)) {
+ this.refs.tradetypeBtn.setVisible(true); //设置交易类型是否显示
+ }
+ }
+ let trueBtn = []; //可见的按钮
+ let falseBtn = []; //不可见的按钮
+ for (let i = 0; i < this.Info.allButtonsKey.length; i++) {
+ let flag = buttonVisible(status, cardhead, this.Info.allButtonsKey[i], 'card', this);
+ if (flag) {
+ trueBtn.push(this.Info.allButtonsKey[i]);
+ } else {
+ falseBtn.push(this.Info.allButtonsKey[i]);
+ }
+ }
+ //初始化肩部按钮信息增行等按钮的控制
+ if (status == 'browse') {
+ initCardBodybrowseControl(this);
+ } else {
+ initCardBodyEditControl(this.props, cardhead.pk_org_v ? cardhead.pk_org_v.value : null, this);
+ }
+
+ let billtype = cardhead.pk_billtype.value;
+ //处理转单不可见按钮
+ dealTranferBtns.call(this, falseBtn, billtype);
+ //处理退款按钮的可见性
+ dealRefundBtns.call(this, trueBtn, falseBtn)
+ //来源项目采购订单资产相关单据不可见按钮
+ dealSrcProjectBtns.call(this, falseBtn, this.props.cardTable.getRowsByIndexs(this.tableId, 0), billtype);
+ // //票据子票区间开始结束,默认不可修改
+ // this.props.cardTable.setColEditableByKey(this.tableId,['billrangestart','billrangeend'], true);
+ this.props.button.setButtonVisible(trueBtn, true);
+ this.props.button.setButtonVisible(falseBtn, false);
+ //联查场景,默认场景,浏览态存在返回按钮
+ if (this.props.getUrlParam('scene') && this.props.getUrlParam('scene') != 'linksce' &&
+ this.props.getUrlParam('scene') != 'fip') {
+ this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: false });
+ }
+ //来自流程中心的,不存在返回按钮
+ if (this.props.getUrlParam('mark') && this.props.getUrlParam('mark') == 'processCenter') {
+ this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: false });
+ }
+ if (this.props.getUrlParam('scene') && this.props.getUrlParam('scene') == 'bz' && this.props.getUrlParam('status') == 'browse') {
+ let truebtns = [headButton.ImportData, headButton.ExportData, headButton.ConnectSettleInfo];
+ this.props.button.setButtonVisible(truebtns, true);
+ if (res) {
+ this.props.button.setButtonDisabled(headButton.ExportData, false);
+ } else {
+ this.props.button.setButtonDisabled(headButton.ExportData, true);
+ }
+ }
+ if (this.props.getUrlParam('scene') && this.props.getUrlParam('scene') == 'zycl' && this.props.getUrlParam('status') == 'browse') {
+ //我的稽核场景 只保留更多下面的按钮 新增,复制,收回 ,制单按钮隐藏
+ let notshowbtns = [headButton.Add, headButton.Copy, headButton.Uncommit, headButton.MadeBill];
+ this.props.button.setButtonVisible(notshowbtns, false);
+ }
+ this.props.button.setButtonVisible([headButton.Quit, headButton.QuitRefund], false);
+
+ let redBackType = this.props.form.getFormItemsValue(this.formId, 'redbacktype');
+ if (redBackType && (redBackType.value == 3||redBackType.value == "3")&&status=="edit") {
+ this.props.button.setButtonVisible(["CopyLine", "DelLine","Delete_inner","Copy_inner"], false);
+ }
+ if (redBackType && (redBackType.value == 2||redBackType.value == "2")&&status=="edit") {
+ this.props.button.setButtonVisible(["CopyLine", "DelLine","Delete_inner","Copy_inner"], false);
+ }
+ if (status=="edit"&&redBackType && (redBackType.value == 3||redBackType.value == 1||redBackType.value == 2)) {
+ this.props.button.setButtonVisible(['Allocate'], false);
+ }
+ //控制单据联查期间分摊按钮显示
+ ctrAllocBtn(this);
+ //浏览态非自由态的单据:隐藏修改按钮
+ // let approvestatus = this.props.form.getFormItemsValue(this.formId, 'approvestatus').value;;
+ // if(status == 'browse'){
+ // if(approvestatus!=-1){
+ // this.props.button.setButtonVisible([headButton.Edit], false);
+ // }else {
+ // this.props.button.setButtonVisible([headButton.Edit], true);
+ // }
+ // }
+ dealSmartCard.call(this,{cardId:this.cardId,url:this.smartCardUrl});
+ };
+ toggeleShow436S3 = (res) => {
+ if (res) {
+ toggleBtnStatus.call(this, res, 'card_head');
+ }
+ cardFieldsEditableWithProxy(this);
+ let status = this.props.getUrlParam('status');
+ let flag = status === 'browse' ? true : false;
+
+ let falseBtn = this.Info.allButtonsKey; //不可见的按钮
+ this.props.button.setButtonVisible(falseBtn, false);
+ if (flag) {
+ let billstatus = this.props.form.getFormItemsValue(this.formId, 'billstatus').value;
+ if (billstatus == -1) {
+ this.props.button.setButtonVisible([headButton.Edit], flag);
+ } else {
+ this.props.button.setButtonVisible([headButton.Edit], !flag);
+ this.props.button.setButtonVisible([headButton.Uncommit], flag);
+ }
+ }
+ this.props.button.setButtonVisible([headButton.TempSave], false);
+ this.props.button.setButtonVisible([headButton.Save, headButton.Cancel, innerButton.Delete_inner, headButton.SaveAndCommit, bodyButton.CopyLine, bodyButton.DelLine,bodyButton.AddLine], !flag);
+ let source = this.props.getUrlParam('source');
+ this.props.BillHeadInfo.setBillHeadInfoVisible({ showBackBtn: false });
+ if (source && source == 'refund') {
+ this.props.button.setButtonVisible(['Quit'], false);
+ this.props.button.setButtonVisible(['QuitRefund'], true);
+ } else {
+ this.props.button.setButtonVisible(['Quit'], true);
+ this.props.button.setButtonVisible(['QuitRefund'], false);
+ }
+
+ this.props.form.setFormStatus(formId, status);
+ this.props.cardTable.setStatus(tableId, status);
+ if (status == 'add') {
+ this.props.cardTable.setStatus(this.tableId, 'edit');
+ } else {
+ this.props.cardTable.setStatus(this.tableId, status);
+ }
+ this.props.form.setFormItemsDisabled(this.formId, { 'pk_org': true });
+ this.props.form.setFormItemsDisabled(this.formId, { 'pk_org_v': true });
+
+ }
+ //卡片表体点击行事件
+ onSelected = () => {
+ onSelectedCardBodyEditControl(this);
+ dealSmartCard.call(this,{cardId:this.cardId,url:this.smartCardUrl});
+ };
+
+ //删除单据
+ delConfirm = (extype, flag) => {
+ let id = this.props.getUrlParam('id');
+ let nextId = getNextId(id, dataSource);
+ ajax({
+ url: '/nccloud/arap/arappub/delete.do',
+ data: [
+ Object.assign({
+ pk_bill: this.props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ billType: this.billType,
+ extype: extype,
+ flag: flag,
+ pageId:"CARD"
+ }, this.dataInSaga)
+ ],
+ success: (res) => {
+ //删除单据后,卡片界面显示该单据的下一个单据
+ //如果是最后一个单据,删除后返回list界面
+ if (res.success) {
+ if (res.data&&res.data.exType == '1') {
+ this.Info.tipContent = res.data.message;
+ this.Info.exType = '1';
+ this.Info.flag = true;
+ this.props.modal.show('deleteCheck');
+ return;
+ } else {
+ toast({ color: 'success', content: this.state.json['paybill-000009'] }); /* 国际化处理: 删除成功*/
+ deleteCacheById(pkname, id, dataSource);
+ if (nextId) {
+ if (this.props.getUrlParam('type') === 'transfer') {
+ this.props.setUrlParam({ status: 'browse' });
+ }
+ this.props.setUrlParam({ id: nextId });
+ this.initShow();
+ } else {
+ this.props.setUrlParam({ id: null });
+ this.props.form.EmptyAllFormValue(this.formId);
+ triggerEventListener.call(this,'refresh');
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.toggleShow();
+ }
+ this.clearExType();
+ }
+ }
+ }
+ });
+ };
+
+ cancel = () => {
+ //取消按钮
+ this.props.form.setFormItemsValue("allocobjrule", { "allocobjrule": { value: '', display: '' } });
+ if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
+ //如果type存在就删除
+ this.props.delUrlParam('type');
+ }
+ let pk_org_v = this.props.form.getFormItemsValue(this.formId, 'pk_org_v');
+ if (!pk_org_v || !pk_org_v.value || pk_org_v.value == '') {
+ this.props.resMetaAfterPkorgEdit();
+ }
+ let src = this.props.getUrlParam('src') == 'settlement';
+ if (src) {
+ dealCommisionPayFieldBack(this.props, this.formId, this.tableId);
+ }
+ this.props.beforeUpdatePage(); //打开开关
+ this.state.buttonfalg = null;
+ if (this.props.getUrlParam('status') === 'edit') {
+ this.props.setUrlParam({ status: 'browse' });
+ let id = this.props.getUrlParam('id');
+ let cardData = getCacheById(id, dataSource);
+ if (cardData) {
+ this.props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, cardData.body[this.tableId]);
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.toggleShow('', cardData);
+ } else {
+ this.initShow();
+ }
+ } else if (this.props.getUrlParam('status') === 'add') {
+ let id = this.props.getUrlParam('id');
+ if (!id) {
+ id = getCurrentLastId(dataSource);
+ }
+ if (id) {
+ this.props.setUrlParam({ status: 'browse', id: id });
+ let cardData = getCacheById(id, dataSource);
+ if (cardData) {
+ this.props.form.setAllFormValue({ [this.formId]: cardData.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, cardData.body[this.tableId]);
+ let pagecode = cardData.head[this.formId].rows[0].values.pk_tradetype.value;
+ if (this.getPagecode() != pagecode && !this.props.getUrlParam('scene')) {
+ this.props.setUrlParam({ pagecode: pagecode });
+ initTemplate.call(this, this.props);
+ }
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.toggleShow('', cardData);
+ throwSagaErrorAgency.call(this, cardData)
+ } else {
+ this.initShow();
+ }
+ } else {
+ this.props.form.EmptyAllFormValue(this.formId);
+ triggerEventListener.call(this,'refresh');
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ this.toggleShow();
+ //空白单据放出导入按钮
+ let importbtns = [headButton.ImportData, headButton.ExportData, headButton.ConnectSettleInfo];
+ this.props.button.setButtonVisible(importbtns, true);
+ this.props.button.setButtonDisabled(headButton.ExportData, true);
+ }
+ }
+ if (this.props.getUrlParam('src') === '36S3' && this.props.getUrlParam('status') === 'add') {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ this.toggeleShow436S3();
+ }
+ let redBackType = this.props.form.getFormItemsValue(this.formId, 'redbacktype');
+ if (redBackType && redBackType.value == 3) {
+ let keys = ['money_de', 'local_money_de', 'groupdebit', 'globaldebit','pk_currtype'];
+ this.props.cardTable.setColEditableByKey(this.tableId, keys, false);
+ }
+ this.setState({});
+ };
+
+ //保存单据
+ saveBill = (url, extype, flag, modelIndex) => {
+ this.props.form.setFormItemsValue("allocobjrule", { "allocobjrule": { value: '', display: '' } });
+ // if (url != '/nccloud/arap/arappub/tempsave.do') {
+ // //暂存不进行校验
+ // //删除空白行
+ // let checkCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ // delBlankLine(this, this.tableId, this.billType, checkCardData, modelIndex);
+
+ // let result = this.props.validatePageToToast([
+ // {
+ // name: this.formId,
+ // type: "form",
+ // },
+ // {
+ // name: this.tableId,
+ // type: "cardTable",
+ // }
+ // ]);
+ // if (result && !result.allPassed) {
+ // return;
+ // }
+ // }
+ let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ let newCardData = dealCardData(this, cardData); //去掉空值,减少压缩时间
+ if(checkScommet(this, cardData)) {
+ return;
+ }
+ let validateCardData = delCardDataForVailData(this, newCardData);
+ let top_billtype = this.props.getUrlParam('srcFrom36S3')
+ let datas = {
+ cardData: newCardData,
+ uiState: this.props.getUrlParam('status'),
+ extype: extype,
+ flag: flag,
+ pk_settle: this.props.getUrlParam('pk_settle'),
+ top_billtype:top_billtype
+ };
+ if ('/nccloud/arap/arappub/save.do' == url) {
+ this.Info.saveflag = true;
+ }
+ let callback = () => {
+ ajax({
+ url: url,
+ data: Object.assign(datas, this.dataInSaga),
+ success: (res) => {
+ let pk_paybill = null;
+ let pk_tradetype = null;
+ if (res.success) {
+ if (res.data) {
+ if (res.data.exType == '1') {
+ this.Info.tipContent = res.data.message;
+ this.Info.pk_bill = res.data.pk_bill;
+ this.Info.ts = res.data.ts;
+ this.Info.billCard = res.data.billCard;
+ this.Info.tipUrl = res.data.pk_bill == null ? url : '/nccloud/arap/arappub/saveandcommit.do';
+ this.Info.exType = '1';
+ this.Info.flag = true;
+ if (res.data.pk_bill == null) {
+ this.props.modal.show('saveCheck');
+ } else if (res.data.assignInfo &&
+ res.data.assignInfo.workflow &&
+ (res.data.assignInfo.workflow == 'approveflow' ||
+ res.data.assignInfo.workflow == 'workflow')) {
+ this.Info.compositedata = res.data.assignInfo;
+ this.Info.exType = res.data.exType;
+ this.Info.tipUrl = '/nccloud/arap/arappub/saveandcommit.do'; //指派信息确定按钮继续走保存提交;
+ this.setState({ compositedisplay: true });
+ return;
+ } else {
+ this.commitAndUncommit();
+ }
+ // this.props.modal.show(res.data.pk_bill == null ? 'saveCheck' : 'commitAndUncommit');
+ return;
+ } else if (res.data.exType == '2') {
+ this.Info.tipContent = res.data.message;
+ this.Info.pk_bill = res.data.pk_bill;
+ this.Info.ts = res.data.ts;
+ this.Info.billCard = res.data.billCard;
+ this.Info.tipUrl = res.data.pk_bill == null ? url : '/nccloud/arap/arappub/saveandcommit.do';
+ this.Info.exType = '2';
+ this.Info.flag = true;
+ if (res.data.pk_bill == null) {
+ this.props.modal.show('saveCheck');
+ } else if (res.data.assignInfo &&
+ res.data.assignInfo.workflow &&
+ (res.data.assignInfo.workflow == 'approveflow' ||
+ res.data.assignInfo.workflow == 'workflow')) {
+ this.Info.compositedata = res.data.assignInfo;
+ this.Info.exType = res.data.exType;
+ this.Info.tipUrl = '/nccloud/arap/arappub/saveandcommit.do'; //指派信息确定按钮继续走保存提交;
+ this.setState({ compositedisplay: true });
+ return;
+ } else {
+ this.commitAndUncommit();
+ }
+ // this.props.modal.show(res.data.pk_bill == null ? 'saveCheck' : 'commitAndUncommit');
+ return;
+ } else if (res.data.exType == '3') {
+ //普通异常要捕获到并抛出错误信息,同时要将保存后的单据进行回写
+ let content = res.data.message;
+ // toast({ color: 'danger', content: JSON.stringify(content) });
+ } else if (
+ res.data.assignInfo &&
+ res.data.assignInfo.workflow &&
+ (res.data.assignInfo.workflow == 'approveflow' ||
+ res.data.assignInfo.workflow == 'workflow')
+ ) {
+ this.Info.compositedata = res.data.assignInfo;
+ this.Info.pk_bill = res.data.pk_bill;
+ this.Info.ts = res.data.ts;
+ this.Info.exType = res.data.exType;
+ this.Info.billCard = res.data.billCard;
+ this.Info.tipUrl = '/nccloud/arap/arappub/saveandcommit.do';
+ this.setState({ compositedisplay: true });
+ return;
+ }
+ if (this.props.getUrlParam('type') == 'transfer' || this.props.getUrlParam('src') === '36S3') {
+ setValue.call(this, this.props, res);
+ } else {
+ this.props.beforeUpdatePage(); //打开开关
+ if (res.data.head && res.data.head[this.formId]) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ pk_paybill = res.data.head[this.formId].rows[0].values.pk_paybill.value;
+ pk_tradetype = res.data.head[this.formId].rows[0].values.pk_tradetype.value;
+ }
+ if (res.data.body && res.data.body[this.tableId]) {
+ this.props.cardTable.updateDataByRowId(this.tableId, res.data.body[this.tableId]);
+ if(url=='/nccloud/arap/arappub/saveandcommit.do'){
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ }
+ this.state.buttonfalg = null;
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ let newCardData = this.props.createMasterChildData(
+ this.getPagecode(),
+ this.formId,
+ this.tableId
+ );
+ if (this.props.getUrlParam('status') == 'add') {
+ addCache(pk_paybill, newCardData, this.formId, dataSource); //新增
+ let idObj = { id: pk_paybill, status: 1 }//1 修改 2新增 3删除
+ this.props.cardPagination.setCardPaginationId(idObj);
+ } else {
+ updateCache(pkname, pk_paybill, newCardData, this.formId, dataSource); //修改之后更新缓存
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ }
+ if (this.props.getUrlParam('type')) {
+ this.props.delUrlParam('type');
+ }
+ if (this.props.getUrlParam('scene')) {
+ this.props.setUrlParam({ status: 'browse', id: pk_paybill });
+ } else {
+ this.props.setUrlParam({
+ status: 'browse',
+ id: pk_paybill,
+ pagecode: pk_tradetype
+ });
+ }
+ }
+
+ let redBackType = this.props.form.getFormItemsValue(this.formId, 'redbacktype');
+ if (redBackType && redBackType.value == 3) {
+ let keys = ['money_de', 'local_money_de', 'groupdebit', 'globaldebit','pk_currtype'];
+ this.props.cardTable.setColEditableByKey(this.tableId, keys, false);
+ }
+ if (!res.data.message) {
+ if(this.Info.saveflag){
+ toast({ color: 'success', content: this.state.json['paybill-000010'] }); /* 国际化处理: 保存成功*/
+ }else if(url == '/nccloud/arap/arappub/tempsave.do'){
+ toast({ color: 'success', content: this.state.json['paybill-000070'] }); /* 国际化处理: 暂存成功*/
+ }else{
+ toast({ color: 'success', content: this.state.json['paybill-000068'] }); /* 国际化处理: 提交成功*/
+ }
+
+ } else {
+ toast({ color: 'danger', content: JSON.stringify(res.data.message) });
+ }
+ }
+ }
+ if (this.Info.isModelSave) {
+ this.Info.isModelSave = false;
+ this.props.cardTable.closeModel(this.tableId);
+ }
+ if (this.props.getUrlParam('type') != 'transfer') {//
+
+ if (this.props.getUrlParam('src') == '36S3') {
+ this.toggeleShow436S3('', res);
+ } else {
+ this.toggleShow('', res);
+ }
+ }
+ this.clearExType();
+ //控制联查分摊期间按钮
+ ctrAllocBtn(this);
+ }
+ });
+ };
+
+ this.props.validateToSave(validateCardData, callback, { table1: 'cardTable' }, 'card');
+ };
+
+ //提交和收回弹框点击取消
+ clearExType = () => {
+ this.Info.tipContent = '';
+ this.Info.pk_bill = null;
+ this.Info.ts = null;
+ this.Info.billCard = null;
+ this.Info.tipUrl = null;
+ this.Info.exType = null;
+ this.Info.flag = false;
+ this.Info.compositedata = null;
+ this.Info.saveflag = false;
+ };
+ cancelClickInCommit = () => { //保存提交事务,取消指派框
+ this.setState({ compositedisplay: false });
+ this.Info.saveflag = false;
+ this.clearExType();
+ };
+ cancelClick = () => {
+ this.Info.saveflag = false;
+ if (this.Info.pk_bill != null) {
+ if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
+ this.props.delUrlParam('type');
+ }
+ this.props.beforeUpdatePage(); //打开开关
+ this.state.buttonfalg = null;
+ if (this.Info.billCard.head) {
+ this.props.form.setAllFormValue({ [this.formId]: this.Info.billCard.head[this.formId] });
+ }
+ if (this.Info.billCard.body) {
+ this.props.cardTable.updateDataByRowId(this.tableId, this.Info.billCard.body[this.tableId]);
+ }
+ if (this.props.getUrlParam('scene')) {
+ this.props.setUrlParam({
+ status: 'browse',
+ id: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill
+ });
+ } else {
+ this.props.setUrlParam({
+ status: 'browse',
+ id: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill,
+ pagecode: this.Info.billCard.head[this.formId].rows[0].values.pk_tradetype.value
+ });
+ }
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ addCache(pkname, newCardData, this.formId, dataSource); //新增
+ this.toggleShow();
+ }
+ if (this.state.compositedisplay) {
+ this.setState({ compositedisplay: false });
+ }
+ this.clearExType();
+ };
+
+ //提交and收回公共调用函数
+ commitAndUncommit = () => {
+ let tipUrl = this.Info.tipUrl;
+ let extype = this.Info.exType;
+ let flag = this.Info.flag;
+ ajax({
+ url: tipUrl,
+ data: Object.assign({
+ pk_bill: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill,
+ ts: this.Info.ts == null ? this.props.form.getFormItemsValue(this.formId, 'ts').value : this.Info.ts,
+ pageId: this.getPagecode(),
+ billType: this.billType,
+ type: 2,
+ extype: extype,
+ flag: flag,
+ assignObj: this.Info.compositedata
+ }, this.dataInSaga),
+ success: (res) => {
+ if(res.data){
+ if (res.data.exType == '1') {
+ let content = res.data.message;
+ this.Info.tipContent = content;
+ this.Info.tipUrl = tipUrl;
+ this.Info.exType = '1';
+ this.Info.flag = true;
+ this.props.modal.show('commitAndUncommit');
+ return;
+ } else if (
+ res.data.workflow &&
+ (res.data.workflow == 'approveflow' || res.data.workflow == 'workflow')
+ ) {
+ this.Info.compositedata = res.data;
+ this.Info.tipUrl = tipUrl;
+ this.setState({ compositedisplay: true });
+ return;
+ }
+ }
+ if (res.success) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ if (this.Info.pk_bill == null) {
+ updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ } else {
+ if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
+ this.props.delUrlParam('type');
+ }
+ this.state.buttonfalg = null;
+ addCache(pkname, newCardData, this.formId, dataSource); //新增
+ }
+ if (this.props.getUrlParam('status') != 'browse') {
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ }
+
+ let pk_bill = this.props.form.getFormItemsValue(this.formId, pkname).value;
+ if(this.Info.pk_bill){
+ pk_bill = this.Info.pk_bill;
+ }else if(this.props.getUrlParam('id')){
+ pk_bill = this.props.getUrlParam('id')
+ }
+
+ this.props.setUrlParam({
+ status: 'browse',
+ id: pk_bill
+ });
+
+ if (this.state.compositedisplay) {
+ this.setState({ compositedisplay: false });
+ }
+ this.clearExType();
+ if (this.props.getUrlParam('src') == '36S3') {
+ this.toggeleShow436S3('', res);
+ } else {
+ this.toggleShow('', res);
+ }
+ if(tipUrl.indexOf("uncommit")!=-1){
+ this.props.button.setButtonVisible([headButton.Edit], true);
+ toast({ color: 'success', content: this.state.json['paybill-000069'] }); /* 国际化处理: 收回成功*/
+ }else{
+ this.props.button.setButtonVisible([headButton.Edit], false);
+ toast({ color: 'success', content: this.state.json['paybill-000068'] }); /* 国际化处理: 提交成功*/
+ }
+ }
+ }
+ });
+ };
+ commitInSaveAndCommit = (value) => {
+ //this.Info.pk_bill始终有值,即便异常当异常抛出到当保存提交亦或时保存再提交。所以判断条件单凭这个PK不够 所以增加参数
+ this.Info.compositedata = value;
+ if (this.Info.saveflag) {
+ this.Info.tipUrl = '/nccloud/arap/arappub/commit.do';
+ this.Info.saveflag = false;
+ this.commitAndUncommit();
+ } else {
+ let extype = this.Info.exType ? this.Info.exType : null
+ let flag = this.Info.flag;
+ let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ let newCardData = dealCardData(this, cardData); //去掉空值,减少压缩时间
+ ajax({
+ url: this.Info.tipUrl,
+ data: Object.assign({
+ pk_bill: this.Info.pk_bill == null ? this.props.getUrlParam('id') : this.Info.pk_bill,
+ ts: this.Info.ts == null ? this.props.form.getFormItemsValue(this.formId, 'ts').value : this.Info.ts,
+ cardData: newCardData,
+ uiState: this.props.getUrlParam('status'),
+ pageId: this.getPagecode(),
+ billType: this.billType,
+ type: 2,
+ extype: extype,
+ flag: flag,
+ assignObj: this.Info.compositedata
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ if (this.Info.pk_bill == null) {
+ updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ } else {
+ if (this.props.getUrlParam('type') && this.props.getUrlParam('type') != 'transfer') {
+ this.props.delUrlParam('type');
+ }
+ addCache(pkname, newCardData, this.formId, dataSource); //新增
+ }
+ if (this.props.getUrlParam('status') != 'browse') {
+ this.props.cardTable.setStatus(this.tableId, 'browse');
+ this.props.form.setFormStatus(this.formId, 'browse');
+ }
+ this.props.setUrlParam({
+ status: 'browse',
+ id: res.data.head.head ? res.data.head.head.rows[0].values.pk_paybill.value : res.data.head.rows[0].values.pk_paybill.value
+ });
+ if (this.state.compositedisplay) {
+ this.setState({ compositedisplay: false });
+ }
+ this.clearExType();
+ this.toggleShow('', res);
+ toast({ color: 'success', content: this.state.json['receivablebill-000025'] }); /* 国际化处理: 操作成功*/
+ }
+ }
+ });
+
+ }
+ };
+ //单据删除模态框确定按钮点击事件
+ deleteBillSureBtnClick = () => {
+ let exType = this.Info.exType;
+ let flag = this.Info.flag;
+ this.delConfirm(exType, flag);
+ };
+
+ //挂起和取消挂起操作
+ pause = (url) => {
+ let selectedData = this.props.cardTable.getCheckedRows(this.tableId);
+ if (selectedData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000033'] }); /* 国际化处理: 请选择表体行!*/
+ return;
+ }
+ let pauseObj = [];
+ selectedData.forEach((val) => {
+ pauseObj.push(val.data.values.pk_payitem.value);
+ });
+ let data = {
+ pk_items: pauseObj,
+ pk_bill: this.props.getUrlParam('id'),
+ ts: this.props.form.getFormItemsValue(this.formId, 'ts').value,
+ pageId: this.getPagecode(),
+ billType: this.billType
+ };
+ ajax({
+ url: url,
+ data: Object.assign(data, this.dataInSaga),
+ success: (res) => {
+ if (res.data.message) {
+ toast({
+ duration: 'infinity',
+ color: res.data.PopupWindowStyle,
+ content: res.data.message
+ });
+ } else {
+ toast({ color: 'success', content: this.state.json['paybill-000073'] }); /* 国际化处理: 操作成功*/
+ }
+ if (res.data.billCard) {
+ if (res.data.billCard.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.billCard.head[this.formId] });
+ }
+ if (res.data.billCard.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.billCard.body[this.tableId]);
+ }
+ let newCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ updateCache(pkname, this.props.getUrlParam('id'), newCardData, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data.billCard,dataSource,tableId:this.tableId,formId:this.formId});
+ }
+ this.onSelected();
+ }
+ });
+ };
+
+ //获取列表肩部信息
+ getTableHead = () => {
+ if (this.props.getUrlParam("src") == "36S3") {
+ return (
+
+ {this.props.button.createButtonApp({
+ area: 'card_body',
+ buttonLimit: 3,
+ onButtonClick: buttonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+
+ )
+ } else {
+ return (
+
+ {this.props.button.createButtonApp({
+ area: 'card_body',
+ buttonLimit: 3,
+ onButtonClick: buttonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+
+ );
+ }
+ };
+
+ //联查处理情况按钮
+ handleCombined = () => {
+ this.setState({
+ isCombinedExaminationModelShow: true
+ }, () => {
+ if (this.state.isCombinedExaminationModelShow) {
+ this.child.modalOpen();
+ } else {
+ this.child.modalClose();
+ }
+ });
+ };
+ onRender = (ref) => {
+ this.child = ref;
+ };
+
+
+ //关闭联查执行预算的模态框
+ tbbLinkcancel() {
+ this.setState({
+ isTbbLinkshow: false
+ });
+ }
+
+ //审批详情模态框控制
+ closeApprove = () => {
+ this.setState({
+ showApproveDetail: false
+ });
+ };
+
+ //打印
+ onPrint = () => {
+ this.printData.oids = [this.props.getUrlParam('id')];
+ this.printData.nodekey = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ // print(
+ // 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ // '/nccloud/arap/arappub/print.do', //后台服务url
+ // this.printData
+ // // false 去掉后支持弹出选择打印模板
+ // );
+ this.printPreviewBill();
+ };
+
+ //打印输出
+ printOutput = () => {
+ this.outputData.oids = [this.props.getUrlParam('id')];
+ this.outputData.nodekey = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ this.refs.printOutput.open();
+ };
+ //正式打印
+ officalPrintOutput = () => {
+ this.printData.oids = [this.props.getUrlParam('id')];
+ this.printData.nodekey = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ this.printData.userjson = billType+","+this.props.getSearchParam('p');
+ ajax({
+ url: '/nccloud/arap/arappub/officialPrint.do',
+ data: this.printData,
+ async: false,
+ success: (res) => {
+ if (res.success) {
+ // print(
+ // 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ // '/nccloud/arap/arappub/print.do', //后台服务url
+ // this.printData,
+ // false
+ // );
+ this.printPreviewBill();
+ if (res.data) {
+ updateCache(pkname, this.props.getUrlParam('id'), res.data, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ } else {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ }
+ this.toggleShow('', res);
+ throwSagaErrorAgency.call(this, res)
+ }
+ }
+ });
+ };
+
+ //预览打印
+ printPreviewBill = () => {
+ printPreview(
+ this.props,
+ '/nccloud/arap/arappub/print.do',
+ {
+ //billType:"F3",
+ billtype:this.printData.billtype,
+ funcode: this.printData.funcode,
+ appcode: this.printData.appcode, //⼩应⽤编码
+ pageCode:this.props.getSearchParam('p'),
+ nodekey: this.printData.nodekey, //模板节点标识
+ oids: this.printData.oids,
+ //userjson: encodeURI(JSON.stringify({numFrom: 1,numEnd: 2})),
+ //controlPrintNum: true,
+ type :'1',
+ sysType: '1',
+ //suffx:['pdf'],
+ realData:true,
+ //新增项
+ //hideTemplate: true,//是否需要打印模板切换
+ //printSetting:JSON.stringify({currentNccloudPaper:{paperHeight: 210,paperId: "",paperName:this.state.json['paybill-000046'],paperWidth: 297}}),
+ //⾃定义内容项
+ //formulaConfig: null,
+ //userjson: this.printData.billtype //单据类型`
+ },
+ true
+ )
+ }
+
+ //取消正式打印
+ cancelPrintOutput = () => {
+ this.printData.oids = [this.props.getUrlParam('id')];
+ this.printData.nodekey = this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value;
+ this.printData.userjson = billType+","+this.props.getSearchParam('p');
+ ajax({
+ url: '/nccloud/arap/arappub/cancelPrint.do',
+ data: this.printData,
+ async: false,
+ success: (res) => {
+ if (res.success) {
+ if (res.data) {
+ updateCache(pkname, this.props.getUrlParam('id'), res.data, this.formId, dataSource);
+ updateCacheTss.call(this,{pkname,data:res.data,dataSource,tableId:this.tableId,formId:this.formId});
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.setTableData(this.tableId, res.data.body[this.tableId]);
+ }
+ } else {
+ this.props.form.EmptyAllFormValue(this.formId);
+ this.props.cardTable.setTableData(this.tableId, { rows: [] });
+ }
+ this.toggleShow('', res);
+ throwSagaErrorAgency.call(this, res)
+ //打开协同单据节点
+ toast({ color: 'success', content: this.state.json['paybill-000072'] });
+ }
+ }
+ });
+ };
+
+ //输出成功回调函数
+ onSubmit() { }
+
+ //返回列表
+ backList = () => {
+ if (this.props.getUrlParam('scene') == 'linksce' || this.props.getUrlParam('scene') == 'fip') {
+ this.props.pushTo('/list', {
+ pagecode: '20080EBM_LIST_LINK',
+ scene: 'linksce'
+ });
+ } else {
+ this.props.pushTo('/list', {
+ pagecode: '20080EBM_LIST'
+ });
+ }
+ };
+
+ //返回转单页面
+ backTransfer = () => {
+ let dataSource = this.props.getUrlParam('dataSource');
+ let src_appcode = getDefData('src_appcode', dataSource);
+ let url = '/' + this.props.getUrlParam('srcBilltype');
+ let busitypedata = this.props.getUrlParam('busitype');
+ if (this.props.getUrlParam('srcBilltype')) {
+ this.props.pushTo(url, {
+ src_appcode: src_appcode,
+ dest_billtype: this.billType,
+ dest_tradetype: this.getPagecode(),
+ busitype: busitypedata
+ });
+ } else {
+ this.props.pushTo('/list', {
+ pagecode: '20080EBM_LIST'
+ });
+ }
+ };
+
+ //保存事件模态框确定按钮点击事件
+ saveSureBtnClick = () => {
+ let tipUrl = this.Info.tipUrl;
+ let exType = this.Info.exType;
+ let flag = this.Info.flag;
+ if (this.Info.saveflag) {
+ tipUrl = '/nccloud/arap/arappub/save.do'
+ this.Info.saveflag = false;
+ }
+ this.saveBill(tipUrl, exType, flag);
+ };
+ //整单保存事件
+ modelSaveClick = (a, modelIndex) => {
+ this.dataInSaga.butncode = 'save';
+ this.Info.isModelSave = true;
+ let saveUrl = '/nccloud/arap/arappub/save.do';
+ this.saveBillBefore(saveUrl, modelIndex);
+ };
+
+ saveBillBefore = (url, modelIndex) => {
+ //删除空白行
+ let checkCardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId);
+ delBlankLine(this, this.tableId, this.billType, checkCardData, null);
+
+ let result = this.props.validatePageToToast([
+ {
+ name: this.formId,
+ type: "form",
+ },
+ {
+ name: this.tableId,
+ type: "cardTable",
+ }
+ ]);
+ if (result && !result.allPassed) {
+ return;
+ }
+
+ let allRows = this.props.cardTable.getVisibleRows(this.tableId);
+ let noTop = false;
+ let haveTop = false;
+ let rowno = [];
+ for (let i = 0; i < allRows.length; i++) {
+ let row = allRows[i];
+ if(row.values.top_billid && row.values.top_billid.value){
+ haveTop = true;
+ }else{
+ rowno.push(i + 1);
+ noTop = true;
+ }
+ }
+ if(noTop && haveTop){
+ promptBox({
+ color: 'warning',
+ title: url.includes('saveandcommit') ? this.state.json['public-000293'] : this.state.json['public-000279'] /* 国际化处理: 保存*/,
+ content: this.state.inlt.get('public-000280', {1: rowno.join(',')}) /* 国际化处理: 第{1}行是手工增补行,与上游系统无关联,是否继续保存?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: this.state.json['public-000076'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['public-000077'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () =>{
+ this.saveBill(url, null, null, modelIndex);
+ }
+ });
+ }else{
+ this.saveBill(url, null, null, modelIndex);
+ }
+ };
+
+ //侧拉删行
+ modelDelRow = () => {
+ calculateHeadMoney(this);
+ let allVisibleRows = this.props.cardTable.getVisibleRows(this.tableId);
+ if (!allVisibleRows || allVisibleRows.length == 0) {
+ this.props.cardTable.closeModel(this.tableId);
+ }
+ };
+
+ //侧拉增行
+ modelAddRow = () => {
+ if (this.props.form.getFormItemsValue(this.formId, 'pk_org_v').value != null) {
+ let allRowsNumber = this.props.cardTable.getNumberOfRows(this.tableId);
+ ajax({
+ url: '/nccloud/arap/paybillpub/addline.do',
+ data: this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId),
+ success: (res) => {
+ if (res.data) {
+ if (res.data.head) {
+ this.props.form.setAllFormValue({ [this.formId]: res.data.head[this.formId] });
+ }
+ if (res.data.body) {
+ this.props.cardTable.updateDataByIndexs(this.tableId, [
+ {
+ index: allRowsNumber - 1,
+ data: {
+ status: 2,
+ values: res.data.body[this.tableId].rows[0].values
+ }
+ }
+ ]);
+ }
+ }
+ }
+ });
+ } else {
+ toast({ color: 'warning', content: this.state.json['paybill-000027'] }); /* 国际化处理: 请先选择财务组织*/
+ }
+ };
+
+ switchTemplate = () => {
+ //initTemplate.call(this, this.props);
+ let pagecode = this.getPagecode();
+ let appcode = this.props.getSearchParam('c') ? this.props.getSearchParam('c') : this.props.getUrlParam('c');
+ let tradetype = getDefData('sessionTradeType', dataSource);
+ if (!tradetype) {
+ tradetype = tradeType;
+ }
+ ajax({
+ url: '/nccloud/arap/arappub/queryallbtns.do',
+ data: {
+ appcode: appcode,
+ pagecode: pagecode,
+ tradetype: tradetype,
+ billtype: billType
+ },
+ success: (res) => {
+ let data = res.data;
+ if (data.button) {
+ let button = data.button;
+ this.Info.pullBillInfoVOAry = data.pullbillinfo;
+ getButtonsKey(button, this.Info.allButtonsKey); //获取所有按钮
+ this.props.button.setButtons(button);
+ }
+ }
+ });
+ };
+
+ modalContent = () => {
+ return(
+
+ {this.Info.tipContent}
+
+ )
+ }
+
+ dealGroupMoveList = (groupList) =>{
+ let billPK = this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value;
+ return groupList.filter( (item, index) => item.fullPath && item.fullPath.indexOf(billPK)!=-1);
+ }
+
+ //处理附件分组:
+ dealGroupList =(list)=>{
+ let pk_bill=this.props.form.getFormItemsValue(this.formId, 'pk_paybill').value;
+ let tempList=list;
+ if(tempList!=null&&tempList.length>0){
+ for(let i=0;i0){
+ for(let j=0;j0){
+ tempList[i]["children"][j]["disableButton"]= JSON.stringify( ["fs_group_add"]);
+ }else{
+ tempList[i]["disableButton"]=JSON.stringify( ["fs_group_add","fs_group_delete","fs_group_edit","fs_delete","fs_move","fs_edit","fs_upload"]);
+ }
+ }
+ }
+ return list;
+ }
+ render() {
+ let { cardTable, form, button, modal, cardPagination, transferTable,smartCard } = this.props;
+ const { createBillHeadInfo } = this.props.BillHeadInfo;
+ let buttons = this.props.button.getButtons();
+ let { createForm } = form;
+ let { createCardTable } = cardTable;
+ let { createButton } = button;
+ const { createCardPagination } = cardPagination;
+ let { createModal } = modal;
+ let transfer = this.props.getUrlParam('type') == 'transfer';
+ const { createTransferList } = transferTable;
+ let { showUploader, target } = this.state;
+ let {createSmartCard}=smartCard;
+ if (transfer) {
+ return (
+
+
+
+
+ {createBillHeadInfo({
+ title: this.props.getSearchParam('n') ? this.props.getSearchParam('n') : this.state.json['paybill-000046'],//国际化处理: 付款单
+ backBtnClick: () => {
+ this.backTransfer();
+ }
+ })}
+
+
+ {cardSocketConnect.call(this, 'card_head', dataSource)}
+ {cardSocketErrorFlag.call(this, 'card_head')}
+ {this.props.button.createButtonApp({
+ area: 'card_head',
+ buttonLimit: 3,
+ onButtonClick: transferButtonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+ {getDefData('scene', dataSource) == 'bz' || (this.props.getUrlParam('status') == 'add' && this.props.getUrlParam('srcbilltype')) ? null : (
+
+ {this.state.json['paybill-000047']}
+
+ )}
+ {/* 国际化处理: 取消转单*/}
+
+
+
+
{
+ this.horExpandFlag=expandFlag;
+ if(expandFlag){
+ dealSmartCard.call(this,{cardId:this.cardId,url:this.smartCardUrl});
+ }
+ }}
+ rightDomNode={createSmartCard('SmartCard_AP', {
+ walletConfig:this.smartCardConfig||{},
+ disabledVisibleCache:disabledVisibleCache,
+ showRefresh:true
+ })}
+ >
+
+ {createTransferList({
+ headcode: this.formId,
+ bodycode: this.tableId,
+ transferListId: this.leftarea, //转单列表id
+ onTransferItemSelected: (record, status, index) => {
+ //转单缩略图被选中时的钩子函数
+ this.transferIndex = index;
+ let isEdit = status ? 'browse' : 'edit';
+ if (isEdit == 'browse') {
+ let id = record.head[this.formId].rows[0].values.pk_paybill.value;
+ record = id == null ? record : getCacheById(id, dataSource);
+ this.props.setUrlParam({ status: 'browse' });
+ this.props.setUrlParam({ id: id });
+ } else {
+ this.props.setUrlParam({ status: 'add' });
+ this.props.delUrlParam('id');
+ this.state.buttonfalg = true;
+ }
+ this.toggleShow(record.head[this.formId]);
+ this.props.beforeUpdatePage(); //打开开关
+ this.props.form.setFormStatus(this.formId, isEdit);
+ this.props.cardTable.setStatus(this.tableId, isEdit);
+ this.props.form.setAllFormValue({ [this.formId]: record.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, record.body[this.tableId]);
+ this.props.updatePage(this.formId, this.tableId); //关闭开关
+ }
+ })}
+
+
+ {createForm(this.formId, {
+ fieldid: "paybill",
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: formBeforeEvent.bind(this),
+ getPopupContainer:getPopupContainer.bind(this)
+ })}
+
+
+ {createCardTable(this.tableId, {
+ fieldid: "paybill",
+ tableHead: this.getTableHead.bind(this, buttons),
+ modelSave: this.modelSaveClick.bind(this),
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: bodyBeforeEvent.bind(this),
+ modelAddRow: this.modelAddRow.bind(this),
+ modelDelRow: this.modelDelRow.bind(this),
+ onSelected: this.onSelected.bind(this),
+ onSelectedAll: this.onSelected.bind(this),
+ hideAdd: addAndDelBtninModule.call(this, 'Add', billType),
+ hideDel: addAndDelBtninModule.call(this, 'Del', billType),
+ showCheck: true,
+ showIndex: true,
+ isAddRow: false,
+ adaptionHeight: true,
+ high_selectable: {
+ enable: true //默认为true
+ },
+ // 框选
+ onBatchSelected: (...params) => {
+ this.onSelected.call(this)
+ },
+ onBatchChange: onBatchChange.bind(this)
+ })}
+
+ {/* {联查处理情况} */}
+
+
+ {/* {附件管理} */}
+ {showUploader && (
+
this.closeModal()}
+ customize={{
+ pk_billType: this.props.form.getFormItemsValue(this.formId, 'pk_billtype')
+ ? this.props.form.getFormItemsValue(this.formId, 'pk_billtype').value
+ : null
+ }}
+ billConfig={this.Config.billConfig}
+ customInterface={{
+ //queryLeftTree: '/nccloud/arap/arappub/arapFileLeftTreeQuery.do',
+ queryAttachments: '/nccloud/arap/arappub/transformBillEnclosureQuery.do'
+ }}
+
+ formatGroupMoveList = { (groupList) => {
+ return this.dealGroupMoveList(groupList);
+ }}
+ getGroupList = { (list) => {
+ return this.dealGroupList(list);
+ }}
+
+ />
+ )}
+ {/* 单据追溯组件 */}
+ {
+ this.setState({ showBillTrack: false });
+ }}
+ pk={this.props.getUrlParam('id')} //单据id
+ type={
+ this.props.form.getFormItemsValue(this.formId, 'pk_tradetype') ? (
+ this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value
+ ) : null
+ } //单据类型
+ />
+ {/* {打印输出} */}
+
+ {/* {审批详情模态框} */}
+
+ {/* {导入} */}
+ {createModal('importModal', {
+ noFooter: true,
+ className: 'import-modal',
+ hasBackDrop: false
+ })}
+
+ {/* {联查计划预算} */}
+
+
+
+
+ {/*分摊模态框 */}
+
+ {createModal("allocobjrule", {
+ fieldid: "allocobjrule",
+ title: this.state.json['paybill-000071'],//对象分摊
+ size: 'sm',
+ zIndex:270,
+ content:
+
+
+ {createForm("allocobjrule", {
+ fieldid: "allocobjrule",
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: formBeforeEvent.bind(this)
+ })}
+
+
,
+ beSureBtnClick: beSureAllocation.bind(this),
+ cancelBtnClick: cancelAllocation.bind(this)
+ })}
+
+ {/* 异常模态框 */}
+
+ {createModal('saveCheck', {
+ title: this.state.json['paybill-000042'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 异常提示信息*/
+ content: this.modalContent(), //this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ beSureBtnClick: this.saveSureBtnClick.bind(this) //点击确定按钮事件
+ })}
+ {createModal('deleteCheck', {
+ title: this.state.json['paybill-000042'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 异常提示信息*/
+ content: this.modalContent(), //this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ beSureBtnClick: this.deleteBillSureBtnClick.bind(this) //点击确定按钮事件
+ })}
+ {createModal('commitAndUncommit', {
+ title: this.state.json['paybill-000042'] /* 国际化处理: 异常提示信息*/,
+ content: this.modalContent(), //this.Info.tipContent,
+ beSureBtnClick: this.commitAndUncommit.bind(this), //点击确定按钮事件
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ cancelBtnClick: this.cancelClick.bind(this) //提交和收回取消事件
+ })}
+ {/* 指派信息弹框 */}
+ {this.state.compositedisplay ? (
+
+ ) : null}
+
+
+
+
+
+ );
+ } else if (!transfer && this.props.getUrlParam("src") == "36S3") {
+ return (
+
+
+
+ {createBillHeadInfo({
+ title: this.props.getSearchParam('n') ? this.props.getSearchParam('n') : this.state.json['paybill-000046'],//国际化处理: 付款单
+ })}
+
+
+ {cardSocketConnect.call(this, 'card_head', dataSource)}
+ {cardSocketErrorFlag.call(this, 'card_head')}
+ {this.props.button.createButtonApp({
+ area: 'card_head',
+ buttonLimit: 3,
+ onButtonClick: buttonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+
+
+
{
+ this.horExpandFlag=expandFlag;
+ if(expandFlag){
+ dealSmartCard.call(this,{cardId:this.cardId,url:this.smartCardUrl});
+ }
+ }}
+ rightDomNode={createSmartCard('SmartCard_AP', {
+ walletConfig:this.smartCardConfig||{},
+ disabledVisibleCache:disabledVisibleCache,
+ showRefresh:true
+ })}
+ >
+
+ {createTransferList({
+ headcode: this.formId,
+ bodycode: this.tableId,
+ transferListId: this.leftarea,
+ onTransferItemSelected: (record, status, index) => {
+ //转单缩略图被选中时的钩子函数
+ this.transferIndex = index;
+ let isEdit = status ? 'browse' : 'edit';
+ if (isEdit == 'browse') {
+ this.props.setUrlParam({ status: 'browse' })
+ let id = record.head[this.formId].rows[0].values[this.pkName].value
+ this.props.setUrlParam({ id: id })
+ } else {
+ this.props.setUrlParam({ status: 'add' })
+ this.props.delUrlParam('id')
+ }
+ this.toggeleShow436S3(record.head[this.formId]);
+ this.props.form.setAllFormValue({ [this.formId]: record.head[this.formId] });
+ this.props.cardTable.setTableData(this.tableId, record.body[this.tableId]);
+ this.props.form.setFormStatus(this.formId, isEdit);
+ this.props.cardTable.setStatus(this.tableId, isEdit);
+ }
+ })}
+
+
+ {createForm(this.formId, {
+ fieldid: "forcmp36S3",
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: formBeforeEvent.bind(this),
+ getPopupContainer:getPopupContainer.bind(this)
+ })}
+
+
+ {createCardTable(this.tableId, {
+ fieldid: "forcmp36S3",
+ tableHead: this.getTableHead.bind(this, buttons),
+ modelSave: this.saveBill,
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: bodyBeforeEvent.bind(this),
+ hideAdd: addAndDelBtninModule.call(this, 'Add', billType),
+ hideDel: addAndDelBtninModule.call(this, 'Del', billType),
+ showCheck: true,
+ showIndex: true,
+ isAddRow: false,
+ adaptionHeight: true,
+ high_selectable: {
+ enable: true //默认为true
+ },
+ // 框选
+ onBatchSelected: (...params) => {
+ this.onSelected.call(this)
+ },
+ onBatchChange: onBatchChange.bind(this)
+ })}
+
+
+
+
+
+ );
+ } else {
+ return (
+
+
+
+
+ {/* {联查场景,默认场景,浏览态存在返回按钮} */}
+
+ {createBillHeadInfo({
+ title: this.props.getSearchParam('n') ? this.props.getSearchParam('n') : this.state.json['paybill-000046'],//国际化处理: 付款单
+ backBtnClick: () => {
+ this.backList();
+ }
+ })}
+
+ {/* 国际化处理: 付款单*/}
+
+ {cardSocketConnect.call(this, 'card_head', dataSource)}
+ {cardSocketErrorFlag.call(this, 'card_head')}
+ {/* {交易类型按钮,默认场景} */}
+ {!this.props.getUrlParam('scene') && !getContext(loginContextKeys.transtype) ? (
+
+ {TradeTypeButton({
+ ref: 'tradetypeBtn',
+ billtype: 'F3',
+ dataSource: dataSource,
+ switchTemplate: this.switchTemplate.bind(this),
+ propschil: this.props,
+ appcode: this.props.getSearchParam('c') ? this.props.getSearchParam('c') : this.props.getUrlParam('c'),
+ pagecode: this.props.getSearchParam('p') ? this.props.getSearchParam('p') : null
+ })}
+
+ ) : null}
+
+ {this.props.button.createButtonApp({
+ area: 'card_head',
+ buttonLimit: 3,
+ onButtonClick: buttonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+
+ {/* {分页按钮,默认场景或者联查场景} */}
+ {(this.props.getUrlParam('scene') == 'linksce' ||
+ this.props.getUrlParam('scene') == 'fip' ||
+ !this.props.getUrlParam('scene')) ? (
+
+ {createCardPagination({
+ handlePageInfoChange: pageInfoClick.bind(this),
+ dataSource: dataSource
+ })}
+
+ ) : null}
+
+
+
+
+
{
+ this.horExpandFlag=expandFlag;
+ if(expandFlag){
+ dealSmartCard.call(this,{cardId:this.cardId,url:this.smartCardUrl});
+ }
+ }}
+ rightDomNode={createSmartCard('SmartCard_AP', {
+ walletConfig:this.smartCardConfig||{},
+ disabledVisibleCache:disabledVisibleCache,
+ showRefresh:true
+ })}
+ >
+
+ {createForm(this.formId, {
+ fieldid: "paybill",
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: formBeforeEvent.bind(this),
+ getPopupContainer:getPopupContainer.bind(this)
+ })}
+
+
+
+ {createCardTable(this.tableId, {
+ fieldid: "paybill",
+ tableHead: this.getTableHead.bind(this, buttons),
+ modelSave: this.modelSaveClick.bind(this),
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: bodyBeforeEvent.bind(this),
+ modelAddRow: this.modelAddRow.bind(this),
+ modelDelRow: this.modelDelRow.bind(this),
+ hideAdd: addAndDelBtninModule.call(this, 'Add', billType),
+ hideDel: addAndDelBtninModule.call(this, 'Del', billType),
+ sideRowChange: (record) => {
+ //动态修改票据号字段类型
+ modifyChecknoItemtype(
+ this.props,
+ this.tableId,
+ record.values.pk_org_v.value,
+ record.values.checktype.value
+ );
+ },
+ onSelected: this.onSelected.bind(this),
+ onSelectedAll: this.onSelected.bind(this),
+ showCheck: true,
+ showIndex: true,
+ adaptionHeight: true,
+ high_selectable: {
+ enable: true //默认为true
+ },
+ // 框选
+ onBatchSelected: (...params) => {
+ this.onSelected.call(this)
+ },
+ onBatchChange: onBatchChange.bind(this)
+ })}
+
+
+
+
+
+ {/* {联查处理情况} */}
+
+ {showUploader && (
+
this.closeModal()}
+ customize={{
+ pk_billType: this.props.form.getFormItemsValue(this.formId, 'pk_billtype')
+ ? this.props.form.getFormItemsValue(this.formId, 'pk_billtype').value
+ : null
+ }}
+ billConfig={this.Config.billConfig}
+ customInterface={{
+ //queryLeftTree: '/nccloud/arap/arappub/arapFileLeftTreeQuery.do',
+ queryAttachments: '/nccloud/arap/arappub/transformBillEnclosureQuery.do'
+ }}
+ formatGroupMoveList = { (groupList) => {
+ return this.dealGroupMoveList(groupList);
+ }}
+ getGroupList = { (list) => {
+ return this.dealGroupList(list);
+ }}
+ />
+ )}
+
+ {/* {审批详情模态框} */}
+
+
+ {/* 单据追溯组件 */}
+ {
+ this.setState({ showBillTrack: false });
+ }}
+ pk={this.props.getUrlParam('id')} //单据id
+ type={
+ this.props.form.getFormItemsValue(this.formId, 'pk_tradetype') ? (
+ this.props.form.getFormItemsValue(this.formId, 'pk_tradetype').value
+ ) : null
+ } //单据类型
+ />
+
+ {/* {打印输出} */}
+
+ {/* {导入} */}
+ {createModal('importModal', {
+ noFooter: true,
+ className: 'import-modal',
+ hasBackDrop: false
+ })}
+
+
+ {/* {联查计划预算} */}
+
+ {/*分摊模态框 */}
+
+ {createModal("allocobjrule", {
+ fieldid: "allocobjrule",
+ title: this.state.json['paybill-000071'],//对象分摊
+ size: 'sm',
+ zIndex:270,
+ content:
+
+
+ {createForm("allocobjrule", {
+ fieldid: "allocobjrule",
+ onAfterEvent: afterEvent.bind(this),
+ onBeforeEvent: formBeforeEvent.bind(this)
+ })}
+
+
,
+ beSureBtnClick: beSureAllocation.bind(this),
+ cancelBtnClick: cancelAllocation.bind(this)
+ })}
+
+ {/* 异常模态框 */}
+
+ {createModal('saveCheck', {
+ title: this.state.json['paybill-000043'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 预算异常提示信息*/
+ content: this.modalContent(), //this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ beSureBtnClick: this.saveSureBtnClick.bind(this) //点击确定按钮事件
+ })}
+ {createModal('deleteCheck', {
+ title: this.state.json['paybill-000042'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 异常提示信息*/
+ content: this.modalContent(), //this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ beSureBtnClick: this.deleteBillSureBtnClick.bind(this) //点击确定按钮事件
+ })}
+ {createModal('commitAndUncommit', {
+ title: this.state.json['paybill-000044'] /* 国际化处理: 提示信息*/,
+ content: this.modalContent(), //this.Info.tipContent,
+ closeModalEve: () => {
+ this.Info.flag = true
+ this.Info.exType = null
+ },
+ beSureBtnClick: this.commitAndUncommit.bind(this), //点击确定按钮事件
+ cancelBtnClick: this.cancelClick.bind(this) //提交和收回取消事件
+ })}
+ {/* 指派信息弹框 */}
+ {this.state.compositedisplay ? (
+
+ ) : null}
+
+
+ );
+ }
+ }
+}
+
+Card = createPage({
+ orderOfHotKey: [formId,tableId],//区域快捷键切换支持
+ hotKeyChange:true
+})(Card);
+
+export default Card;
+
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/constants.js b/src/arap/paybill/paybill/list/constants.js
new file mode 100644
index 0000000..20c1540
--- /dev/null
+++ b/src/arap/paybill/paybill/list/constants.js
@@ -0,0 +1,40 @@
+/*kHr1VQMdEU42oXEu346enGx+6rXJ4OFHE2VimKRgjU4=*/
+
+/**
+ * 查询区域
+ */
+export const searchId = 'query';
+
+/**
+ * 列表区域
+ */
+export const tableId = 'list';
+
+
+/**
+ * 单据类型
+ */
+export const billType = 'F3';
+
+/**
+ * 默认交易类型
+ */
+export const tradeType = 'D3';
+
+/**
+ * 默认模板节点标识
+ */
+export const nodekey = "list";
+/**
+ * 单页应用缓存
+ */
+export const dataSource = 'fi.arap.paybill.20080EBM';
+
+/**
+ * 单页应用缓存主键名字(该名字为表的主键名字)
+ */
+export const pkname = 'pk_paybill';
+
+export const searchKey = 'pk_paybill_search';
+
+/*kHr1VQMdEU42oXEu346enGx+6rXJ4OFHE2VimKRgjU4=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/events/buttonClick.js b/src/arap/paybill/paybill/list/events/buttonClick.js
new file mode 100644
index 0000000..e981174
--- /dev/null
+++ b/src/arap/paybill/paybill/list/events/buttonClick.js
@@ -0,0 +1,673 @@
+/*q2LCmxM8POvl78IL0LiydiXQT6yFM8mpfFEU8+B79Fw=*/
+import { ajax, toast, printer, cardCache, promptBox } from 'nc-lightapp-front';
+import { billType, tradeType, dataSource, searchId, tableId,pkname } from '../constants';
+import { headButton } from '../../../../public/components/pubUtils/buttonName.js';
+import { getTransferInfo } from '../../../../public/components/pubUtils/transferButtonUtil.js';
+import { imageScan, imageView } from 'sscrp/rppub/components/image';
+import arapLinkReport from '../../../../public/components/arapBillLinkReport.js';
+import linkvouchar from '../../../../public/components/linkvouchar.js';
+import madeBill from '../../../../public/components/madeBill.js';
+import { getContext, loginContextKeys } from '../../../../public/components/arapInitInfo/loginContext';
+import { batchGenerate, batchSendSpAndCancelSenSPPubFun } from '../../../../public/components/pubUtils/billPubUtil.js';
+import IndependentSettleUtil from 'sp/pub/utils/IndependentSettleUtil';
+import { moduleEnable, IMAG } from '../../../../public/components/moduleEnable.js';
+import {ListAllocperiodruleLinkQuery} from '../../../../public/components/allocation.js';
+let { getDefData, setDefData } = cardCache;
+import linkSourceList from '../../../../public/components/linkSourceList.js';
+import updateTableDataTs,{getAllCheckedDataNew,deleteTableRowsByRowIds,deleteCachePKAndTS} from '../../../../public/components/updateTableDataTs';
+export default function buttonClick(props, id) {
+ const { openToIndepSettle } = IndependentSettleUtil;
+ let code = getContext(loginContextKeys.transtype);
+ let pagecode = props.getSearchParam('p');
+ this.dataInSaga.butncode = id;
+ switch (id) {
+ case headButton.Add:
+ pagecode = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ pagecode = code;
+ } else if (!pagecode) {
+ pagecode = tradeType;
+ }
+ props.pushTo('/card', {
+ status: 'add',
+ pagecode: pagecode
+ });
+ break;
+ case headButton.Commit: // 批量提交
+ commitOpreration(this, this.props, this.tableId, billType, headButton.Commit);
+ break;
+ case headButton.Uncommit: // 批量收回
+ commitOpreration(this, this.props, this.tableId, billType, headButton.Uncommit);
+ break;
+ case headButton.Generate://生成
+ batchGenerate(this)
+ break;
+ case headButton.SendSP://传结算
+ batchSendSpAndCancelSenSPPubFun(this, 1)
+ break;
+ case headButton.CancelSendSP://取消传结算
+ batchSendSpAndCancelSenSPPubFun(this, 2)
+ break;
+ case headButton.Delete:
+ promptBox({
+ color: 'warning',
+ title: this.state.json['paybill-000002'] /* 国际化处理: 删除*/,
+ content: this.state.json['paybill-000052'] /* 国际化处理: 确定要删除所选数据吗?*/,
+ noFooter: false,
+ noCancelBtn: false,
+ beSureBtnName: this.state.json['paybill-000004'] /* 国际化处理: 确定*/,
+ cancelBtnName: this.state.json['paybill-000005'] /* 国际化处理: 取消*/,
+ beSureBtnClick: () => {
+ // let delObjs = getAllCheckedData.call(this, this.props, this.tableId, billType);
+ let {delObjs ,rowIds}= getAllCheckedDataNew.call(this, this.props, this.tableId, billType,pkname);
+ if (delObjs.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000012'] }); /* 国际化处理: 请选中至少一行数据!*/
+ return;
+ }
+ // if (delObjs.length == 1) {
+ // this.Info.pk_bill = delObjs[0].pk_bill;
+ // this.Info.ts = delObjs[0].ts;
+ // this.Info.index = delObjs[0].index;
+ // this.delConfirm();
+ // } else {
+ ajax({
+ url: '/nccloud/arap/arappub/delete.do',
+ data: delObjs,
+ success: (res) => {
+ let { success, data } = res;
+ if (success) {
+ if (data) {
+ toast({
+ duration: 'infinity',
+ color: data.PopupWindowStyle,
+ content: data.errMsg
+ });
+
+ //删除当前行数据
+ // props.table.deleteTableRowsByIndex(tableId, data.successIndexs);
+ deleteTableRowsByRowIds.call(this,{props,data,rowIds,tableId});
+ //删除缓存数据
+ if(data.successPKs){
+ // props.table.deleteCacheId(tableId, data.successPKs);
+ deleteCachePKAndTS.call(this,{props,tableId,successPKs:data.successPKs,checkedRows:delObjs,pkId:'pk_bill',pkname});
+ }
+ //列表控制按钮
+ this.onSelected();
+ }
+ }
+ }
+ });
+ // }
+ }
+ });
+
+ break;
+ case headButton.MadeBill: //制单
+ madeBill(
+ this,
+ props,
+ this.props.table.getCheckedRows(this.tableId,false),
+ 'pk_paybill',
+ props.getSearchParam('c'),
+ true
+ );
+ break;
+ case headButton.BillLinkQuery: //联查单据
+ let selectInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ this.Info.pk_bill = selectInfo.data.values.pk_paybill.value;
+ this.Info.pk_tradetype = selectInfo.data.values.pk_tradetype.value;
+ this.setState({
+ showBillTrack: true
+ });
+ break;
+ case headButton.LinkInvoice: //发票查看
+ if (!moduleEnable(this, IMAG)) { //校验关联模块是否启用
+ return;
+ }
+ this.setState({ showSSCmodule: true });
+ let InvoiceInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ const billId = InvoiceInfo.data.values.pk_paybill.value;
+ const billtype = InvoiceInfo.data.values.pk_billtype.value;
+ const billCode = InvoiceInfo.data.values.billno.value;
+ const pk_org = InvoiceInfo.data.values.pk_org.value;
+ const tradetype = InvoiceInfo.data.values.pk_tradetype.value;
+ const viewRandom = new Date().getTime();
+
+ this.setState({
+ sscivmInvoiceData: { billId, billtype, billCode, pk_org, tradetype, viewRandom }
+ });
+ break;
+ case headButton.LinkAprv: //审批详情
+ let LinkAprvData = this.props.table.getCheckedRows(this.tableId,false)[0];
+ if (LinkAprvData) {
+ this.Info.pk_bill = LinkAprvData.data.values.pk_paybill.value;
+ this.Info.pk_tradetype = LinkAprvData.data.values.pk_tradetype.value;
+ this.setState({
+ showApproveDetail: true
+ });
+ } else {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ }
+ break;
+ case headButton.ConnectSettleInfo: //关联结算信息
+ ajax({
+ url: '/nccloud/arap/arappub/validatecmp.do',
+ data: null,
+ success: (res) => {
+ if (res.success) {
+ pagecode = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ pagecode = code;
+ } else if (!pagecode) {
+ pagecode = tradeType;
+ }
+
+ openToIndepSettle({
+ props,
+ direction: "1",
+ pk_billtypecode:"F3",
+ rollbackAppcode: props.getSearchParam('c'),
+ rollbackPageCode: pagecode
+ })
+ }
+ }
+ });
+ break;
+ case headButton.LinkInformer: //到账通知
+ let InformerInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ ajax({
+ url: '/nccloud/arap/arappub/linkinformer.do',
+ data: Object.assign({
+ pk_bill: InformerInfo.data.values.pk_paybill.value,
+ billType: billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success && res.data) {
+ let length = res.data.length;
+ if (length == 1) {
+ props.openTo('/nccloud/resources/cmp/informer/LinkBill/card/index.html', {
+ appcode: '36070AISC',
+ pagecode: '36070AILLINK',
+ status: 'browse',
+ id: res.data
+ });
+ } else {
+ props.openTo('/nccloud/resources/cmp/informer/LinkBill/list/index.html', {
+ appcode: '36070AISC',
+ pagecode: '36070AICLINK',
+ status: 'browse',
+ ids: res.data
+ });
+ }
+ }
+ }
+ });
+ break;
+ case headButton.LinkBal: //联查余额表
+ let linkBalInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ arapLinkReport(
+ this.props,
+ linkBalInfo.data.values.pk_paybill.value,
+ billType,
+ linkBalInfo.data.values.objtype.value,
+ linkBalInfo.data.values.pk_org_v
+ );
+ break;
+ case headButton.LinkDeal: //联查处理情况
+ let dealInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ ajax({
+ url: '/nccloud/arap/arappub/linkdeal.do',
+ data: Object.assign({
+ pk_bill: dealInfo.data.values.pk_paybill.value,
+ ts: dealInfo.data.values.ts.value,
+ billType: billType
+ }, this.dataInSaga),
+ success: (res) => {
+ if (res.success) {
+ //打开处理情况模态框
+ let data = res.data;
+ //当前选中数据的第一行的交易类型和单据号,用于联查处理情况的模态框上面的显示
+ let checkedData = this.props.table.getCheckedRows(this.tableId,false)[0].data.values;
+ this.Info.combinedExaminationData = data;
+ this.Info.pk_tradetypeid = checkedData.pk_tradetypeid
+ ? checkedData.pk_tradetypeid.display
+ : null;
+ this.Info.billno = checkedData.billno ? checkedData.billno.value : null;
+
+ this.handleCombined();
+ }
+ }
+ });
+ break;
+ case headButton.LinkVouchar: //联查凭证
+ let voucharInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ linkvouchar(this, props, voucharInfo, voucharInfo.data.values.pk_paybill.value, props.getSearchParam('c'));
+ break;
+ case headButton.LinkConfer: //联查协同单据
+ let conferInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ ajax({
+ url: '/nccloud/arap/arappub/linkconfer.do',
+ async: false,
+ data: Object.assign({
+ pk_bill: conferInfo.data.values.pk_paybill.value,
+ billType: billType
+ }, this.dataInSaga),
+ success: (res) => {
+ let data = res.data;
+ if (data) {
+ props.openTo(data.url, data.condition);
+ }
+ }
+ });
+ break;
+ case headButton.LinkTbb: //联查计划预算
+ let tbbInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ ajax({
+ url: '/nccloud/arap/arappub/linktbb.do',
+ data: {
+ pk_bill: tbbInfo.data.values.pk_paybill.value,
+ billType: billType
+ },
+ success: (res) => {
+ this.Info.tbbLinkSourceData = res.data;
+ this.setState({
+ isTbbLinkshow: true
+ });
+ }
+ });
+ break;
+ case headButton.Print: //打印
+ let printData = this.props.table.getCheckedRows(this.tableId);
+ if (printData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ let pk_bills = [];
+ printData.forEach((val) => {
+ pk_bills.push(val.data.values ? val.data.values.pk_paybill.value : val.data.pk);
+ });
+ this.printData.oids = pk_bills;
+ this.printData.nodekey = 'card';
+ this.onPrint();
+ break;
+ case headButton.PrintList: //打印清单
+ printData = this.props.table.getCheckedRows(this.tableId);
+ pk_bills = [];
+ printData.forEach((val) => {
+ pk_bills.push(val.data.values ? val.data.values.pk_paybill.value : val.data.pk);
+ });
+ if (pk_bills.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ this.printData.oids = pk_bills;
+ this.printData.nodekey = 'list';
+ // printer(
+ // 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ // '/nccloud/arap/arappub/print.do', //后台服务url
+ // this.printData
+ // );
+ this.printPreviewBill(true);
+ break;
+ case headButton.Output: //打印输出
+ printData = this.props.table.getCheckedRows(this.tableId);
+ if (printData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ pk_bills = [];
+ printData.forEach((val) => {
+ pk_bills.push(val.data.values ? val.data.values.pk_paybill.value : val.data.pk);
+ });
+ this.outputData.oids = pk_bills;
+ this.outputData.nodekey = 'card';
+ this.printOutput();
+ break;
+ case headButton.OutputList: //输出清单
+ printData = this.props.table.getCheckedRows(this.tableId);
+ if (printData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ pk_bills = [];
+ printData.forEach((val) => {
+ pk_bills.push(val.data.values ? val.data.values.pk_paybill.value : val.data.pk);
+ });
+ this.outputData.oids = pk_bills;
+ this.outputData.nodekey = 'list';
+ this.printOutput();
+ break;
+ case headButton.OfficalPrint: //正式打印
+ printData = this.props.table.getCheckedRows(this.tableId);
+ if (printData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ pk_bills = [];
+ printData.forEach((val) => {
+ let pkBill = val.data.values ? val.data.values.pk_paybill.value : val.data.pk;
+ pk_bills.push(pkBill+"_"+val.index);
+ });
+ this.printData.oids = pk_bills;
+ this.printData.nodekey = 'card';
+ this.officalPrintOutput();
+ break;
+ case headButton.CancelPrint: //取消正式打印
+ printData = this.props.table.getCheckedRows(this.tableId);
+ if (printData.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ pk_bills = [];
+ printData.forEach((val) => {
+ let pkBill = val.data.values ? val.data.values.pk_paybill.value : val.data.pk;
+ pk_bills.push(pkBill+"_"+val.index);
+ });
+ this.printData.oids = pk_bills;
+ this.printData.nodekey = 'card';
+ this.cancelPrintOutput();
+ break;
+ case headButton.ExportData: //导出
+ if (this.state.forceRender) {
+ this.setState({ forceRender: false })
+ }
+ let outputData = this.props.table.getCheckedRows(this.tableId);
+ pk_bills = [];
+ outputData.forEach((val) => {
+ pk_bills.push(val.data.values ? val.data.values.pk_paybill.value : val.data.pk);
+ });
+ if (pk_bills.length == 0) {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ this.Info.selectedPKS = pk_bills; //传递主键数组,之前nc需要导出的加主键
+ this.props.modal.show('exportFileModal'); //不需要导出的只执行这行代码
+ break;
+ case headButton.Refresh: //刷新
+ let data = getDefData(searchId, dataSource);
+ if (data) {
+ data.queryInfo.pageInfo = this.props.table.getTablePageInfo(this.tableId);//重新获取分页信息
+ ajax({
+ url: '/nccloud/arap/paybill/queryscheme.do',
+ data: Object.assign(data, this.dataInSaga),
+ success: (res) => {
+ let { success, data } = res;
+ if (success) {
+ if (data) {
+ toast({ color: 'success', title: this.state.json['paybill-000051'] }); /* 国际化处理: 刷新成功*/
+ this.props.table.setAllTableData(this.tableId, data[this.tableId]);
+ setDefData(this.tableId, dataSource, data); //放入缓存
+ this.onSelected();
+ } else {
+ toast({ color: 'success', title: this.state.json['paybill-000051'] }); /* 国际化处理: 刷新成功*/
+ this.props.table.setAllTableData(this.tableId, { rows: [] });
+ }
+
+ }
+ }
+ });
+ }else if ('browse' == this.props.getUrlParam('status')&&'fip' == this.props.getUrlParam('scene')) {
+ //联查
+ linkSourceList(this.props, this.tableId);
+ } else {
+ toast({ color: 'success', title: this.state.json['paybill-000051'] }); /* 国际化处理: 刷新成功*/
+ this.props.table.setAllTableData(this.tableId, { rows: [] });
+ }
+ break;
+ case headButton.ReceiptCheck: //影像查看pk_tradetype
+ if (!moduleEnable(this, IMAG)) { //校验关联模块是否启用
+ return;
+ }
+ let CheckInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+
+ var billInfoMap = {};
+
+ //基础字段 单据pk,单据类型,交易类型,单据的组织
+ billInfoMap.pk_billid = CheckInfo.data.values.pk_paybill.value;
+ billInfoMap.pk_billtype = CheckInfo.data.values.pk_billtype.value;
+ billInfoMap.pk_tradetype = CheckInfo.data.values.pk_tradetype.value;
+ billInfoMap.pk_org = CheckInfo.data.values.pk_org.value;
+ imageView(billInfoMap, 'iweb');
+ break;
+ case headButton.ReceiptScan: //影像扫描
+ if (!moduleEnable(this, IMAG)) { //校验关联模块是否启用
+ return;
+ }
+ let ScanInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+
+ var billInfoMap = {};
+
+ //基础字段 单据pk,单据类型,交易类型,单据的组织
+ billInfoMap.pk_billid = ScanInfo.data.values.pk_paybill.value;
+ billInfoMap.pk_billtype = ScanInfo.data.values.pk_billtype.value;
+ billInfoMap.pk_tradetype = ScanInfo.data.values.pk_tradetype.value;
+ billInfoMap.pk_org = ScanInfo.data.values.pk_org.value;
+
+ //影像所需 FieldMap
+ billInfoMap.BillType = ScanInfo.data.values.pk_tradetype.value;
+ billInfoMap.BillDate = ScanInfo.data.values.creationtime.value;
+ billInfoMap.Busi_Serial_No = ScanInfo.data.values.pk_paybill.value;
+ // billInfoMap.pk_billtype = billdata.head.head.rows[0].values.pk_billtype.value;
+ billInfoMap.OrgNo = ScanInfo.data.values.pk_org.value;
+ billInfoMap.BillCode = ScanInfo.data.values.billno.value;
+ billInfoMap.OrgName = ScanInfo.data.values.pk_org_v.display;
+ billInfoMap.Cash = ScanInfo.data.values.money.value;
+ imageScan(billInfoMap, 'iweb');
+ break;
+ case headButton.AttachManage:
+ let AttachInfo = getFirstCheckedData.call(this,this.props, this.tableId);
+ this.Info.pk_bill = AttachInfo.data.values.pk_paybill.value;
+ this.Info.billno = AttachInfo.data.values.billno.value;
+ //设置付款框左侧分组
+ setBillConfig(this);
+ this.setState({
+ showUploader: true,
+ target: null
+ });
+ break;
+ case headButton.AllocperiodruleLinkQuery:
+ ListAllocperiodruleLinkQuery(this);
+ break;
+ default:
+ let transferInfo = getTransferInfo(this, id);
+ if (transferInfo) {
+ ajax({
+ url: '/nccloud/arap/arappub/queryrelatedapp.do',
+ data: {
+ billType: transferInfo.src_billtype,
+ transTypes: transferInfo.transtypes
+ },
+ success: (res) => {
+ if (res) {
+ //将业务流程放入缓存
+ setDefData(
+ transferInfo.src_billtype + transferInfo.transtypes[0],
+ 'transfer.dataSource',
+ transferInfo.busitypes
+ );
+ let dest_tradetype = getDefData('sessionTradeType', dataSource);
+ if (code) {
+ dest_tradetype = code;
+ } else if (!dest_tradetype) {
+ dest_tradetype = tradeType;
+ }
+ let url = '/' + transferInfo.src_billtype;
+ props.pushTo(url, {
+ //appcode:res.data.appcode,
+ src_appcode: res.data.appcode,
+ src_tradetype: transferInfo.transtypes[0], //来源交易类型
+ dest_billtype: billType,
+ dest_tradetype: dest_tradetype
+ });
+ }
+ }
+ });
+ }
+ break;
+ }
+}
+
+//获取选中数据的第一行,选中多行的时候只取第一行数据
+let getFirstCheckedData = function (props, tableId) {
+ let checkedData = props.table.getCheckedRows(tableId,false);
+ let checkedObj;
+ if (checkedData.length > 0) {
+ checkedObj = checkedData[0];
+ } else {
+ toast({ color: 'warning', content: this.state.json['paybill-000029'] }); /* 国际化处理: 请选中一行数据!*/
+ return;
+ }
+ return checkedObj;
+};
+
+//获取选中数据的id和billType
+let getAllCheckedData = function (props, tableId, billType) {
+ let checkedData = props.table.getCheckedRows(tableId);
+ let checkedObj = [];
+ checkedData.forEach((val) => {
+ checkedObj.push(Object.assign({
+ pk_bill: val.data.values ? val.data.values.pk_paybill.value : val.data.pk,
+ billno: val.data.values?val.data.values.billno.value:val.data.billno,
+ ts: val.data.values ? val.data.values.ts.value : val.data.ts,
+ billType: billType,
+ index: val.index,
+ rowid:val.data&&val.data.rowid?val.data.rowid:'',
+ pageId: props.getSearchParam('p')
+ }, this.dataInSaga));
+ });
+ return checkedObj;
+};
+
+let commitOpreration = function (that, props, tableId, billType, actionType) {
+ let commitParams = getAllCheckedData.call(that, props, tableId, billType);
+ if (commitParams.length == 0) {
+ toast({ color: 'warning', content: that.state.json['paybill-000012'] }); /* 国际化处理: 请选中至少一行数据!*/
+ return;
+ }
+ let ajaxUrl = '';
+ if (actionType == headButton.Commit) {
+ ajaxUrl = '/nccloud/arap/arappub/batchcommit.do';
+ } else if (actionType == headButton.Uncommit) {
+ ajaxUrl = '/nccloud/arap/arappub/batchuncommit.do';
+ }
+ if (commitParams.length == 1 && actionType == headButton.Commit) {
+ let checkedRows=props.table.getCheckedRows(tableId);
+ //单条的时候走单条的处理
+ that.Info.tipUrl = '/nccloud/arap/arappub/commit.do';
+ that.Info.record = checkedRows[0].data.values?checkedRows[0].data.values:checkedRows[0].data;
+ that.Info.record.numberindex = { scale: 0, value: commitParams[0].index + 1 };
+ that.commitAndUncommit();
+ return;
+ }
+
+ ajax({
+ url: ajaxUrl,
+ data: commitParams,
+ success: (res) => {
+ let { success, data } = res;
+ if (success) {
+ // if (data.grid) {
+ // let grid = data.grid;
+ // let updateValue = [];
+ // for (let key in grid) {
+ // updateValue.push({ index: key, data: { values: grid[key].values } });
+ // }
+ // props.table.updateDataByIndexs(tableId, updateValue);
+
+ // props.table.selectAllRows(tableId, false) //由于平台没支持跨页 操作后updateDataByIndexs 取消跨页勾选,此处自己调一次全部取消勾选
+ // }
+ if(data&&data.grid){
+ updateTableDataTs.call(that,{props,data,tableId});
+ }
+ if (data.message) {
+ toast({
+ duration: 'infinity',
+ color: data.PopupWindowStyle,
+ content: data.message
+ });
+ that.onSelected();
+ }
+ }
+ }
+ });
+};
+
+
+/**
+ * qinwef 2022-0211
+ * 加载附件管理左侧分组
+ */
+function setBillConfig(that) {
+ let selectInfo = getFirstCheckedData.call(that,that.props, that.tableId);
+ let billPK = selectInfo.data.values.pk_paybill.value;
+ let billno = selectInfo.data.values.billno.value;
+ let billType = selectInfo.data.values.pk_billtype.value;
+ let nowBillTypeName = that.state.json['paybill-000064'];
+ // if(billno!=null&&billno!='undefined'&&billno!='null'&&billno!=''){
+ // nowBillTypeName=nowBillTypeName+billno;
+ // }
+ //初始设置:主单据
+ that.Config.billConfig = [{
+ billId: billPK,
+ folderName: nowBillTypeName,
+ disableButton:JSON.stringify( ["fs_group_delete","fs_group_edit"]),
+ showtype: "SHOWTYPE20"
+ },{
+ billId:billPK+"/"+that.state.json['paybill-000066'],
+ folderName: that.state.json['paybill-000066'],
+ disableButton: JSON.stringify( ["fs_group_add","fs_group_delete","fs_group_edit","fs_delete","fs_move","fs_edit","fs_upload"]),
+ showtype: "SHOWTYPE40"
+ }];
+
+ //进行单据追溯,查询上游单据
+ let datas = {
+ "queryCondition": {
+ "bill_PK": billPK,
+ "bill_type": billType
+ }
+ };
+ ajax({
+ url: '/nccloud/baseapp/riart/billFlow/billFlowAction.do',
+ data: datas,
+ async:false,
+ success: (res) => {
+ let upBillInfo = res.data;
+ let upBillIdList = [];
+ let upBillTypeMap = new Map();
+ let upBillTypeNameMap = new Map();
+ let upBillnoMap = new Map();
+ let upForwardMap = new Map();
+ if (upBillInfo != null && upBillInfo.length > 0) {
+ for (let i = 0; i < upBillInfo.length; i++) {
+ let isForward = upBillInfo[i].isForward;
+ let billId = upBillInfo[i].lightBillVO.billID;
+ let billTypeName = upBillInfo[i].lightBillVO.billTypeName;
+ let billType = upBillInfo[i].lightBillVO.billType;
+ let billno= upBillInfo[i].lightBillVO.billCode;
+ if (billId != null&&billPK!=billId&&isForward<0) {
+ upBillIdList.push(billId);
+ upBillTypeMap.set(billId, billType);
+ upBillTypeNameMap.set(billId, billTypeName);
+ upBillnoMap.set(billId,billno);
+ upForwardMap.set(isForward);
+ }
+ }
+ }
+ if (upBillIdList != null && upBillIdList.length > 0) {
+ for(let j=0;j {
+ if (data.context.paramMap != null&&data.context.paramMap.transtype_name&&data.context.paramMap.pk_transtype){
+
+ props.search.setSearchValByField(searchId, 'pk_tradetypeid', { display: data.context.paramMap.transtype_name, value: data.context.paramMap.pk_transtype });
+ }
+ });
+ modifierSearchMetas(searchId, props, meta, billType,data.context.paramMap?data.context.paramMap.transtype:null, that);
+ }
+
+ if (data.context) {
+ // 初始化上下文变量
+ loginContext(data.context);
+ if(getContext(loginContextKeys.transtype)){
+ if (that.refs.tradetypeBtn) {
+ that.refs.tradetypeBtn.setVisible(false);
+ }
+ }
+ }
+ if(callback){
+ callback()
+ }
+
+
+ }
+ }
+ )
+}
+
+
+function modifierMeta(that,props, meta,lineButton) {
+ meta[tableId].items = meta[tableId].items.map((item, key) => {
+ if (item.attrcode == 'billno') {
+ item.render = (text, record, index) => {
+ return (
+ {
+ let searchVal = props.search.getAllSearchData(searchId);
+ if (searchVal) {
+ setDefData(searchKey, dataSource, searchVal);
+ }
+ if (props.getUrlParam("scene") == 'linksce' || props.getUrlParam("scene") == 'fip') {
+ props.pushTo('/card', {
+ status: 'browse',
+ id: record.pk_paybill.value,
+ pagecode:'20080EBM_CARD_LINK',
+ scene:'linksce'
+ })
+ }else{
+ props.pushTo('/card', {
+ status: 'browse',
+ id: record.pk_paybill.value,
+ pagecode:record.pk_tradetype.value,
+ })
+ }
+ }}
+ >
+ {record.billno && record.billno.value}
+
+ );
+ };
+ }
+ return item;
+ });
+ //添加操作列
+ meta[tableId].items.push({
+ label: that.state.json['paybill-000007'],/* 国际化处理: 操作*/
+ itemtype: 'customer',
+ attrcode: 'opr',
+ width: OperationColumn,
+ visible: true,
+ fixed: 'right',
+ render: (text, record, index) => {
+ let buttonAry = lineButton ? lineButton : [];
+ let trueBtn = [];
+ for (let i = 0; i < buttonAry.length; i++) {
+ let flag = buttonVisible('browse', record, buttonAry[i]);
+ if (flag) {
+ trueBtn.push(buttonAry[i]);
+ }
+ }
+
+ return props.button.createOprationButton(trueBtn, {
+ area: "list_inner",
+ buttonLimit: 3,
+ onButtonClick: (props, key) => tableButtonClick(that,props, key, text, record, index)
+ });
+
+ }
+
+ });
+ return meta;
+}
+
+function getTradeType(){
+ let cacheTradeType = getDefData('sessionTradeType', dataSource);
+ if (cacheTradeType != null && cacheTradeType != undefined) {
+ return cacheTradeType;
+ } else {
+ return tradeType;
+ }
+}
+
+/*pmFWCFu5nhKkBzYmrkBakYqb4t+QDKrWy/miWT3MDKY=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/events/pageInfoClick.js b/src/arap/paybill/paybill/list/events/pageInfoClick.js
new file mode 100644
index 0000000..b3984be
--- /dev/null
+++ b/src/arap/paybill/paybill/list/events/pageInfoClick.js
@@ -0,0 +1,31 @@
+/*j07c8riwYnz20MYibuDbtKRzyoQHuVaQOXRyHJYcGsY=*/
+import {ajax} from 'nc-lightapp-front';
+import { tableId} from '../constants';
+
+export default function (props, config, pks) {
+ let that = this;
+ if(!pks || pks.length == 0){
+ return ;
+ }
+ let data = {
+ pk_bills: pks,
+ pageId: props.getSearchParam('p')
+ };
+ ajax({
+ url: '/nccloud/arap/paybill/querygridbyids.do',
+ data: data,
+ success: function (res) {
+ let { success, data } = res;
+ if (success) {
+ if (data) {
+ props.table.setAllTableData(tableId, data[tableId]);
+ } else {
+ props.table.setAllTableData(tableId, { rows: [] });
+ }
+ }
+ that.onSelected();
+ }
+ });
+}
+
+/*j07c8riwYnz20MYibuDbtKRzyoQHuVaQOXRyHJYcGsY=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/events/searchBtnClick.js b/src/arap/paybill/paybill/list/events/searchBtnClick.js
new file mode 100644
index 0000000..59aebf4
--- /dev/null
+++ b/src/arap/paybill/paybill/list/events/searchBtnClick.js
@@ -0,0 +1,48 @@
+/*YuO8szH0cVixePu/Bt+mG6B82aSbGhMosB18vg69kDk=*/
+import {ajax,toast,cardCache} from 'nc-lightapp-front';
+import { tableId, searchId,dataSource} from '../constants';
+let {setDefData, getDefData } = cardCache;
+import { loginContext, getContext, loginContextKeys } from '../../../../public/components/arapInitInfo/loginContext';
+
+//点击查询,获取查询区数据
+export default function clickSearchBtn(props,searchVal) {
+ if(searchVal&&searchVal.conditions&&searchVal.conditions.length>0){
+ let transtype = getContext(loginContextKeys.transtype);
+ let pageInfo = props.table.getTablePageInfo(this.tableId);
+ let queryInfo = props.search.getQueryInfo(this.searchId);
+ queryInfo.pageInfo = pageInfo;
+ let data = {
+ pageId: props.getSearchParam('p'),
+ queryInfo:queryInfo,
+ tradeType:transtype
+ };
+ setDefData(searchId, dataSource, data);//放入缓存
+ ajax({
+ url: '/nccloud/arap/paybill/queryscheme.do',
+ data: data,
+ success: (res) => {
+ let { success, data } = res;
+ if (success) {
+ if(data){
+ let num = data[this.tableId]?data[this.tableId].allpks:data['bodys'].allpks;//第二种场景是浏览器刷新props.getSearchParam('p')获取异常
+ let tableDate = data[this.tableId]?data[this.tableId]:data['bodys'];
+ toast({ color: 'success', content: this.state.json['paybill-000015']+num.length+this.state.json['paybill-000016'] });/* 国际化处理: 查询成功,共,条*/
+ this.props.table.setAllTableData(this.tableId, tableDate);
+
+ this.props.table.selectAllRows(this.tableId, false)
+
+ setDefData(this.tableId, dataSource, data);//放入缓存
+ this.onSelected()
+ }else{
+ toast({ color: 'warning', content: this.state.json['paybill-000017'] });/* 国际化处理: 未查询出符合条件的数据*/
+ this.props.table.setAllTableData(this.tableId, {rows:[]});
+ }
+
+ }
+ }
+ });
+ }
+
+};
+
+/*YuO8szH0cVixePu/Bt+mG6B82aSbGhMosB18vg69kDk=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/events/tableButtonClick.js b/src/arap/paybill/paybill/list/events/tableButtonClick.js
new file mode 100644
index 0000000..6059a31
--- /dev/null
+++ b/src/arap/paybill/paybill/list/events/tableButtonClick.js
@@ -0,0 +1,93 @@
+/*0GI1xcoeligdpMeXoHBphrnqLawXs2pmyhj4kEvBMik=*/
+import { ajax, toast ,promptBox} from 'nc-lightapp-front';
+import { billType, tableId } from '../constants';
+import { innerButton } from '../../../../public/components/pubUtils/buttonName.js';
+import madeBill from '../../../../public/components/madeBill.js';
+export default function (that,props, key, text, record, index) {
+ switch (key) {
+ case innerButton.Edit_inner:
+ ajax({
+ url: '/nccloud/arap/arappub/edit.do',
+ data: {
+ pk_bill: record.pk_paybill.value,
+ billType: billType,
+ ts: record.ts.value
+ },
+ success: (res) => {
+ if (res.success) {
+ let src ='';
+ if(res.data&&res.data.isFrom36S3){
+ src ='36S3';
+ }
+ if (props.getUrlParam("scene") == 'linksce' || props.getUrlParam("scene") == 'fip') {
+ props.pushTo('/card', {
+ status: 'edit',
+ id: record.pk_paybill.value,
+ pagecode:'20080EBM_CARD_LINK',
+ scene:'linksce',
+ srcFrom36S3:src
+ })
+ }else{
+ props.pushTo('/card', {
+ status: 'edit',
+ id: record.pk_paybill.value,
+ pagecode:record.pk_tradetype.value,
+ srcFrom36S3:src
+ })
+ }
+ }
+ }
+ });
+ break;
+ case innerButton.Delete_Inner:
+ that.Info.pk_bill = record.pk_paybill.value
+ that.Info.ts = record.ts.value
+ that.Info.index = index;
+ that.delConfirm();
+ break;
+ case innerButton.Copy_inner:
+ if (props.getUrlParam("scene") == 'linksce' ||props.getUrlParam("scene") == 'fip') {
+ props.pushTo('/card', {
+ status: 'add',
+ id: record.pk_paybill.value,
+ type: 'copy',
+ pagecode:'20080EBM_CARD_LINK',
+ scene:'linksce'
+ })
+ }else{
+ if(record.objtype.value == '0'&&record.isrefund&&record.isrefund.value ){
+ toast({ color: 'danger', content: that.state.json['paybill-000056'] }); /* 国际化处理:退款付款单不能执行该操作!*/
+ return true;
+ }
+ props.pushTo('/card', {
+ status: 'add',
+ id: record.pk_paybill.value,
+ type: 'copy',
+ pagecode:record.pk_tradetype.value,
+ })
+ }
+ break;
+ case innerButton.Commit_inner:
+ that.Info.tipUrl = '/nccloud/arap/arappub/commit.do';
+ that.Info.record = record;
+ that.commitAndUncommit();
+ break;
+ case innerButton.Uncommit_inner:
+ that.Info.tipUrl = '/nccloud/arap/arappub/uncommit.do';
+ that.Info.record = record;
+ that.commitAndUncommit();
+ break;
+ case innerButton.MadeBill_inner://制单
+ let madeData = [{
+ pk_bill: record.pk_paybill.value,
+ billType: billType,
+ tradeType: record.pk_tradetype.value,
+ }]
+ madeBill(that,props,madeData,'',props.getSearchParam('c'));
+ break;
+ default:
+ break;
+ }
+};
+
+/*0GI1xcoeligdpMeXoHBphrnqLawXs2pmyhj4kEvBMik=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/list/index.js b/src/arap/paybill/paybill/list/index.js
new file mode 100644
index 0000000..93bfd30
--- /dev/null
+++ b/src/arap/paybill/paybill/list/index.js
@@ -0,0 +1,833 @@
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
+//主子表列表
+
+import React, { Component } from 'react';
+import { createPage, ajax, base, high, print, toast, cardCache, cacheTools, getMultiLang } from 'nc-lightapp-front';
+import { buttonClick, initTemplate, searchBtnClick, pageInfoClick, tableModelConfirm, doubleClick } from './events';
+import {
+ getButtonsKey,
+ onListButtonControl
+} from '../../../public/components/pubUtils/buttonvisible.js';
+import { tableId, searchId, nodekey, billType, dataSource, pkname, searchKey, tradeType } from './constants';
+import CombinedExaminationModel from '../../../public/components/combinedExaminationModel'; //联查处理情况
+import linkSourceList from '../../../public/components/linkSourceList.js';
+import Inspection from 'epmp/exports/components/Inspection';
+import ApproveDetail from 'uap/common/components/ApproveDetail';
+import NCUploader from 'uap/common/components/NCUploader';
+const { NCDiv } = base;
+let { BillTrack, PrintOutput} = high;
+let { setDefData, getDefData, getCacheById, getCurrentLastId } = cardCache;
+import { getContext, loginContextKeys } from '../../../public/components/arapInitInfo/loginContext';
+import TradeTypeButton from '../../../public/components/tradetype'; //交易类型按钮
+import '../../../public/less/tradetype.less';
+import afterEvent from '../../../public/components/searchAreaAfterEvent'; //查询区编辑后事件
+import InvoiceLink from 'sscivm/ivmpub/components/invoice-link'
+import ExcelOutput from 'uap/common/components/ExcelOutput';
+import ApprovalTrans from 'uap/common/components/approvalTrans';
+import {listSocketConnect} from '../../../public/components/pubUtils/MicroServiceSocket.js';
+import { extendArea, getInitdata } from '../../../public/components/tradetypeToEmptyArea/listEmptyArea';
+import {updateTableRecordTs} from '../../../public/components/updateTableDataTs';
+import poc from 'uap/common/components/printOnClient';
+const {printPreview, printOnClient, PubSub, printerView, printOnClientByMoreTem} = poc;
+
+class List extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ checkedTradetype:'',//手动选中的交易类型
+ isCombinedExaminationModelShow: false, //联查处理情况模态框
+ isTbbLinkshow: false, //控制联查执行预算的模态框
+ showBillTrack: false, //单据追溯模态框显示的状态
+ showApproveDetail: false, //是否显示审批详情模态框
+ showUploader: false, //附件管理
+ target: null, //附件管理
+ compositedisplay: false,
+ json: {},
+ forceRender: true,//导出模板懒加载,true为不加载,false为加载
+ sscivmInvoiceData: {}, //联查发票
+ tradeNames: [], //空指引--交易类型
+ buttons: [], //空指引--按钮
+ showSSCmodule: false
+ };
+ this.printData = {
+ billtype: billType, //单据类型
+ appcode: props.getSearchParam('c') ? props.getSearchParam('c') : props.getUrlParam('c'), //功能节点编码,即模板编码
+ nodekey: nodekey, //模板节点标识
+ oids: null, // 功能节点的数据主键
+ userjson: billType, //单据类型,billtype不是必需字段,后台没有设置接收字段,以userjson代替
+ funcode:props.getSearchParam('c') ? props.getSearchParam('c') : props.getUrlParam('c')
+ };
+ this.outputData = {
+ billtype: billType, //单据类型
+ funcode: props.getSearchParam('c') ? props.getSearchParam('c') : props.getUrlParam('c'), //功能节点编码,即模板编码 \
+ appcode: props.getSearchParam('c') ? props.getSearchParam('c') : props.getUrlParam('c'), //功能节点编码,即模板编码
+ nodekey: nodekey, //模板节点标识
+ oids: null, // 功能节点的数据主键
+ userjson: billType, //单据类型,billtype不是必需字段,后台没有设置接收字段,以userjson代替
+ outputType: 'output'
+ };
+ this.searchId = searchId;
+ this.tableId = tableId;
+ this.billType = billType;
+ this.pkname = pkname;
+ this.pageId = props.getSearchParam('p');
+ let { search } = this.props;
+ let { setSearchValByField, getAllSearchData } = search;
+ this.setSearchValByField = setSearchValByField; //设置查询区某个字段值
+ this.getAllSearchData = getAllSearchData; //获取查询区所有字段数据
+ this.Info = {
+ allButtonsKey: [], //保存所有头部按钮
+ tbbLinkSourceData: null, //联查执行预算的数据
+ combinedExaminationData: [], //联查处理情况模态框表格数据
+ pk_tradetypeid: null, //当前选中第一行行的交易类型
+ pk_tradetype: null, //当前选中第一行行的交易类型code
+ billno: null, //当前选中第一行的单据号
+ billCode: '', // 发票号
+ pk_bill: null, //当前选中第一行的主键pk
+ ts: null,
+ selectedPKS: [], //导出数据的主键pk
+ tipContent: '', //提示框Content
+ tipUrl: null, //提示框二次交互的url
+ exType: null, //异常类型,现为三种(1,2,3)
+ record: null, //点提交时当前行数据
+ flag: false, //提交收回异常交互参数值,默认为false
+ index: null, //当前选中行的序号
+ compositedata: null //指派信息处理
+ };
+ this.dataInSaga = { //用于saga里面的busiinfo
+ appcode: props.getSearchParam('c') ? props.getSearchParam('c') : null,
+ pagecode: props.getSearchParam('p') ? props.getSearchParam('p') : null,
+ butncode: null
+ }
+ this.Config= {
+ billConfig:[]
+ };
+ props.use.table(tableId);
+ props.use.search(searchId);
+ }
+
+ componentWillReceiveProps(nextProps) { }
+
+ componentWillMount() {
+ if (getDefData('scene', dataSource) == 'bz') {
+ this.dealBzScence();
+ } else {
+ let callback = (json) => {
+ this.setState({ json: json }, () => {
+ initTemplate.call(this, this.props, this.initShow);
+ });
+ };
+ getMultiLang({ moduleId: ['paybill', 'public'], domainName: 'arap', currentLocale: 'simpchn', callback });
+ }
+ }
+
+ //在第一次渲染后调用
+ componentDidMount() {
+ getInitdata(this, dataSource, billType, tradeType, this.state);
+ }
+
+ getPagecode = () => {
+ let pagecode = null;
+ if (this.props.getUrlParam('scene') || this.props.getSearchParam('p') == '20080EBM_LIST_LINK') {
+ if (!this.props.getUrlParam('scene')) {
+ ////浏览器的刷新可能导致场景丢失,这里自己塞一次
+ this.props.setUrlParam({ scene: 'linksce' });
+ }
+ pagecode = '20080EBM_LIST_LINK';
+ } else {
+ pagecode = '20080EBM_LIST';
+ }
+ return pagecode;
+ };
+
+ initShow = () => {
+ this.onSelected(); //缓存不存在,就控制按钮
+ if (!this.props.table.hasCacheData(dataSource)) {
+
+ if (this.props.getUrlParam('src') == 'widget') {
+ let RecToDoSearchVO = cacheTools.get('F3widget');
+ let pageInfo = this.props.table.getTablePageInfo(this.tableId);
+ let queryInfo = {
+ pageInfo: pageInfo,
+ queryAreaCode: this.searchId, //查询区编码
+ oid: '0001Z31000000005PSYI',
+ querytype: 'tree'
+ };
+ let data = {
+ pageId: this.props.getSearchParam('p'),
+ queryInfo: queryInfo,
+ toDoSearchVO: RecToDoSearchVO
+ };
+ ajax({
+ url: '/nccloud/arap/paybill/querywidget.do',
+ data: data,
+ success: (res) => {
+ let { data } = res;
+ if (data) {
+ this.props.table.setAllTableData(this.tableId, data[this.tableId]);
+ } else {
+ toast({ color: 'warning', content: this.state.json['paybill-000017'] }); /* 国际化处理: 未查询到数据*/
+ this.props.table.setAllTableData(this.tableId, { rows: [] });
+ }
+ setDefData(this.tableId, dataSource, data); //放入缓存
+ }
+ });
+ } else if (this.props.getUrlParam('src') == 'widgetconfer') {
+ let PayConferSearchVO = cacheTools.get('F3widgetconfer');
+ let pageInfo = this.props.table.getTablePageInfo(this.tableId);
+ let queryInfo = {
+ pageInfo: pageInfo,
+ queryAreaCode: this.searchId, //查询区编码
+ oid: '0001Z31000000005PSYI',
+ querytype: 'tree'
+ };
+ let data = {
+ pageId: this.props.getSearchParam('p'),
+ queryInfo: queryInfo,
+ arapConferSearchVO: PayConferSearchVO
+ };
+ ajax({
+ url: '/nccloud/arap/paybill/queryconferwidget.do',
+ data: data,
+ success: (res) => {
+ let { data } = res;
+ if (data) {
+ this.props.table.setAllTableData(this.tableId, data[this.tableId]);
+ } else {
+ toast({ color: 'warning', content: this.state.json['paybill-000017'] }); /* 国际化处理: 未查询到数据*/
+ this.props.table.setAllTableData(this.tableId, { rows: [] });
+ }
+ setDefData(this.tableId, dataSource, data); //放入缓存
+ }
+ });
+ } else if ('browse' == this.props.getUrlParam('status')) {
+ if ('fip' == this.props.getUrlParam('scene')||'linksce' == this.props.getUrlParam('scene')) {
+ linkSourceList(this.props, this.tableId);
+ }
+ }
+ }
+ let isSwitchTradeType = getDefData('isSwitchTradeType', dataSource);
+ if (isSwitchTradeType) {
+ //如果卡片切换过交易类型的话,列表返回卡片需要重新刷新列表按钮
+ this.switchTemplate.call(this);
+ }
+ //控制联查期间按钮
+ let selectedData = this.props.table.getCheckedRows(this.tableId);
+ if(selectedData&&selectedData.length>0){
+ this.props.button.setButtonDisabled("AllocperiodruleLinkQuery", false);
+ }else{
+ this.props.button.setButtonDisabled("AllocperiodruleLinkQuery", true);
+ }
+ };
+
+ //处理报账平台返回到列表界面的场景
+ dealBzScence = () => {
+ let id = getCurrentLastId(dataSource);
+ if (id) {
+ let cardData = getCacheById(id, dataSource);
+ let pagecode = cardData.head.head.rows[0].values.pk_tradetype.value;
+ let pk_paybill = cardData.head.head.rows[0].values.pk_paybill.value;
+ this.props.pushTo('/card', {
+ status: 'browse',
+ id: pk_paybill,
+ pagecode: pagecode,
+ scene: 'bz'
+ });
+ } else {
+ this.props.pushTo('/card', {
+ status: 'browse',
+ pagecode: getDefData('pagecode', dataSource),
+ scene: 'bz'
+ });
+ }
+ };
+
+ //列表控制按钮
+ onSelected = () => {
+ onListButtonControl(this);
+ };
+
+ //联查处理情况按钮
+ handleCombined = () => {
+ this.setState({
+ isCombinedExaminationModelShow: true
+ }, () => {
+ if (this.state.isCombinedExaminationModelShow) {
+ this.child.modalOpen();
+ } else {
+ this.child.modalClose();
+ }
+ });
+ };
+ onRender = (ref) => {
+ this.child = ref;
+ };
+
+
+ //关闭联查执行预算的模态框
+ tbbLinkcancel() {
+ this.setState({
+ isTbbLinkshow: false
+ });
+ }
+ //打印
+ onPrint = () => {
+ // print(
+ // 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ // '/nccloud/arap/arappub/print.do', //后台服务url
+ // this.printData
+ // );
+ this.printPreviewBill();
+ };
+
+ //正式打印
+ officalPrintOutput = () => {
+ this.printData.userjson = billType+","+this.props.getSearchParam('p');
+ ajax({
+ url: '/nccloud/arap/arappub/officialPrint.do',
+ data: this.printData,
+ async: false,
+ success: (res) => {
+ if (res.success) {
+ // print(
+ // 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ // '/nccloud/arap/arappub/print.do', //后台服务url
+ // this.printData,
+ // false
+ // );
+ this.printPreviewBill();
+ if (res.data.grid) {
+ let grid = res.data.grid;
+ let updateValue = [];
+ for (let key in grid) {
+ updateValue.push({ index: key, data: { values: grid[key].values } });
+ }
+ this.props.table.updateDataByIndexs(tableId, updateValue);
+
+ this.props.table.selectAllRows(tableId, false) //由于平台没支持跨页 操作后updateDataByIndexs 取消跨页勾选,此处自己调一次全部取消勾选
+ this.onSelected();
+ }
+ }
+ }
+ });
+ };
+
+ //预览打印
+ printPreviewBill = (islist) => {
+ if(islist){
+ print(
+ 'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
+ '/nccloud/arap/arappub/print.do',
+ {
+ billtype:this.printData.billtype,
+ funcode: this.printData.funcode,
+ appcode: this.printData.appcode, //⼩应⽤编码
+ pageCode:this.props.getSearchParam('p'),
+ nodekey: this.printData.nodekey, //模板节点标识
+ oids: this.printData.oids,
+ type :'1',
+ sysType: '2'
+ },
+ false
+ );
+ }else{
+ printPreview(
+ this.props,
+ '/nccloud/arap/arappub/print.do',
+ {
+ billtype:this.printData.billtype,
+ funcode: this.printData.funcode,
+ appcode: this.printData.appcode, //⼩应⽤编码
+ pageCode:this.props.getSearchParam('p'),
+ nodekey: this.printData.nodekey, //模板节点标识
+ oids: this.printData.oids,
+ type :'1',
+ sysType: '1',
+ realData:'true_part'
+ },
+ true
+ )
+ }
+ }
+
+ //取消正式打印
+ cancelPrintOutput = () => {
+ this.printData.userjson = billType+","+this.props.getSearchParam('p');
+ ajax({
+ url: '/nccloud/arap/arappub/cancelPrint.do',
+ data: this.printData,
+ async: false,
+ success: (res) => {
+ if (res.success) {
+ if (res.data.grid) {
+ let grid = res.data.grid;
+ let updateValue = [];
+ for (let key in grid) {
+ updateValue.push({ index: key, data: { values: grid[key].values } });
+ }
+ this.props.table.updateDataByIndexs(tableId, updateValue);
+
+ this.props.table.selectAllRows(tableId, false) //由于平台没支持跨页 操作后updateDataByIndexs 取消跨页勾选,此处自己调一次全部取消勾选
+ }
+ //取消正式打印提示框
+ toast({ color: 'success', content: this.state.json['paybill-000072'] });
+ this.onSelected();
+ }
+ }
+ });
+ };
+
+ //打印输出
+ printOutput = () => {
+ this.refs.printOutput.open();
+ };
+ //输出成功回调函数
+ onSubmit() { }
+
+ //审批详情模态框控制
+ closeApprove = () => {
+ this.setState({
+ showApproveDetail: false
+ });
+ };
+
+ //提交和收回弹框点击取消
+ clearExType = () => {
+ this.Info.exType = null;
+ this.Info.flag = true;
+ this.Info.tipContent = '';
+ this.Info.tipUrl = '';
+ this.Info.compositedata = null;
+ if (this.state.compositedisplay) {
+ this.setState({ compositedisplay: false });
+ }
+ };
+
+ //提交and收回公共调用函数
+ commitAndUncommit = () => {
+ let tipUrl = this.Info.tipUrl;
+ let extype = this.Info.exType;
+ let flag = this.Info.flag;
+ let record = this.Info.record;
+ ajax({
+ url: tipUrl,
+ data:Object.assign({
+ pk_bill: record.pk_paybill&&record.pk_paybill.value?record.pk_paybill.value:record.pk,
+ ts: record.ts&&record.ts.value?record.ts.value:record.ts,
+ pageId: this.props.getSearchParam('p'),
+ billType: this.billType,
+ type: 1,
+ extype: extype,
+ flag: flag,
+ assignObj: this.Info.compositedata
+ },this.dataInSaga) ,
+ success: (res) => {
+ if (res.data.exType == '1') {
+ let content = res.data.message;
+
+ this.Info.tipContent = content;
+ this.Info.tipUrl = tipUrl;
+ this.Info.exType = '1';
+ this.Info.flag = true;
+
+ this.props.modal.show('commitAndUncommit');
+ return;
+ } else if (
+ res.data.workflow &&
+ (res.data.workflow == 'approveflow' || res.data.workflow == 'workflow')
+ ) {
+ this.Info.compositedata = res.data;
+ this.Info.tipUrl = tipUrl;
+ this.setState({ compositedisplay: true });
+ return;
+ }
+ if (res.success) {
+ this.clearExType();
+ if(tipUrl.indexOf("uncommit")!=-1){
+ toast({ color: 'success', content: this.state.json['paybill-000069'] }); /* 国际化处理: 收回成功*/
+ }else{
+ toast({ color: 'success', content: this.state.json['paybill-000068'] }); /* 国际化处理: 提交成功*/
+ }
+ //更新当前行数据
+ if(res.data&&res.data[this.tableId]){
+ updateTableRecordTs.call(this,{props:this.props,data:res.data,tableId:this.tableId,pkname});
+ }
+ // this.props.table.updateDataByIndexs(this.tableId, [
+ // { index: record.numberindex.value - 1, data: { values: res.data[this.tableId].rows[0].values } }
+ // ]);
+ this.onSelected();
+ }
+ }
+ });
+ };
+
+ delConfirm = (extype, flag) => {
+ ajax({
+ url: '/nccloud/arap/arappub/delete.do',
+ data: [
+ Object.assign({
+ pk_bill: this.Info.pk_bill,
+ ts: this.Info.ts,
+ billType: this.billType,
+ index: this.Info.index,
+ extype: extype,
+ flag: flag
+ },this.dataInSaga)
+ ],
+ success: (res) => {
+ let { success, data } = res;
+ if (success) {
+ if (data) {
+ if (res.data.exType == '1') {
+ this.Info.tipContent = res.data.message;
+ this.Info.exType = '1';
+ this.Info.flag = true;
+ this.props.modal.show('deleteCheck');
+ return;
+ } else {
+ toast({
+ color: data.PopupWindowStyle,
+ content: data.errMsg
+ });
+ //删除当前行数据
+ this.props.table.deleteTableRowsByIndex(this.tableId, data.successIndexs);
+ //删除缓存数据
+ this.props.table.deleteCacheId(this.tableId, data.successPKs);
+ //删行之后控制肩部按钮
+ this.onSelected();
+ this.clearExType();
+ }
+ }
+ }
+ }
+ });
+ };
+
+ //单据删除模态框确定按钮点击事件
+ deleteBillSureBtnClick = () => {
+ let exType = this.Info.exType;
+ let flag = this.Info.flag;
+ this.delConfirm(exType, flag);
+ };
+ // 附件的关闭点击
+ onHideUploader = () => {
+ this.setState({
+ showUploader: false
+ });
+ };
+
+ switchTemplate = (checkedTradetype) => {
+ //initTemplate.call(this, this.props);
+ let {tradeNames}=this.state;
+ let pagecode = this.getPagecode();
+ let appcode = this.props.getSearchParam('c') ? this.props.getSearchParam('c') : this.props.getUrlParam('c');
+ let tradetype = getDefData('sessionTradeType', dataSource);
+ if (!tradetype) {
+ tradetype = tradeType;
+ }
+ let isHasTradeName=false;
+ let new_tradeNames=[];
+ if(checkedTradetype){
+ tradeNames.forEach((item,index)=>{
+ if(item.code==checkedTradetype.code){
+ isHasTradeName=true;
+ }else{
+ new_tradeNames.push(item);
+ }
+ })
+ // if(!isHasTradeName){
+ new_tradeNames.unshift(checkedTradetype);
+ // }
+ this.setState({
+ tradeNames:new_tradeNames,
+ checkedTradetype:checkedTradetype
+ })
+ }
+ ajax({
+ url: '/nccloud/arap/arappub/queryallbtns.do',
+ data: {
+ appcode: appcode,
+ pagecode: pagecode,
+ tradetype: tradetype,
+ billtype: billType
+ },
+ success: (res) => {
+ let data = res.data;
+ if (data.button) {
+ let button = data.button;
+ this.Info.pullBillInfoVOAry = data.pullbillinfo;
+ getButtonsKey(button, this.Info.allButtonsKey); //获取所有按钮
+ this.props.button.setButtons(button);
+ }
+ }
+ });
+ };
+
+ // 查询区渲染完成回调函数
+ renderCompleteEvent = () => {
+ let cachesearch = getDefData(searchKey, dataSource);
+ if (cachesearch && cachesearch.conditions) {
+ // this.props.search.setSearchValue(this.searchId, cachesearch);
+ for (let item of cachesearch.conditions) {
+ if (item.field == 'billdate') {
+ // 时间类型特殊处理
+ let time = [];
+ time.push(item.value.firstvalue);
+ time.push(item.value.secondvalue);
+ this.props.search.setSearchValByField(this.searchId, item.field, {
+ display: item.display,
+ value: time
+ });
+ } else {
+ this.props.search.setSearchValByField(this.searchId, item.field, {
+ display: item.display,
+ value: item.value.firstvalue
+ });
+ }
+ }
+ }
+ };
+
+ dealGroupMoveList = (groupList) =>{
+ return groupList.filter( (item, index) => item.fullPath && item.fullPath.indexOf(this.Info.pk_bill)!=-1);
+ }
+
+ //处理附件分组:
+ dealGroupList =(list)=>{
+ let pk_bill=this.Info.pk_bill;
+ let tempList=list;
+ if(tempList!=null&&tempList.length>0){
+ for(let i=0;i0){
+ for(let j=0;j{
+ this.setState({
+ checkedTradetype:value
+ })
+ }
+ render() {
+ let { table, search, modal } = this.props;
+ let { createSimpleTable } = table;
+ let { NCCreateSearch } = search;
+ let { createModal } = modal;
+ let { showUploader, target } = this.state;
+ const { createBillHeadInfo } = this.props.BillHeadInfo;
+ return (
+
+ {listSocketConnect.call(this)}
+
+
+ {createBillHeadInfo({
+ title: this.props.getSearchParam('n')?this.props.getSearchParam('n'):this.state.json['paybill-000046'],//国际化处理: 付款单
+ initShowBackBtn: false,
+ })}
+
+
+ {/* {交易类型按钮,默认场景} */}
+ {!this.props.getUrlParam('scene') && !getContext(loginContextKeys.transtype) ? (
+
+ {TradeTypeButton({
+ ref: 'tradetypeBtn',
+ billtype: 'F3',
+ dataSource: dataSource,
+ switchTemplate: this.switchTemplate.bind(this),
+ propschil:this.props,
+ type:'list',
+ appcode: this.props.getSearchParam('c') ? this.props.getSearchParam('c') : this.props.getUrlParam('c'),
+ pagecode: this.props.getSearchParam('p') ? this.props.getSearchParam('p') : null
+ })}
+
+ ) : null}
+ {this.props.button.createButtonApp({
+ area: 'list_head',
+ buttonLimit: 3,
+ onButtonClick: buttonClick.bind(this),
+ popContainer: document.querySelector('.header-button-area')
+ })}
+
+
+
+ {NCCreateSearch(
+ this.searchId, //模块id
+ {
+ clickSearchBtn: searchBtnClick.bind(this), // 点击按钮事件
+ showAdvBtn: true, // 显示高级按钮
+ onAfterEvent: afterEvent.bind(this), //编辑后事件
+ renderCompleteEvent: this.renderCompleteEvent // 查询区渲染完成回调函数
+ }
+ )}
+
+
+ {createSimpleTable(this.tableId, {
+ fieldid: "paybill",
+ dataSource: dataSource,
+ pkname: pkname,
+ handlePageInfoChange: pageInfoClick.bind(this),
+ tableModelConfirm: tableModelConfirm,
+ onRowDoubleClick: doubleClick.bind(this),
+ showCheck: true,
+ showIndex: true,
+ onSelected: this.onSelected.bind(this),
+ onSelectedAll: this.onSelected.bind(this),
+ crossPageSelect:true,
+ selectedChange:(...params)=>{
+ this.onSelected.call(this)
+ },
+ high_selectable: {
+ enable: true //默认为true
+ },
+ // 框选
+ onBatchSelected: (...params) => {
+ this.onSelected.call(this)
+ },
+ componentInitFinished: () => {
+ this.onSelected();
+ },
+ renderEmptyText: () => {
+ return this.state.json['public-000291']/* 国际化处理: 当前页面暂无数据,这些操作将帮助你开始*/;
+ },
+ renderExtendZone: () => {
+ return extendArea.call(this,{dataSource, billType, tradeType, buttonClick,updateTradeType:this.updateTradeType})
+ }
+ })}
+
+ {/* 联查收付款协议 */}
+
+ {/* 单据追溯组件 */}
+
{
+ this.setState({ showBillTrack: false });
+ }}
+ pk={this.Info.pk_bill} //单据id
+ type={this.Info.pk_tradetype} //单据类型
+ />
+
+ {/* {审批详情} */}
+
+
+ {/* {打印输出} */}
+
+ {/* {导入} */}
+ {createModal('importModal', {
+ noFooter: true,
+ className: 'import-modal',
+ hasBackDrop: false
+ })}
+
+ {/* 联查计划预算 */}
+
+ {/* {联查发票} */}
+ {this.state.showSSCmodule ? (
+
+ ) : null}
+ {showUploader && (
+ {
+ return this.dealGroupMoveList(groupList);
+ }}
+ getGroupList = { (list) => {
+ return this.dealGroupList(list);
+ }}
+ />
+ )}
+ {/* 异常模态框 */}
+
+ {createModal('commitAndUncommit', {
+ title: this.state.json['paybill-000044'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 提示信息*/
+ content: this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve:()=>{
+ this.Info.flag = true
+ this.Info.exType=null
+ },
+ beSureBtnClick: this.commitAndUncommit.bind(this), //点击确定按钮事件
+ cancelBtnClick: this.clearExType.bind(this) //提交和收回取消事件
+ })}
+ {createModal('deleteCheck', {
+ title: this.state.json['paybill-000044'], //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 提示信息*/
+ content: this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom
+ closeModalEve:()=>{
+ this.Info.flag = true
+ this.Info.exType=null
+ },
+ beSureBtnClick: this.deleteBillSureBtnClick.bind(this) //点击确定按钮事件
+ })}
+ {/* 指派信息弹框 */}
+ {this.state.compositedisplay ? (
+
+ ) : null}
+
+
+ );
+ }
+}
+
+List = createPage({})(List);
+
+export default List;
+
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/main/config.json b/src/arap/paybill/paybill/main/config.json
new file mode 100644
index 0000000..e553988
--- /dev/null
+++ b/src/arap/paybill/paybill/main/config.json
@@ -0,0 +1,33 @@
+{
+ "dependjs": [
+ "../../../../sscivm/ivmpub/components/invoice-uploader/index.js",
+ "../../../../sscivm/ivmpub/components/invoice-link/index.js",
+ "../../../../sscrp/rppub/components/image/index.js",
+ "../../../../ampub/index.js",
+ "../../../../epmp/exports/components/Inspection/index.js",
+ "../../../../uap/common/components/ApproveDetail/index.js",
+ "../../../../uap/common/components/excelImportconfig/index.js",
+ "../../../../uap/common/components/ExcelOutput/index.js",
+ "../../../../uap/common/components/NCUploader/index.js",
+ "../../../../uap/common/components/approvalTrans/index.js",
+ "../../../../uap/common/components/ApproveDetail/index.js",
+ "../../../../sp/pub/utils/IndependentSettleUtil/index.js",
+ "../../../../uap/common/components/printOnClient/index.js"
+
+ ],
+ "dependModuleName": [
+ "sscivm/ivmpub/components/invoice-uploader",
+ "sscivm/ivmpub/components/invoice-link",
+ "sscrp/rppub/components/image",
+ "ampub",
+ "epmp/exports/components/Inspection",
+ "uap/common/components/ApproveDetail",
+ "uap/common/components/ApproveDetail",
+ "uap/common/components/excelImportconfig",
+ "uap/common/components/ExcelOutput",
+ "uap/common/components/NCUploader",
+ "uap/common/components/approvalTrans",
+ "sp/pub/utils/IndependentSettleUtil",
+ "uap/common/components/printOnClient"
+ ]
+}
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/main/index.js b/src/arap/paybill/paybill/main/index.js
new file mode 100644
index 0000000..dd2af77
--- /dev/null
+++ b/src/arap/paybill/paybill/main/index.js
@@ -0,0 +1,10 @@
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
+import { RenderRouter } from 'nc-lightapp-front';
+import routes from './router';
+
+
+(function main(routers, htmlTagid) {
+ RenderRouter(routers, htmlTagid);
+})(routes, "app");
+
+/*zSUoWKMuZerEXLsc4aAHfpzRg5lzN2RmctWmdBaiPTc=*/
\ No newline at end of file
diff --git a/src/arap/paybill/paybill/main/router.js b/src/arap/paybill/paybill/main/router.js
new file mode 100644
index 0000000..4505603
--- /dev/null
+++ b/src/arap/paybill/paybill/main/router.js
@@ -0,0 +1,98 @@
+/*tTimbHVfNMl+Pbqkv0j1sznfVXzCyreCe5PVeEUJhYI=*/
+import { asyncComponent, useJS } from 'nc-lightapp-front';
+import List from '../list';
+
+//付款单卡片
+const card = asyncComponent(() => import(/*webpackChunkName:"/arap/paybill/paybill/card/card"*/ /* webpackMode: "eager" */ '../card'));
+//预核销
+const prev = asyncComponent(() => import(/*webpackChunkName:"/arap/verificationsheet/preverify/list/prev"*/ /* webpackMode: "eager" */ '../../../verificationsheet/preverify/list'));
+//及时核销 list
+const nowv = asyncComponent(() => import(/*webpackChunkName:"/arap/verificationsheet/verifynow/list/nowv"*/ /* webpackMode: "eager" */ '../../../verificationsheet/verifynow/list'));
+//及时核销card
+const nowvcard = asyncComponent(() => import(/*webpackChunkName:"/arap/verificationsheet/verifynow/nowvcard"*/ /* webpackMode: "eager" */ '../../../verificationsheet/verifynow/nowvcard'));
+//应收单转单
+const F0 = asyncComponent(() => import(/*webpackChunkName:"/arap/receivablebill/recbill/transfer/f0transfer"*/ /* webpackMode: "eager" */ '../../../receivablebill/recbill/transfer'));
+//应付单转单
+const F1 = asyncComponent(() => import(/*webpackChunkName:"/arap/payablebill/payablebill/transfer/f1transfer"*/ /* webpackMode: "eager" */ '../../../payablebill/payablebill/transfer'));
+//收款单
+const F2 = asyncComponent(() => import(/*webpackChunkName:"/arap/gatheringbill/gatheringbill/transfer/f2transfer"*/ /* webpackMode: "eager" */ '../../../gatheringbill/gatheringbill/transfer'));
+//付款合同转单
+// const FCT1 = asyncComponent(() => import(/*webpackChunkName:"/fct/bill/ap/transfer/fct1transfer"*/ /* webpackMode: "eager" */ '../../../../fct/bill/ap/transfer'));
+//付款申请转单
+// const apply = asyncComponent(() => import(/*webpackChunkName:"/cmp/apply/apply/ref23/36d1transfer"*/ /* webpackMode: "eager" */ '../../../../cmp/apply/apply/ref23'));
+
+//采用useJS方式,运行需要依赖引用模块的编译后代码
+useJS.setConfig({
+ "fct/bill/ap/transfer/index": "../../../../fct/bill/ap/transfer/index.js",
+ "cmp/apply/apply/ref23/index":"../../../../cmp/apply/apply/ref23/index.js",
+ 'ali/rent/paymentapplytransfer/source/index': '../../../../ali/rent/paymentapplytransfer/source/index.js'
+})
+const FCT1 = useJS(["fct/bill/ap/transfer/index"], function (FCT1) {
+ return FCT1;
+})
+const apply = useJS(["cmp/apply/apply/ref23/index"], function (apply) {
+ return apply;
+})
+//付款单拉 -> 资产租入管理付款申请单
+const For4A3L = useJS([ 'ali/rent/paymentapplytransfer/source/index' ], function(For4A3L) {
+ return For4A3L;
+});
+
+const routes = [
+ {
+ path: '/',
+ component: List,
+ exact: true
+ },
+ {
+ path: '/list',
+ component: List
+ },
+ {
+ path: '/card',
+ component: card
+ },
+ {
+ path: '/prev',
+ component: prev
+ },
+ {
+ path: '/nowv',
+ component: nowv
+ },
+ {
+ path: '/nowvcard',
+ component: nowvcard
+ },
+ {
+ path: '/F0',
+ component: F0
+ },
+ {
+ path: '/F1',
+ component: F1
+ },
+ {
+ path: '/F2',
+ component: F2
+ },
+ {
+ path: '/FCT1',
+ component: FCT1
+ },
+ {
+ path: '/36D1',
+ component: apply
+ },
+ {
+ path: '/4A3L',
+ component: For4A3L
+ }
+
+];
+
+export default routes;
+
+
+
+/*tTimbHVfNMl+Pbqkv0j1sznfVXzCyreCe5PVeEUJhYI=*/
\ No newline at end of file