From af908c42b98f85c9c773b2fbf530aaad882c7259 Mon Sep 17 00:00:00 2001 From: lihao Date: Thu, 10 Apr 2025 11:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=BB=98=E6=AC=BE=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paybill/card/events/buttonClick.js | 58 ++++++++++ src/arap/paybill/paybill/card/index.js | 101 ++++++++++++++++++ 2 files changed, 159 insertions(+) diff --git a/src/arap/paybill/paybill/card/events/buttonClick.js b/src/arap/paybill/paybill/card/events/buttonClick.js index 441350d..fcb6089 100644 --- a/src/arap/paybill/paybill/card/events/buttonClick.js +++ b/src/arap/paybill/paybill/card/events/buttonClick.js @@ -49,6 +49,34 @@ export function buttonClick(props, id) { if(id==headButton.Cancel||id==headButton.Save||id==headButton.SaveAndCommit||id==headButton.Add||id==headButton.Copy){//保存/保存提交/取消 this.checknoArray = []; } + if(id==headButton.Save||id==headButton.SaveAndCommit||id==headButton.Commit){ + const executeSave = async () => { + const shouldContinue = await this.saveBillChecktenday(); + if (!shouldContinue) { + return; + } + switch (id) { + case headButton.Commit: //提交 + this.Info.tipUrl = '/nccloud/arap/arappub/commit.do'; + this.commitAndUncommit(); + break; + case headButton.Save: + saveBillClick(this, '/nccloud/arap/arappub/save.do') + // this.saveBill('/nccloud/arap/arappub/save.do'); + break; + case headButton.SaveAndCommit: + saveBillClick(this, '/nccloud/arap/arappub/saveandcommit.do') + // this.saveBill('/nccloud/arap/arappub/saveandcommit.do'); + break; + } + ctrAllocBtn(this); + // 原后续逻辑 + // ...原保存提交代码... + } + executeSave(); + }else{ + + switch (id) { case headButton.Commit: //提交 this.Info.tipUrl = '/nccloud/arap/arappub/commit.do'; @@ -713,6 +741,8 @@ export function buttonClick(props, id) { } //控制单据联查期间分摊按钮显示 ctrAllocBtn(this); + } + } function saveBillClick(that, url) { @@ -779,7 +809,35 @@ let invoiceLink = function (that) { isLink:true }); }; +// export function saveBillChecktenday() { +// let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId); +// let newCardData = dealCardData(this, cardData); //去掉空值,减少压缩时间 +// let accounts =[]; +// let amounts=[]; +// if(newCardData.body.bodys.rows>0){ +// for(let i=0;i { +// if (res.success) { +// if (res.data) { + +// } +// } +// } +// }); +// } export function cardBillEdit() { this.props.cardTable.selectAllRows(this.tableId, false); let sceneType = 0; diff --git a/src/arap/paybill/paybill/card/index.js b/src/arap/paybill/paybill/card/index.js index 342ef69..d503b4f 100644 --- a/src/arap/paybill/paybill/card/index.js +++ b/src/arap/paybill/paybill/card/index.js @@ -66,6 +66,7 @@ import {cancelAllocation,beSureAllocation,setAllocField,ctrAllocBtn} from '../.. import {dealSmartCard,triggerEventListener,getStoreExpandFlag,disabledVisibleCache,smartCardArea} from '../../../public/components/arapSmartCard.js'; import {updateCacheTss} from '../../../public/components/updateTableDataTs'; import poc from 'uap/common/components/printOnClient'; +import {CARD} from "../../../../dm/dm/delivbill/constance"; const {printPreview, printOnClient, PubSub, printerView, printOnClientByMoreTem} = poc; class Card extends Component { @@ -159,6 +160,7 @@ class Card extends Component { this.horExpandFlag=false;//智能区默认收起 this.checknoArray = [];//票据号数组,用于存储票据 this.prepay = {display:null,value:null}; + this.shouldContinue = true; props.use.cardTable(tableId); props.use.form(formId); props.use.form(allocation); @@ -1150,6 +1152,97 @@ class Card extends Component { this.props.validateToSave(validateCardData, callback, { table1: 'cardTable' }, 'card'); }; + // saveBillChecktenday = () => { + // let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId); + // let newCardData = dealCardData(this, cardData); //去掉空值,减少压缩时间 + // let accounts =[]; + // let amounts=[]; + // if(newCardData.body.bodys.rows.length>0){ + // for(let i=0;i { + // if (res.data == '1') { + // // 弹出模态框 + // this.props.modal.show('saveChecktenday', { + // beSureBtnClick: () => { + // // 用户点击“确定”,设置标志变量为true + // this.shouldContinue = true; + // this.props.modal.hide('saveChecktenday'); + // }, + // cancelBtnClick: () => { + // // 用户点击“取消”,设置标志变量为false + // this.shouldContinue = false; + // this.props.modal.hide('saveChecktenday'); + // } + // }); + // } else { + // // 如果没有异常,继续执行原逻辑 + // this.shouldContinue = true; + // } + // } + // }); + // }; + // 修改saveBillChecktenday为async函数 + saveBillChecktenday = async () => { + return new Promise((resolve) => { + let cardData = this.props.createMasterChildData(this.getPagecode(), this.formId, this.tableId); + let newCardData = dealCardData(this, cardData); + let accounts = []; + let amounts = []; + if (newCardData.body.bodys.rows.length > 0) { + for (let i = 0; i < newCardData.body.bodys.rows.length; i++) { + accounts.push(newCardData.body.bodys.rows[i].values.recaccount.value); + amounts.push(newCardData.body.bodys.rows[i].values.local_money_de.value); + } + } + let datas = { + pkorg: newCardData.head.head.rows[0].values.pk_org.value, + billdata: newCardData.body.bodys.rows[0].values.billdate.value, + amounts: amounts, + accounts: accounts + }; + + console.log('开始检查十天汇款'); + ajax({ + url: "/nccloud/arap/arappub/savecheck.do", + data: Object.assign(datas, this.dataInSaga), + success: (res) => { + if (res.data.num == '1') { + this.props.modal.show('saveChecktenday', { + title: "十天内重复提报单据提示", //'预算异常提示信息',//'预算异常提示信息',//this.state.json['10170406-000017'],// 异常提示/* 国际化处理: 预算异常提示信息*/ + size:"100", + beSureBtnName: "继续" /* 国际化处理: 继续*/, + content: "近期已经提交付款金额为"+res.data.money+"该单位的付款单", //this.Info.tipContent, // '预算不通过!',//this.modalContent.call(this), //弹框内容,可以是字符串或dom + beSureBtnClick: () => { + console.log('开始检查十天汇款1'); + this.props.modal.close('saveChecktenday'); + resolve(true); // 用户确认继续 + }, + cancelBtnClick: () => { + this.props.modal.close('saveChecktenday'); + resolve(false); // 用户取消操作 + } + }); + } else { + resolve(true); // 没有异常直接继续 + } + } + }); + }); + }; //提交和收回弹框点击取消 clearExType = () => { @@ -2117,6 +2210,10 @@ class Card extends Component { cancel={this.cancelClickInCommit.bind(this)} /> ) : null} + {createModal('saveChecktenday', { + closeModalEve: () => { + } + })} @@ -2532,6 +2629,10 @@ class Card extends Component { cancel={this.cancelClickInCommit.bind(this)} /> ) : null} + {createModal('saveChecktenday', { + closeModalEve: () => { + } + })} );