From 4ac8b41847c156bf84b8e2a1c96612fc98426ca1 Mon Sep 17 00:00:00 2001
From: pengm <674192343@qq.com>
Date: Wed, 1 Apr 2026 11:57:29 +0800
Subject: [PATCH] 1.五彩:采购发票增加图标可以批量删除已勾选的明细数据
---
src/assets/disabledelete.svg | 2 +-
src/components/Common/CommonComponent/index.js | 4 ++--
src/components/Common/CommonNewBill.js | 18 +++++++++++++++++-
src/components/Common/CommonTable/index.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
src/components/Common/commonBusiness.js | 1 +
5 files changed, 67 insertions(+), 5 deletions(-)
diff --git a/src/assets/disabledelete.svg b/src/assets/disabledelete.svg
index 8a3c1bc..046db79 100644
--- a/src/assets/disabledelete.svg
+++ b/src/assets/disabledelete.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js
index 8900976..c6aa680 100644
--- a/src/components/Common/CommonComponent/index.js
+++ b/src/components/Common/CommonComponent/index.js
@@ -284,8 +284,8 @@ export default class CommonComponent extends Component {
onFocus = () => {
this.isDropdownFilter = false;
this.setState({ sActiveDisplay: false });
- console.log(this.props, 'asdasdads');
-
+
+
};
onBlur = event => {
diff --git a/src/components/Common/CommonNewBill.js b/src/components/Common/CommonNewBill.js
index eabb437..3f04b6a 100644
--- a/src/components/Common/CommonNewBill.js
+++ b/src/components/Common/CommonNewBill.js
@@ -694,6 +694,15 @@ class CommonNewBill extends Component {
}
};
+ handleTableDelSelect = (name, isWait, tableSelectedRowKeys) => {
+ const { slaveSelectedRowKeys, slaveData, slaveConfig, sModelsId, masterData } = this.props;
+ const slaveReturnData = this.props.onDataRowDel(name, isWait, tableSelectedRowKeys);
+ this.props.onSaveState({
+ ...slaveReturnData,
+ });
+ return true;
+ };
+
/* 迭代删除从表子表数据 */
handleDelSlaveChild = (tableData, sId, tableSelectedKeys) => {
const filterData = tableData.filter(item => item.sFatherSlaveId === sId);
@@ -1418,6 +1427,7 @@ class CommonNewBill extends Component {
onSetTabNumList={this.handleSetTabNumList}
onDataRowDownload={this.handleDownload}
onDelRow={this.handleTableDel}
+ onDelRowSelect={this.handleTableDelSelect}
onJsonModalOk={this.handleJSONModalOk}
/>
{visible ? (
@@ -1994,6 +2004,9 @@ const BillComponent = Form.create({
: false; /* 是否是树形的单据 */
const bSlaveSort = slaveConfig?.gdsconfigformslave?.find(item => item.sControlName === "handleSort")?.bVisible || false;
+ const markSelectRowKeys = commonUtils.isNotEmptyArr(slaveData)
+ ? slaveData.filter(item => item.bMark).map(item => item.sId)
+ : [];
const slaveTableProps = {
...commonBusiness.getTableTypes("slave", props),
@@ -2010,12 +2023,14 @@ const BillComponent = Form.create({
},
noVlistTable: bPagination,
onDelRow: props.onDelRow,
+ onDelRowSelect: props.onDelRowSelect,
data: bSingleTree && commonUtils.isNotEmptyArr(slaveData) ? commonUtils.genTreeByArr(slaveData, "sId", "sFatherSlaveId") : slaveData,
onTreeAddChild: props.onDataRowAddChild,
customConfig: props.customConfig,
isDragAndDrop: bSlaveSort,
onMoveRow: props.onMoveRow,
- isSettingFunctions:true
+ isSettingFunctions:true,
+ markSelectRowKeys: markSelectRowKeys
};
const bCheck0 = commonUtils.isNotEmptyObject(slave0Config) && slave0Config.sTbName === "sysbillcheckresult" ? true : false;
@@ -2670,6 +2685,7 @@ const BillComponent = Form.create({
separateTabName10 = separateTabConfig.showName;
}
}
+ console.log('333props', props);
const flexRowStyle = bFlow ? { display: "flex", flexDirection: "row" } : {};
const flexContentStyle = bFlow ? { width: "75%" } : {};
diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js
index cd0cdb0..70a27a5 100644
--- a/src/components/Common/CommonTable/index.js
+++ b/src/components/Common/CommonTable/index.js
@@ -53,6 +53,8 @@ import ParamIcon from '@/assets/param.svg';
import sAlumiteIcon from '@/assets/sAlumite.svg';
import ReplaceIcon from '@/assets/extract.svg';
import DisReplaceIcon from '@/assets/disableExtract.svg';
+import DelSelectIcon from '@/assets/delete.svg';
+import DisDelSelectIcon from '@/assets/disabledelete.svg';
import DisAlumiteIcon from '@/assets/disabledsAlumite.svg';
import ShowImg from '@/components/Common/ShowImage/ShowImage';
import ShowImgStyle from '@/components/Common/ShowImage/ShowImage.less';
@@ -2964,6 +2966,8 @@ class CommonTableRc extends React.Component {
sAlumitePopup = this.findVisibleControlName(this.props, 'BtnPopupsAlumiteBomBillNo'); /* 表头放大镜 */
bCopyMore = this.findVisibleControlName(this.props, 'BtnCopyMore'); /* 复制多行 */
bReplace = this.findVisibleControlName(this.props, 'BtnReplace'); /* 替换材料 */
+ const { sModelsType } = this.props.app.currentPane;
+ const bDelSelect = sModelsType?.includes('purchase/purchasecheck') ? true : false;
const setNoCommonOperate = props.tableProps.setNoCommonOperate; /* 没有默认的增加删除按钮 */
let operateWidth = isSlaveInfoM ? 80 : 0;
@@ -3312,7 +3316,7 @@ class CommonTableRc extends React.Component {
this.props.enabled ? :
}
- : {setOperation} {headPopup ? {!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? : } : ''} ),
+ : {setOperation} {bDelSelect ? {!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnDelSelect")) ?
:
} : ""} {headPopup ? {!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? : } : ''} ),
width: operateWidth + 'px',
// fixed: commonUtils.isNotEmptyObject(this.props.tableProps.AutoTableHeight) ? 'right' : false,
fixed: 'right',
@@ -3937,6 +3941,12 @@ class CommonTableRc extends React.Component {
}, 0);
};
+ delSelectTbRow = (index, record, btnName) => {
+ setTimeout(() => {
+ this.handleDelSelectRow(index, record, btnName);
+ }, 0);
+ };
+
paramModalTbRow = (index, record) => {
this.handleParamRow(index, record);
};
@@ -5295,6 +5305,41 @@ class CommonTableRc extends React.Component {
}
}
};
+
+ handleDelSelectOkRow = (index, record, tableSelectedRowKeys) => {
+ setTimeout(() => {
+ if (this.props.onDelRowSelect(this.props.name, true, tableSelectedRowKeys)) {
+ this.handleSumAllColumn(this.props.config, this.state.dataSource);
+ }
+ }, 0);
+
+ };
+ /** 下载行 */
+ handleDelSelectRow = (index, record, btnName) => {
+ const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?';
+ const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?';
+ const _this = this;
+ console.log('rrr', this.props);
+ const { markSelectRowKeys = []} = this.props;
+
+ if(commonUtils.isEmptyArr(markSelectRowKeys)){
+ message.warn('请至少选择一行数据!');
+ return;
+ }
+ confirm({
+ title: '确认要删除已选中数据吗?',
+ onOk() {
+ _this.handleDelSelectOkRow(index, record, markSelectRowKeys);
+ },
+ onCancel() {
+ return false;
+ },
+ okText: BtnSure,
+ cancelText: BtnCancel
+ });
+ };
+
+
/** 查看工艺参数 */
handleParamRow = (index, record) => {
const tableSelectedRowKeys = [];
diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js
index 8c4c1da..b3ac4eb 100644
--- a/src/components/Common/commonBusiness.js
+++ b/src/components/Common/commonBusiness.js
@@ -319,6 +319,7 @@ export function getTableTypes(name, props) {
onCopyRow: props.onDataRowCopy,
onCopyAllRow: props.onDataRowCopyAll,
onDelRow: props.onDataRowDel,
+ onDelRowSelect : props.onDelRowSelect,
onDownloadRow: props.onDataRowDownload,
onShowParamRow: props.onDataRowShowParam,
onSelectRowChange: props.onTableSelectRowChange,
--
libgit2 0.22.2