From 0771ad9ed3e8530bdcf3aa3badffdc4809569872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 13 Mar 2024 17:27:49 +0800 Subject: [PATCH] =?UTF-8?q?hotfix/3.0.0.2403.01=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=AF=BC=E5=85=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/importDialog/index.less | 24 ++++++ .../cumDeduct/components/importFormCom.js | 2 +- .../pages/dataAcquisition/cumDeduct/index.js | 59 ++----------- .../dataAcquisition/cumSituation/index.js | 58 +------------ .../pages/dataAcquisition/importDialog.js | 84 +++++++++++++++++++ .../hrmSalary/pages/dataAcquisition/layout.js | 46 +++++----- .../dataAcquisition/otherDeduct/index.js | 32 +------ .../specialAddDeduction/index.js | 54 +----------- 8 files changed, 152 insertions(+), 207 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/importDialog.js diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less index 95cee40b..21d314d9 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.less +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -120,6 +120,30 @@ } } + .import-option { + .screenWrapper { + padding: 0; + margin: 10px; + border: 1px solid #e5e5e5; + + .wea-content { + padding: 0; + } + + .wea-form-cell { + padding: 0 16px; + + .wea-date-picker { + width: 85%; + } + } + + .wea-helpful-tip { + padding-left: 10px; + } + } + } + } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/importFormCom.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/importFormCom.js index 0044f630..4746d846 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/importFormCom.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/importFormCom.js @@ -32,7 +32,7 @@ class ImportFormCom extends Component { value: taxAgentId || "", onChange: this.screenChange, options: [{ key: "", showname: "全部" }, ...taxAgentOption], - key: "taxAgentId" + key: "taxAgentId", viewAttr: 3 }) } ]; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 5c3658fb..eaba3e5b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -19,14 +19,13 @@ import { editAddUpDeduction, getAddUpDeduction, getCumDeductSaCondition, - importCumDeductParam, - importCumDeductPreview + importCumDeductParam } from "../../../apis/cumDeduct"; import DataTables from "../dataTables"; import AddItems from "../addItems"; import ImportFormCom from "./components/importFormCom"; import TableRecord from "../components/tableRecord"; -import { dataCollectCondition, modalColumns } from "./columns"; +import { dataCollectCondition } from "./columns"; import { removePropertyCondition } from "../../../util/response"; import { convertToUrlString } from "../../../util/url"; import Layout from "../layout"; @@ -59,10 +58,9 @@ class Index extends Component { taxAgentId: "" }, importFormComponent: null, - step: 0, templateLink: "/api/bs/hrmsalary/addUpDeduction/downloadTemplate", importResult: {}, - slideDataSource: [] + previewUrl: "/api/bs/hrmsalary/addUpDeduction/preview" }, exportPayloadUrl: "", exportPayloadType: false, @@ -200,41 +198,6 @@ class Index extends Component { exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=${ids.join(",")}&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` }); }; - /* - * Author: 黎永顺 - * Description: 导入数据采集数据 - * Params: - * Date: 2023/2/20 - */ - handleImportFile = (params) => { - importCumDeductParam(params).then(({ status, data }) => { - if (status) { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, importResult: data } - }); - } - }); - }; - /* - * Author: 黎永顺 - * Description: 导入数据采集-数据查看 - * Params: - * Date: 2023/2/20 - */ - handlePreviewImport = (params) => { - importCumDeductPreview(params).then(({ status, data, errormsg }) => { - if (status) { - const { preview = [] } = data; - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, slideDataSource: preview } - }); - } else { - message.error(errormsg || "预览失败"); - } - }); - }; /* * Author: 黎永顺 * Description: 数据采集-信息保存 @@ -530,12 +493,6 @@ class Index extends Component { importPayload: { ...importPayload, importOpts: { ...importOpts, [key]: value } } }); }; - handleImportSetStep = (step) => { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, step } - }); - }; render() { const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props; @@ -551,11 +508,9 @@ class Index extends Component { slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} exportPayloadType={exportPayloadType} logFunction="addupdeduction" form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} - onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} - importPayload={importPayload} onImportFile={this.handleImportFile} - onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} + onCancel={this.handleCloseImport} onImportFile={importCumDeductParam} + importPayload={importPayload} detailOptBtns={this.getDetailOptBtns()} targetid={targetid} onClearTargrtid={() => this.setState({ targetid: "" })} - columns={modalColumns} > this.tableRef = dom} @@ -588,9 +543,9 @@ export const DataCollectionDatePicker = (props) => { ; }; export const DataCollectionSelect = (props) => { - const { value, label, onChange, options, key, labelCol = 10, wrapperCol = 14 } = props; + const { value, label, onChange, options, key, labelCol = 10, wrapperCol = 14, viewAttr = 2 } = props; return - onChange({ key, value: val })} options={options}/> + onChange({ key, value: val })} options={options} viewAttr={viewAttr}/> ; }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index d6b70c9c..dd32ab7c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -15,8 +15,7 @@ import { editAddUpSituation, getAddUpSituation, getCumSituationSaCondition, - importCumSituationParam, - importCumSituationPreview + importCumSituationParam } from "../../../apis/cumSituation"; import { removePropertyCondition } from "../../../util/response"; import DataTables from "../dataTables"; @@ -27,7 +26,6 @@ import moment from "moment"; import { dataCollectCondition, taxOptions } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; -import { situationModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; const getKey = WeaTools.getKey; @@ -57,10 +55,9 @@ class Index extends Component { declareMonth: moment(new Date()).format("YYYY-MM") }, importFormComponent: null, - step: 0, templateLink: "/api/bs/hrmsalary/addUpSituation/downloadTemplate", importResult: {}, - slideDataSource: [] + previewUrl: "/api/bs/hrmsalary/addUpSituation/preview" }, exportPayloadUrl: "", exportPayloadType: false, @@ -126,46 +123,6 @@ class Index extends Component { }); } }; - /* - * Author: 黎永顺 - * Description: 导入数据采集数据 - * Params: - * Date: 2023/2/20 - */ - handleImportFile = (params) => { - const { declareMonth, ...extra } = params; - const payload = { - taxYearMonth: declareMonth, - ...extra - }; - importCumSituationParam(payload).then(({ status, data }) => { - if (status) { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, importResult: data } - }); - } - }); - }; - /* - * Author: 黎永顺 - * Description: 导入数据采集-数据查看 - * Params: - * Date: 2023/2/20 - */ - handlePreviewImport = (params) => { - importCumSituationPreview(params).then(({ status, data, errormsg }) => { - if (status) { - const { preview = [] } = data; - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, slideDataSource: preview } - }); - } else { - message.error(errormsg || "预览失败"); - } - }); - }; /* * Author: 黎永顺 * Description:列表操作 @@ -485,12 +442,6 @@ class Index extends Component { importPayload: { ...importPayload, importOpts: { ...importOpts, [key]: value } } }); }; - handleImportSetStep = (step) => { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, step } - }); - }; /* * Author: 黎永顺 * Description:详情页面-操作按钮 @@ -555,10 +506,9 @@ class Index extends Component { slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} exportPayloadType={exportPayloadType} logFunction="addupsituation" form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} - onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} + onCancel={this.handleCloseImport} onImportFile={importCumSituationParam} + detailOptBtns={this.getDetailOptBtns()} importPayload={{ ...importPayload, importOpts: { taxYearMonth: importPayload.importOpts.declareMonth } }} - onImportFile={this.handleImportFile} columns={situationModalColumns} - onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} targetid={targetid} onClearTargrtid={() => this.setState({ targetid: "" })} > { + const { importDialog } = this.state, { onImportFile, importOpts } = this.props; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + onImportFile({ ...payload, ...importOpts }).then(({ data, status }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog, hasData } = this.state; + const { visible, onCancel, importParams, templateLink, importOpts } = this.props; + return ( + this.setState({ + importDialog: { ...importDialog, importResult: {}, imageId: "", link: "" } + })} + exportDataDom={ + this.setState({ hasData: val === "1" }, () => { + this.setState({ + importDialog: { + ...importDialog, + link: `${templateLink}?${convertToUrlString({ ...importOpts, hasData: this.state.hasData })}` + } + }); + })} + /> + } + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js index 587f2785..0c42281c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js @@ -8,11 +8,11 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; -import ImportModal from "../../components/importModal"; +import ImportModal from "./importDialog"; +import LogDialog from "../../components/logViewModal"; import SlideModalTitle from "../../components/slideModalTitle"; import { getSearchs } from "../../util"; import "./index.less"; -import LogDialog from "../../components/logViewModal"; const getLabel = WeaLocaleProvider.getLabel; @@ -78,14 +78,13 @@ class Layout extends Component { const { showSearchAd, logDialogVisible, filterConditions } = this.state; const { title, btns, leftComp, children, taxAgentStore: { showOperateBtn }, - slidePayload, onClose, onSave, slideLoading, form, condition, - onAdSearch, onCancel, importPayload, onImportSetStep, onImportFile, - onPreviewImport, detailOptBtns, columns, logFunction, onClearTargrtid + slidePayload, onClose, onSave, slideLoading, form, condition, onImportFile, + onAdSearch, onCancel, importPayload, detailOptBtns, logFunction, onClearTargrtid } = this.props; const { visible, title: subtitle, children: slideChildren } = slidePayload; const { - visible: importVisiable, step, importFormComponent, importOpts, - importResult, slideDataSource, templateLink + visible: importVisiable, importFormComponent, importOpts, + importResult, templateLink, previewUrl } = importPayload; return (
@@ -115,21 +114,26 @@ class Layout extends Component { {children} {/*导入弹框*/} onCancel(true)} - slideDataSource={slideDataSource} - previewImport={onPreviewImport} - importFile={onImportFile} - templateLink={templateLink} - renderFormComponent={() => importFormComponent} - visiable={importVisiable} - onCancel={onCancel} + visible={importVisiable} onCancel={onCancel} importParams={importFormComponent} + importOpts={importOpts} importResult={importResult} templateLink={templateLink} + previewUrl={previewUrl} onImportFile={onImportFile} /> + {/* onCancel(true)}*/} + {/* slideDataSource={slideDataSource}*/} + {/* previewImport={onPreviewImport}*/} + {/* importFile={onImportFile}*/} + {/* templateLink={templateLink}*/} + {/* renderFormComponent={() => importFormComponent}*/} + {/* visiable={importVisiable}*/} + {/* onCancel={onCancel}*/} + {/*/>*/} {/* 新增-编辑-详情弹框 */} { - importOtherDeductionParam(params).then(({ status, data }) => { - if (status) { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, importResult: data } - }); - } - }); - }; /* * Author: 黎永顺 * Description: 导入数据采集-数据查看 @@ -479,12 +461,6 @@ class Index extends Component { importPayload: { ...importPayload, importOpts: { ...importOpts, [key]: value } } }); }; - handleImportSetStep = (step) => { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, step } - }); - }; /* * Author: 黎永顺 * Description:详情页面-操作按钮 @@ -549,11 +525,9 @@ class Index extends Component { slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} exportPayloadType={exportPayloadType} logFunction="otherdeduction" form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} - onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} - importPayload={importPayload} onImportFile={this.handleImportFile} - onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()} + onCancel={this.handleCloseImport} importPayload={importPayload} + detailOptBtns={this.getDetailOptBtns()} onImportFile={importOtherDeductionParam} targetid={targetid} onClearTargrtid={() => this.setState({ targetid: "" })} - columns={otherModalColumns} > this.tableRef = dom} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 25288174..fe79d45f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -11,8 +11,7 @@ import { specialAddDeductionDeleteAllData, specialAddDeductionDeleteSelectData, specialAddDeductionEditData, - specialAddDeductionImportData, - specialAddDeductionPreview + specialAddDeductionImportData } from "../../../apis/special"; import { removePropertyCondition } from "../../../util/response"; import { DataCollectionSelect } from "../cumDeduct"; @@ -20,7 +19,6 @@ import ImportFormCom from "../cumDeduct/components/importFormCom"; import { condition } from "./components/condition"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; -import { specialModalColumns } from "../cumDeduct/columns"; import { convertToUrlString } from "../../../util/url"; const getKey = WeaTools.getKey; @@ -47,10 +45,9 @@ class Index extends Component { taxAgentId: "" }, importFormComponent: null, - step: 0, templateLink: "/api/bs/hrmsalary/specialAddDeduction/downloadTemplate", importResult: {}, - slideDataSource: [] + previewUrl: "/api/bs/hrmsalary/specialAddDeduction/preview" }, exportPayloadUrl: "", exportPayloadType: false, @@ -101,41 +98,6 @@ class Index extends Component { }); } }; - /* - * Author: 黎永顺 - * Description: 导入数据采集数据 - * Params: - * Date: 2023/2/20 - */ - handleImportFile = (params) => { - specialAddDeductionImportData(params).then(({ status, data }) => { - if (status) { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, importResult: data } - }); - } - }); - }; - /* - * Author: 黎永顺 - * Description: 导入数据采集-数据查看 - * Params: - * Date: 2023/2/20 - */ - handlePreviewImport = (params) => { - specialAddDeductionPreview(params).then(({ status, data, errormsg }) => { - if (status) { - const { preview = [] } = data; - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, slideDataSource: preview } - }); - } else { - message.error(errormsg || "预览失败"); - } - }); - }; /* * Author: 黎永顺 * Description: 高级搜素框-表单项 @@ -439,12 +401,6 @@ class Index extends Component { importPayload: { ...importPayload, importOpts: { ...importOpts, [key]: value } } }); }; - handleImportSetStep = (step) => { - const { importPayload } = this.state; - this.setState({ - importPayload: { ...importPayload, step } - }); - }; render() { const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props; @@ -460,11 +416,9 @@ class Index extends Component { slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} exportPayloadType={exportPayloadType} logFunction="specialAddDeduction" form={advanceForm} condition={advanceCondition} onAdSearch={this.handleAdSearch} - onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} - importPayload={importPayload} onImportFile={this.handleImportFile} - onPreviewImport={this.handlePreviewImport} detailOptBtns={[]} + onCancel={this.handleCloseImport} detailOptBtns={[]} + importPayload={importPayload} onImportFile={specialAddDeductionImportData} targetid={targetid} onClearTargrtid={() => this.setState({ targetid: "" })} - columns={specialModalColumns} > this.tableRef = dom}