Commit 4ac8b41847c156bf84b8e2a1c96612fc98426ca1
1 parent
d4cfb69b
1.五彩:采购发票增加图标可以批量删除已勾选的明细数据
Showing
5 changed files
with
67 additions
and
5 deletions
src/assets/disabledelete.svg
| 1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1568961105953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9439" width="22" height="22" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M799.104 874.24a62.464 62.464 0 0 1-62.4 62.4H287.36a62.464 62.464 0 0 1-62.4-62.336V212.096h574.208v662.208zM349.632 100.224c0-7.232 5.632-12.8 12.8-12.8h299.904c7.232 0 12.8 5.568 12.8 12.8v37.568H349.632v-37.568z m636.608 37.568H749.504v-37.568c0-48-39.168-87.168-87.168-87.168H362.432c-48 0-87.168 39.168-87.168 87.168v37.568H37.76a37.568 37.568 0 1 0 0 75.2h112V874.24a137.6 137.6 0 0 0 137.536 137.536h449.408a137.6 137.6 0 0 0 137.6-137.6V212.16h112a37.568 37.568 0 0 0 37.504-37.568 36.864 36.864 0 0 0-37.568-36.8zM512 823.872a37.568 37.568 0 0 0 37.568-37.568V386.432a37.568 37.568 0 1 0-75.136 0v399.872c0 20.8 16.768 37.568 37.568 37.568z m-175.168 0a37.568 37.568 0 0 0 37.632-37.568V386.432a37.568 37.568 0 1 0-75.2 0v399.872a38.592 38.592 0 0 0 37.568 37.568z m350.336 0a37.568 37.568 0 0 0 37.568-37.568V386.432a37.568 37.568 0 1 0-75.2 0v399.872c0 20.8 16.832 37.568 37.632 37.568z" fill="#8a8a8a" p-id="9440"></path></svg> | |
| 2 | 1 | \ No newline at end of file |
| 2 | +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1568961105953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9439" width="22" height="22" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M799.104 874.24a62.464 62.464 0 0 1-62.4 62.4H287.36a62.464 62.464 0 0 1-62.4-62.336V212.096h574.208v662.208zM349.632 100.224c0-7.232 5.632-12.8 12.8-12.8h299.904c7.232 0 12.8 5.568 12.8 12.8v37.568H349.632v-37.568z m636.608 37.568H749.504v-37.568c0-48-39.168-87.168-87.168-87.168H362.432c-48 0-87.168 39.168-87.168 87.168v37.568H37.76a37.568 37.568 0 1 0 0 75.2h112V874.24a137.6 137.6 0 0 0 137.536 137.536h449.408a137.6 137.6 0 0 0 137.6-137.6V212.16h112a37.568 37.568 0 0 0 37.504-37.568 36.864 36.864 0 0 0-37.568-36.8zM512 823.872a37.568 37.568 0 0 0 37.568-37.568V386.432a37.568 37.568 0 1 0-75.136 0v399.872c0 20.8 16.768 37.568 37.568 37.568z m-175.168 0a37.568 37.568 0 0 0 37.632-37.568V386.432a37.568 37.568 0 1 0-75.2 0v399.872a38.592 38.592 0 0 0 37.568 37.568z m350.336 0a37.568 37.568 0 0 0 37.568-37.568V386.432a37.568 37.568 0 1 0-75.2 0v399.872c0 20.8 16.832 37.568 37.632 37.568z" fill="#8a8a8a" p-id="9440"></path></svg> | ... | ... |
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -284,8 +284,8 @@ export default class CommonComponent extends Component { |
| 284 | 284 | onFocus = () => { |
| 285 | 285 | this.isDropdownFilter = false; |
| 286 | 286 | this.setState({ sActiveDisplay: false }); |
| 287 | - console.log(this.props, 'asdasdads'); | |
| 288 | - | |
| 287 | + | |
| 288 | + | |
| 289 | 289 | }; |
| 290 | 290 | |
| 291 | 291 | onBlur = event => { | ... | ... |
src/components/Common/CommonNewBill.js
| ... | ... | @@ -694,6 +694,15 @@ class CommonNewBill extends Component { |
| 694 | 694 | } |
| 695 | 695 | }; |
| 696 | 696 | |
| 697 | + handleTableDelSelect = (name, isWait, tableSelectedRowKeys) => { | |
| 698 | + const { slaveSelectedRowKeys, slaveData, slaveConfig, sModelsId, masterData } = this.props; | |
| 699 | + const slaveReturnData = this.props.onDataRowDel(name, isWait, tableSelectedRowKeys); | |
| 700 | + this.props.onSaveState({ | |
| 701 | + ...slaveReturnData, | |
| 702 | + }); | |
| 703 | + return true; | |
| 704 | + }; | |
| 705 | + | |
| 697 | 706 | /* 迭代删除从表子表数据 */ |
| 698 | 707 | handleDelSlaveChild = (tableData, sId, tableSelectedKeys) => { |
| 699 | 708 | const filterData = tableData.filter(item => item.sFatherSlaveId === sId); |
| ... | ... | @@ -1418,6 +1427,7 @@ class CommonNewBill extends Component { |
| 1418 | 1427 | onSetTabNumList={this.handleSetTabNumList} |
| 1419 | 1428 | onDataRowDownload={this.handleDownload} |
| 1420 | 1429 | onDelRow={this.handleTableDel} |
| 1430 | + onDelRowSelect={this.handleTableDelSelect} | |
| 1421 | 1431 | onJsonModalOk={this.handleJSONModalOk} |
| 1422 | 1432 | /> |
| 1423 | 1433 | {visible ? ( |
| ... | ... | @@ -1994,6 +2004,9 @@ const BillComponent = Form.create({ |
| 1994 | 2004 | : false; /* 是否是树形的单据 */ |
| 1995 | 2005 | |
| 1996 | 2006 | const bSlaveSort = slaveConfig?.gdsconfigformslave?.find(item => item.sControlName === "handleSort")?.bVisible || false; |
| 2007 | + const markSelectRowKeys = commonUtils.isNotEmptyArr(slaveData) | |
| 2008 | + ? slaveData.filter(item => item.bMark).map(item => item.sId) | |
| 2009 | + : []; | |
| 1997 | 2010 | |
| 1998 | 2011 | const slaveTableProps = { |
| 1999 | 2012 | ...commonBusiness.getTableTypes("slave", props), |
| ... | ... | @@ -2010,12 +2023,14 @@ const BillComponent = Form.create({ |
| 2010 | 2023 | }, |
| 2011 | 2024 | noVlistTable: bPagination, |
| 2012 | 2025 | onDelRow: props.onDelRow, |
| 2026 | + onDelRowSelect: props.onDelRowSelect, | |
| 2013 | 2027 | data: bSingleTree && commonUtils.isNotEmptyArr(slaveData) ? commonUtils.genTreeByArr(slaveData, "sId", "sFatherSlaveId") : slaveData, |
| 2014 | 2028 | onTreeAddChild: props.onDataRowAddChild, |
| 2015 | 2029 | customConfig: props.customConfig, |
| 2016 | 2030 | isDragAndDrop: bSlaveSort, |
| 2017 | 2031 | onMoveRow: props.onMoveRow, |
| 2018 | - isSettingFunctions:true | |
| 2032 | + isSettingFunctions:true, | |
| 2033 | + markSelectRowKeys: markSelectRowKeys | |
| 2019 | 2034 | }; |
| 2020 | 2035 | |
| 2021 | 2036 | const bCheck0 = commonUtils.isNotEmptyObject(slave0Config) && slave0Config.sTbName === "sysbillcheckresult" ? true : false; |
| ... | ... | @@ -2670,6 +2685,7 @@ const BillComponent = Form.create({ |
| 2670 | 2685 | separateTabName10 = separateTabConfig.showName; |
| 2671 | 2686 | } |
| 2672 | 2687 | } |
| 2688 | + console.log('333props', props); | |
| 2673 | 2689 | |
| 2674 | 2690 | const flexRowStyle = bFlow ? { display: "flex", flexDirection: "row" } : {}; |
| 2675 | 2691 | const flexContentStyle = bFlow ? { width: "75%" } : {}; | ... | ... |
src/components/Common/CommonTable/index.js
| ... | ... | @@ -53,6 +53,8 @@ import ParamIcon from '@/assets/param.svg'; |
| 53 | 53 | import sAlumiteIcon from '@/assets/sAlumite.svg'; |
| 54 | 54 | import ReplaceIcon from '@/assets/extract.svg'; |
| 55 | 55 | import DisReplaceIcon from '@/assets/disableExtract.svg'; |
| 56 | +import DelSelectIcon from '@/assets/delete.svg'; | |
| 57 | +import DisDelSelectIcon from '@/assets/disabledelete.svg'; | |
| 56 | 58 | import DisAlumiteIcon from '@/assets/disabledsAlumite.svg'; |
| 57 | 59 | import ShowImg from '@/components/Common/ShowImage/ShowImage'; |
| 58 | 60 | import ShowImgStyle from '@/components/Common/ShowImage/ShowImage.less'; |
| ... | ... | @@ -2964,6 +2966,8 @@ class CommonTableRc extends React.Component { |
| 2964 | 2966 | sAlumitePopup = this.findVisibleControlName(this.props, 'BtnPopupsAlumiteBomBillNo'); /* 表头放大镜 */ |
| 2965 | 2967 | bCopyMore = this.findVisibleControlName(this.props, 'BtnCopyMore'); /* 复制多行 */ |
| 2966 | 2968 | bReplace = this.findVisibleControlName(this.props, 'BtnReplace'); /* 替换材料 */ |
| 2969 | + const { sModelsType } = this.props.app.currentPane; | |
| 2970 | + const bDelSelect = sModelsType?.includes('purchase/purchasecheck') ? true : false; | |
| 2967 | 2971 | |
| 2968 | 2972 | const setNoCommonOperate = props.tableProps.setNoCommonOperate; /* 没有默认的增加删除按钮 */ |
| 2969 | 2973 | let operateWidth = isSlaveInfoM ? 80 : 0; |
| ... | ... | @@ -3312,7 +3316,7 @@ class CommonTableRc extends React.Component { |
| 3312 | 3316 | this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{ color: 'rgb(189, 189, 189)' }} /> |
| 3313 | 3317 | } |
| 3314 | 3318 | </a> |
| 3315 | - </Upload></span> : <span> {setOperation} {headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : ''} </span>), | |
| 3319 | + </Upload></span> : <span> {setOperation} {bDelSelect ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnDelSelect")) ? this.delSelectTbRow : null}>{!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnDelSelect")) ? <img src={DelSelectIcon} alt="删除选中" width="16px" height="15px" /> : <img src={DisDelSelectIcon} alt="删除选中" width="16px" height="15px" />}</a> : ""} {headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : ''} </span>), | |
| 3316 | 3320 | width: operateWidth + 'px', |
| 3317 | 3321 | // fixed: commonUtils.isNotEmptyObject(this.props.tableProps.AutoTableHeight) ? 'right' : false, |
| 3318 | 3322 | fixed: 'right', |
| ... | ... | @@ -3937,6 +3941,12 @@ class CommonTableRc extends React.Component { |
| 3937 | 3941 | }, 0); |
| 3938 | 3942 | }; |
| 3939 | 3943 | |
| 3944 | + delSelectTbRow = (index, record, btnName) => { | |
| 3945 | + setTimeout(() => { | |
| 3946 | + this.handleDelSelectRow(index, record, btnName); | |
| 3947 | + }, 0); | |
| 3948 | + }; | |
| 3949 | + | |
| 3940 | 3950 | paramModalTbRow = (index, record) => { |
| 3941 | 3951 | this.handleParamRow(index, record); |
| 3942 | 3952 | }; |
| ... | ... | @@ -5295,6 +5305,41 @@ class CommonTableRc extends React.Component { |
| 5295 | 5305 | } |
| 5296 | 5306 | } |
| 5297 | 5307 | }; |
| 5308 | + | |
| 5309 | + handleDelSelectOkRow = (index, record, tableSelectedRowKeys) => { | |
| 5310 | + setTimeout(() => { | |
| 5311 | + if (this.props.onDelRowSelect(this.props.name, true, tableSelectedRowKeys)) { | |
| 5312 | + this.handleSumAllColumn(this.props.config, this.state.dataSource); | |
| 5313 | + } | |
| 5314 | + }, 0); | |
| 5315 | + | |
| 5316 | + }; | |
| 5317 | + /** 下载行 */ | |
| 5318 | + handleDelSelectRow = (index, record, btnName) => { | |
| 5319 | + const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?'; | |
| 5320 | + const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?'; | |
| 5321 | + const _this = this; | |
| 5322 | + console.log('rrr', this.props); | |
| 5323 | + const { markSelectRowKeys = []} = this.props; | |
| 5324 | + | |
| 5325 | + if(commonUtils.isEmptyArr(markSelectRowKeys)){ | |
| 5326 | + message.warn('请至少选择一行数据!'); | |
| 5327 | + return; | |
| 5328 | + } | |
| 5329 | + confirm({ | |
| 5330 | + title: '确认要删除已选中数据吗?', | |
| 5331 | + onOk() { | |
| 5332 | + _this.handleDelSelectOkRow(index, record, markSelectRowKeys); | |
| 5333 | + }, | |
| 5334 | + onCancel() { | |
| 5335 | + return false; | |
| 5336 | + }, | |
| 5337 | + okText: BtnSure, | |
| 5338 | + cancelText: BtnCancel | |
| 5339 | + }); | |
| 5340 | + }; | |
| 5341 | + | |
| 5342 | + | |
| 5298 | 5343 | /** 查看工艺参数 */ |
| 5299 | 5344 | handleParamRow = (index, record) => { |
| 5300 | 5345 | const tableSelectedRowKeys = []; | ... | ... |
src/components/Common/commonBusiness.js
| ... | ... | @@ -319,6 +319,7 @@ export function getTableTypes(name, props) { |
| 319 | 319 | onCopyRow: props.onDataRowCopy, |
| 320 | 320 | onCopyAllRow: props.onDataRowCopyAll, |
| 321 | 321 | onDelRow: props.onDataRowDel, |
| 322 | + onDelRowSelect : props.onDelRowSelect, | |
| 322 | 323 | onDownloadRow: props.onDataRowDownload, |
| 323 | 324 | onShowParamRow: props.onDataRowShowParam, |
| 324 | 325 | onSelectRowChange: props.onTableSelectRowChange, | ... | ... |