From a058242d35f382a4fd8b64dc2cc1761c6d5a0188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 14:23:51 +0800 Subject: [PATCH 01/18] =?UTF-8?q?feature/2.9.42308.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8C=E6=AD=A5=E5=88=B0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E8=B4=A6=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/item.js | 256 +++++++++--------- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 21 ++ pc4mobx/hrmSalary/pages/salaryItem/index.js | 27 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 8 + .../syncToSalaryAccountSetDialog.js | 85 ++++++ pc4mobx/hrmSalary/stores/salaryItem.js | 2 + 6 files changed, 276 insertions(+), 123 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index 3c3bb052..2d23377a 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -1,4 +1,4 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; /** * 薪资项目api @@ -7,171 +7,171 @@ import { WeaTools } from 'ecCom'; // 薪资项目-获取列表 export const getItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/salaryitem/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; //薪资项目的高级搜索 export const getSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSearchCondition', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSearchCondition", "GET", params); }; //数据源列表字典项 export const formulaDatasourceList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/formula/datasource/list', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/formula/datasource/list", "GET", params); }; //薪资项目-系统薪资项目列表 export const getSysItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/sysList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/salaryitem/sysList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; //系统薪资项目的高级搜索 export const getSysSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSysSearchCondition', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSysSearchCondition", "GET", params); +}; //薪资项目-批量删除薪资项目 export const deleteItem = params => { - return fetch('/api/bs/hrmsalary/salaryitem/delete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-批量删除列表 export const deleteItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/listCanDelete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-新增薪资项目 export const saveItem = params => { - delete params.formulaContent - return fetch('/api/bs/hrmsalary/salaryitem/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + delete params.formulaContent; + return fetch("/api/bs/hrmsalary/salaryitem/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-更新薪资项目 export const updateItem = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/update', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/update", "POST", params); +}; //薪资项目-薪资项目详情 export const getItemForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSalaryForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalaryForm", "GET", params); +}; //薪资项目-添加系统薪资项目 export const saveSysItem = params => { - return fetch('/api/bs/hrmsalary/salaryitem/saveSys', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/saveSys", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取薪资项目可选的类型(与属性有联动) export const getItemTypeOption = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption", "GET", params); +}; //获取公式描述 export const getFormulaDes = params => { - return WeaTools.callApi('/api/bs/hrmsalary/formula/des', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/formula/des", "GET", params); +}; // *** 公式 start *** // 获取公式变量类型 export const formualSearchGroup = params => { - return fetch('/api/bs/hrmsalary/formula/search/group', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/search/group", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取公式变量字段 export const formualSearchField = params => { - return fetch('/api/bs/hrmsalary/formula/search/field', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/search/field", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // /api/bs/hrmsalary/formula/save // 保存公式 export const saveFormual = params => { - return fetch('/api/bs/hrmsalary/formula/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 公式测试 export const testFormual = params => { - return fetch('/api/bs/hrmsalary/formula/mock', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/mock", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 根据id获取formual export const detailFormual = params => { - return fetch('/api/bs/hrmsalary/formula/detail', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/detail", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // *** 公式 end *** @@ -179,14 +179,28 @@ export const detailFormual = params => { // 列出可以删除的薪资项目 export const listCanDelete = params => { - return fetch('/api/bs/hrmsalary/salaryitem/listCanDelete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - + return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//获取哪些账套中使用了该薪资项目 +export const getSalarySobBySalaryItem = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalarySobBySalaryItem", "GET", params); +}; +// 同步到薪资账套 +export const syncSalaryItemToSalarySobItem = params => { + return fetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem ", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 04580369..47abe5b1 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -155,6 +155,27 @@ export const valTakeOptions = [ { key: "2", showname: "公式" }, { key: "3", showname: "SQL" } ]; +export const salarySetConditions = [ + { + items: [{ + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["salarySobIds"], + fieldcol: 18, + label: "薪资账套", + lanId: 538010, + labelcol: 6, + options: [], + rules: "required|string", + multiple: true, + viewAttr: 3 + }], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 556b0d7e..c2c63718 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -9,6 +9,7 @@ import { columns } from "./columns"; import SlideModalTitle from "../../components/slideModalTitle"; import CustomSalaryItemSlide from "./customSalaryItemSlide"; import CustomPaginationTable from "../../components/customPaginationTable"; +import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; import "../socialSecurityBenefits/programme/index.less"; const { getLabel } = WeaLocaleProvider; @@ -25,7 +26,8 @@ export default class SalaryItem extends React.Component { searchValue: "", formalModalVisible: false, searchParams: { current: 1, pageSize: 10, total: 0 }, - selectedRowKeys: [] + selectedRowKeys: [], + syncSalarySetDialog: { visible: false, title: "", id: "" } }; columns.map(item => { if (item.dataIndex == "refere") { @@ -69,7 +71,10 @@ export default class SalaryItem extends React.Component { onEditItem = (record, isedit) => { this.record = record; const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props; - this.setState({ editable: isedit, isAdd: false }); + this.setState({ + editable: isedit, isAdd: false, + syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id } + }); getItemForm(record.id).then(() => { setEditSlideVisible(true); }).catch(({ errormsg }) => { @@ -308,6 +313,15 @@ export default class SalaryItem extends React.Component { ]; } else if (this.state.editable) { arrList = [ + , @@ -365,6 +379,15 @@ export default class SalaryItem extends React.Component { + this.setState({ + syncSalarySetDialog: { + ...this.state.syncSalarySetDialog, + visible: false, id: "", title: "" + } + })} + /> { systemItemVisible && diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 97c79576..f02dac13 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -102,3 +102,11 @@ } } } + +.salarySetDialog { + .salarySetDialogContent { + .wea-select, .ant-select-selection, .ant-select { + width: 100%; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js new file mode 100644 index 00000000..bcaa8852 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -0,0 +1,85 @@ +/* + * Author: 黎永顺 + * name: 同步到薪资账套 + * Description: + * Date: 2023/8/31 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import { getSearchs } from "../../util"; +import { getSalarySobBySalaryItem } from "../../apis/item"; +import { salarySetConditions } from "./columns"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("salaryItemStore") +@observer +class SyncToSalaryAccountSetDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + conditions: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { salaryItemStore: { salarySetform } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSalarySobBySalaryItem(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) salarySetform.resetForm(); + } + + getSalarySobBySalaryItem = (props) => { + const { id, salaryItemStore: { salarySetform } } = props; + getSalarySobBySalaryItem({ id }).then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(salarySetConditions, item => { + return { + ...item, + items: _.map(item.items, o => ({ + ...o, + options: _.map(data, it => ({ key: it.id, showname: it.content })) + })) + }; + }) + }, () => { + salarySetform.initFormFields(this.state.conditions); + }); + } + }); + }; + + save = () => { + const { salaryItemStore: { salarySetform } } = this.props; + salarySetform.validateForm().then(f => { + console.log(salarySetform.getFormParams()); + if (f.isValid) { + this.setState({ loading: true }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { salaryItemStore: { salarySetform } } = this.props; + const { conditions } = this.state; + return ( + {getLabel(537558, "确定")}]} + > +
+ {getSearchs(salarySetform, conditions, 1)} +
+
+ ); + } +} + +export default SyncToSalaryAccountSetDialog; diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index 3e97782f..7e7925bc 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -8,6 +8,8 @@ import { notNull } from "../util/validate"; const { TableStore } = WeaTableNew; export class SalaryItemStore { + @observable salarySetform = new WeaForm(); //同步薪资账套form + @observable tableStore = new TableStore(); // new table @observable sysListTableStore = new TableStore(); @observable form = new WeaForm(); // nrew 一个form From 036e59b91a78f7c8bdd309f97b1ae3ea62ad9b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 14:43:57 +0800 Subject: [PATCH 02/18] =?UTF-8?q?feature/2.9.42308.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8C=E6=AD=A5=E5=88=B0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E8=B4=A6=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.less | 34 ++++++++++++++++++- .../syncToSalaryAccountSetDialog.js | 18 +++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index f02dac13..b0063821 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -105,8 +105,40 @@ .salarySetDialog { .salarySetDialogContent { - .wea-select, .ant-select-selection, .ant-select { + .wea-select, .ant-select, .ant-select-selection { width: 100%; } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 345px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js index bcaa8852..e8ca847b 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -7,9 +7,9 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider } from "ecCom"; -import { Button } from "antd"; +import { Button, message } from "antd"; import { getSearchs } from "../../util"; -import { getSalarySobBySalaryItem } from "../../apis/item"; +import { getSalarySobBySalaryItem, syncSalaryItemToSalarySobItem } from "../../apis/item"; import { salarySetConditions } from "./columns"; const getLabel = WeaLocaleProvider.getLabel; @@ -53,11 +53,21 @@ class SyncToSalaryAccountSetDialog extends Component { }; save = () => { - const { salaryItemStore: { salarySetform } } = this.props; + const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props; salarySetform.validateForm().then(f => { - console.log(salarySetform.getFormParams()); if (f.isValid) { + const { salarySobIds } = salarySetform.getFormParams(); this.setState({ loading: true }); + syncSalaryItemToSalarySobItem({ salaryItemId, salarySobIds: salarySobIds.split(",") }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(38462, "同步成功!")); + this.props.onCancel(); + } else { + message.error(errormsg || getLabel(81556, "同步失败!")); + } + }).catch(() => this.setState({ loading: false })); } else { f.showErrors(); } From 2a40afb7b4e6739d707405cde01d1123133d92c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 5 Sep 2023 15:14:05 +0800 Subject: [PATCH 03/18] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/welfareArchive.js | 4 + .../importDialog/components/impStep1.js | 86 +++++++++++ .../importDialog/components/impStep3.js | 51 ++++++ .../components/importDialog/index.js | 135 ++++++++++++++++ .../components/importDialog/index.less | 145 ++++++++++++++++++ .../archives/config/index.js | 9 +- .../socialSecurityBenefits/archives/index.js | 21 ++- 7 files changed, 444 insertions(+), 7 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep1.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep3.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.less diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index a38f22ce..e86e909e 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -13,6 +13,10 @@ export const getCondition = params => { export const queryList = (params) => { return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; +//社保福利档案_非系统人员列表 +export const getExtTable = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getExtTable", params); +}; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js new file mode 100644 index 00000000..9e24dbf5 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤一 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Icon, Upload, message } from "antd"; + +const Dragger = Upload.Dragger; +const { getLabel } = WeaLocaleProvider; + +class ImpStep1 extends Component { + constructor(props) { + super(props); + this.state = { + fileList: [] + }; + } + + handleChange = (data) => { + const { fileList, file } = data; + if (file.response && typeof (file.response) != "undefined") message.success(getLabel(111, "上传成功")); + this.setState({ fileList }); + }; + + render() { + const { fileList } = this.state; + const dragger = { + accept: ".xlsx", + name: "file", + multiple: false, + action: "/api/doc/upload/uploadFile", + fileList, + onChange: this.handleChange + }; + return ( +
+ {/* 导入选项 */} + { + this.props.importParams && +
+
{getLabel(543201, "导入选项")}
+ {this.props.importParams} +
+ } +
{getLabel(543202, "导入Excel")}
+

+ +

+

+

{getLabel(543203, "点击或将文件拖拽到此区域上传")}

+

{getLabel(543204, "支持单个或批量上传,严禁上传公司内部资料及其他违禁文件")}

+
+ +

+ +
+
{getLabel(27577, "操作步骤")}
+

+ {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   + {getLabel(543207, "点击这里下载模板")} +

+

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
+ +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+ +
+ ); + } +} + +export default ImpStep1; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js new file mode 100644 index 00000000..481813b4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤3 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import successImg from "../../importModal/success.svg"; + +const getLabel = WeaLocaleProvider.getLabel; + +class ImpStep3 extends Component { + render() { + const { importResult } = this.props; + return ( +
+ { + !_.isEmpty(importResult) ? +
+

+

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+
: +
+

{getLabel(111, "导入失败")}

+
+ } + { + !_.isEmpty(importResult.errorData) && + + } +
+ ); + } +} + +export default ImpStep3; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js new file mode 100644 index 00000000..49956e37 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -0,0 +1,135 @@ +/* + * Author: 黎永顺 + * name: 导入弹框-步骤条 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; +import ImpStep1 from "./components/impStep1"; +import ImpStep3 from "./components/impStep3"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + current: 0 + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult)) { + this.setState({ + current: this.state.current + 1 + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + } + + renderChildren = () => { + const { current } = this.state; + const { importParams, link, excludeKey, importResult } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = this.step1Ref = dom}/>; + break; + case 1: + CurrentDom = null; + if (excludeKey) { + CurrentDom = ; + } + break; + case 2: + CurrentDom = null; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + + /* + * Author: 黎永顺 + * Description: 下一步 + * Params: + * Date: 2023/8/11 + */ + handleNext = () => { + const { params } = this.props; + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.error(getLabel(111, "请先上传EXCEL文件")); + return; + } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + }; + + render() { + const { current } = this.state; + const stepData = [ + { key: 0, label: getLabel(543202, "上传EXCEL") }, + { key: 1, label: getLabel(543200, "数据预览") }, + { key: 2, label: getLabel(502835, "导入数据") } + ]; + const btns = [ + , + , + + ]; + return ( + +
+
+ + {/*this.props.key: 不需要展示的步骤*/} + { + _.map(_.filter(stepData, item => item.key !== this.props.excludeKey), it => ( + )) + } + +
+
+ { + this.renderChildren() + } +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less new file mode 100644 index 00000000..8e4dbb53 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -0,0 +1,145 @@ +.importBox { + .importCont { + padding: 16px 8px; + + .weapp-batch-impsteps-picker-content-imp-steps { + width: 80%; + margin: 0 auto; + } + + .weapp-batch-impsteps-picker { + margin: 16px auto; + + .weapp-batch-impsteps-picker-content-imp-step1 { + width: 98%; + background-color: #fff; + margin: 8px auto; + border-radius: 3px; + padding: 1px 12px; + + .weapp-batch-impsteps-picker-content-imp-step1 div { + color: #111; + line-height: 22px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param { + box-sizing: border-box; + padding: 16px; + height: auto; + flex-wrap: wrap; + width: 100%; + } + + .weapp-salary-import-param { + border: 1px solid #ebedf0; + padding: 8px; + margin: 4px 0 14px; + } + + .weapp-salary-tb-filter { + display: flex; + flex-wrap: wrap; + align-items: center; + height: 46px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param .tbf-item { + display: flex; + justify-content: flex-start !important; + } + + .weapp-salary-tb-filter .tbf-item { + padding: 0 20px 0 0; + display: flex; + align-items: center; + font-size: 12px; + color: #111; + height: 40px; + } + + .weapp-salary-tb-filter .tbf-item > .tbfi-label { + flex-basis: 100px; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-right: 10px; + color: #666; + } + + .draggerUploadWrapper { + margin: 16px 0 0; + + .ant-upload-drag-container { + padding: 24px 0 16px; + + .iconUpload { + i { + color: #5d9cec; + font-size: 43px; + } + } + + .uplaod-title { + font-size: 14px; + color: #333; + height: 24px; + line-height: 24px; + margin-top: 8px; + } + + .uplaod-subTitle { + height: 22px; + font-size: 12px; + color: #666; + text-align: center; + line-height: 22px; + } + } + } + + .bottom-border, .description { + margin-top: 12px; + + p { + font-size: 12px; + color: #666; + line-height: 15px; + margin: 12px 0; + } + } + + .bottom-border { + border-bottom: 1px solid #e5e5e5; + + .weapp-salary-link { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #5d9cec; + } + } + + } + } + + .weapp-batch-impsteps-picker-content-imp-step3 { + .weapp-batch-impsteps-picker-spinText { + position: relative; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding-top: 80px; + padding-bottom: 80px; + text-align: center; + + p { + margin: 14px 0; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js index de89e096..84bcb6ff 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js @@ -26,5 +26,12 @@ export const tabCondition = [ showcount: true, title: "停缴员工", viewcondition: "stop" - } + }, + { + color: "#000000", + groupid: "ext", + showcount: true, + title: "非系统人员", + viewcondition: "ext" + }, ]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index cab89a87..329dc99e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -19,6 +19,10 @@ import { salaryArchiveDelete } from "../../../apis/payrollFiles"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; +const APILIST = { + runStatuses: API["queryList"], + extWelArchiveList: API["getExtTable"] +}; @inject("archivesStore", "taxAgentStore") @observer export default class Archives extends React.Component { @@ -78,7 +82,7 @@ export default class Archives extends React.Component { const formParams = form.getFormParams() || {}; const payload = { ...pageInfo }; this.setState({ loading: { ...loading, query: true } }); - API.queryList({ ...formParams, ...payload, ...params }).then(({ data, status }) => { + APILIST[_.keys(params)[0]]({ ...formParams, ...payload, ...params }).then(({ data, status }) => { this.setState({ loading: { ...loading, query: false } }); if (status) { const { pageInfo: paganition, columns, datas: dataSource } = data; @@ -375,9 +379,12 @@ export default class Archives extends React.Component { case "suspend": this.queryList({ runStatuses: ["3"] }); break; - default: + case "stop": this.queryList({ runStatuses: ["4", "5"] }); break; + default: + this.queryList({ extWelArchiveList: true }); + break; } }; handleMenuBtnClick = () => { @@ -564,13 +571,15 @@ export default class Archives extends React.Component { {/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/} ; break; - default: + case "stop": dom =
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
{/*
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
*/} {/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/}
; break; + default: + break; } return dom; }; @@ -719,7 +728,7 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ] : [ + ] : selectedKey === "stop" ? [ } @@ -733,7 +742,7 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ]; + ] : []; const pagination = { current: pageInfo.current, @@ -807,7 +816,7 @@ export default class Archives extends React.Component { xWidth={this.getColumns().length * 120} /> { - !_.isEmpty(this.getColumns()) && + !_.isEmpty(this.getColumns()) && selectedKey !== "ext" && {this.getTipChildren()} } From bb1e328c9209e8cd19c786bd9cbe8d70b44a137a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 5 Sep 2023 16:49:26 +0800 Subject: [PATCH 04/18] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importDialog/components/impStep1.js | 3 +- .../components/importDialog/index.js | 7 +-- .../socialSecurityBenefits/archives/index.js | 52 ++++++++++++++++--- pc4mobx/hrmSalary/util/url.js | 15 +++--- 4 files changed, 59 insertions(+), 18 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index 9e24dbf5..e8a3f662 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -62,7 +62,8 @@ class ImpStep1 extends Component {

{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   {getLabel(543207, "点击这里下载模板")} + target="_blank">{getLabel(543207, "点击这里下载模板")}   + {this.props.exportDataDom}

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index 49956e37..bfaf70cf 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -33,11 +33,12 @@ class Index extends Component { renderChildren = () => { const { current } = this.state; - const { importParams, link, excludeKey, importResult } = this.props; + const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; let CurrentDom = null; switch (current) { case 0: - CurrentDom = this.step1Ref = dom}/>; + CurrentDom = this.step1Ref = dom}/>; break; case 1: CurrentDom = null; @@ -74,7 +75,7 @@ class Index extends Component { } } if (_.isEmpty(fileList)) { - message.error(getLabel(111, "请先上传EXCEL文件")); + message.warning(getLabel(111, "请先上传EXCEL文件")); return; } const [file] = fileList; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 329dc99e..864a555b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -2,7 +2,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { Button, Dropdown, Menu, message, Modal, Popover } from "antd"; -import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; +import { WeaCheckbox, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; import { getSearchs, renderLoading } from "../../../util"; import BaseForm from "./baseForm"; import SlideModalTitle from "../../../components/slideModalTitle"; @@ -14,8 +14,9 @@ import * as API from "../../../apis/welfareArchive"; import ImportModal from "../../../components/importModal"; import TipLabel from "../../../components/TipLabel"; import UnifiedTable from "../../../components/UnifiedTable"; -import { convertToUrlString } from "../../../util/url"; +import { convertToUrlString, getURLParameters } from "../../../util/url"; import { salaryArchiveDelete } from "../../../apis/payrollFiles"; +import ImportDialog from "../../../components/importDialog"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -50,14 +51,19 @@ export default class Archives extends React.Component { stayAdd: 0, paying: 0, stayDel: 0, - stopPay: 0 + stopPay: 0, + ext: 0 }, pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 + salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 + importDialog: { + visible: false, title: "", nextloading: false, + link: "" + } }; this.record = {}; } @@ -593,7 +599,8 @@ export default class Archives extends React.Component { dataSource: dataSourceActive, pageInfo, tabCount, - loading + loading, + importDialog } = this.state; const { form, condition, showSearchAd, setShowSearchAd, @@ -742,7 +749,15 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ] : []; + ] : [ + ]; const pagination = { current: pageInfo.current, @@ -887,6 +902,31 @@ export default class Archives extends React.Component { this.setState({ selectedTab: "0" }); })}/> } + this.setState(({ + importDialog: { + visible: false, title: "", nextloading: false, + link: "" + } + }))} + exportDataDom={ + { + const payload = { exportData: val === "1" }; + this.setState(({ + importDialog: { + ...importDialog, + link: `/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true&${convertToUrlString(payload)}` + } + })); + }} + /> + } + nextCallback={()=>{}} + /> { this.state.importVisible && { diff --git a/pc4mobx/hrmSalary/util/url.js b/pc4mobx/hrmSalary/util/url.js index a69b4f81..d2802383 100644 --- a/pc4mobx/hrmSalary/util/url.js +++ b/pc4mobx/hrmSalary/util/url.js @@ -1,11 +1,10 @@ -// export const getQueryString = (name) => { -// let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); -// let r = window.location.hash.split("?")[1].match(reg); -// if (r != null) { -// return decodeURIComponent(r[2]); -// }; -// return null; -// } +export const getURLParameters = (url) => + (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce( + (a, v) => ( + (a[v.slice(0, v.indexOf("="))] = v.slice(v.indexOf("=") + 1)), a + ), + {} + ); export const getQueryString = (variable) => { let split = window.location.hash.split("?"); From f593e9720756b087521eb86640b1ba8348d78335 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, 6 Sep 2023 10:19:35 +0800 Subject: [PATCH 05/18] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importDialog/components/impStep1.js | 6 +- .../importDialog/components/impStep2.js | 49 ++++++++++++++++ .../components/importDialog/index.js | 57 ++++++++++++------- .../components/importDialog/index.less | 2 - .../socialSecurityBenefits/archives/index.js | 32 ++++++++--- .../standingBookDetail/components/index.less | 4 -- pc4mobx/hrmSalary/stores/archives.js | 2 +- 7 files changed, 115 insertions(+), 37 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep2.js diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index e8a3f662..6ab09b3e 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import { Icon, Upload, message } from "antd"; +import { Icon, message, Upload } from "antd"; const Dragger = Upload.Dragger; const { getLabel } = WeaLocaleProvider; @@ -21,8 +21,8 @@ class ImpStep1 extends Component { handleChange = (data) => { const { fileList, file } = data; - if (file.response && typeof (file.response) != "undefined") message.success(getLabel(111, "上传成功")); - this.setState({ fileList }); + if (file.response && typeof (file.response) != "undefined" && file.status !== "removed") message.success(getLabel(111, "上传成功")); + this.setState({ fileList: fileList.slice(-1) }); }; render() { diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js new file mode 100644 index 00000000..8a7373d4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -0,0 +1,49 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤二 + * Description: + * Date: 2023/9/5 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { postFetch } from "../../../util/request"; + +class ImpStep2 extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [] + }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + const { previewUrl, imageId } = this.props; + const payload = { imageId }; + this.setState({ loading: true }); + postFetch(previewUrl, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { headers, list } = data; + this.setState({ + columns: _.map(headers, (item, index) => ({ title: item, dataIndex: index + "", width: 120 })), + dataSource: _.map(list, item => { + return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {}); + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, columns, loading } = this.state; + return ( + + ); + } +} + +export default ImpStep2; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index bfaf70cf..b7eafd97 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { Button, message, Modal } from "antd"; import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; import ImpStep1 from "./components/impStep1"; +import ImpStep2 from "./components/impStep2"; import ImpStep3 from "./components/impStep3"; import "./index.less"; @@ -23,7 +24,7 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult)) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult) && !_.isEmpty(nextProps.importResult)) { this.setState({ current: this.state.current + 1 }); @@ -41,13 +42,13 @@ class Index extends Component { ref={dom => this.step1Ref = dom}/>; break; case 1: - CurrentDom = null; + CurrentDom = ; if (excludeKey) { CurrentDom = ; } break; case 2: - CurrentDom = null; + CurrentDom = ; break; default: CurrentDom = null; @@ -55,7 +56,19 @@ class Index extends Component { } return CurrentDom; }; - + /* + * Author: 黎永顺 + * Description: 上一步 + * Params: + * Date: 2023/9/5 + */ + handlePreviousStep = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "是否放弃已上传的文件?"), + onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) + }); + }; /* * Author: 黎永顺 * Description: 下一步 @@ -63,24 +76,28 @@ class Index extends Component { * Date: 2023/8/11 */ handleNext = () => { - const { params } = this.props; - const { fileList } = this.step1Ref.state; - if (!_.isEmpty(params)) { - if (!Object.values(params).every(o => !!o)) { - Modal.warning({ - title: getLabel(131329, "信息确认"), - content: getLabel(518702, "必要信息不完整,红色*为必填项!") - }); + const { params, importResult } = this.props; + if (_.isEmpty(importResult)) { + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.warning(getLabel(111, "请先上传EXCEL文件")); return; } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + } else { + this.setState({ current: this.state.current + 1 }); } - if (_.isEmpty(fileList)) { - message.warning(getLabel(111, "请先上传EXCEL文件")); - return; - } - const [file] = fileList; - const { response } = file; - this.props.nextCallback(response.data.fileid); }; render() { @@ -91,7 +108,7 @@ class Index extends Component { { key: 2, label: getLabel(502835, "导入数据") } ]; const btns = [ - , + , , diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less index 8e4dbb53..95cee40b 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.less +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -131,8 +131,6 @@ justify-content: center; align-items: center; flex-direction: column; - padding-top: 80px; - padding-bottom: 80px; text-align: center; p { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 864a555b..62bd167d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -62,7 +62,8 @@ export default class Archives extends React.Component { salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 importDialog: { visible: false, title: "", nextloading: false, - link: "" + link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/scheme/preview" } }; this.record = {}; @@ -319,8 +320,19 @@ export default class Archives extends React.Component { // 导入 handleImport = (params) => { const { archivesStore: { importBatch } } = this.props; - const { runStatus } = this.state; - importBatch({ ...params, runStatus }); + const { runStatus, importDialog } = this.state; + this.setState(({ + importDialog: { + ...importDialog, nextloading: true, ...params + } + })); + importBatch({ ...params, runStatus }).then(({ status, data }) => { + this.setState(({ + importDialog: { + ...importDialog, nextloading: false, importResult: data, ...params + } + })); + }); }; // 导入完成 @@ -751,6 +763,7 @@ export default class Archives extends React.Component { ] : [ + ]} + className="shareDialogWrapper" + style={{ + width: 750, + height: 275.6, + minHeight: 200, + minWidth: 380, + maxHeight: "60%", + maxWidth: "60%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {getSearchs(shareForm, conditions, 1, false)} +
+ + ); + } +} + +export default SalaryStatisticsDetailShareDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js new file mode 100644 index 00000000..1632940f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareLogDialog.js @@ -0,0 +1,189 @@ +/* + * Author: 黎永顺 + * name: 分享记录-查看分享记录详情 + * Description: + * Date: 2023/9/19 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { + WeaButtonIcon, + WeaDialog, + WeaHelpfulTip, + WeaInputSearch, + WeaLocaleProvider, + WeaSearchGroup, + WeaTable, + WeaTools +} from "ecCom"; +import { message, Modal } from "antd"; +import { shareLogCondition } from "./condition"; +import { getConditionDomkeys, getSearchs } from "../../../util"; +import { salaryStatisticsPushcancel, salaryStatisticsPushGetDetail } from "../../../apis/statistics"; +import SalaryStatisticsDetailSharePersonDialog from "./salaryStatisticsDetailSharePersonDialog"; +import "./index.less"; + +const getKey = WeaTools.getKey; +const { getLabel } = WeaLocaleProvider; + +@inject("attendanceStore") +@observer +class SalaryStatisticsDetailShareLogDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false, dataSource: [], columns: [], + userNameSearch: "", sharePerDialog: { visible: false, id: "" } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { attendanceStore: { initShareLogForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.salaryStatisticsPushGetDetail(nextProps); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + initShareLogForm(); + } + } + + renderShareLogTitle = () => { + return
+
+ {getLabel(111, "被分享人")} + +
+
+ this.setState({ + sharePerDialog: { + ...this.state.sharePerDialog, + visible: true, id: this.props.id + } + })}/> + this.setState({ userNameSearch: v })} + onSearch={() => this.salaryStatisticsPushGetDetail(this.props)} + /> +
+
; + }; + salaryStatisticsPushGetDetail = (props) => { + const { userNameSearch } = this.state; + const { attendanceStore: { shareLogForm }, id } = props; + this.setState({ loading: true }); + salaryStatisticsPushGetDetail({ id, userNameSearch }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { detailForm, detailTable } = data; + const { columns, list: dataSource } = detailTable; + this.setState({ + columns, dataSource, + conditions: _.map(shareLogCondition, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "effectiveTime") { + return { + ...o, + helpfulTitle: getLabel(111, "有效时间之外,被分享人无法查看您分享的报表") + }; + } + return { ...o }; + }) + }; + }) + }, () => { + shareLogForm.initFormFields(this.state.conditions); + getConditionDomkeys(this.state.conditions).map(key => { + shareLogForm.updateFields({ + [key]: detailForm[key] || "" + }); + }); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + salaryStatisticsPushcancel = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要全部撤回吗?"), + onOk: () => { + salaryStatisticsPushcancel({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(505793, "撤回成功!")); + this.salaryStatisticsPushGetDetail(this.props); + this.props.onGetTable(); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { attendanceStore: { shareLogForm } } = this.props; + const { conditions, dataSource, columns, loading, sharePerDialog } = this.state; + return ( + +
+ {getSearchs(shareLogForm, conditions, 1, false)} + + + {getLabel(30585, "操作")} + +

{getLabel(111, "1、分享状态为成功且撤回状态为空时,可操作撤回;")}

+

{getLabel(111, "2、撤回后不可重新分享;")}

+

{getLabel(111, "3、分享状态为失败,可操作重新分享;")}

+

{getLabel(111, "4、重新分享:以当前分享记录的分享报表、有效时间、渠道和说明重新分享,分享后自动刷新分享时间和分享状态")}

+
+ } + /> + , + render: (__, record) => (_.isEmpty(record.rebackStatus) ? + this.salaryStatisticsPushcancel(record.id)}>{getLabel(32025, "撤回")} : null) + } + ]} + /> + this.setState({ sharePerDialog: { ...sharePerDialog, visible: false, id: "" } })} + onGetTable={() => { + this.salaryStatisticsPushGetDetail(this.props); + this.props.onGetTable(); + }} + /> + + +
+ ); + } +} + +export default SalaryStatisticsDetailShareLogDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js new file mode 100644 index 00000000..b0f8073e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailSharePersonDialog.js @@ -0,0 +1,74 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { salaryStatisticsPushAddSharedSendMsg } from "../../../apis/statistics"; +import { sharePersonCondition } from "./condition"; +import { getSearchs } from "../../../util"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("attendanceStore") +@observer +class SalaryStatisticsDetailSharePersonDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { attendanceStore: { initSharePerForm, sharePerForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) { + sharePerForm.initFormFields(sharePersonCondition); + } else { + initSharePerForm(); + } + } + + save = () => { + const { attendanceStore: { sharePerForm }, id } = this.props; + sharePerForm.validateForm().then(f => { + if (f.isValid) { + const { sharedBy } = sharePerForm.getFormParams(); + const payload = { + id, sharedBy: sharedBy.split(",") + }; + salaryStatisticsPushAddSharedSendMsg(payload) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(); + this.props.onGetTable(); + } else { + message.error(errormsg); + } + }) + .catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { attendanceStore: { sharePerForm }, loading } = this.props; + return ( + {getLabel(111, "保存并分享")} + ]} + style={{ width: 600, height: 100 }} + > + {getSearchs(sharePerForm, sharePersonCondition, 1, false)} + + ); + } +} + +export default SalaryStatisticsDetailSharePersonDialog; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js new file mode 100644 index 00000000..3e35f626 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/salaryStatisticsDetailShareRecord.js @@ -0,0 +1,132 @@ +/* + * Author: 黎永顺 + * name: 统计报表-分享记录 + * Description: + * Date: 2023/9/19 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSlideModal, WeaTable } from "ecCom"; +import { message, Modal } from "antd"; +import { salaryStatisticsPushcancelAll, salaryStatisticsPushGetTable } from "../../../apis/statistics"; +import SalaryStatisticsDetailShareLogDialog from "./salaryStatisticsDetailShareLogDialog"; + +const { getLabel } = WeaLocaleProvider; + +class SalaryStatisticsDetailShareRecord extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], columns: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + shareLogDialog: { + visible: false, id: "" + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.salaryStatisticsPushGetTable(); + } + + salaryStatisticsPushGetTable = () => { + this.setState({ loading: true }); + salaryStatisticsPushGetTable({ ...this.state.pageInfo }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, + pageInfo: { ...this.state.pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleWithdrawAll = (id) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要全部撤回吗?"), + onOk: () => { + salaryStatisticsPushcancelAll({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.salaryStatisticsPushGetTable(); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { dataSource, columns, loading, pageInfo, shareLogDialog } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.salaryStatisticsPushGetTable(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.salaryStatisticsPushGetTable(); + }); + } + }; + return ( + +
+
+
+
{getLabel(111, "分享记录")}
+
+
+
+ } + content={( + ( + + this.setState({ + shareLogDialog: { visible: true, id: record.id } + })}>{getLabel(111, "查询详情")} + this.handleWithdrawAll(record.id)}>{getLabel(111, "全部撤回")} + this.salaryStatisticsPushGetTable()} + onCancel={() => this.setState({ + shareLogDialog: { visible: false, id: "" } + })} + /> + + ) + } + ]} + /> + )}/> + ); + } +} + +export default SalaryStatisticsDetailShareRecord; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js new file mode 100644 index 00000000..a2a7b0ae --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/components/topBtns.js @@ -0,0 +1,54 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import SalaryStatisticsDetailShareDialog from "./salaryStatisticsDetailShareDialog"; +import SalaryStatisticsDetailShareRecord from "./salaryStatisticsDetailShareRecord"; + +const { getLabel } = WeaLocaleProvider; + +class TopBtns extends Component { + constructor(props) { + super(props); + this.state = { + shareDialog: { + visible: false + }, + shareRecordDialog: { + visible: false + } + }; + } + + handleShare = () => { + this.setState({ + shareDialog: { visible: true } + }); + }; + handleShareRecord = () => { + this.setState({ + shareRecordDialog: { visible: true } + }); + }; + + render() { + const { shareDialog, shareRecordDialog } = this.state; + return [ + , + , + this.setState({ + shareDialog: { visible: false } + })} + />, + this.setState({ + shareRecordDialog: { visible: false } + })} + /> + ]; + } +} + +export default TopBtns; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index c315ae53..4e0829a3 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -11,9 +11,11 @@ import { message, Modal } from "antd"; import LeftTab from "./components/leftTab"; import ReportContent from "./components/reportContent"; import StatisticalMicroSettingsSlide from "./components/statisticalMicroSettingsSlide"; +import TopBtns from "./components/topBtns"; import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig"; import "./index.less"; + const { getLabel } = WeaLocaleProvider; @inject("taxAgentStore", "attendanceStore") @@ -98,14 +100,12 @@ class Index extends Component { render() { const { report, dimensionList, statisticalPayload } = this.state; - const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption } } = this.props; + const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props; return ( } - iconBgcolor="#F14A2D" - showDropIcon={false} - className="reportViewWrapper" + title={getLabel(111, "报表查看")} icon={} + iconBgcolor="#F14A2D" className="reportViewWrapper" + buttons={showOperateBtn ? [] : []} > this.shareForm = new WeaForm(); + @action("报表查看-查看分享记录详情表单初始化") + initShareLogForm = () => this.shareLogForm = new WeaForm(); + @action("报表查看-追加被分享人表单初始化") + initSharePerForm = () => this.sharePerForm = new WeaForm(); } From 6ac979e9e7afbb4b818cc59228e1a4ae594131b6 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, 20 Sep 2023 09:25:10 +0800 Subject: [PATCH 09/18] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/reportView/components/condition.js | 22 +++- .../reportView/components/reportContent.js | 21 +-- .../reportView/components/rightOptions.js | 9 +- .../salaryStatisticsDetailShareDialog.js | 2 +- .../statisticalMicroSettingsSlide.js | 120 +++++++++++------- pc4mobx/hrmSalary/pages/reportView/index.js | 15 +-- 6 files changed, 114 insertions(+), 75 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index 816dec2d..9d141953 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -215,16 +215,26 @@ export const shareCondition = [ viewAttr: 3 }, { - colSpan: 1, - conditionType: "RANGEPICKER", - domkey: ["startTime", "endTime"], + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["startTime"], fieldcol: 12, - label: "报表查看有效时间", + label: "报表查看有效开始时间", lanId: 111, labelcol: 6, value: "", - rules: "required", - viewAttr: 3 + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "DATEPICKER", + domkey: ["endTime"], + fieldcol: 12, + label: "报表查看有效结束时间", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 }, { colSpan: 1, diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index e87e1eed..9ddc8380 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -43,7 +43,7 @@ class ReportContent extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.report !== this.props.report && nextProps.report.dimensionId) { - this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId); + this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId, nextProps.report.isShare); this.setState({ viewType: "dataView", chartsInfo: {} }); } } @@ -64,7 +64,8 @@ class ReportContent extends Component { //数据透视弹框 if (id === "PIVOTCHART") { const { record } = params; - const { dimension: dimensionValue } = record; + const { dimension: dimensionValue, isShare } = record; + if (isShare) return; const { id: pivotId, dimensionId } = this.props.report; this.setState({ povitView: { @@ -81,8 +82,8 @@ class ReportContent extends Component { dataSource, columns, showSum, countResult }), "*"); }; - reportStatisticsReportGetData = (id, dimensionId) => { - const payload = { id, dimensionId }; + reportStatisticsReportGetData = (id, dimensionId, isShare) => { + const payload = { id, dimensionId, isShare }; this.setState({ loading: true }); reportStatisticsReportGetData(payload).then(({ status, data }) => { this.setState({ loading: false }); @@ -191,13 +192,13 @@ class ReportContent extends Component { handleChangeChartOpts = (chartsType, viewType) => { this.setState({ chartsInfo: {} }); if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); - const { report: { id: reportId, dimensionId } } = this.props; + const { report: { id: reportId, dimensionId, isShare } } = this.props; const { rangSet } = this.state; viewType !== "setting" && this.setState({ chartsType, viewType }, () => { const { viewType, chartsType } = this.state; viewType !== "dataView" ? this.queryRangeSetting({ reportId, chartsType }, true) : - this.reportStatisticsReportGetData(reportId, dimensionId); + this.reportStatisticsReportGetData(reportId, dimensionId, isShare); }); viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => { this.queryRangeSetting({ reportId, chartsType }); @@ -213,8 +214,8 @@ class ReportContent extends Component { }; handleGetData = () => { const { report } = this.props; - const { id, dimensionId } = report; - this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId)); + const { id, dimensionId, isShare } = report; + this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare)); }; renderCharts = () => { const { chartsInfo, viewType } = this.state; @@ -229,6 +230,8 @@ class ReportContent extends Component { render() { const { loading, viewType, rangSet, columns, povitView } = this.state; + const { report } = this.props; + const { isShare } = report; return (
@@ -245,7 +248,7 @@ class ReportContent extends Component {
{/*侧边栏*/} - + {/* 图表范围数据设置框 */} @@ -32,8 +32,11 @@ class RightOptions extends Component { onClick={() => onChange("1", "bar")}/> onChange("2", "line")}/> onChange("0", "pie")}/> - onChange("1", "setting")}/> + { + !isShare && + onChange("1", "setting")}/> + }
{ - return { - ...item, - items: _.map(item.items, child => { - if (child.domkey[0] === "taxAgent") { - return { - ...child, - options: toJS(nextProps.taxAgentAdminOption) - }; - } - return { ...child }; - }) - }; - }); - this.setState({ conditions }); - nextProps.form.initFormFields(condition); - } + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentSelectList(nextProps); if (nextProps.id !== this.props.id && !_.isEmpty(nextProps.id)) { - this.reportStatisticsGetSearchCondition(nextProps.id); this.statisticsItemList(nextProps.id).then(r => { }); } @@ -82,6 +66,31 @@ class StatisticalMicroSettingsSlide extends Component { } } + getTaxAgentSelectList = (props) => { + getTaxAgentSelectList().then(({ status, data }) => { + if (status) { + const conditions = _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + if (getKey(child) === "taxAgent") { + return { + ...child, viewAttr: props.isShare ? 1 : child.viewAttr, + options: _.map(data, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, viewAttr: props.isShare ? 1 : child.viewAttr }; + }) + }; + }); + this.setState({ conditions }, () => { + props.form.initFormFields(this.state.conditions); + props.id && this.reportStatisticsGetSearchCondition(props.id); + }); + + } + }); + }; reportStatisticsGetSearchCondition = (id) => { const { conditions } = this.state; const { form } = this.props; @@ -189,7 +198,7 @@ class StatisticalMicroSettingsSlide extends Component { }; renderProjectTitle = () => { const { selectedRowKeys } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; return
{getLabel(111, "统计项目")} @@ -198,19 +207,25 @@ class StatisticalMicroSettingsSlide extends Component { />
- - this.setState({ - statisticalItemPayload: { - visible: true, id, dimension, - statisticsItemId: "" - } - })} - /> + { + !isShare && + + } + { + !isShare && + this.setState({ + statisticalItemPayload: { + visible: true, id, dimension, + statisticsItemId: "" + } + })} + /> + }
; }; @@ -220,16 +235,19 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth, conditions, selectedRowKeys, loading, statisticalItemPayload, dataSource, unitTypeList } = this.state; - const { id, dimension } = this.props; + const { id, dimension, isShare } = this.props; const columns = [ { title: "统计项名称", dataIndex: "itemName", render: (txt, record) => { return ( - this.setState({ - statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } - })}>{txt} + { + if (isShare) return; + this.setState({ + statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } + }); + }}>{txt} ); } }, @@ -238,7 +256,7 @@ class StatisticalMicroSettingsSlide extends Component { dataIndex: "unitType", render: (txt, record) => { return this.customStatisticsItemsRef.reportStatisticsItemSave({ id: record.id, unitType })} />; } @@ -248,7 +266,10 @@ class StatisticalMicroSettingsSlide extends Component { selectedRowKeys, onChange: (selectedRowKeys) => { this.setState({ selectedRowKeys }); - } + }, + getCheckboxProps: record => ({ + disabled: isShare + }) }; return ( } + title={} content={ - this.setState({ salaryMonth: v })}/> @@ -319,16 +340,19 @@ const TitleDialog = (props) => {
- + { + !props.isShare && + + }
; }; export const MonthRangePicker = (props) => { - const { dateRange, onChange, viewAttr } = props; + const { dateRange, onChange, viewAttr, disabled = false } = props; const [startDate, endDate] = dateRange || []; return
{ return current && endDate && current.getTime() > new Date(endDate).getTime(); }} @@ -338,7 +362,7 @@ export const MonthRangePicker = (props) => { /> { return current && startDate && current.getTime() < new Date(startDate).getTime(); }} diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 4e0829a3..2db97c5c 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -33,9 +33,7 @@ class Index extends Component { } componentDidMount() { - const { taxAgentStore: { fetchTaxAgentOption } } = this.props; this.reportGetForm(); - fetchTaxAgentOption(); } reportGetForm = () => { @@ -94,18 +92,19 @@ class Index extends Component { */ exportData = () => { const { report } = this.state; - const { id, dimensionId } = report; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}`, "_self"); + const { id, dimensionId, isShare } = report; + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_self"); }; render() { const { report, dimensionList, statisticalPayload } = this.state; + const { isShare } = report; const { attendanceStore: { settingForm }, taxAgentStore: { taxAgentOption, showOperateBtn } } = this.props; return ( } iconBgcolor="#F14A2D" className="reportViewWrapper" - buttons={showOperateBtn ? [] : []} + buttons={(showOperateBtn && !isShare) ? [] : []} >
{getLabel(111, "统计维度")}: - this.handleChangeDimension(key, showname)}/>
@@ -150,10 +149,10 @@ class Index extends Component { {/*统计数据范围及规则设置弹框*/} this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } - }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId))} + }, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))} />
From a58da11dc339be3dc80da46c1b9cb8db31a0d6a1 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, 20 Sep 2023 14:20:51 +0800 Subject: [PATCH 10/18] hotfix/2.9.42309.01 20230920 --- .../payroll/templatePreview/computerTemplate/index.js | 2 +- .../pages/payroll/templatePreview/phoneTemplate/index.js | 2 +- .../pages/payrollFiles/components/allWithoutPay.js | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js index 8bcb6aa8..aeb6db18 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -94,7 +94,7 @@ export default class ComputerTemplate extends React.Component {
{ salaryItemSet.length > 0 && - salaryItemSet.map((group, index) => { + _.filter(salaryItemSet, it => (!_.isNil(it) && !_.isEmpty(it))).map((group, index) => { return
{group.groupName}
diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js index 01730ef7..67c1ebef 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js @@ -75,7 +75,7 @@ export default class PhoneTemplate extends React.Component {
{ salaryItemSet.length > 0 && - salaryItemSet.map((group, index) => ( + _.filter(salaryItemSet, it => (!_.isNil(it) && !_.isEmpty(it))).map((group, index) => (
{group.groupName}
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js index c9d85ff8..5b2ca302 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/allWithoutPay.js @@ -11,15 +11,16 @@ class AllWithoutPay extends Component { message.warning("未选择条目"); return; } - API.gotoStop(selectedRowKeys).then(({ status, errormsg }) => { + API.gotoStop(selectedRowKeys).then(({ status, data, errormsg }) => { if (status) { - message.success("操作成功!"); + const { msg } = data; + message.info(msg || "操作成功!"); refreshList(); } else { message.error(errormsg || "操作失败!"); } }); - }else{ + } else { const { pageInfo } = this.props; if (pageInfo.total === 0) { message.warning("您没有需要处理的待停薪人员!"); @@ -31,7 +32,7 @@ class AllWithoutPay extends Component { onOk: () => { API.allGotoStop({}).then(({ status, data, errormsg }) => { if (status) { - const { msg }= data; + const { msg } = data; message.info(msg || "操作成功!"); refreshList(); } else { From d7c59f543486bd874f7a8741288177cbe47596f5 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, 20 Sep 2023 15:03:05 +0800 Subject: [PATCH 11/18] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=2020230920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/reportList.js | 21 +++++++++++-------- .../reportView/components/reportContent.js | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 6510d5b1..30b8a474 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -73,7 +73,7 @@ class ReportList extends Component { { _.isEmpty(dataSource) ?
{getLabel(111, "暂无数据")}
: _.map(dataSource, it => { - const { reportName, dimension, id, dimensionId } = it; + const { reportName, dimension, id, dimensionId, isShare } = it; return this.handleGoReportView(id)}>
@@ -85,14 +85,17 @@ class ReportList extends Component {
- this.handleOptsClick(e, id, dimensionId)}> - {getLabel(111, "编辑")} - {getLabel(111, "删除")} - - }> - - + { + !isShare && + this.handleOptsClick(e, id, dimensionId)}> + {getLabel(111, "编辑")} + {getLabel(111, "删除")} + + }> + + + }
; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index 9ddc8380..c3e9d6e7 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -64,9 +64,9 @@ class ReportContent extends Component { //数据透视弹框 if (id === "PIVOTCHART") { const { record } = params; - const { dimension: dimensionValue, isShare } = record; + const { dimension: dimensionValue } = record; + const { id: pivotId, dimensionId, isShare } = this.props.report; if (isShare) return; - const { id: pivotId, dimensionId } = this.props.report; this.setState({ povitView: { visible: true, id: pivotId, dimensionId, dimensionValue From b22b41382f4ba8339eb93a0b6345fab079a261a4 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, 20 Sep 2023 16:51:00 +0800 Subject: [PATCH 12/18] =?UTF-8?q?hotfix/2.9.42309.01=2020230920-=E7=A4=BE?= =?UTF-8?q?=E4=BF=9D=E7=A6=8F=E5=88=A9=E6=96=B9=E6=A1=88=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../programme/columns.js | 141 +++++------------- .../programme/defaultSlideForm.js | 5 + .../socialSecurityBenefits/programme/index.js | 123 +++++++++------ pc4mobx/hrmSalary/stores/programme.js | 30 ++-- 4 files changed, 130 insertions(+), 169 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js index 5acd68bf..b20698b6 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js @@ -1,114 +1,10 @@ -// 社保 -export const socialSecurityColumns = [{ - title: "方案名称", - dataIndex: "title", - key: "title" -}, { - title: "缴纳类型", - dataIndex: "username", - key: "username" -}, { - title: "缴纳范围", - dataIndex: "projectName", - key: "projectName" -}, { - title: "备注", - dataIndex: "customer", - key: "customer" -}, { - title: "操作", - dataIndex: "customer", - key: "customer" -}]; - -// 公积金 -export const accumulationFundColumns = [{ - title: "方案名称", - dataIndex: "title", - key: "title" -}, { - title: "缴纳类型", - dataIndex: "username", - key: "username" -}, { - title: "缴纳范围", - dataIndex: "projectName", - key: "projectName" -}, { - title: "备注", - dataIndex: "customer", - key: "customer" -}, { - title: "操作", - dataIndex: "customer", - key: "customer" -}]; - -// 企业年金及其他福利 -export const otherBenefitsColumns = [ - { - title: "方案名称", - dataIndex: "title", - key: "title" - - }, - { - title: "缴纳类型", - dataIndex: "title", - key: "title" - }, - { - title: "缴纳范围", - dataIndex: "title", - key: "title" - }, - { - title: "备注", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; - -export const CustomBenefitsColumns = [ - { - title: "福利名称", - dataIndex: "title", - key: "title" - }, - { - title: "启用", - dataIndex: "title", - key: "title" - }, - { - title: "类型", - dataIndex: "title", - key: "title" - }, - { - title: "缴纳对象", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; - export const insertUpdateColumns = [ { title: "类型名称", dataIndex: "insuranceName", key: "insuranceName", width: 120, - fixed: 'left' + fixed: "left" }, { title: "是否缴费", @@ -172,8 +68,39 @@ export const insertUpdateColumns = [ } ]; - -export const dataSource = []; +export const conditons = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["schemeName"], + fieldcol: 12, + isQuickSearch: true, + label: "方案名称", + lanId: 33162, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["paymentType"], + fieldcol: 12, + isQuickSearch: true, + label: "缴纳类型", + lanId: 543163, + labelcol: 6, + value: "", + options: [], + viewAttr: 2 + } + ], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index fabf6a86..e7c215c2 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -141,6 +141,11 @@ export default class DefaultSlideForm extends React.Component { key: "2", selected: true, showname: "2" + }, + { + key: "3", + selected: false, + showname: "3" } ]; item.render = (text, record) => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 1181f8a0..8ef780b3 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -2,9 +2,8 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { Button, Dropdown, Menu, message, Modal } from "antd"; -import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom"; -import { renderNoright } from "../../../util"; -import CustomTab from "../../../components/customTab"; +import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTab, WeaTools, WeaTop } from "ecCom"; +import { getSearchs, renderNoright } from "../../../util"; import SlideModalTitle from "../../../components/slideModalTitle"; import TipLabel from "../../../components/TipLabel"; import DefaultSlideForm from "./defaultSlideForm"; @@ -14,8 +13,10 @@ import CustomPaginationTable from "../../../components/customPaginationTable"; import TwoColContent from "../../../components/twoColContent"; import CopySchemaModal from "./copySchemaModal"; import CustomBenefitsTable from "./customBenefitsTable"; +import { conditons } from "./columns"; import "./index.less"; +const getKey = WeaTools.getKey; const { getLabel } = WeaLocaleProvider; @inject("programmeStore", "taxAgentStore", "salaryFileStore") @observer @@ -30,7 +31,8 @@ export default class Programme extends React.Component { copyModalValue: "", copyId: "", customNewVisible: false, - customEdit: false + customEdit: false, + showSearchAd: false }; this.pageInfo = { current: 1, pageSize: 10 }; @@ -38,12 +40,29 @@ export default class Programme extends React.Component { componentWillMount() { const { programmeStore, salaryFileStore, taxAgentStore } = this.props; - const { doInit } = programmeStore; + const { doInit, planSearchForm } = programmeStore; doInit(); const { commonEnumList } = salaryFileStore; commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }); const { getTaxAgentSelectListAsAdmin } = taxAgentStore; getTaxAgentSelectListAsAdmin(); + planSearchForm.initFormFields(_.map(conditons, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "paymentType") { + return { + ...o, + options: [ + { key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") }, + { key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") } + ] + }; + } + return { ...o }; + }) + }; + })); } // 增加编辑功能,重写columns绑定事件 @@ -173,6 +192,7 @@ export default class Programme extends React.Component { } render() { + const { showSearchAd } = this.state; const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props; const { loading, hasRight, form, getTableDatas } = programmeStore; const { @@ -187,7 +207,8 @@ export default class Programme extends React.Component { customNewVisible, tableDataSource, tableColumns, - tablePageInfo + tablePageInfo, + planSearchForm } = programmeStore; if (!hasRight && !loading) return renderNoright(); @@ -317,59 +338,65 @@ export default class Programme extends React.Component { const { programmeStore: { initSlideParms } } = this.props; initSlideParms(); }; - + const customButtons = [ + { + setCustomSelectkey(v); + this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v }); + }} + /> + ]; + const tabButtons = [ + + ]; return (
} // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={false} // 是否显示下拉按钮 + title="社保福利方案" icon={} + iconBgcolor="#F14A2D" showDropIcon={false} > - - {/* 操作按钮权限 */} - {showOperateBtn && - } - - {selectedKey == "custom" && - { - setCustomSelectkey(v); - this.customBenefitsTableRef.getCustomCategoryList({ current: 1, welfareTypeEnum: v }); - }} - />} -
- } + this.setState({ showSearchAd: bool })} + advanceHeight={200} searchsAd={getSearchs(planSearchForm, _.map(conditons, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "paymentType") { + return { + ...o, + options: [ + { key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") }, + { key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") } + ] + }; + } + return { ...o }; + }) + }; + }), 2, false)} + onAdSearch={() => getTableDatas(selectedKey)} + onAdReset={v => planSearchForm.resetForm()} + onSearch={() => getTableDatas(selectedKey)} onChange={v => { setSelectedKey(v); handleSlideClose(); - if (v == "custom") { - // 自定义福利 - } else { - getTableDatas(v); - } + v !== "custom" && getTableDatas(v); }} + onSearchChange={v => planSearchForm.updateFields({ schemeName: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 + searchsBaseValue={planSearchForm.getFormParams().schemeName} + buttons={!showOperateBtn ? [] : selectedKey !== "custom" ? tabButtons : [...tabButtons, ...customButtons]} />
- {selectedKey == "custom" + {selectedKey === "custom" ? { this.loading = true; - const formParams = this.form.getFormParams() || {}; - params = params || formParams; - params.welfareTypeEnum = selectKey; - API.getTable(params).then(action(res => { - if (res.status) { // 接口请求成功/失败处理 - // this.tableStore.getDatas(res.data.datas); // table 请求数据 - this.tableDataSource = res.data.list ? res.data.list : []; - this.tableColumns = res.data.columns; - this.tablePageInfo = res.data; - } else { - message.error(res.errormsg || "接口调用失败!"); - } - this.loading = false; - })); + API.getTable({ ...params, ...this.planSearchForm.getFormParams(), welfareTypeEnum: selectKey }) + .then(action(res => { + if (res.status) { // 接口请求成功/失败处理 + // this.tableStore.getDatas(res.data.datas); // table 请求数据 + this.tableDataSource = res.data.list ? res.data.list : []; + this.tableColumns = res.data.columns; + this.tablePageInfo = res.data; + } else { + message.error(res.errormsg || "接口调用失败!"); + } + this.loading = false; + })); }; From d664ad27691a37b2f8515a53a61d86fcbaa6243c 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, 20 Sep 2023 17:03:24 +0800 Subject: [PATCH 13/18] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=2020230920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 18 +++++++----------- .../statisticalMicroSettingsSlide.js | 2 +- pc4mobx/hrmSalary/pages/reportView/index.js | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 25747f12..1b0f58d8 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { formPost, postFetch } from "../util/request"; +import { postFetch } from "../util/request"; //个税扣缴义务人列表 export const getTaxAgentList = (params) => { @@ -7,9 +7,9 @@ export const getTaxAgentList = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //同步人员范围 @@ -18,9 +18,9 @@ export const taxAgentRangeSync = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -108,12 +108,8 @@ export const taxAgentRangeImportData = (params) => { }; //个税扣缴义务人下拉列表 -export const getTaxAgentSelectList = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/selectList", - "GET", - params - ); +export const getTaxAgentSelectList = (isShare = false) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare }); }; //当前登录人个税扣缴义务人下拉列表 diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 536ad2da..65668107 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -67,7 +67,7 @@ class StatisticalMicroSettingsSlide extends Component { } getTaxAgentSelectList = (props) => { - getTaxAgentSelectList().then(({ status, data }) => { + getTaxAgentSelectList(true).then(({ status, data }) => { if (status) { const conditions = _.map(condition, item => { return { diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 2db97c5c..ffe5a3db 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -93,7 +93,7 @@ class Index extends Component { exportData = () => { const { report } = this.state; const { id, dimensionId, isShare } = report; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_self"); + window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_blank"); }; render() { From 26fdf624bbc82e1b6db5f48401a83897011df6de 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, 20 Sep 2023 17:25:56 +0800 Subject: [PATCH 14/18] hotfix/2.9.42309.01 --- .../standingBookDetail/components/adjustmentSlide.js | 2 +- .../standingBookDetail/components/index.less | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 90fe32b1..2fb3f37c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -73,7 +73,7 @@ class AdjustmentSlide extends Component { const { data: dataMsg, errorMessage = [] } = data; const msg = dataMsg + errorMessage.join(","); !_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功"); - _.isEmpty(errorMessage) && + // _.isEmpty(errorMessage) && this.adjustTableRef.getCompensationList().then(r => { }); } else { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 7bb28208..0481abfb 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -4,10 +4,6 @@ height: 100%; background: #f6f6f6; - .wea-new-top-req-wapper .wea-new-top-req-main { - background: #f6f6f6 !important; - } - .wea-new-top-req-wapper .wea-new-top-req { z-index: 0 !important; } From c0220d88534260a838baa10a6c8a28b336d39845 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, 20 Sep 2023 17:29:50 +0800 Subject: [PATCH 15/18] hotfix/2.9.42309.01 --- .../hrmSalary/pages/socialSecurityBenefits/programme/columns.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js index b20698b6..80fe193f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js @@ -86,7 +86,7 @@ export const conditons = [ { colSpan: 2, conditionType: "SELECT", - domkey: ["paymentType"], + domkey: ["paymentTypeEnum"], fieldcol: 12, isQuickSearch: true, label: "缴纳类型", From e7e4d17cfaf7b72aff6b78f569ce952446b96cf9 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, 20 Sep 2023 17:42:06 +0800 Subject: [PATCH 16/18] hotfix/2.9.42309.01 --- .../hrmSalary/pages/socialSecurityBenefits/programme/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 8ef780b3..c3673fae 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -50,7 +50,7 @@ export default class Programme extends React.Component { return { ...item, items: _.map(item.items, o => { - if (getKey(o) === "paymentType") { + if (getKey(o) === "paymentTypeEnum") { return { ...o, options: [ @@ -369,7 +369,7 @@ export default class Programme extends React.Component { return { ...item, items: _.map(item.items, o => { - if (getKey(o) === "paymentType") { + if (getKey(o) === "paymentTypeEnum") { return { ...o, options: [ From 96032b5f1c9918098be7095061d194e2ea898fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 21 Sep 2023 10:17:06 +0800 Subject: [PATCH 17/18] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E9=85=AC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E5=88=86=E4=BA=AB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customStatisticsItemsModal.js | 22 ++++++++++++------- .../components/povitpivotChartModal.js | 10 ++++----- .../reportView/components/reportContent.js | 8 +++---- .../statisticalMicroSettingsSlide.js | 15 +++++-------- pc4mobx/hrmSalary/pages/reportView/index.less | 12 ++++++++++ 5 files changed, 40 insertions(+), 27 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js index f87d7912..49f5a462 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js @@ -269,7 +269,7 @@ class CustomStatisticsItemsModal extends Component { render() { const { loading, columns, dataSource, formData } = this.state; const { itemName, itemValue, itemValueSpan } = formData; - const { statisticsItemId } = this.props; + const { statisticsItemId, isShare } = this.props; const cols = _.map(columns, it => { const { text, column } = it; if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") { @@ -278,6 +278,7 @@ class CustomStatisticsItemsModal extends Component { ...it, title: !!child[`${key}Value`])} onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)} /> @@ -286,6 +287,7 @@ class CustomStatisticsItemsModal extends Component { render: (txt, record) => { return this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)} /> @@ -305,6 +307,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["m2mValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -321,6 +324,7 @@ class CustomStatisticsItemsModal extends Component { , render: (txt, record) => { return !!record["y2yValue"] && this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)} @@ -335,8 +339,10 @@ class CustomStatisticsItemsModal extends Component { title={
{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")} - + { + !isShare && + }
} style={{ width: 900, height: 450 }} @@ -348,7 +354,7 @@ class CustomStatisticsItemsModal extends Component { ({ @@ -381,7 +387,7 @@ class CustomStatisticsItemsModal extends Component { - this.setState({ formData: { ...formData, itemName } })}/> @@ -406,11 +412,11 @@ export default CustomStatisticsItemsModal; * Date: 2023/4/23 */ const IntervalSettingsComp = (props) => { - const { LowerLimit, UpperLimit, onChange } = props; + const { LowerLimit, UpperLimit, onChange, isShare } = props; return
- onChange("min", val)}/> + onChange("min", val)} disabled={isShare}/> {`% <${getLabel(111, "增幅")}<`} - onChange("max", val)}/> + onChange("max", val)} disabled={isShare}/> %
; }; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js index 4af04328..801bb99e 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/povitpivotChartModal.js @@ -35,8 +35,8 @@ class PovitpivotChartModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { id, dimensionId, dimensionValue } = nextProps; - this.getDataPerspective({ id, dimensionId, dimensionValue }); + const { id, dimensionId, dimensionValue, isShare } = nextProps; + this.getDataPerspective({ id, dimensionId, dimensionValue, isShare }); } else { this.setState({ dataSource: [], @@ -63,13 +63,11 @@ class PovitpivotChartModal extends Component { }); } else if (type === "turn") { if (id === "PAGEINFO") { - const { id, dimensionId, dimensionValue } = this.props; + const { id, dimensionId, dimensionValue, isShare } = this.props; const { pageNum: current, size: pageSize } = params; this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getDataPerspective({ - id, - dimensionId, - dimensionValue + id, dimensionId, dimensionValue, isShare })); } } diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index c3e9d6e7..70980238 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -26,7 +26,7 @@ class ReportContent extends Component { chartsType: "0", chartsInfo: {}, povitView: { - visible: false, id: "", + visible: false, id: "", isShare: false, dimensionId: "", dimensionValue: "" }, rangSet: { @@ -66,10 +66,9 @@ class ReportContent extends Component { const { record } = params; const { dimension: dimensionValue } = record; const { id: pivotId, dimensionId, isShare } = this.props.report; - if (isShare) return; this.setState({ povitView: { - visible: true, id: pivotId, dimensionId, dimensionValue + visible: true, id: pivotId, dimensionId, dimensionValue, isShare } }); } @@ -262,7 +261,8 @@ class ReportContent extends Component { {...povitView} onCancel={() => this.setState({ povitView: { - visible: false, id: "", dimensionId: "", dimensionValue: "" + visible: false, id: "", dimensionId: "", dimensionValue: "", + isShare: false } })} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 65668107..32f074d1 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -49,7 +49,7 @@ class StatisticalMicroSettingsSlide extends Component { salaryMonth: [], statisticalItemPayload: { visible: false, id: "", dimension: "", - statisticsItemId: "" + statisticsItemId: "", isShare: false } }; } @@ -67,7 +67,7 @@ class StatisticalMicroSettingsSlide extends Component { } getTaxAgentSelectList = (props) => { - getTaxAgentSelectList(true).then(({ status, data }) => { + getTaxAgentSelectList(props.isShare).then(({ status, data }) => { if (status) { const conditions = _.map(condition, item => { return { @@ -221,7 +221,7 @@ class StatisticalMicroSettingsSlide extends Component { onClick={() => this.setState({ statisticalItemPayload: { visible: true, id, dimension, - statisticsItemId: "" + statisticsItemId: "", isShare } })} /> @@ -243,9 +243,8 @@ class StatisticalMicroSettingsSlide extends Component { render: (txt, record) => { return ( { - if (isShare) return; this.setState({ - statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id } + statisticalItemPayload: { visible: true, id, dimension, statisticsItemId: record.id, isShare } }); }}>{txt} ); @@ -315,10 +314,8 @@ class StatisticalMicroSettingsSlide extends Component { {...statisticalItemPayload} onCancel={(isRefresh) => this.setState({ statisticalItemPayload: { - visible: false, - id: "", - dimension: "", - statisticsItemId: "" + visible: false, id: "", dimension: "", + statisticsItemId: "", isShare: false } }, () => isRefresh && this.statisticsItemList(this.props.id))} /> diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index 99d4d917..ecf9b997 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -204,6 +204,18 @@ .microSlideWrapper { z-index: 999; + .wea-form-item-wrapper { + display: flex !important; + + .wea-browser { + width: 100%; + } + } + + .wea-form-item .wea-form-item-wrapper .wea-field-readonly { + white-space: pre-wrap !important; + } + .wea-slide-modal-title { height: auto !important; line-height: normal !important; From 9030e2244997e4c426783b01ea80f60d5aff5763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 21 Sep 2023 12:04:55 +0800 Subject: [PATCH 18/18] hotfix/2.9.42309.01 --- .../pages/payroll/stepForm/baseInformForm.js | 1 + .../standingBookDetail/components/adjustTable.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js index 94719f8d..b429cfb7 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js @@ -117,6 +117,7 @@ export default class BaseInformForm extends React.Component { { this.state.inited && { if (index === idx) { return { - ...item, + ...item, adjustTo: "", companyTotal: data[0].totalNum, adjustToOptions: categoryType ? _.map(categoryType.split(","), tmpV => { return _.find(item.categoryTypeOptions, tmpJ => tmpJ.key === tmpV); @@ -330,7 +330,7 @@ class AdjustTable extends Component { }; handleClick = (record) => { - const { status, id, paymentOrganization, billMonth } = record; + const { status, id, paymentOrganization, billMonth, employeeId } = record; const { targetOptions } = this.state; if (status) { Modal.confirm({ @@ -338,7 +338,8 @@ class AdjustTable extends Component { content: "确定撤回吗?撤回后该笔调差将失效!", onOk: () => { const payload = { id, paymentOrganization, billMonth }; - compensationBack(payload).then(({ status, data, errormsg }) => { + compensationBack(payload).then(async ({ status, data, errormsg }) => { + const { data: categoryTypeOptions } = await compensationCategoryType({ id: _.find(targetOptions, child => child.employeeId == employeeId).target }); if (status) { message.success(data || "撤回成功"); this.setState({ @@ -347,7 +348,11 @@ class AdjustTable extends Component { return { ...it, status: false, - uuid: new Date().getTime() + idx + uuid: new Date().getTime() + idx, + categoryTypeOptions: _.map(categoryTypeOptions, child => ({ + key: child.id, + showname: child.content + })) }; } return { ...it, uuid: new Date().getTime() + idx };