Commit a5f054730dcce9709d70c23dc10062c6a2dbb55f

Authored by Min
1 parent 57135eb8

1.PAD端支持上传图片

src/mobile/common/CommobilePadBill/index.js
@@ -9,6 +9,7 @@ import { DownOutlined, UploadOutlined } from "@ant-design/icons"; @@ -9,6 +9,7 @@ import { DownOutlined, UploadOutlined } from "@ant-design/icons";
9 import CommonNewSales from "@/components/Common/CommonNewBillEvent"; /* 继承销售模块业务功能 */ 9 import CommonNewSales from "@/components/Common/CommonNewBillEvent"; /* 继承销售模块业务功能 */
10 import * as commonFunc from "@/components/Common/commonFunc"; /* 通用单据方法 */ /* 通用单据方法 */ 10 import * as commonFunc from "@/components/Common/commonFunc"; /* 通用单据方法 */ /* 通用单据方法 */
11 import Toolbar from "@/components/Common/ToolBar/ToolBarNew"; 11 import Toolbar from "@/components/Common/ToolBar/ToolBarNew";
  12 +import CommobileToolBar from '../CommobileToolBar';
12 import StaticEditTable from "@/components/Common/CommonTable"; /* 可编辑表格 */ 13 import StaticEditTable from "@/components/Common/CommonTable"; /* 可编辑表格 */
13 import styles from "@/index.less"; 14 import styles from "@/index.less";
14 import stylesNew from "./index.less" 15 import stylesNew from "./index.less"
@@ -3677,19 +3678,30 @@ const CommonNewBillComponent = (baseProps) => { @@ -3677,19 +3678,30 @@ const CommonNewBillComponent = (baseProps) => {
3677 return menuDataCopy.filter(item => commonUtils.isEmptyArr(item.child)).map(item => { 3678 return menuDataCopy.filter(item => commonUtils.isEmptyArr(item.child)).map(item => {
3678 const { showName } = item; 3679 const { showName } = item;
3679 const menuItemProps = getMenuProps(item, "key"); 3680 const menuItemProps = getMenuProps(item, "key");
  3681 + // 如果child包含BtnUpdPic,使用CommobileToolBar
  3682 + if (item?.sControlName.includes('BtnUpdPic')) {
  3683 + return (
  3684 + <CommobileToolBar
  3685 + key={item.key}
  3686 + {...props}
  3687 + buttonConfig={[item]}
  3688 + />
  3689 + );
  3690 + }else {
  3691 + return <div>
  3692 + <Button
  3693 + type="primary"
  3694 + size="large"
  3695 + {...menuItemProps}
  3696 + onClick={() => {
  3697 + handleClick(menuItemProps);
  3698 + }}
  3699 + >
  3700 + {showName}
  3701 + </Button>
  3702 + </div>
  3703 + }
3680 3704
3681 - return <div>  
3682 - <Button  
3683 - type="primary"  
3684 - size="large"  
3685 - {...menuItemProps}  
3686 - onClick={() => {  
3687 - handleClick(menuItemProps);  
3688 - }}  
3689 - >  
3690 - {showName}  
3691 - </Button>  
3692 - </div>  
3693 }) 3705 })
3694 }} 3706 }}
3695 /> 3707 />
src/mobile/common/CommobileToolBar.js
@@ -31,7 +31,10 @@ class CommobileToolBar extends Component { @@ -31,7 +31,10 @@ class CommobileToolBar extends Component {
31 } = nextProps; 31 } = nextProps;
32 const { buttonConfig: buttonConfigOld } = this.state; 32 const { buttonConfig: buttonConfigOld } = this.state;
33 if (commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isEmptyArr(buttonConfigOld)) { 33 if (commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isEmptyArr(buttonConfigOld)) {
34 - const buttonConfig = masterConfig.gdsconfigformslave.filter(item => item.sName === '' && item.showName !== '' && item.bVisible && item.sControlName.substring(0, 3) === 'Btn'); 34 + let buttonConfig = masterConfig.gdsconfigformslave.filter(item => item.sName === '' && item.showName !== '' && item.bVisible && item.sControlName.substring(0, 3) === 'Btn');
  35 + if(location.pathname.toLowerCase().includes('padbill')) {
  36 + buttonConfig = buttonConfig.filter(item => item.sControlName?.toLowerCase().includes('btnupdpic'))
  37 + }
35 this.setState({ buttonConfig, btnStyle, divStyle }); 38 this.setState({ buttonConfig, btnStyle, divStyle });
36 } 39 }
37 } 40 }
@@ -527,7 +530,7 @@ class CommobileToolBar extends Component { @@ -527,7 +530,7 @@ class CommobileToolBar extends Component {
527 return ( 530 return (
528 <FileShowMobile {...this.props} btnConfig={item} selectedRow={selectedRow} />); 531 <FileShowMobile {...this.props} btnConfig={item} selectedRow={selectedRow} />);
529 } 532 }
530 - return (<Button type={btnStyle.type} inline style={btnStyle} disabled={this.getMenuStatus(item)} onClick={this.handleClick.bind(this, item.sControlName)} >{item.showName}</Button>); 533 + return (<Button type={btnStyle?.type} inline style={btnStyle} disabled={this.getMenuStatus(item)} onClick={this.handleClick.bind(this, item.sControlName)} >{item.showName}</Button>);
531 })} 534 })}
532 </div> 535 </div>
533 536