diff --git a/src/components/Common/ToolBar/ToolBarNew.js b/src/components/Common/ToolBar/ToolBarNew.js index 6d25e4c..5d18db0 100644 --- a/src/components/Common/ToolBar/ToolBarNew.js +++ b/src/components/Common/ToolBar/ToolBarNew.js @@ -2541,7 +2541,7 @@ class ToolBarComponent extends Component { boxVisible: true, makeUpPDFRecord, title: config.showName, - + onCancel: () => { this.setState({ BtnBoxData: null, makeUpPDFRecord: undefined }); this.props.onSaveState({ @@ -2580,7 +2580,7 @@ class ToolBarComponent extends Component { }); } else if (this.props.onButtonClick !== undefined) { this.props.onButtonClick(key); - } + } }; // 删除当前pane @@ -3891,6 +3891,34 @@ class ToolBarComponent extends Component { } }; + + /* 通用上传各种文件 */ + handleUploadFilesChange = info => { + const { file,} = info; + if (file.response && file.response.code === 1) { + /* 刷新列表 */ + message.open({ + type: 'success', + content: '文件上传成功', + duration: 1 + }); + this.handleRefresh(); + }else if (file.response && file.response.code === -8) { + Modal.info({ + title: '温馨提示:', + content: ( +
+ {this.handleGetMsg(file.response.msg)} +
+ ), + okText: '确认', + onOk() {}, + }); + } else if (file.response && file.response.code === -1) { + message.error(file.response.msg); + } + }; + customRequest = option => { const { onSuccess, onError, file, action, data = {} } = option; // 添加额外的参数 @@ -4255,6 +4283,18 @@ class ToolBarComponent extends Component { disabled: !this.props.enabled, // beforeUpload: this.handleBeforeUpload, }; + const sBrandsId = userinfo?.sBrandsId; + const sSubsidiaryId = userinfo?.sSubsidiaryId; + /* 上传文件 */ + const uploadFilesProps = { + action: `${commonConfig.file_host}file/uploadMachinePlc?sModelsId=${sModelsId}&&sBrandsId=${sBrandsId}&sSubsidiaryId=${sSubsidiaryId}&token=${app.token}`, + onChange: this.handleUploadFilesChange, + accept: '*/*', + showUploadList: false, + disabled: false, + multiple:true, + // beforeUpload: this.handleBeforeUpload, + }; /* 发票上传 */ let invoiceBody = {}; @@ -4524,6 +4564,14 @@ class ToolBarComponent extends Component { {showNameNew} + ): commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.indexOf("BtnImportFile") > -1 ? ( +
+ + + {showNameNew} + + +
) : commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.indexOf("BtnDlPbOrder") > -1 ? (
this.handleBtnDownload()}> diff --git a/src/components/Common/ToolBar/index.less b/src/components/Common/ToolBar/index.less index 75bde6e..017d04d 100644 --- a/src/components/Common/ToolBar/index.less +++ b/src/components/Common/ToolBar/index.less @@ -45,6 +45,12 @@ fill: @disable_color!important; stroke: @disable_color!important; } + .uploadlink{ + color: #ffffff; + } + .uploadlink:hover{ + color:#1890FF!important; + } } .xlyProcess {