From 10e981d0d3d81b2f6026b54430c87ec6a584d706 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, 25 Apr 2024 14:26:06 +0800 Subject: [PATCH 001/131] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E8=B4=A6=E5=A5=97=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/ledger.js | 12 ++ .../components/ledgerAccountApprRule.js | 160 ++++++++++++++++++ ...erAccountApprRuleClassifyNameEditDialog.js | 71 ++++++++ .../components/ledgerAccountSalaryItemsSet.js | 134 +++++++++++++++ .../ledgerPage/components/ledgerSlide.js | 78 +++++++-- pc4mobx/hrmSalary/pages/ledgerPage/config.js | 54 ++++++ pc4mobx/hrmSalary/stores/ledger.js | 58 ++++--- 7 files changed, 527 insertions(+), 40 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 487181bc..d4f64824 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -155,3 +155,15 @@ export const salarysobRangeImportData = params => { export const getSalaryItemForm = params => { return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params); }; +//薪资核算规则配置-获取薪资审批规则表单 +export const getSalaryApprovalForm = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params); +}; +//薪资核算规则配置-保存薪资审批规则表单 +export const salaryApprovalSaveForm = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params); +}; +//薪资核算规则配置-获取能够添加的项目 +export const getListSalaryItem = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params); +}; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js new file mode 100644 index 00000000..59990157 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js @@ -0,0 +1,160 @@ +/* + * Author: 黎永顺 + * name: 薪资核算规则配置 + * Description: + * Date: 2024/4/24 + */ +import React, { Component } from "react"; +import { WeaSwitch } from "comsMobx"; +import { inject, observer } from "mobx-react"; +import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import LedgerAccountSalaryItemsSet from "./ledgerAccountSalaryItemsSet"; +import * as API from "../../../apis/ledger"; +import { acctApprRulesConditions } from "../config"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +@inject("ledgerStore") +@observer +class LedgerAccountApprRule extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], approvalId: "", approvalItemGroup: [] + }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + const { saveSalarySobId, editId } = this.props; + API.getSalaryApprovalForm({ salarySobId: saveSalarySobId || editId }).then(({ status, data }) => { + if (status) { + this.setState({ + approvalId: data.id, + approvalItemGroup: _.map(data.approvalItemGroup, item => ({ + ...item, id: String(item.sorted), + approvalItems: _.map(item.approvalItems, o => ({ ...o, id: `${String(item.sorted)}-${String(o.sorted)}` })) + })), + conditions: _.map(acctApprRulesConditions, item => ({ + ...item, items: _.map(item.items, o => ({ + ...o, value: getKey(o) === "isOpenApproval" ? (data[getKey(o)] ? "1" : "0") : data[getKey(o)], + viewAttr: getKey(o) === "approvalWorkflowUrl" ? (data["isOpenApproval"] ? 3 : 2) : o.viewAttr, + hide: getKey(o) !== "isOpenApproval" ? !data["isOpenApproval"] : false, + label: getLabel(o.lanId, o.label) + })) + })) + }, () => { + const { ledgerStore: { AARForm } } = this.props; + AARForm.initFormFields(this.state.conditions); + }); + } + }); + }; + + componentWillUnmount() { + const { ledgerStore: { initAARForm } } = this.props; + initAARForm(); + } + + renderForm = (form, conditions) => { + const { saveSalarySobId, editId } = this.props; + const { approvalItemGroup } = this.state; + const { isFormInit } = form; + const formParams = form.getFormParams(); + let group = []; + isFormInit && conditions && conditions.map(c => { + let items = []; + c.items.map(fields => { + if (getKey(fields) !== "approvalItemGroup") { + items.push({ + com: ( + + + ), + hide: fields.hide + }); + } else { + items.push({ + com: ( + + this.setState({ + approvalItemGroup: _.map(approvalItemGroup, o => ({ + ...o, + approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({ + salaryItemId: k.id, salaryItemName: k.name, + id: `${String(o.sorted)}-${String(o.approvalItems.length + ki)}` + }))] : o.approvalItems + })) + }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} + onEdit={(groupName, groupId) => this.setState({ + approvalItemGroup: _.map(approvalItemGroup, o => ({ + ...o, groupName: groupId === o.id ? groupName : o.groupName + })) + }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} + onDelete={(group, item) => this.setState({ + approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) : + _.map(approvalItemGroup, o => ({ + ...o, + approvalItems: _.filter(o.approvalItems, oo => oo.id !== item.id) + })) + }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} + onChange={datas => this.setState({ + approvalItemGroup: datas + }, () => form.updateFields({ approvalItemGroup: { value: datas } }))}/> + ), + hide: fields.hide + }); + } + }); + group.push(); + }); + return group; + }; + convertFormItemViewAttr = (viewAttr) => { + const { ledgerStore: { AARForm } } = this.props; + const { isOpenApproval } = AARForm.getFormParams(); + this.setState({ + conditions: _.map(this.state.conditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "approvalWorkflowUrl") { + return { ...o, viewAttr, hide: isOpenApproval === "0" }; + } else if (getKey(o) === "approvalItemGroup") { + return { ...o, viewAttr, hide: isOpenApproval === "0" }; + } + return { ...o }; + }) + })) + }); + }; + handleFormItemChange = (value) => { + const { ledgerStore: { AARForm } } = this.props; + const { isOpenApproval } = AARForm.getFormParams(); + if (_.keys(value)[0] === "isOpenApproval") { + this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2); + } + }; + + render() { + const { conditions } = this.state; + const { ledgerStore: { AARForm } } = this.props; + return ( +
+ {this.renderForm(AARForm, conditions)} +
+ ); + } +} + +export default LedgerAccountApprRule; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js new file mode 100644 index 00000000..482f3ea5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js @@ -0,0 +1,71 @@ +/* + * Author: 黎永顺 + * name:审批规则分类编辑 + * Description: + * Date: 2024/4/25 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { getSearchs } from "../../../util"; +import { classifyConditions } from "../config"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("ledgerStore") +@observer +class LedgerAccountApprRuleClassifyNameEditDialog extends Component { + constructor(props) { + super(props); + this.state = { conditions: [] }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.ledgerStore.initAARClassifyForm(); + } + + init = (props) => { + const { ledgerStore: { AARClassifyForm }, groupName } = props; + this.setState({ + conditions: _.map(classifyConditions, item => ({ + ...item, + items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => { + AARClassifyForm.initFormFields(this.state.conditions); + AARClassifyForm.updateFields({ groupName }); + }); + }; + save = () => { + const { ledgerStore: { AARClassifyForm }, groupId } = this.props; + AARClassifyForm.validateForm().then(f => { + if (f.isValid) { + this.props.onCancel(); + this.props.onEdit(AARClassifyForm.getFormParams().groupName, groupId); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { conditions } = this.state; + const { ledgerStore: { AARClassifyForm } } = this.props; + return ( + {getLabel(537558, "保存")} + ]} + > +
{getSearchs(AARClassifyForm, conditions, 1, false)}
+
+ ); + } +} + +export default LedgerAccountApprRuleClassifyNameEditDialog; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js new file mode 100644 index 00000000..7152c7ba --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js @@ -0,0 +1,134 @@ +/* + * Author: 黎永顺 + * name: 薪资核算规则配置-审批薪资项目 + * Description: + * Date: 2024/4/24 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom"; +import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog"; +import * as API from "../../../apis/ledger"; +import { Icon, Modal } from "antd"; +import cs from "classnames"; +import SalaryItemModal from "../../payroll/stepForm/salaryItemModal"; + +const getLabel = WeaLocaleProvider.getLabel; + +class LedgerAccountSalaryItemsSet extends Component { + constructor(props) { + super(props); + this.state = { + editDialog: { visible: false, groupName: "", groupId: "" }, + salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" } + }; + } + + handleDeleteClick = (group, item = {}) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543231, "确认删除本条数据吗?"), + onOk: () => this.props.onDelete(group, item) + }); + }; + handleAddSalaryItems = (group) => { + const { salaryItemDialog } = this.state; + const { salarySobId } = this.props; + const payload = { + salarySobId, excludeIds: _.map(group.approvalItems, o => o.salaryItemId) + }; + API.getListSalaryItem(payload).then(({ status, data }) => { + if (status) this.setState({ + salaryItemDialog: { + ...salaryItemDialog, visible: true, options: data, groupId: group.id + } + }); + }); + }; + handleConfirm = () => { + const { salaryItemDialog } = this.state; + this.setState({ + salaryItemDialog: { ...salaryItemDialog, visible: false } + }, () => this.props.onAdd(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem))); + }; + + render() { + const { editDialog, salaryItemDialog } = this.state; + const { datas } = this.props; + return ( +
+ this.props.onChange(list)} + renderNodeItem={(item) => { + return
+
+ + {item.groupName} + + this.setState({ + editDialog: { visible: true, groupName: item.groupName, groupId: item.id } + })}/> + this.handleDeleteClick(item)}/> + + + this.handleAddSalaryItems(item)}/> +
+
+ { + !_.isEmpty(item.approvalItems) ? + this.props.onChange( + _.map(datas, child => { + if (child.id === item.id) { + return { ...child, approvalItems: items }; + } + return { ...child }; + }) + )} + renderNodeItem={(filed) => { + return
+
+
{filed.salaryItemName}
+ this.handleDeleteClick(item, filed)}/> +
+
; + }} + className="wea-sortable-salary-item" + /> : +
暂无数据
+ } +
+
; + }} + className="wea-sortable-salary-item" + /> + this.setState({ + editDialog: { ...editDialog, visible: false } + })}/> + this.setState({ + salaryItemDialog: { ...salaryItemDialog, visible: false } + })} onConfirm={this.handleConfirm}> +
+ g.checkedSalaryItem), o => o.id)} + onChange={v => { + this.setState({ + salaryItemDialog: { + ...salaryItemDialog, + options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) })) + } + }); + }} + /> +
+
+
+ ); + } +} + +export default LedgerAccountSalaryItemsSet; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index 5692c526..07c4cd0d 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaSlideModal, WeaSteps } from "ecCom"; +import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; import { Button, message, Modal } from "antd"; import SlideModalTitle from "../../../components/slideModalTitle"; import LedgerBaseSetting from "./ledgerBaseSetting"; @@ -14,17 +14,12 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel"; import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules"; import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem"; import LedgerSalaryItem from "./ledgerSalaryItem"; -import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger"; +import LedgerAccountApprRule from "./ledgerAccountApprRule"; +import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger"; import "./index.less"; const Step = WeaSteps.Step; -const tabs = [ - { key: 0, title: "基础设置" }, - { key: 1, title: "关联人员" }, - { key: 2, title: "薪资项目" }, - { key: 3, title: "回算薪资项目" }, - { key: 4, title: "调薪计薪规则" } -]; +const getLabel = WeaLocaleProvider.getLabel; @inject("taxAgentStore", "ledgerStore") @observer @@ -95,7 +90,6 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success("保存成功"); - this.handleClose(); } else { message.success(errormsg || "保存失败"); } @@ -166,6 +160,40 @@ class LedgerSlide extends Component { handleSaveSalaryItemParams = (empFields, itemGroups) => { this.setState({ empFields, itemGroups }); }; + handleDefaultSave = () => { + const { saveSalarySobId } = this.state; + const { state: { approvalId } } = this.approRef.wrappedInstance; + const { ledgerStore: { AARForm } } = this.props; + const { approvalItemGroup, isOpenApproval, ...extra } = AARForm.getFormParams(); + const group = _.map(approvalItemGroup, (item, index) => ({ + groupName: item.groupName, sorted: index, + approvalItems: _.map(item.approvalItems, (o, oi) => ({ + salaryItemId: o.salaryItemId, sorted: oi, + salaryItemName: o.salaryItemName + })) + })); + if (isOpenApproval === "1" && _.isEmpty(extra.approvalWorkflowUrl)) { + AARForm.showError("approvalWorkflowUrl", getLabel(111, "\"审批流程地址\"未填写")); + return; + } else if (isOpenApproval === "1" && _.isEmpty(group)) { + AARForm.showError("approvalItemGroup", getLabel(111, "\"审批薪资项目\"未填写")); + return; + } + const payload = { + ...extra, isOpenApproval: isOpenApproval === "1", id: approvalId, + salarySobId: this.props.editId || saveSalarySobId, + approvalItemGroup: group + }; + this.setState({ loading: true }); + salaryApprovalSaveForm(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "保存成功!")); + } else { + message.error(errormsg); + } + }); + }; renderChildren = () => { const { current, saveSalarySobId } = this.state; let CurrentDom = null; @@ -189,7 +217,8 @@ class LedgerSlide extends Component { onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>; break; default: - CurrentDom = null; + CurrentDom = + this.approRef = dom} saveSalarySobId={saveSalarySobId}/>; break; } return CurrentDom; @@ -245,13 +274,28 @@ class LedgerSlide extends Component { case 4: CurrentDom = !editId ? [ + , , - + ] : [ - + ]; break; default: + CurrentDom = !editId ? + [ + , + + ] : [ + + ]; break; } } @@ -261,6 +305,14 @@ class LedgerSlide extends Component { render() { const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props; const { current } = this.state; + const tabs = [ + { key: 0, title: getLabel(82751, "基础设置") }, + { key: 1, title: getLabel(543467, "关联人员") }, + { key: 2, title: getLabel(542362, "薪资项目") }, + { key: 3, title: getLabel(543468, "回算薪资项目") }, + { key: 4, title: getLabel(543469, "调薪计薪规则") }, + { key: 10, title: getLabel(111, "核算审批规则") } + ]; return ( this.AARForm = new WeaForm();//重置核算审批规则form + @action initAARClassifyForm = (v) => this.AARClassifyForm = new WeaForm();//重置审批规则分类编辑form /*******************************************************/ @@ -148,14 +152,14 @@ export class LedgerStore { setItemGroups = itemGroups => { itemGroups = itemGroups ? [...itemGroups] : []; itemGroups && - itemGroups.map(item => { - if (item.items) { - item.items && - item.items.map(i => { - i.key = i.id; - }); - } - }); + itemGroups.map(item => { + if (item.items) { + item.items && + item.items.map(i => { + i.key = i.id; + }); + } + }); this.itemGroups = itemGroups; }; @@ -388,9 +392,9 @@ export class LedgerStore { if (!this.validateBaseFrom(params)) { reject("保存失败"); } - this.saveLoading= true; + this.saveLoading = true; API.saveLedgerBasic(params).then(res => { - this.saveLoading= false; + this.saveLoading = false; if (res.status) { this.salarySobId = res.data; resolve(); @@ -463,9 +467,9 @@ export class LedgerStore { //薪资帐套人员范围(包含)列表 getLedgerPersonRangeInclude = params => { - this.loading= true; + this.loading = true; API.getLedgerPersonRangeInclude(params).then(res => { - this.loading= false; + this.loading = false; if (res.status) { this.setUserTableStore(res.data); } else { @@ -476,9 +480,9 @@ export class LedgerStore { //薪资帐套人员范围(排除)列表 getLedgerPersonRangeExclude = params => { - this.loading= true; + this.loading = true; API.getLedgerPersonRangeExclude(params).then(res => { - this.loading= false; + this.loading = false; if (res.status) { this.setUserTableStore(res.data); } else { @@ -508,12 +512,12 @@ export class LedgerStore { listSalaryItem = (searchValue = "", current = 1) => { let excludeIds = []; this.itemGroups && - this.itemGroups.map(item => { - item.items && - item.items.map(i => { - excludeIds.push(i.salaryItemId); - }); + this.itemGroups.map(item => { + item.items && + item.items.map(i => { + excludeIds.push(i.salaryItemId); }); + }); this.loading = true; API.listSalaryItem({ name: searchValue, excludeIds, current }).then(res => { if (res.status) { @@ -562,7 +566,7 @@ export class LedgerStore { salaryItemId: i.salaryItemId, sortedIndex: index + 1, formulaId: i.formulaId, - itemHide: i.itemHide || "0", + itemHide: i.itemHide || "0" })); return result; } @@ -571,14 +575,14 @@ export class LedgerStore { let params = { salarySobId: this.salarySobId, - empFields: _.map(this.userSelectedList, (it, idx) => ({...it, sortedIndex:idx })), + empFields: _.map(this.userSelectedList, (it, idx) => ({ ...it, sortedIndex: idx })), itemGroups: itemGroups.filter(item => item.id != "default"), items: itemGroups.filter(item => item.id == "default")[0].items }; return new Promise((resolve, reject) => { - this.saveLoading= true; + this.saveLoading = true; API.saveLedgerItem(params).then(res => { - this.saveLoading= false; + this.saveLoading = false; if (res.status) { resolve(); message.success("保存成功"); @@ -626,9 +630,9 @@ export class LedgerStore { ruleParams: this.sobItemRuleDataSource }; return new Promise((resolve, reject) => { - this.saveLoading= true; + this.saveLoading = true; API.saveAdjustmentRule(params).then(res => { - this.saveLoading= false; + this.saveLoading = false; if (res.status) { resolve(); message.success("保存成功"); From 2e5404bee63f1b485bcf4be8e181669f074b00d0 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, 25 Apr 2024 16:07:04 +0800 Subject: [PATCH 002/131] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E8=B4=A6=E5=A5=97=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 4 + .../hrmSalary/pages/calculate/doCalc/index.js | 18 ++- .../components/ledgerAccountApprRule.js | 12 +- ...erAccountApprRuleClassifyNameEditDialog.js | 5 +- .../components/ledgerAccountSalaryItemsSet.js | 147 ++++++++++-------- 5 files changed, 109 insertions(+), 77 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 0abda464..e4431c8a 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -266,4 +266,8 @@ export const deleteExportTemplate = (params) => { export const getExportTemplateForm = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); }; +//薪资审批-薪资核算页面获取审批信息 +export const getApprovalInfoByRecordId = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index d8a8d78e..d7e6dd26 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -9,7 +9,12 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; -import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate"; +import { + acctresultAccounting, + getApprovalInfoByRecordId, + getCalculateProgress, + getExportField +} from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryEditCalc from "./components/salaryEditCalc"; @@ -30,6 +35,7 @@ class Index extends Component { selectedKey: "person", progressVisible: false, progress: 0, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, + approvalInfo: {},//审批信息, accountExceptInfo: "" //核算报错信息, }; @@ -37,6 +43,14 @@ class Index extends Component { this.timer = null; } + init = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + }; handleMenuClick = ({ key }) => { switch (key) { case "calc_selected": @@ -196,7 +210,7 @@ class Index extends Component { const { calculateStore: { setOtherConditions } } = this.props; const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state; return ( - +
{ const { saveSalarySobId, editId } = this.props; - API.getSalaryApprovalForm({ salarySobId: saveSalarySobId || editId }).then(({ status, data }) => { + API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => { if (status) { this.setState({ approvalId: data.id, @@ -88,8 +88,8 @@ class LedgerAccountApprRule extends Component { wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom" > - this.setState({ + this.setState({ approvalItemGroup: _.map(approvalItemGroup, o => ({ ...o, approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({ @@ -99,9 +99,11 @@ class LedgerAccountApprRule extends Component { })) }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} onEdit={(groupName, groupId) => this.setState({ - approvalItemGroup: _.map(approvalItemGroup, o => ({ + approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({ ...o, groupName: groupId === o.id ? groupName : o.groupName - })) + })) : [{ + approvalItems: [], groupName, id: String(approvalItemGroup.length) + }, ...approvalItemGroup] }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))} onDelete={(group, item) => this.setState({ approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) : diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js index 482f3ea5..9958b727 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js @@ -28,7 +28,7 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { } init = (props) => { - const { ledgerStore: { AARClassifyForm }, groupName } = props; + const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props; this.setState({ conditions: _.map(classifyConditions, item => ({ ...item, @@ -36,7 +36,7 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { })) }, () => { AARClassifyForm.initFormFields(this.state.conditions); - AARClassifyForm.updateFields({ groupName }); + groupId && AARClassifyForm.updateFields({ groupName }); }); }; save = () => { @@ -57,7 +57,6 @@ class LedgerAccountApprRuleClassifyNameEditDialog extends Component { return ( {getLabel(537558, "保存")} ]} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js index 7152c7ba..1f53c37b 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js @@ -5,7 +5,7 @@ * Date: 2024/4/24 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom"; +import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom"; import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog"; import * as API from "../../../apis/ledger"; import { Icon, Modal } from "antd"; @@ -18,7 +18,7 @@ class LedgerAccountSalaryItemsSet extends Component { constructor(props) { super(props); this.state = { - editDialog: { visible: false, groupName: "", groupId: "" }, + editDialog: { visible: false, groupName: "", groupId: "", title: "" }, salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" } }; } @@ -32,9 +32,11 @@ class LedgerAccountSalaryItemsSet extends Component { }; handleAddSalaryItems = (group) => { const { salaryItemDialog } = this.state; - const { salarySobId } = this.props; + const { salarySobId, datas } = this.props; const payload = { - salarySobId, excludeIds: _.map(group.approvalItems, o => o.salaryItemId) + salarySobId, excludeIds: _.reduce(datas, (pre, cur) => { + return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId)); + }, []) }; API.getListSalaryItem(payload).then(({ status, data }) => { if (status) this.setState({ @@ -48,84 +50,95 @@ class LedgerAccountSalaryItemsSet extends Component { const { salaryItemDialog } = this.state; this.setState({ salaryItemDialog: { ...salaryItemDialog, visible: false } - }, () => this.props.onAdd(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem))); + }, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem))); }; render() { const { editDialog, salaryItemDialog } = this.state; const { datas } = this.props; return ( -
- this.props.onChange(list)} - renderNodeItem={(item) => { - return
-
+
+
+ this.setState({ + editDialog: { visible: true, title: getLabel(111, "添加分类") } + })}/> + +
+
+ this.props.onChange(list)} + renderNodeItem={(item) => { + return
+
{item.groupName} this.setState({ - editDialog: { visible: true, groupName: item.groupName, groupId: item.id } + editDialog: { + visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑") + } })}/> this.handleDeleteClick(item)}/> - this.handleAddSalaryItems(item)}/> -
-
- { - !_.isEmpty(item.approvalItems) ? - this.props.onChange( - _.map(datas, child => { - if (child.id === item.id) { - return { ...child, approvalItems: items }; - } - return { ...child }; - }) - )} - renderNodeItem={(filed) => { - return
-
-
{filed.salaryItemName}
- this.handleDeleteClick(item, filed)}/> -
-
; - }} - className="wea-sortable-salary-item" - /> : -
暂无数据
- } -
-
; - }} - className="wea-sortable-salary-item" - /> - this.setState({ - editDialog: { ...editDialog, visible: false } - })}/> - this.setState({ - salaryItemDialog: { ...salaryItemDialog, visible: false } - })} onConfirm={this.handleConfirm}> -
- g.checkedSalaryItem), o => o.id)} - onChange={v => { - this.setState({ - salaryItemDialog: { - ...salaryItemDialog, - options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) })) + this.handleAddSalaryItems(item)}/> +
+
+ { + !_.isEmpty(item.approvalItems) ? + this.props.onChange( + _.map(datas, child => { + if (child.id === item.id) { + return { ...child, approvalItems: items }; + } + return { ...child }; + }) + )} + renderNodeItem={(filed) => { + return
+
+
{filed.salaryItemName}
+ this.handleDeleteClick(item, filed)}/> +
+
; + }} + className="wea-sortable-salary-item" + /> : +
暂无数据
} - }); - }} - /> -
-
+
+
; + }} + className="wea-sortable-salary-item" + /> + this.setState({ + editDialog: { ...editDialog, visible: false } + })}/> + this.setState({ + salaryItemDialog: { ...salaryItemDialog, visible: false } + })} onConfirm={this.handleConfirm}> +
+ g.checkedSalaryItem), o => o.id)} + onChange={v => { + this.setState({ + salaryItemDialog: { + ...salaryItemDialog, + options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) })) + } + }); + }} + /> +
+
+
); } From ffeb4283b2b1c2e01bf88c92b8ee64aa8ed9b0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 26 Apr 2024 11:23:19 +0800 Subject: [PATCH 003/131] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E8=B4=A6=E5=A5=97=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/calculate/doCalc/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index d7e6dd26..c1a24fa8 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -45,10 +45,8 @@ class Index extends Component { init = () => { const { routeParams: { salaryAcctRecordId } } = this.props; - getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data }) => { - if (status) { - console.log(data); - } + getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { + if (status) this.setState({ approvalInfo }); }); }; handleMenuClick = ({ key }) => { @@ -144,7 +142,9 @@ class Index extends Component { } }; renderReqBtns = () => { - const { selectedKey, accountExceptInfo } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + const { selectedKey, accountExceptInfo, approvalInfo } = this.state; + const { isOpenApproval, approvalWorkflowUrl } = approvalInfo; let reqBtns = []; switch (selectedKey) { case "calc": @@ -169,6 +169,9 @@ class Index extends Component { this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> ]; + isOpenApproval && reqBtns.unshift(); accountExceptInfo && reqBtns.unshift( this.downloadTxtfile(accountExceptInfo)}/>); From e58f5e73e0c362a83e0b107f48f2f345b1c2479c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sun, 28 Apr 2024 17:53:12 +0800 Subject: [PATCH 004/131] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E8=B4=A6=E5=A5=97=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=20=E6=B7=BB=E5=8A=A0=E8=A7=84=E5=88=99?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ledgerPage/components/ledgerSlide.js | 45 ++++++++---- .../hrmSalary/pages/ruleConfig/conditions.js | 68 +++++++++++++++++++ .../hrmSalary/pages/ruleConfig/ruleConfig.js | 51 ++++++++++++-- 3 files changed, 145 insertions(+), 19 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index 07c4cd0d..e97f89c6 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -16,6 +16,7 @@ import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem"; import LedgerSalaryItem from "./ledgerSalaryItem"; import LedgerAccountApprRule from "./ledgerAccountApprRule"; import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger"; +import { sysConfCodeRule } from "../../../apis/ruleconfig"; import "./index.less"; const Step = WeaSteps.Step; @@ -32,10 +33,18 @@ class LedgerSlide extends Component { baseSettingInfo: {}, adjustRules: [], empFields: [], itemGroups: [], - saveSalarySobId: "" + saveSalarySobId: "", + salaryApprovalStatus: false }; } + async componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { data } = await sysConfCodeRule({ code: "SALARY_APPROVAL_STATUS" }); + this.setState({ salaryApprovalStatus: data === "1" }); + } + } + componentWillUnmount() { this.setState({ saveSalarySobId: "" @@ -225,7 +234,7 @@ class LedgerSlide extends Component { }; renderCustomOperate = () => { const { taxAgentStore: { showOperateBtn }, editId } = this.props; - const { current, loading } = this.state; + const { current, loading, salaryApprovalStatus } = this.state; let CurrentDom = []; //管理员操作权限 if (showOperateBtn) { @@ -272,16 +281,25 @@ class LedgerSlide extends Component { ] : []; break; case 4: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; + const btns = salaryApprovalStatus ? [ + , + , + + ] : [ + , + + ]; + CurrentDom = !editId ? btns : [ + + ]; break; default: CurrentDom = !editId ? @@ -304,7 +322,7 @@ class LedgerSlide extends Component { render() { const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props; - const { current } = this.state; + const { current, salaryApprovalStatus } = this.state; const tabs = [ { key: 0, title: getLabel(82751, "基础设置") }, { key: 1, title: getLabel(543467, "关联人员") }, @@ -313,6 +331,7 @@ class LedgerSlide extends Component { { key: 4, title: getLabel(543469, "调薪计薪规则") }, { key: 10, title: getLabel(111, "核算审批规则") } ]; + !salaryApprovalStatus && tabs.splice(_.indexOf(tabs, { key: 10 }), 1); return ( ({ - ...item, + ...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => { if (getKey(o) === "matchRule" || getKey(o) === "orderRule" || getKey(o) === "ascOrDesc" || getKey(o) === "rule") { - return { ...o, options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel })) }; + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel })) + }; } else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") { - return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 }; + return { + ...o, label: getLabel(o.lanId, o.label), + viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 + }; } else if (getKey(o) === "taxDeclarationFunction") { return { - ...o, + ...o, label: getLabel(o.lanId, o.label), viewAttr: (_.isNil(sysinfo.taxDeclarationFunction) || sysinfo.taxDeclarationFunction !== "0") ? 2 : 1 }; + } else if ( + getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS" + ) { + return { + ...o, label: getLabel(o.lanId, o.label), + hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"]) + }; } - return { ...o }; + return { ...o, label: getLabel(o.lanId, o.label) }; }) })) }, async () => { @@ -73,6 +86,10 @@ class RuleConfig extends Component { form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); } else if (item === "OPEN_APPLICATION_ENCRYPT") { form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } }); + } else if ( + item === "APPROVAL_CAN_MANUAL_FILE_STATUS" || item === "APPROVAL_CAN_RE_CALC_STATUS" || item === "APPROVAL_CAN_EDIT_RESULT_STATUS" + ) { + form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "0") } }); } else { form.updateFields({ [item]: { value: sysinfo[item] || "" } }); } @@ -116,6 +133,10 @@ class RuleConfig extends Component { case "taxAgentShowStatus": case "salaryShowStatus": case "adjustShowStatus": + case "SALARY_APPROVAL_STATUS": + case "APPROVAL_CAN_MANUAL_FILE_STATUS": + case "APPROVAL_CAN_RE_CALC_STATUS": + case "APPROVAL_CAN_EDIT_RESULT_STATUS": const confTitle = { welBaseDiffByPerAndCom: getLabel(111, "福利档案基数区分个人和公司"), welBaseAutoAdjust: getLabel(111, "福利档案导入基数不符合要求时自动调整为上限/下限"), @@ -123,7 +144,11 @@ class RuleConfig extends Component { extEmpsWitch: getLabel(544097, "开启非系统人员"), taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"), salaryShowStatus: getLabel(111, "显示工资单页签"), - adjustShowStatus: getLabel(111, "显示调薪记录页签") + adjustShowStatus: getLabel(111, "显示调薪记录页签"), + SALARY_APPROVAL_STATUS: getLabel(111, "是否开启薪资审批"), + APPROVAL_CAN_MANUAL_FILE_STATUS: getLabel(111, "开启审批的核算记录允许手动归档"), + APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"), + APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据") }; this.unifiedSettings(key, confTitle[key]); break; @@ -292,6 +317,20 @@ class RuleConfig extends Component { API.saveSysOperate(payload).then(({ status, errormsg }) => { if (status) { message.success(getLabel(22619, "保存成功!")); + if (confKey === "SALARY_APPROVAL_STATUS") { + this.setState({ + conditions: _.map(this.state.conditions, item => ({ + ...item, items: _.map(item.items, o => { + if ( + getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS" + ) { + return { ...o, hide: form.getFormParams()[confKey] === "0" }; + } + return { ...o }; + }) + })) + }); + } } else { message.error(errormsg || getLabel(22620, "保存失败!")); } From 9476ffb62a8b377d16c5919b56d8f0b78e03bdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 29 Apr 2024 16:44:46 +0800 Subject: [PATCH 005/131] =?UTF-8?q?feature/2.12.1.2404.02-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E8=B4=A6=E5=A5=97=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryCalcPersonConfirm/index.js | 15 +++++++++------ pc4mobx/hrmSalary/pages/calculate/doCalc/index.js | 12 +++++++----- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index 68b7245f..7e1bece3 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -78,6 +78,7 @@ class Index extends Component { renderTabBtns = () => { const { selectedKey, selectedRowKeys } = this.state; + const { calcDetail } = this.props; let tabBtns = []; switch (selectedKey) { case "range": @@ -92,6 +93,7 @@ class Index extends Component { , ]; + calcDetail && tabBtns.splice(0, 2); break; case "add": case "sub": @@ -182,7 +184,7 @@ class Index extends Component { }; render() { - const { calculateStore: { PCSearchForm } } = this.props; + const { calculateStore: { PCSearchForm }, calcDetail } = this.props; const { selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, columns, dataSource @@ -252,8 +254,8 @@ class Index extends Component { onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth /> { let width = ""; const { dataIndex } = item; @@ -272,9 +274,10 @@ class Index extends Component { dataIndex: "operate", title: getLabel(30585, "操作"), width: 120, - render: (_, record) => ( - this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")} + render: (_, record) => ( + {calcDetail ? null : this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}} + ) } ]} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index c1a24fa8..1455b6a8 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -144,7 +144,7 @@ class Index extends Component { renderReqBtns = () => { const { routeParams: { salaryAcctRecordId } } = this.props; const { selectedKey, accountExceptInfo, approvalInfo } = this.state; - const { isOpenApproval, approvalWorkflowUrl } = approvalInfo; + const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo; let reqBtns = []; switch (selectedKey) { case "calc": @@ -155,7 +155,7 @@ class Index extends Component { ); const moreMenu = ( - {getLabel(32935, "导入")} + {canEdit && {getLabel(32935, "导入")}} {getLabel(81272, "导出全部")} {getLabel(544270, "自定义导出")} {getLabel(543249, "线下对比")} @@ -169,6 +169,7 @@ class Index extends Component { this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> ]; + !canEdit && reqBtns.splice(0, 1); isOpenApproval && reqBtns.unshift(); @@ -190,14 +191,15 @@ class Index extends Component { element.click(); }; renderContent = () => { - const { selectedKey } = this.state; + const { selectedKey, approvalInfo } = this.state; + const { canEdit } = approvalInfo; let dom = null; switch (selectedKey) { case "person": - dom = ; + dom = ; break; case "calc": - dom = this.calc = dom}/>; + dom = this.calc = dom}/>; break; default: break; From 26649039597741bca54327966fe488265d96131e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 23 Sep 2024 16:25:46 +0800 Subject: [PATCH 006/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/pages/appConfig/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index e13000eb..aee9eb68 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -94,8 +94,8 @@ class AppConfig extends Component { } = this.state; const btns = [ , - , - + // , + // ]; const items = [ { From f2b17872f731d8e56bb951f6e0f1ea6cc901922d 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, 25 Sep 2024 11:12:53 +0800 Subject: [PATCH 007/131] release/2.15.2.2409.01 --- .../hrmSalary/pages/ruleConfig/conditions.js | 28 +++++++++---------- .../hrmSalary/pages/ruleConfig/ruleConfig.js | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index c04384b0..d7340658 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -144,20 +144,20 @@ export const conditions = [ title: getLabel(111, "薪资核算固定列头数"), defaultshow: true }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["extEmpsWitch"], - fieldcol: 10, - label: getLabel(111, "开启非系统人员"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "非系统人员"), - defaultshow: true - }, + // { + // items: [ + // { + // conditionType: "SWITCH", + // domkey: ["extEmpsWitch"], + // fieldcol: 10, + // label: getLabel(111, "开启非系统人员"), + // labelcol: 8, + // viewAttr: 2 + // } + // ], + // title: getLabel(111, "非系统人员"), + // defaultshow: true + // }, { items: [ { diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index 3f24a0d6..d1dcdc12 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -10,10 +10,10 @@ import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; import { message, Modal } from "antd"; import * as API from "../../apis/ruleconfig"; import { conditions, payloadList } from "./conditions"; +import ProgressModal from "../../components/progressModal"; import { renderRuleForm } from "./form"; import { getConditionDomkeys } from "../../util"; import "./index.less"; -import ProgressModal from "../../components/progressModal"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; From 9c318d22b721fca48817f066f09a273ab06143b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sun, 29 Sep 2024 10:57:22 +0800 Subject: [PATCH 008/131] hotfix/2.15.1.2409.01 --- pc4mobx/hrmSalary/apis/calculate.js | 5 ++++- .../salaryCalcPersonConfirm/index.js | 20 +++++++++++++++++++ .../salaryCalcPersonConfirm/index.less | 12 +++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 85805d5c..a41a7c07 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -95,7 +95,10 @@ export const comparisonresultList = (params) => { export const refreshTaxAgent = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refreshTaxAgent", params); }; - +// 核算人员--刷新薪资核算人员的 +export const refreshAcctemployee = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refresh", params); +}; // 薪资核算-编辑表单 export const acctresultDetail = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/detail", "GET", params); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index 5a3f9abc..d4aca862 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -14,6 +14,7 @@ import { addedemployeeList, deleteAcctemployee, reducedemployeeList, + refreshAcctemployee, saveAcctemployee } from "../../../../../apis/calculate"; import { personConfirmSearchConditions } from "./condition"; @@ -90,6 +91,8 @@ class Index extends Component { > , + , ]; break; @@ -180,6 +183,23 @@ class Index extends Component { } }); }; + handleRefresh = () => { + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + const { routeParams: { salaryAcctRecordId } } = this.props; + refreshAcctemployee({ salaryAcctRecordId }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.queryPCList(); + } else { + message.error(errormsg); + } + }); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + }; render() { const { calculateStore: { PCSearchForm } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less index eb4fb73b..e912632d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -6,6 +6,18 @@ .wea-new-table { background: #fff; } + + .icon-refresh { + display: flex; + justify-content: center; + align-items: center; + width: 20px; + height: 20px; + color: #fff; + background: #55a1f8; + cursor: pointer; + border-radius: 3px; + } } .docalc-baseinfo-layout { From 53d45c2069f9d4325698a0e57015ff0702afb7ca 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, 8 Oct 2024 13:21:55 +0800 Subject: [PATCH 009/131] =?UTF-8?q?hotfix/2.15.1.2409.01=20=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/ruleConfig/conditions.js | 243 +++++++++--------- pc4mobx/hrmSalary/pages/ruleConfig/index.less | 2 +- 2 files changed, 127 insertions(+), 118 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index d7340658..feaf423d 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -4,6 +4,21 @@ import { WeaLocaleProvider } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; export const conditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["rule"], + fieldcol: 10, + label: getLabel(543352, "人员字段"), + labelcol: 8, + options: [], + viewAttr: 2 + } + ], + title: getLabel(543357, "人员校验规则"), + defaultshow: true + }, { items: [ { @@ -28,21 +43,6 @@ export const conditions = [ title: getLabel(543356, "排序规则"), defaultshow: true }, - { - items: [ - { - conditionType: "SELECT", - domkey: ["rule"], - fieldcol: 10, - label: getLabel(543352, "人员字段"), - labelcol: 8, - options: [], - viewAttr: 2 - } - ], - title: getLabel(543357, "人员校验规则"), - defaultshow: true - }, { items: [ { @@ -57,107 +57,6 @@ export const conditions = [ title: getLabel(543358, "加密规则"), defaultshow: true }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["taxDeclarationFunction"], - fieldcol: 10, - label: getLabel(111, "系统算税"), - labelcol: 8, - viewAttr: 1 - }, - { - conditionType: "SWITCH", - domkey: ["WITHDRAW_TAX_DECLARATION"], - fieldcol: 10, - label: getLabel(111, "撤回申报表"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "算税规则"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["salaryArchiveDelete"], - fieldcol: 10, - label: getLabel(111, "允许删除档案"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(538004, "薪资档案"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SWITCH", - domkey: ["welBaseDiffByPerAndCom"], - fieldcol: 10, - label: getLabel(111, "区分个人和公司"), - labelcol: 8, - viewAttr: 2 - }, - { - conditionType: "SWITCH", - domkey: ["welBaseAutoAdjust"], - fieldcol: 10, - label: getLabel(111, "导入基数自动调整上/下限"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "福利档案基数"), - defaultshow: true - }, - { - items: [ - { - conditionType: "SELECT", - domkey: ["matchRule"], - fieldcol: 10, - label: getLabel(111, "匹配规则"), - options: [], - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "薪资核算人员匹配规则"), - defaultshow: true - }, - { - items: [ - { - conditionType: "INPUTNUMBER", - domkey: ["salaryAcctFixedColumns"], - fieldcol: 10, - label: getLabel(111, "固定数"), - labelcol: 8, - viewAttr: 2 - } - ], - title: getLabel(111, "薪资核算固定列头数"), - defaultshow: true - }, - // { - // items: [ - // { - // conditionType: "SWITCH", - // domkey: ["extEmpsWitch"], - // fieldcol: 10, - // label: getLabel(111, "开启非系统人员"), - // labelcol: 8, - // viewAttr: 2 - // } - // ], - // title: getLabel(111, "非系统人员"), - // defaultshow: true - // }, { items: [ { @@ -187,7 +86,117 @@ export const conditions = [ ], title: getLabel(111, "我的薪资福利设置"), defaultshow: true - } + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["welBaseDiffByPerAndCom"], + fieldcol: 10, + label: getLabel(111, "区分个人和公司"), + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SWITCH", + domkey: ["welBaseAutoAdjust"], + fieldcol: 10, + label: getLabel(111, "导入基数自动调整上/下限"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "福利档案基数"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["salaryArchiveDelete"], + fieldcol: 10, + label: getLabel(111, "允许删除档案"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(538004, "薪资档案"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["matchRule"], + fieldcol: 10, + label: getLabel(111, "匹配规则"), + options: [], + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["salaryAcctFixedColumns"], + fieldcol: 10, + label: getLabel(111, "固定数"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资核算"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SWITCH", + domkey: ["taxDeclarationFunction"], + fieldcol: 10, + label: getLabel(111, "系统算税"), + labelcol: 8, + viewAttr: 1 + }, + { + conditionType: "SWITCH", + domkey: ["WITHDRAW_TAX_DECLARATION"], + fieldcol: 10, + label: getLabel(111, "撤回申报表"), + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "算税规则"), + defaultshow: true + }, + { + items: [ + { + conditionType: "SELECT", + domkey: ["abc"], + fieldcol: 10, + label: getLabel(111, "组织信息"), + options: [], + labelcol: 8, + viewAttr: 2 + } + ], + title: getLabel(111, "薪资报表"), + defaultshow: true + }, + // { + // items: [ + // { + // conditionType: "SWITCH", + // domkey: ["extEmpsWitch"], + // fieldcol: 10, + // label: getLabel(111, "开启非系统人员"), + // labelcol: 8, + // viewAttr: 2 + // } + // ], + // title: getLabel(111, "非系统人员"), + // defaultshow: true + // }, ]; export const payloadList = [ { enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" }, diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.less b/pc4mobx/hrmSalary/pages/ruleConfig/index.less index a4599477..a7a7c267 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.less +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.less @@ -3,7 +3,7 @@ overflow: hidden !important; .ruleWrapper { - padding: 16px; + padding: 8px 16px 0; background: #e5e5e5; height: 100%; overflow: hidden auto; From bd93223774e90d3d6b28c2a204b5648f68a08dbc 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, 8 Oct 2024 15:08:00 +0800 Subject: [PATCH 010/131] =?UTF-8?q?hotfix/2.15.1.2409.01=20=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=E6=B7=BB=E5=8A=A0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=B8=AD=E7=9A=84=E7=BB=84=E7=BB=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=BE=E7=BD=AE=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/ruleConfig/conditions.js | 87 ++++++++++++------- .../hrmSalary/pages/ruleConfig/ruleConfig.js | 18 +++- 2 files changed, 69 insertions(+), 36 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index feaf423d..bb22f65e 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -1,8 +1,3 @@ -import React from "react"; -import { WeaLocaleProvider } from "ecCom"; - -const getLabel = WeaLocaleProvider.getLabel; - export const conditions = [ { items: [ @@ -10,13 +5,15 @@ export const conditions = [ conditionType: "SELECT", domkey: ["rule"], fieldcol: 10, - label: getLabel(543352, "人员字段"), + label: "人员字段", + lanId: 543352, labelcol: 8, options: [], viewAttr: 2 } ], - title: getLabel(543357, "人员校验规则"), + title: "人员校验规则", + lanId: 543357, defaultshow: true }, { @@ -25,7 +22,8 @@ export const conditions = [ conditionType: "SELECT", domkey: ["orderRule"], fieldcol: 10, - label: getLabel(15512, "排序字段"), + label: "排序字段", + lanId: 15512, labelcol: 8, options: [], viewAttr: 2 @@ -34,13 +32,15 @@ export const conditions = [ conditionType: "SELECT", domkey: ["ascOrDesc"], fieldcol: 10, - label: getLabel(543351, "正序/倒序"), + label: "正序/倒序", + lanId: 543351, labelcol: 8, options: [], viewAttr: 2 } ], - title: getLabel(543356, "排序规则"), + title: "排序规则", + lanId: 543356, defaultshow: true }, { @@ -49,12 +49,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["OPEN_APPLICATION_ENCRYPT"], fieldcol: 10, - label: getLabel(526997, "加密设置"), + label: "加密设置", + lanId: 526997, labelcol: 8, viewAttr: 2 } ], - title: getLabel(543358, "加密规则"), + title: "加密规则", + lanId: 543358, defaultshow: true }, { @@ -63,7 +65,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["salaryShowStatus"], fieldcol: 10, - label: getLabel(111, "显示工资单页签"), + label: "显示工资单页签", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -71,7 +74,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["adjustShowStatus"], fieldcol: 10, - label: getLabel(111, "显示调薪记录页签"), + label: "显示调薪记录页签", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -79,12 +83,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["taxAgentShowStatus"], fieldcol: 10, - label: getLabel(111, "显示【个税扣缴义务人】信息"), + label: "显示【个税扣缴义务人】信息", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "我的薪资福利设置"), + title: "我的薪资福利设置", + lanId: 111, defaultshow: true }, { @@ -93,7 +99,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["welBaseDiffByPerAndCom"], fieldcol: 10, - label: getLabel(111, "区分个人和公司"), + label: "区分个人和公司", + lanId: 111, labelcol: 8, viewAttr: 2 }, @@ -101,12 +108,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["welBaseAutoAdjust"], fieldcol: 10, - label: getLabel(111, "导入基数自动调整上/下限"), + label: "导入基数自动调整上/下限", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "福利档案基数"), + title: "福利档案基数", + lanId: 111, defaultshow: true }, { @@ -115,12 +124,14 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["salaryArchiveDelete"], fieldcol: 10, - label: getLabel(111, "允许删除档案"), + label: "允许删除档案", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(538004, "薪资档案"), + title: "薪资档案", + lanId: 538004, defaultshow: true }, { @@ -129,7 +140,8 @@ export const conditions = [ conditionType: "SELECT", domkey: ["matchRule"], fieldcol: 10, - label: getLabel(111, "匹配规则"), + label: "匹配规则", + lanId: 111, options: [], labelcol: 8, viewAttr: 2 @@ -138,12 +150,14 @@ export const conditions = [ conditionType: "INPUTNUMBER", domkey: ["salaryAcctFixedColumns"], fieldcol: 10, - label: getLabel(111, "固定数"), + label: "固定数", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "薪资核算"), + title: "薪资核算", + lanId: 111, defaultshow: true }, { @@ -152,7 +166,8 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["taxDeclarationFunction"], fieldcol: 10, - label: getLabel(111, "系统算税"), + label: "系统算税", + lanId: 111, labelcol: 8, viewAttr: 1 }, @@ -160,41 +175,47 @@ export const conditions = [ conditionType: "SWITCH", domkey: ["WITHDRAW_TAX_DECLARATION"], fieldcol: 10, - label: getLabel(111, "撤回申报表"), + label: "撤回申报表", + lanId: 111, labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "算税规则"), + title: "算税规则", + lanId: 111, defaultshow: true }, { items: [ { conditionType: "SELECT", - domkey: ["abc"], + domkey: ["REPORT_ORGANIZATIN_TYPE"], fieldcol: 10, - label: getLabel(111, "组织信息"), + label: "组织信息", + lanId: 111, options: [], labelcol: 8, viewAttr: 2 } ], - title: getLabel(111, "薪资报表"), + title: "薪资报表", + lanId: 111, defaultshow: true - }, + } // { // items: [ // { // conditionType: "SWITCH", // domkey: ["extEmpsWitch"], // fieldcol: 10, - // label: getLabel(111, "开启非系统人员"), + // label: "开启非系统人员", + // lanId: 111, // labelcol: 8, // viewAttr: 2 // } // ], - // title: getLabel(111, "非系统人员"), + // title: "非系统人员", + // lanId: 111, // defaultshow: true // }, ]; diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index d1dcdc12..8c56b847 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -39,10 +39,18 @@ class RuleConfig extends Component { const optionsList = { matchRule, orderRule, ascOrDesc, rule }; this.setState({ sysinfo, conditions: _.map(conditions, item => ({ - ...item, + ...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; if (getKey(o) === "matchRule" || getKey(o) === "orderRule" || getKey(o) === "ascOrDesc" || getKey(o) === "rule") { return { ...o, options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel })) }; + } else if (getKey(o) === "REPORT_ORGANIZATIN_TYPE") { + return { + ...o, options: [ + { key: "0", showname: getLabel(111, "核算时组织信息"), selected: true }, + { key: "1", showname: getLabel(111, "实时组织信息"), selected: false } + ] + }; } else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") { return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 }; } else if (getKey(o) === "taxDeclarationFunction") { @@ -69,7 +77,9 @@ class RuleConfig extends Component { } else if (item === "matchRule") { form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } }); } else if (item === "taxDeclarationFunction") { - form.updateFields({ [item]: { value: sysinfo["taxDeclarationFunction"] === "0" ? "0" : "1" } }); + form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } }); + } else if (item === "REPORT_ORGANIZATIN_TYPE") { + form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } }); } else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") { form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); } else if (item === "OPEN_APPLICATION_ENCRYPT") { @@ -117,6 +127,7 @@ class RuleConfig extends Component { case "taxAgentShowStatus": case "salaryShowStatus": case "adjustShowStatus": + case "REPORT_ORGANIZATIN_TYPE": if (!this.handleDebounce) { this.handleDebounce = _.debounce(() => { const confTitle = { @@ -126,7 +137,8 @@ class RuleConfig extends Component { extEmpsWitch: getLabel(544097, "开启非系统人员"), taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"), salaryShowStatus: getLabel(111, "显示工资单页签"), - adjustShowStatus: getLabel(111, "显示调薪记录页签") + adjustShowStatus: getLabel(111, "显示调薪记录页签"), + REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息") }; this.unifiedSettings(key, confTitle[key]); this.handleDebounce = null; From 215094dac85b8a2395a5f0cfa8c1d5427a77a566 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, 9 Oct 2024 11:25:50 +0800 Subject: [PATCH 011/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/apis/variableSalary.js | 2 +- pc4mobx/hrmSalary/pages/variableSalary/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/variableSalary.js b/pc4mobx/hrmSalary/apis/variableSalary.js index 8cd818b5..1bd063d0 100644 --- a/pc4mobx/hrmSalary/apis/variableSalary.js +++ b/pc4mobx/hrmSalary/apis/variableSalary.js @@ -44,7 +44,7 @@ export const getVariableSalaryDetail = params => { }; // 获取当前管理员下的所有的个税扣缴义务人 export const getAdminTaxAgentList = () => { - return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {}); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare: false }); }; // 浮动薪酬档案导出 export const exportVariableSalary = (params) => { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 76e364e4..f8b13f3b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -43,7 +43,7 @@ class Index extends Component { componentDidMount() { API.getAdminTaxAgentList().then(({ status, data }) => { if (status) { - const taxAgentOption = _.map(data, (o, i) => ({ key: String(o.id), showname: o.name })); + const taxAgentOption = _.map(data, (o, i) => ({ key: o.id, showname: o.content })); this.setState({ taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","), SIDialog: { ...this.state.SIDialog, taxAgentOption }, From 307f954eace713b4f44514a79fd893834fe271d4 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, 9 Oct 2024 14:55:11 +0800 Subject: [PATCH 012/131] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/payrollFiles/components/salaryFileList/index.js | 2 +- .../welfareArchive/components/welfareTableList/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js index efe2605b..24f3cd63 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileList/index.js @@ -150,7 +150,7 @@ class Index extends Component { "操作日志": getLabel(545781, "操作日志") }; const childFrameObj = document.getElementById("atdTable"); - childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getSalaryFileList = (props, init = false) => { const { pageInfo } = this.state; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index a9029a86..11524d22 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -238,7 +238,7 @@ class Index extends Component { "操作日志": getLabel(545781, "操作日志") }; const childFrameObj = document.getElementById("atdTable"); - childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; handleChangeProgramme = (type, schemeId, payload) => { this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum[type], schemeId }) From ab7d0c1f7fbaef2026342ffde6ac6c6f415d992a 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, 9 Oct 2024 18:12:06 +0800 Subject: [PATCH 013/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index f1ad9a67..fce37671 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,6 +30,7 @@ class Layout extends Component { } componentDidMount() { + this.checkData(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -41,8 +42,26 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } + window.addEventListener("storage", this.checkData); } + componentWillUnmount() { + window.removeEventListener("storage", this.checkData); + } + + checkData = () => { + const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; + if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { + const src = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + const link = document.createElement("link"); + link.setAttribute("rel", "stylesheet"); + link.setAttribute("type", "text/css"); + link.setAttribute("href", src); + let header = document.getElementById("container"); + header.appendChild(link); + } + }; + render() { return ( {this.props.children} From ca3c9079a100fa78d0596c6fe68d36da8338bd97 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, 10 Oct 2024 13:57:09 +0800 Subject: [PATCH 014/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 24 ++++++++++++------- .../components/payrollTempBaseSet/index.js | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index fce37671..df3d02d3 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,7 +30,6 @@ class Layout extends Component { } componentDidMount() { - this.checkData(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -42,23 +41,32 @@ class Layout extends Component { top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); } - window.addEventListener("storage", this.checkData); + window.addEventListener("storage", this.setFontSize); } componentWillUnmount() { - window.removeEventListener("storage", this.checkData); + window.removeEventListener("storage", this.setFontSize); } - checkData = () => { + componentDidUpdate(prevProps, prevState, snapshot) { + this.setFontSize(); + } + + setFontSize = (init = false) => { const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { - const src = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + const href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; + jQuery("#theme-font").remove(); + window.parent.jQuery("#theme-font1").remove(); + jQuery(jQuery("head")[0]).append(``); const link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("type", "text/css"); - link.setAttribute("href", src); - let header = document.getElementById("container"); - header.appendChild(link); + link.setAttribute("href", href); + link.setAttribute("id", "theme-font1"); + setTimeout(() => { + window.parent.document.head.appendChild(link); + }, 500); } }; diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js index 904d9ca4..fbb75a46 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js @@ -174,7 +174,7 @@ class Index extends Component { if (it === "ackFeedbackStatus" || it === "feedbackStatus") { payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" }); } else { - payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); + payrollTempFeedbackForm.updateFields({ [it]: (!_.isNil(fieldsEchoData[it]) && fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "/" }); } }); this.setState({ From bdd4b4e446ffa663aa94b12d874191aa9cd1b066 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, 10 Oct 2024 15:32:41 +0800 Subject: [PATCH 015/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/layout.js | 7 ++----- .../doCalc/components/salaryEditCalcImport/index.js | 2 +- pc4mobx/hrmSalary/pages/calculate/doCalc/index.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index df3d02d3..39c9d174 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -30,6 +30,7 @@ class Layout extends Component { } componentDidMount() { + this.setFontSize(); if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) { const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css"; const link = document.createElement("link"); @@ -48,11 +49,7 @@ class Layout extends Component { window.removeEventListener("storage", this.setFontSize); } - componentDidUpdate(prevProps, prevState, snapshot) { - this.setFontSize(); - } - - setFontSize = (init = false) => { + setFontSize = () => { const { themeFontSize } = JSON.parse(localStorage.getItem("theme-themeInfo")) || { themeFontSize: "12" }; if (window.location.href.indexOf("/spa/hrmSalary/") !== -1) { const href = `/cloudstore/resource/pc/com/font-size/${themeFontSize}px.css`; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index ce58c616..accd461f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -156,7 +156,7 @@ class Index extends Component { } }, () => { const { selectItems: salaryItems } = this.state.headerFieldsDialog; - cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] }) + cacheImportField({ salaryAcctRecordId, salaryItems: salaryItems ? salaryItems.split(",") : [] }) .then(({ status, errormsg }) => { if (status) { const payload = { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 0d1c87fc..fc07e2f2 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -125,6 +125,15 @@ class Index extends Component { case "offlineCompare": window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcOc/${salaryAcctRecordId}`, "_blank"); break; + case "LOCK": + case "UNLOCK": + const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state; + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(543303, "请选择表格数据!")); + return; + } + this.calc.calcTableRef.wrappedInstance.updateEmpLockStatus({ lockStatus: key, acctEmpIds: selectedRowKeys }); + break; default: break; } @@ -145,6 +154,8 @@ class Index extends Component { {getLabel(81272, "导出全部")} {getLabel(544270, "自定义导出")} {getLabel(543249, "线下对比")} + {getLabel(111, "批量锁定")} + {getLabel(111, "批量解锁")} ); reqBtns = [ From 90470c3a5784d3e5ff51cb04e26088b778149ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 11 Oct 2024 17:06:54 +0800 Subject: [PATCH 016/131] =?UTF-8?q?feature/2.15.2.2409.01-=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AssociativeSearchSingle.js | 26 ++ .../components/associativeSearchMult.js | 165 ++++++++++ .../components/associativeTreeMult.js | 84 +++++ .../components/customBrowserDialog.js | 299 ++++++++++++++++++ .../components/customBrowserMutiLeft.js | 81 +++++ .../components/customBrowserMutiRight.js | 91 ++++++ .../components/customBrowserOperation.js | 64 ++++ .../components/customTransferDialog.js | 226 +++++++++++++ .../components/CustomBrowser/index.js | 136 ++++++++ .../components/CustomBrowser/index.less | 72 +++++ .../components/salaryDetails.js | 28 +- .../pages/analysisOfSalaryStatistics/index.js | 12 +- pc4mobx/hrmSalary/stores/taxAgent.js | 10 + 13 files changed, 1283 insertions(+), 11 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.less diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js new file mode 100644 index 00000000..6e6f9555 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js @@ -0,0 +1,26 @@ +/* + * 自定义浏览框组件 + * 单选 + * @Author: 黎永顺 + * @Date: 2024/9/3 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import AssociativeSearchMult from "./associativeSearchMult"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeSearchSingle extends Component { + + + render() { + return ( + + ); + } +} + +export default AssociativeSearchSingle; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js new file mode 100644 index 00000000..3f1dbc54 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -0,0 +1,165 @@ +/* + * 自定义浏览框组件 + * 多选 + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, Icon, Select } from "antd"; +import { postFetch } from "../../../util/request"; +import classNames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; +const Option = Select.Option; + +class AssociativeSearchMult extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, data: [], activeKey: "", dropdownWidth: 200 + }; + this.selectedData = {}; + } + + componentDidMount() { + const { dropdownWidth } = this.state; + const w = $(this.refs.searchWrapperMui).outerWidth(); + if (dropdownWidth < w) { + this.setState({ dropdownWidth: w }); + } + } + + handleSearch = (value) => { + this.setState({ loading: true }); + this.getData(value); + }; + getData = (name = "") => { + const { browserConditionParam } = this.props; + const { + completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {} + } = browserConditionParam; + if (_.trim(name)) { + let payload = { ...dataParams }; + searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + this.setState({ + data: convertDatasource ? convertDatasource(data.list) : data.list, + activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) + }); + } else { + this.setState({ + data: filterByName ? _.filter(_.map(data, o => ({ + ...o, id: String(o.id), name: o.name + })), k => k.name.indexOf(name) !== -1) : _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), + activeKey: this.getActiveKey(data) + }); + } + }); + } else { + this.setState({ data: [], loading: false, activeKey: "" }); + } + }; + getActiveKey = (data) => { + const { selectedValues = [] } = this.props; + let v = ""; + if (data && data.length > 0) { + let target = data.filter((d) => selectedValues.indexOf(d.id) === -1); + if (!_.isEmpty(target)) v = String(target[0].id); + } + return v; + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + this.setState({ activeKey: "" }); + }; + handleBlur = () => this.setState({ data: [], activeKey: "" }); + handleClick = (e) => { + e && e.preventDefault(); + const { datas, selectedValues } = this.props; + if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas); + }; + isReadOnly = () => { + const { viewAttr } = this.props; + return viewAttr === 1 || viewAttr === "1"; + }; + + render() { + const { data, dropdownWidth } = this.state; + const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues), + "mr12": viewAttr === "3" && _.isEmpty(selectedValues), + "wea-associative-single": (isSingle || browserConditionParam.isSingle), + "wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle) + }); + if (this.isReadOnly()) { + let arr = []; + selectedValues && selectedValues.map(v => { + let item = datas[v].name; + if (_.isString(item)) { + arr.push({item}); + } else { + arr.push( ); + } + }); + return ( + {arr} + ); + } + let options = data.map(d => ); + selectedValues && selectedValues.map((v) => { + v && options.unshift(); + }); + const select = ; + return ( +
+ {select} + +
+
+
+ ); + } +} + +export default AssociativeSearchMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js new file mode 100644 index 00000000..f7e975c3 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js @@ -0,0 +1,84 @@ +/* + * 自定义组件 + * 下拉树选择框 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { TreeSelect } from "antd"; +import classNames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeTreeMult extends Component { + constructor(props) { + super(props); + this.state = { + data: [] + }; + this.selectedData = {}; + } + + componentDidMount() { + const { treeData } = this.props; + this.setState({ data: this.filterTree(treeData) }); + } + + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + filterTree = (nodes) => { + const selectableNodes = []; + const recurse = (nodes) => { + nodes.forEach((node) => { + if (node.selectable) selectableNodes.push(node); + if (node.children) recurse(node.children); + }); + }; + recurse(nodes); + return selectableNodes; + }; + + render() { + const { viewAttr, selectedValues, datas, isSingle, treeData } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues) + }); + const tProps = { + treeData, + multiple: true, + allowClear: false, + treeCheckable: true, + style: { width: "100%" }, + treeDefaultExpandAll: true, + value: selectedValues, + onChange: this.handleChange, + dropdownMatchSelectWidth: true, + dropdownStyle: { minWidth: 200, maxHeight: 280, overflowY: "auto" }, + getPopupContainer: (triggerNode) => triggerNode.parentNode + }; + return ( + + ); + } +} + +export default AssociativeTreeMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js new file mode 100644 index 00000000..4cb5a125 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -0,0 +1,299 @@ +/* + * 自定义浏览框组件 + * 弹框选择 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable, WeaTransfer } from "ecCom"; +import { Button, Col, Row, Spin } from "antd"; +import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; +import CustomBrowserMutiRight from "./customBrowserMutiRight"; +import CustomBrowserOperation from "./customBrowserOperation"; +import { postFetch } from "../../../util/request"; + +const WeaTransferList = WeaTransfer.list; +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], + query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + leftListSelectedKeys: [], // 左侧table选择的keys + leftListSelectedData: [], // 左侧table选择的数据 + rightCheckedKeys: [], //右侧选择的keys + rightDatas: [] // 右侧展示的数据 + }; + this.selectedData = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.getData(); + this.setState({ + selectedRowKeys: nextProps.selectedValues, + leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) + }); + } else { + this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] + }); + this.selectedData = {}; + } + } + + getData = () => { + const { pageInfo, query } = this.state; + const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props; + let payload = { ...dataParams, ...query }; + dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query }); + this.setState({ loading: true }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) }); + } + }); + }; + handleRowClick = record => { + if (!this.props.isSingle) return; + const values = [record.id]; + const selectedData = { [record["id"]]: record }; + this.props.onCancel(); + this.props.onChange && this.props.onChange(values, selectedData); + }; + handleClear = () => { + this.props.onCancel(); + this.props.onChange && this.props.onChange([], {}); + }; + handleOk = () => { + const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; + const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; + convertSelectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state; + if (this.selectedData[id]) return this.selectedData[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (String(id) === String(listDatas[i].id)) return listDatas[i]; + } + } + }; + onLeftListCheck = (keys, datas) => { + const { leftListSelectedData } = this.state; + let targets = leftListSelectedData.concat(datas); + targets = _.uniqBy(targets, "id"); + targets = targets.filter((t) => keys.indexOf(t["id"]) > -1); + this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets }); + }; + onleftDoubleClick = (data) => { + const { rightDatas } = this.state; + this.setState({ + rightDatas: rightDatas.concat(data), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + }; + onRightDoubleClick = (key) => { + const { rightDatas } = this.state; + const newRightDatas = rightDatas.filter(item => String(item.id) !== key); + this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] }); + }; + moveTo = (direction) => { + const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; + if (direction === "right") { + this.setState({ + rightDatas: rightDatas.concat(leftListSelectedData), + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } else if (direction === "left") { + this.setState({ + rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)), + rightCheckedKeys: [] + }); + } else if (direction === "allToLeft") { + this.setState({ rightDatas: [], rightCheckedKeys: [] }); + } else if (direction === "allToRight") { + if (this.leftListAllActive()) { + this.setState({ + rightDatas: rightDatas.concat(listDatas), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } + } + }; + leftListAllActive = () => { + const { rightDatas, listDatas } = this.state; + let bool = true; + if (_.isEmpty(listDatas)) bool = false; + if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) { + bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0; + } + return bool; + }; + renderTitle = () => { + const { dialogType, searchParamsKey, isSingle } = this.props, { + query, pageInfo, selectedRowKeys, singleFilterVal + } = this.state; + return (
+ {getLabel(111, "数据选择")} + { + dialogType === "table" ? + this.setState({ query: { ...query, [searchParamsKey]: value } })} + onSearch={() => { + this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }}/> : isSingle ? + this.setState({ singleFilterVal })}/> : +
+ } +
); + }; + + render() { + const { + loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, + singleFilterVal + } = this.state; + const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; + const sheight = this.dialog ? this.dialog.state.height - 116 : 260; + const buttons = [ + , + , + ]; + let rightActive = false, leftActive = false, rightAllActive = false; + if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; + if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; + if (rightDatas && rightDatas.length > 0) rightAllActive = true; + let dom = +
+ { + !isSingle ? +
+ + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> + + +
+ + + +
+
+
+ this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} + /> +
+
+ this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} + /> +
+
: + this.handleRowClick(_.find(listDatas, item => item.id === id))} + data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> + } +
+
; + if (dialogType === "table") { + 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.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + dom =
+ +
; + } + dialogType === "table" && isSingle && buttons.splice(0, 1); + return ( + this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={buttons}>{dom} + ); + } +} + +export default CustomBrowserDialog; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js new file mode 100644 index 00000000..94343950 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js @@ -0,0 +1,81 @@ +/* + * 自定义浏览框组件 + * 选择框左边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +let timeout = null; + +class CustomBrowserMutiLeft extends Component { + constructor(props) { + super(props); + this.dataObj = {}; + } + + onClick = (data) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + let { selectedKeys } = this.props; + let keys = selectedKeys ? [...selectedKeys] : []; + let datas = []; + if (keys.indexOf(data.id) > -1) { + keys = keys.filter((k) => k !== data.id); + } else { + keys.push(data.id); + } + keys.forEach((k) => this.dataObj[k] && datas.push(this.dataObj[k])); + this.props.onClick && this.props.onClick(keys, datas); + }, 200); + }; + onDoubleClick = (data) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick([data]); + }; + cls = (item) => { + const { selectedKeys, filterData } = this.props; + let cls = []; + if (selectedKeys && selectedKeys.indexOf(item.id) > -1) { + cls.push("selected"); + } + if (filterData && filterData.filter((d) => d.id === item.id).length > 0) { + cls.push("hide"); + } + return cls.join(" "); + }; + + render() { + const { datas, selectedKeys } = this.props; + const list = datas.map(item => { + this.dataObj[item.id] = item; + return
  • this.onClick(item)} + onDoubleClick={() => this.onDoubleClick(item)}> +
    {item.name}
    +
    + +
  • ; + }); + return ( +
    +
      + {list} +
    + { + list.length === 0 && +
    + {getLabel(111, "没有可显示的数据")} +
    + } +
    + ); + } +} + +export default CustomBrowserMutiLeft; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js new file mode 100644 index 00000000..ed56dd09 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -0,0 +1,91 @@ +/* + * 自定义浏览框组件 + * 选择框右边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { Tree } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; +const TreeNode = Tree.TreeNode; + +let timeout = null; + +class CustomBrowserMutiRight extends Component { + constructor(props) { + super(props); + this.state = { + key: "" + }; + this.nodeIds = []; + this.nodeObj = {}; + } + + generateTreeNodes = () => { + const { data } = this.props, { key } = this.state; + const treeNodes = []; + let showData = [...data]; + if (_.trim(key)) { + showData = showData.filter((item) => { + return item.name.indexOf(_.trim(key)) > -1; + }); + } + showData = _.uniqBy(showData, "id"); + this.nodeIds = []; + this.nodeObj = {}; + showData.map((item) => { + let title = ( +
    +
    +
    + {item.name} +
    +
    +
    +
    + ); + treeNodes.push(); + this.nodeIds.push(item["id"]); + this.nodeObj[item["id"]] = item; + }); + return treeNodes; + }; + handleSearchChange = (v) => this.setState({ key: v }); + checkHandler = (v) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + this.props.checkedCb && this.props.checkedCb(v); + }, 200); + }; + onDoubleClick = (key) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick(key); + }; + + render() { + const { height, checkedKeys } = this.props; + return ( +
    + +
    + + + {this.generateTreeNodes()} + + +
    +
    + ); + } +} + +export default CustomBrowserMutiRight; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js new file mode 100644 index 00000000..ab56ef02 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js @@ -0,0 +1,64 @@ +/* + * 自定义浏览框组件 + * 弹框操作栏 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserOperation extends Component { + render() { + const { + moveToLeft, + moveToRight, + leftArrowText, + rightArrowText, + leftActive, + rightActive, + className, + leftAllActive, + moveAllToLeft, + rightAllActive, + moveAllToRight + } = this.props; + + const moveToLeftButton = ( + + ); + const moveToRightButton = ( + + ); + + const moveAllToLeftButton = ( + + ); + const moveAllToRightButton = ( + + ); + return ( +
    + {moveToLeftButton} + {moveToRightButton} + {moveAllToLeftButton} + {moveAllToRightButton} +
    + ); + } +} + +export default CustomBrowserOperation; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js new file mode 100644 index 00000000..25ed3916 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js @@ -0,0 +1,226 @@ +/* + * 自定义穿梭框组件 + * 弹框选择 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { Button, Col, Row, Spin } from "antd"; +import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; +import CustomBrowserMutiRight from "./customBrowserMutiRight"; +import CustomBrowserOperation from "./customBrowserOperation"; +import { postFetch } from "../../../util/request"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomTransferDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], + query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + leftListSelectedKeys: [], // 左侧table选择的keys + leftListSelectedData: [], // 左侧table选择的数据 + rightCheckedKeys: [], //右侧选择的keys + rightDatas: [] // 右侧展示的数据 + }; + this.selectedData = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.getData(true); + if (nextProps.datas) { + this.setState({ + leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) + }); + } + } else { + this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] + }); + this.selectedData = {}; + } + } + + getData = (init = false) => { + const { pageInfo, query } = this.state; + const { completeURL, convertDatasource, dataParams = {} } = this.props; + let payload = { ...dataParams, ...query }; + this.setState({ loading: true }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + console.log(64, data); + this.setState({ + listDatas: convertDatasource ? convertDatasource(data) : [], + leftListSelectedData: init ? _.values(nextProps.datas) : [], + rightDatas: init ? _.values(nextProps.datas) : [] + }); + } + }); + }; + handleOk = () => { + const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; + const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; + convertSelectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state; + if (this.selectedData[id]) return this.selectedData[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (String(id) === String(listDatas[i].id)) return listDatas[i]; + } + } + }; + onLeftListCheck = (keys, datas) => { + const { leftListSelectedData } = this.state; + let targets = leftListSelectedData.concat(datas); + targets = _.uniqBy(targets, "id"); + targets = targets.filter((t) => keys.indexOf(t["id"]) > -1); + this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets }); + }; + onleftDoubleClick = (data) => { + const { rightDatas } = this.state; + this.setState({ + rightDatas: rightDatas.concat(data), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + }; + onRightDoubleClick = (key) => { + const { rightDatas } = this.state; + const newRightDatas = rightDatas.filter(item => String(item.id) !== key); + this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] }); + }; + moveTo = (direction) => { + const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; + if (direction === "right") { + this.setState({ + rightDatas: rightDatas.concat(leftListSelectedData), + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } else if (direction === "left") { + this.setState({ + rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)), + rightCheckedKeys: [] + }); + } else if (direction === "allToLeft") { + this.setState({ rightDatas: [], rightCheckedKeys: [] }); + } else if (direction === "allToRight") { + if (this.leftListAllActive()) { + this.setState({ + rightDatas: rightDatas.concat(listDatas), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } + } + }; + leftListAllActive = () => { + const { rightDatas, listDatas } = this.state; + let bool = true; + if (_.isEmpty(listDatas)) bool = false; + if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) { + bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0; + } + return bool; + }; + renderTitle = () => { + return (
    + {getLabel(111, "数据选择")} +
    +
    ); + }; + + render() { + const { + loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, + singleFilterVal + } = this.state; + const { dialogType, isSingle, searchParamsKey } = this.props; + const buttons = [ + , + ]; + let rightActive = false, leftActive = false, rightAllActive = false; + if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; + if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; + if (rightDatas && rightDatas.length > 0) rightAllActive = true; + let dom = +
    +
    + + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> + + +
    + + + +
    +
    +
    + this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} + /> +
    +
    + this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} + /> +
    +
    +
    ; + return ( + this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={buttons}>{dom} + ); + } +} + +export default CustomTransferDialog; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js new file mode 100644 index 00000000..f77d566d --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -0,0 +1,136 @@ +/* + * 自定义浏览框组件 + * + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import AssociativeTreeMult from "./components/associativeTreeMult"; +import AssociativeSearchMult from "./components/associativeSearchMult"; +import AssociativeSearchSingle from "./components/AssociativeSearchSingle"; +import CustomBrowserDialog from "./components/customBrowserDialog"; +import classNames from "classnames"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + browserDialog: { visible: false }, + selectedData: {}, searchKeys: [], // 搜索按钮选择的数据和keys + rightDatas: [] // 右侧展示的数据 + }; + } + + componentDidMount() { + const { value, fieldConfig } = this.props; + const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig; + if ((value || defaultValue) && replaceDatas.length > 0) { + this.setState({ + searchKeys: (value || defaultValue).split(","), + selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {}) + }); + } + } + + componentWillReceiveProps(nextProps, nextContext) { + if ( + (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) || + (nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value)) + ) { + this.setState({ searchKeys: [], selectedData: [] }); + } + } + + renderSingle = () => { + const { fieldConfig } = this.props; + const { selectedData, searchKeys } = this.state; + return (
    + +
    ); + }; + renderMult = () => { + const { fieldConfig } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + const { selectedData, searchKeys } = this.state; + return (
    + { + browserConditionParam.treeSelect ? + : + + } +
    ); + }; + onBrowerChangeHandler = (values, datas) => { + const { form, fieldConfig, isSingle } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + this.setState({ + searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values, + selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas + }, () => { + this.props.onChange && this.props.onChange(values.join(",")); + this.props.onCustomChange && this.props.onCustomChange(this.state.selectedData); + if (form) { + form.updateFields({ + [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } + }); + } + }); + }; + onBrowerClick = (keys, selectedObj) => { + if (_.isEmpty(keys)) { + this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] }); + } + this.setState({ browserDialog: { visible: true } }); + }; + + render() { + const { browserDialog, selectedData, searchKeys } = this.state; + const { isSingle, viewAttr, fieldConfig = {} } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + const className = classNames({ + "wea-browser": true, + "wea-field-readonly": viewAttr === "1" || fieldConfig.viewAttr === "1" + }); + const browser = (isSingle || browserConditionParam.isSingle) ? this.renderSingle() : this.renderMult(); + const style = {}; + if (this.props.resize) style.visibility = "hidden"; + return ( +
    {browser}
    + this.setState({ browserDialog: { visible: false } })} + datas={selectedData} selectedValues={searchKeys}/> +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less new file mode 100644 index 00000000..d4d61a16 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -0,0 +1,72 @@ +.custom_browser_dialog { + .wea-hr-muti-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .wea-hr-muti-input-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } + } + + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } + + .wea-hr-muti-dialog { + height: 100%; + background: #f6f6f6; + padding: 8px 16px; + + .wea-hr-muti-input-left, .wea-hr-muti-input-right { + background: #FFF; + } + + .wea-transfer-list { + background: #FFF; + border: 1px solid #e9e9e9; + } + + .wea-input-focus { + height: 35px !important; + width: 100% !important; + + input { + height: 100% !important; + } + } + + .wea-transfer-list-wrapper { + border: none !important; + + .transfer-tree { + padding: 0 !important; + + & > li { + margin: 0; + cursor: pointer; + width: 100%; + position: relative; + padding: 6px 0 6px 20px !important; + border-bottom: 1px solid #e9e9e9; + color: #333; + overflow: hidden; + + .ant-tree-switcher { + display: none !important; + } + + .tree-title { + line-height: 30px; + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 3f01a8bf..aeafccb6 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -6,13 +6,14 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; -import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { WeaTableNew } from "comsMobx"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { message, Spin } from "antd"; -import * as API from "../../../apis/statistics"; +import { toJS } from "mobx"; import { getIframeParentHeight } from "../../../util"; import { sysConfCodeRule } from "../../../apis/ruleconfig"; +import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog"; +import * as API from "../../../apis/statistics"; import "../index.less"; const WeaTableComx = WeaTableNew.WeaTable; @@ -26,7 +27,12 @@ class SalaryDetails extends Component { this.state = { loading: false, dataSource: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, - showTotalCell: false, updateSum: true + showTotalCell: false, updateSum: true, + transferDialog: { + visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting" + // convertDatasource: null + } }; } @@ -113,10 +119,10 @@ class SalaryDetails extends Component { }; getColumns = () => { const { attendanceStore: { tableStore } } = this.props; - const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum } = this.state; + const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; - if (!_.isEmpty(columns)) { + if (!_.isEmpty(columns) && !transferDialog.visible) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRowlistUrl, payload: { ...payload, updateSum }, @@ -130,9 +136,12 @@ class SalaryDetails extends Component { } return []; }; + handleSetDefCols = () => { + this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + }; render() { - const { loading, dataSource } = this.state; + const { loading, dataSource, transferDialog } = this.state; const { attendanceStore: { tableStore } } = this.props; return (
    + {/*默认显示列*/} + this.setState({ + transferDialog: { ...transferDialog, visible: false } + })}/>
    ); } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 121e334a..f8ac8451 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -275,7 +275,7 @@ class Index extends Component { render() { const { - taxAgentStore: { statisticsReportBtn }, + taxAgentStore: { statisticsReportBtn, PageAndOptAuth }, attendanceStore: { statisticsForm, reportForm, tableStore } } = this.props; const { @@ -313,7 +313,7 @@ class Index extends Component { ]; - const dropMenuDatas = [ + let dropMenuDatas = [ { key: "log", icon: , content: getLabel(545781, "操作日志") @@ -333,6 +333,11 @@ class Index extends Component { { key: "detail", title: getLabel(111, "员工明细") }, { key: "salaryDetail", title: getLabel(111, "薪资明细") } ]; + dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1); + (PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, { + key: "DEF_COLUMN", icon: , content: getLabel(111, "默认显示列"), + onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols() + }]); return ( } selectedKey={selectedKey} @@ -340,8 +345,7 @@ class Index extends Component { buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())} showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1)} - > + dropMenuDatas={dropMenuDatas}>
    this.setState({ showSearchAd: false })} onAdSearch={this.onAdSearch}/>
    diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index ef5cfe2d..33b74a55 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -8,6 +8,15 @@ import { decentralizationConditions, editConditions } from "../pages/taxAgent/ed const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 + @observable roleForm = new WeaForm(); //权限-角色form表单 + @action initRoleForm = () => this.roleForm = new WeaForm(); + @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单 + @action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm(); + @observable PageAndOptAuth = { able: false, opts: [] }; // 业务线页面权限 + @action initPageAndOptAuth = () => this.PageAndOptAuth = { able: true, opts: ["query", "admin"] };// 设置业务线页面权限 + + @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); //表单实体 @observable formDecentralization = new WeaForm(); //关闭分权表单 @@ -140,6 +149,7 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getPermission(params).then(({ status, data }) => { if (status) { + this.PageAndOptAuth = data; const { isAdminEnable, isChief, isOpenDevolution } = data; this.setShowOperateBtn( !isOpenDevolution ? true : isAdminEnable ? true : false From 0754316e770568dcd0dc2c8ddfa96ffab1c6af84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 11 Oct 2024 17:13:19 +0800 Subject: [PATCH 017/131] =?UTF-8?q?feature/2.15.2.2409.01-=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryDetails.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index aeafccb6..ef85c253 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -30,8 +30,7 @@ class SalaryDetails extends Component { showTotalCell: false, updateSum: true, transferDialog: { visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, - completeURL: "/api/bs/hrmsalary/common/pageList/get/setting" - // convertDatasource: null + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: null } }; } @@ -137,7 +136,12 @@ class SalaryDetails extends Component { return []; }; handleSetDefCols = () => { - this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + this.setState({ + transferDialog: { + ...this.state.transferDialog, visible: true, + convertDatasource: datas => _.map(datas.setting, o => ({ id: o.id, name: o.name })) + } + }); }; render() { From 591f29d934f805fed6951c7112148bf9a3c1ccf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 11 Oct 2024 17:15:11 +0800 Subject: [PATCH 018/131] release/2.15.2.2409.01 --- .../calculate/doCalc/components/salaryEditCalcImport/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index accd461f..901cb803 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -156,7 +156,7 @@ class Index extends Component { } }, () => { const { selectItems: salaryItems } = this.state.headerFieldsDialog; - cacheImportField({ salaryAcctRecordId, salaryItems: salaryItems ? salaryItems.split(",") : [] }) + cacheImportField({ salaryAcctRecordId, salaryItemIds: salaryItems ? salaryItems.split(",") : [] }) .then(({ status, errormsg }) => { if (status) { const payload = { From 5b3a645dfc69dbf498c285751a2de503fe425e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 12 Oct 2024 10:07:36 +0800 Subject: [PATCH 019/131] release/2.15.2.2409.01 --- pc4mobx/hrmSalary/apis/statistics.js | 4 ++ .../components/customTransferDialog.js | 52 ++++++------------- .../components/salaryDetails.js | 47 ++++++++++++----- 3 files changed, 54 insertions(+), 49 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index 76056002..17323093 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -134,3 +134,7 @@ export const getSalaryListSum = (params) => { export const exportSalaryList = (params) => { return postExportFetch("/api/bs/hrmsalary/report/statistics/employee/exportSalaryList", params); }; +//薪酬统计报表-保存全局自定义列配置 +export const savePageListSetting = (params) => { + return postFetch("/api/bs/hrmsalary/common/pageList/save/setting", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js index 25ed3916..919ec05c 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js @@ -22,8 +22,8 @@ class CustomTransferDialog extends Component { constructor(props) { super(props); this.state = { - loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], - query: { [props.searchParamsKey]: "" }, singleFilterVal: "", + loading: false, listDatas: [], + query: { [props.searchParamsKey]: "" }, leftListSelectedKeys: [], // 左侧table选择的keys leftListSelectedData: [], // 左侧table选择的数据 rightCheckedKeys: [], //右侧选择的keys @@ -40,9 +40,9 @@ class CustomTransferDialog extends Component { leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) }); } - } else { + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { this.setState({ - pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + query: { [this.props.searchParamsKey]: "" }, rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] }); this.selectedData = {}; @@ -50,7 +50,7 @@ class CustomTransferDialog extends Component { } getData = (init = false) => { - const { pageInfo, query } = this.state; + const { query } = this.state; const { completeURL, convertDatasource, dataParams = {} } = this.props; let payload = { ...dataParams, ...query }; this.setState({ loading: true }); @@ -59,37 +59,20 @@ class CustomTransferDialog extends Component { if (status && data.list) { const { pageNum: current, pageSize, total } = data; this.setState({ - listDatas: convertDatasource ? convertDatasource(data.list) : data.list, - pageInfo: { ...pageInfo, current, pageSize, total } + listDatas: convertDatasource ? convertDatasource(data.list) : data.list }); } else { - console.log(64, data); this.setState({ - listDatas: convertDatasource ? convertDatasource(data) : [], - leftListSelectedData: init ? _.values(nextProps.datas) : [], - rightDatas: init ? _.values(nextProps.datas) : [] + listDatas: convertDatasource ? convertDatasource(data).listDatas : [], + leftListSelectedData: (init && convertDatasource) ? convertDatasource(data).checked : this.state.leftListSelectedData, + rightDatas: (init && convertDatasource) ? convertDatasource(data).checked : this.state.rightDatas }); } }); }; handleOk = () => { - const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; - const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; - convertSelectedRowKeys.forEach((v) => { - let item = this.getItemById(v); - if (item) this.selectedData[v] = item; - }); - this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); - this.props.onCancel && this.props.onCancel(); - }; - getItemById = (id) => { - const { listDatas } = this.state; - if (this.selectedData[id]) return this.selectedData[id]; - if (!_.isEmpty(listDatas)) { - for (let i = 0; i < listDatas.length; i++) { - if (String(id) === String(listDatas[i].id)) return listDatas[i]; - } - } + const { rightDatas } = this.state; + this.props.onChange && this.props.onChange(rightDatas); }; onLeftListCheck = (keys, datas) => { const { leftListSelectedData } = this.state; @@ -155,14 +138,11 @@ class CustomTransferDialog extends Component { }; render() { - const { - loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, - singleFilterVal - } = this.state; - const { dialogType, isSingle, searchParamsKey } = this.props; + const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state; + const { searchParamsKey, saveLoading } = this.props; const buttons = [ - , + , ]; let rightActive = false, leftActive = false, rightAllActive = false; if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; @@ -173,7 +153,7 @@ class CustomTransferDialog extends Component {
    - this.getData()} onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })} /> diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index ef85c253..59995acd 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -29,8 +29,13 @@ class SalaryDetails extends Component { pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, showTotalCell: false, updateSum: true, transferDialog: { - visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, - completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: null + visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false, + completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", convertDatasource: datas => { + return { + listDatas: _.map(datas.setting, o => ({ id: o.id, name: o.name })), + checked: this.converCheckedCol(datas) + }; + } } }; } @@ -78,10 +83,10 @@ class SalaryDetails extends Component { childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getSalaryList = (props) => { - const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props; + const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props; const [startDateStr, endDateStr] = dateRange; const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); - const { pageInfo } = this.state; + const { pageInfo, transferDialog } = this.state; const payload = { taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], departmentIds: departmentIds ? departmentIds.split(",") : [], @@ -98,7 +103,7 @@ class SalaryDetails extends Component { const { list: dataSource, pageNum: current, total, pageSize } = pageparams; this.setState({ dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload, - showTotalCell: confCode === "1" + showTotalCell: confCode === "1", transferDialog: { ...transferDialog, cancel: false } }, () => tableStore.getDatas(dataKey.datas)); } }).catch(() => this.setState({ loading: false })); @@ -121,7 +126,7 @@ class SalaryDetails extends Component { const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum, transferDialog } = this.state; const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; - if (!_.isEmpty(columns) && !transferDialog.visible) { + if (!_.isEmpty(columns) && !transferDialog.visible && !transferDialog.cancel) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRowlistUrl, payload: { ...payload, updateSum }, @@ -135,11 +140,27 @@ class SalaryDetails extends Component { } return []; }; - handleSetDefCols = () => { - this.setState({ - transferDialog: { - ...this.state.transferDialog, visible: true, - convertDatasource: datas => _.map(datas.setting, o => ({ id: o.id, name: o.name })) + handleSetDefCols = () => this.setState({ transferDialog: { ...this.state.transferDialog, visible: true } }); + converCheckedCol = (data) => { + return _.reduce(data.checked, (pre, cur) => { + const item = _.find(data.setting, k => k.id === cur); + if (!_.isEmpty(item)) return [...pre, item]; + return pre; + }, []); + }; + savePageListSetting = (values) => { + const payload = { + page: "salary_details_report", + setting: _.map(values, o => o.id) + }; + this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } }); + API.savePageListSetting(payload).then(({ status, errormsg }) => { + this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ transferDialog: { ...this.state.transferDialog, visible: false } }, () => this.getSalaryList()); + } else { + message.error(errormsg); } }); }; @@ -165,9 +186,9 @@ class SalaryDetails extends Component { columns={this.getColumns()} /> {/*默认显示列*/} - this.setState({ - transferDialog: { ...transferDialog, visible: false } + transferDialog: { ...transferDialog, visible: false, cancel: true } })}/>
    ); From 7980acc6c253864d8167cf5d6ffb0d7737f39338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 14 Oct 2024 14:20:02 +0800 Subject: [PATCH 020/131] release/2.15.2.2409.01 --- .../components/salaryFileDialog/index.js | 15 ++-- .../salaryFileImportDialog/index.js | 22 +++--- .../components/salaryFileList/index.js | 26 ++++--- .../components/searchPannel/index.js | 16 ++++- .../pages/variableSalary/conditions.js | 26 ++++++- .../hrmSalary/pages/variableSalary/index.js | 72 ++++++++----------- .../hrmSalary/pages/variableSalary/index.less | 6 +- 7 files changed, 107 insertions(+), 76 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..d0b0d7f4 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -38,8 +38,9 @@ class Index extends Component { } } - initForm = (props) => { - const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props; + initForm = async (props) => { + const { baseTableStore: { VSSalaryFileForm }, detail } = props; + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ @@ -48,7 +49,8 @@ class Index extends Component { if (getKey(o) === "taxAgentIds") { return { ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - options: taxAgentOption, value: detail[getKey(o)] || "" + value: detail[getKey(o)] || "", + options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content })) }; } return { @@ -65,7 +67,7 @@ class Index extends Component { label: o.name, labelcol: 6, value: detail[`${String(o.id)}_variableItem`] || "", - viewAttr: !_.isEmpty(detail) ? 1 : 2 + viewAttr: 2 })), title: "", col: 2, defaultshow: true @@ -124,10 +126,7 @@ class Index extends Component {
    {title}
    - { - _.isEmpty(detail) && - - } +
    ; }; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index c8917e45..53a96c2b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,12 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps; - const payload = { - salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData - }; + const { baseTableStore: { VSalryForm } } = nextProps; + const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; this.setState({ - importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + importDialog: { + ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + link: `${importDialog.link}?${convertToUrlString(payload)}` + } }); } else { this.setState({ @@ -48,9 +49,10 @@ class Index extends Component { } handleImport = (payload) => { - const { taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; + const { taxAgentIds } = VSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -64,14 +66,14 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
    { - const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; + const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -98,9 +100,9 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f3b0e52a..6b4fcf8b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -24,7 +24,8 @@ class Index extends Component { constructor(props) { super(props); this.state = { - pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [] + pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], + selectedRowKeys: [] }; } @@ -56,10 +57,14 @@ class Index extends Component { pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getVariableSalaryList()); break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; case "DEL": this.handleDelete([params.id]); break; - case "VIEW": + case "EDIT": this.handleView(params.id); break; default: @@ -68,13 +73,14 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds } = VSalryForm.getFormParams(); + const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), - ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] + ...pageInfo, ...VSalryForm.getFormParams(), + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { @@ -100,7 +106,7 @@ class Index extends Component { API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "删除成功")); - this.getVariableSalaryList(); + this.setState({ selectedRowKeys: [] }, () => this.getVariableSalaryList()); } else { message.error(errormsg); } @@ -116,15 +122,15 @@ class Index extends Component { })); if (!_.isEmpty(columns)) { this.postMessageToChild({ - columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 98, - pageInfo: this.state.pageInfo, unitTableType: "variableSalary" + columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 95, + pageInfo: this.state.pageInfo, unitTableType: "variableSalary", selectedRowKeys: this.state.selectedRowKeys }); } return columns; }; postMessageToChild = (payload = {}) => { const i18n = { - "操作": getLabel(30585, "操作"), "查看详情": getLabel(111, "查看详情"), + "操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "删除": getLabel(111, "删除") }; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index d5b274a9..8d47fc7a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -6,10 +6,12 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; +import * as API from "../../../../apis/variableSalary"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; +import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -24,12 +26,19 @@ class VariableSalarySearchPannel extends Component { }; } - componentDidMount() { + async componentDidMount() { + const { data } = await API.getAdminTaxAgentList(); this.setState({ searchConditions: _.map(conditions, item => { return { ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(data, o => ({ key: o.id, showname: o.content, selected: true })) + }; + } return { ...child, label: getLabel(child.lanId, child.label) }; }) }; @@ -54,7 +63,10 @@ class VariableSalarySearchPannel extends Component { - + diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js index 72ff44cf..8486fdb7 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js @@ -1,3 +1,5 @@ +import moment from "moment"; + export const conditions = [ { items: [ @@ -22,6 +24,28 @@ export const conditions = [ value: "", viewAttr: 2 }, + { + conditionType: "MONTHPICKER", + domkey: ["salaryMonth"], + fieldcol: 14, + label: "薪资所属月", + lanId: 111, + labelcol: 6, + value: moment(new Date()).format("YYYY-MM"), + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + value: "", + options: [], + multiple: true, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, @@ -157,7 +181,7 @@ export const salaryFileConditions = [ lanId: 111, labelcol: 8, value: "", - rules: "required|string", + rules: "required", viewAttr: 3 } ], diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index f8b13f3b..f2ea52c1 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop } from "ecCom"; import * as API from "../../apis/variableSalary"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SearchPannel from "./components/searchPannel"; @@ -19,8 +19,7 @@ import SalaryFileDialog from "./components/salaryFileDialog"; import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; -import moment from "moment"; -import { Button } from "antd"; +import { Button, message } from "antd"; import cs from "classnames"; import "./index.less"; @@ -32,27 +31,13 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "", - salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [], - SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框 - SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框 + selectedKey: "salaryFile", isQuery: false, showSearchAd: false, + SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框 + SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框 SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入 }; } - componentDidMount() { - API.getAdminTaxAgentList().then(({ status, data }) => { - if (status) { - const taxAgentOption = _.map(data, (o, i) => ({ key: o.id, showname: o.content })); - this.setState({ - taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","), - SIDialog: { ...this.state.SIDialog, taxAgentOption }, - SFDialog: { ...this.state.SFDialog, taxAgentOption } - }); - } - }); - } - handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); handleOperate = (type, detail = {}) => { @@ -62,7 +47,7 @@ class Index extends Component { this.setState({ SFDialog: { ...this.state.SFDialog, visible: true, detail, - title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "查看薪资档案") + title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "编辑薪资档案") } }); break; @@ -71,12 +56,12 @@ class Index extends Component { break; case "export": const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex); - const { salaryMonth, taxAgentIds } = this.state; + const { taxAgentIds, departmentIds } = VSalryForm.getFormParams(); const payload = { ...VSalryForm.getFormParams(), taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [], - departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [], - salaryMonth, columns + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + columns }; WeaLoadingGlobal.start(); const promise = API.exportVariableSalary(payload); @@ -85,16 +70,22 @@ class Index extends Component { SFTableStore.setColSetVisible(true); SFTableStore.tableColSet(true); break; + case "batchDel": + const { state: { selectedRowKeys }, handleDelete } = this.salaryListRef.wrappedInstance; + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(111, "请选择数据!")); + return; + } + handleDelete(selectedRowKeys); + break; default: break; } }; render() { - const { - selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds - } = this.state; - const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props; + const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state; + const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props; const tabs = [ { title: getLabel(111, "浮动数据"), key: "salaryFile", showDropIcon: true, @@ -107,22 +98,16 @@ class Index extends Component { buttons: showOperateBtn ? [ , , - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + , this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], - children: this.handleOperate("create", data)}/> + children: !_.isEmpty(VSalryForm.getFormParams()) ? + this.salaryListRef = dom} + onViewSalaryFile={(data) => this.handleOperate("create", data)}/> : null }, { title: getLabel(111, "字段管理"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [], @@ -141,7 +126,7 @@ class Index extends Component { ]; return ( } selectedKey={selectedKey} + title={getLabel(111, "浮动数据")} icon={} selectedKey={selectedKey} iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper" buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })} @@ -161,11 +146,10 @@ class Index extends Component { SFDialog: { ...SFDialog, visible: false } }, () => callback && callback())}/> {/* 薪资档案导入*/} - { - this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, - () => callback && this.handleAdvanceSearch()); - }}/> + { + this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, + () => callback && this.handleAdvanceSearch()); + }}/> ); } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index 55dbb34b..ffe361cd 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -4,6 +4,7 @@ } .wea-new-top-req-content { + padding: 8px 16px 0 16px; .wea-new-table { background: #FFF; @@ -30,7 +31,7 @@ } .wea-advanced-searchsAd { - height: 108px; + height: 155px; overflow: hidden auto; .formItem-delete { @@ -56,6 +57,9 @@ } } + .wea-form-item-wrapper { + display: block !important; + } } } From b954e1696eb383992ef554ca2a92e2dfb1cd8e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 14 Oct 2024 16:02:12 +0800 Subject: [PATCH 021/131] release/2.15.2.2409.01 --- .../salaryFileImportDialog/index.js | 26 ++++++---- .../components/salaryFileList/index.js | 52 +++++++++++++++---- .../components/searchPannel/index.js | 20 ++----- .../pages/variableSalary/conditions.js | 52 +++++++++++-------- .../hrmSalary/pages/variableSalary/index.js | 32 ++++-------- .../hrmSalary/pages/variableSalary/index.less | 24 ++++++++- pc4mobx/hrmSalary/stores/baseTable.js | 1 + 7 files changed, 127 insertions(+), 80 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index 53a96c2b..415f7e33 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,11 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm } } = nextProps; - const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData + }; this.setState({ importDialog: { - ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + ...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } }); @@ -49,10 +51,10 @@ class Index extends Component { } handleImport = (payload) => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; - const { taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -66,14 +68,17 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
    { - const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + salaryMonth: val, hasData + }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -100,9 +105,12 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { + salaryMonth, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + hasData: val === "1" + }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index 6b4fcf8b..01969697 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -9,14 +9,20 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; import { WeaTableNew } from "comsMobx"; import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; +import { getSearchs } from "../../../../util"; +import { extraConditions } from "../../conditions"; +import AdvanceInputBtn from "../advanceInputBtn"; +import SearchPannel from "../searchPannel"; import { toJS } from "mobx"; +import cs from "classnames"; const WeaTableComx = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("baseTableStore") @observer @@ -25,11 +31,30 @@ class Index extends Component { super(props); this.state = { pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: [], - selectedRowKeys: [] + selectedRowKeys: [], condtions: [], showSearchAd: false }; } - componentDidMount() { + async componentDidMount() { + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + this.setState({ + condtions: _.map(extraConditions, item => { + return { + ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content })) + }; + } + return { ...child, label: getLabel(child.lanId, child.label) }; + }) + }; + }) + }, () => { + const { baseTableStore: { VExtraSalryForm } } = this.props; + VExtraSalryForm.initFormFields(this.state.condtions); + }); window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); this.getVariableSalaryList(); @@ -73,12 +98,12 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, ...VSalryForm.getFormParams(), + ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { @@ -137,17 +162,26 @@ class Index extends Component { const childFrameObj = document.getElementById("unitTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; + openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); render() { - const { loading, dataSource } = this.state; - const { baseTableStore: { SFTableStore } } = this.props; + const { loading, dataSource, condtions, showSearchAd } = this.state; + const { baseTableStore: { SFTableStore, VExtraSalryForm } } = this.props; const dom = document.querySelector(".wea-new-top-req-content"); let height = 280; if (dom && dataSource.length > 0) { - height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 16; + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 62; } return ( +
    + {getSearchs(VExtraSalryForm, condtions, 2, false, () => this.getVariableSalaryList())} + this.openAdvanceSearch()} + onAdvanceSearch={() => this.getVariableSalaryList()}/> +
    +
    + this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/> +