Commit 236d023721b83472bd36c1122fc99d56ab8b3bef

Authored by chenxt
1 parent 2a732917

表格保存

src/components/Common/CommonTable/index.js
... ... @@ -4860,7 +4860,7 @@ class CommonTableRc extends React.Component {
4860 4860 const { [this.rowKey]: rowKeyId } = record;
4861 4861 const { selectedRowKeys = [] } = props;
4862 4862 if (sControlName?.includes('BtnTableCopyTo.tmpInfoBySqlActProduceReport')) {
4863   - const copyToConfig = props?.config?.gdsconfigformslave.filter(x=>x.sControlName.includes('BtnTableCopyTo.tmpInfoBySqlActProduceReport'))
  4863 + const copyToConfig = props?.config?.gdsconfigformslave.filter(x => x.sControlName.includes('BtnTableCopyTo.tmpInfoBySqlActProduceReport'))
4864 4864 props.onCopyTo(props.name, config.sActiveId, config, copyToConfig, record)
4865 4865 return
4866 4866 }
... ... @@ -12282,29 +12282,68 @@ const useGetTableBtnOprSetting = props => {
12282 12282 );
12283 12283 };
12284 12284 } else if (btnType.includes("del")) {
12285   - resultTemp.mesDel = params => {
12286   - const { record } = params;
12287   - const { sDefault: str } = btnTableDelConfig;
12288   - let disabled = props.getBtnDisabled({
12289   - str,
12290   - defaultValue: false,
12291   - record
12292   - });
12293   - if (props.parentProps.bMesBill && !str) {
12294   - disabled = !props.enabled;
12295   - }
12296   - return (
12297   - <Button
12298   - disabled={disabled}
12299   - className={styles.mesDel}
12300   - icon={<MinusOutlined />}
12301   - onClick={e => {
12302   - e.stopPropagation();
12303   - props.onMesTableLineDel && props.onMesTableLineDel(params);
12304   - }}
12305   - />
12306   - );
12307   - };
  12285 + if (btnType.includes("enventdel")) {
  12286 + resultTemp.mesDel = params => {
  12287 + const { record } = params;
  12288 + const { sDefault: str } = btnTableDelConfig;
  12289 + let disabled = props.getBtnDisabled({
  12290 + str,
  12291 + defaultValue: false,
  12292 + record
  12293 + });
  12294 + if (props.parentProps.bMesBill && !str) {
  12295 + disabled = !props.enabled;
  12296 + }
  12297 + return (
  12298 + <Button
  12299 + disabled={disabled}
  12300 + className={styles.mesDel}
  12301 + icon={<MinusOutlined />}
  12302 + onClick={e => {
  12303 + e.stopPropagation();
  12304 + // props.onMesTableLineDel && props.onMesTableLineDel(params);
  12305 + const btnsConfig =
  12306 + gdsconfigformslave.find(
  12307 + item => item.sControlName?.toLowerCase().includes("btnenventdel")
  12308 + ) || {};
  12309 + props.parentProps.onExecInstructSet({
  12310 + btnConfig: {
  12311 + ...btnsConfig,
  12312 + sInstruct: btnsConfig.sButtonParam
  12313 + },
  12314 + nextProps: {
  12315 + ...props
  12316 + }
  12317 + });
  12318 + }}
  12319 + />
  12320 + );
  12321 + };
  12322 + } else {
  12323 + resultTemp.mesDel = params => {
  12324 + const { record } = params;
  12325 + const { sDefault: str } = btnTableDelConfig;
  12326 + let disabled = props.getBtnDisabled({
  12327 + str,
  12328 + defaultValue: false,
  12329 + record
  12330 + });
  12331 + if (props.parentProps.bMesBill && !str) {
  12332 + disabled = !props.enabled;
  12333 + }
  12334 + return (
  12335 + <Button
  12336 + disabled={disabled}
  12337 + className={styles.mesDel}
  12338 + icon={<MinusOutlined />}
  12339 + onClick={e => {
  12340 + e.stopPropagation();
  12341 + props.onMesTableLineDel && props.onMesTableLineDel(params);
  12342 + }}
  12343 + />
  12344 + );
  12345 + };
  12346 + }
12308 12347 } else if (btnType.includes("copy")) {
12309 12348 resultTemp.mesCopy = params => {
12310 12349 let disabled = false;
... ... @@ -12326,22 +12365,47 @@ const useGetTableBtnOprSetting = props =&gt; {
12326 12365 />
12327 12366 }
12328 12367 ;
12329   - } else if (btnType.includes("slave")) {
12330   - resultTemp.mesSave = () => (
12331   - <Button
12332   - className={styles.mesSave}
12333   - icon={<SaveOutlined />}
12334   - onClick={e => {
12335   - e.stopPropagation();
12336   - props.onMesTableLineSave && props.onMesTableLineSave();
12337   - }}
12338   - />
12339   - );
  12368 + } else if (btnType.includes("save")) {
  12369 + if (btnType.includes("enventsave")) {
  12370 + resultTemp.mesSave = () => (
  12371 + <Button
  12372 + className={styles.mesSave}
  12373 + icon={<SaveOutlined />}
  12374 + onClick={e => {
  12375 + e.stopPropagation();
  12376 + const btnsConfig =
  12377 + gdsconfigformslave.find(
  12378 + item => item.sControlName?.toLowerCase().includes("btnenventsave")
  12379 + ) || {};
  12380 +
  12381 + props.parentProps.onExecInstructSet({
  12382 + btnConfig: {
  12383 + ...btnsConfig,
  12384 + sInstruct: btnsConfig.sButtonParam
  12385 + },
  12386 + nextProps: {
  12387 + ...props
  12388 + }
  12389 + });
  12390 + }}
  12391 + />
  12392 + );
  12393 + } else {
  12394 + resultTemp.mesSave = () => (
  12395 + <Button
  12396 + className={styles.mesSave}
  12397 + icon={<SaveOutlined />}
  12398 + onClick={e => {
  12399 + e.stopPropagation();
  12400 + props.onMesTableLineSave && props.onMesTableLineSave();
  12401 + }}
  12402 + />
  12403 + );
  12404 + }
  12405 +
12340 12406 } else if (btnType.includes("materials")) {
12341 12407 resultTemp.mesMaterials = (text, record, index) => {
12342 12408 let { rowTag } = record || {};
12343   - console.log(rowTag, 'rowTag');
12344   -
12345 12409 return (
12346 12410 <Button
12347 12411 className={styles.mesMaterials}
... ...
src/mes/teamInfo/index.js
... ... @@ -514,7 +514,8 @@ const TeamInfo = baseProps =&gt; {
514 514 bManualTableProps = {
515 515 ...tableBaseProps,
516 516 selectedRowKeys: tableBaseProps.selectedRowKeys ? tableBaseProps.selectedRowKeys : [tableBaseProps?.data?.sId],
517   - fixedHeight: "calc(50vh - 218px)"
  517 + fixedHeight: "calc(50vh - 218px)",
  518 + tableBtnsWidth: "180px",
518 519 }
519 520 bManualSlaveTableProps = {
520 521 ...slaveTableBaseProps,
... ... @@ -570,7 +571,7 @@ const TeamInfo = baseProps =&gt; {
570 571 </div>
571 572 <StaticEditTable {...bManualTableProps} />
572 573 <div style={{ marginBottom: '28px' }}></div>
573   - <Button
  574 + {/* <Button
574 575 type="primary"
575 576 style={{ position: 'absolute', right: '10px', bottom: ' 4px', }}
576 577 onClick={() => {
... ... @@ -579,7 +580,7 @@ const TeamInfo = baseProps =&gt; {
579 580  
580 581 >
581 582 {'保存'}
582   - </Button>
  583 + </Button> */}
583 584 </div>
584 585 </Spin>
585 586 <Spin spinning={props.loadings} delay={500}>
... ... @@ -604,7 +605,7 @@ const TeamInfo = baseProps =&gt; {
604 605 </div>
605 606 <StaticEditTable {...bManualSlaveTableProps} />
606 607 <div style={{ marginBottom: '28px' }}></div>
607   - <Button
  608 + {/* <Button
608 609 type="primary"
609 610 style={{ position: 'absolute', right: '10px', bottom: ' 4px', }}
610 611 onClick={() => {
... ... @@ -613,7 +614,7 @@ const TeamInfo = baseProps =&gt; {
613 614  
614 615 >
615 616 {'保存'}
616   - </Button>
  617 + </Button> */}
617 618 </div>
618 619 </Spin>
619 620 </div>
... ...