From 697b799b324be2074deeb1e98adf81bfe78bac01 Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Mon, 13 Jun 2022 18:08:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=97=E5=AE=9A?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryFile/index.js | 26 +++++++++++++++---- .../socialSecurityBenefits/programme/index.js | 3 ++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index aadfa25e..01d1e624 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -1,6 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; +import { WeaTableNew } from "comsMobx"; import { Button, @@ -24,6 +25,8 @@ import { WeaHelpfulTip, } from "ecCom"; +const WeaTableComx = WeaTableNew.WeaTable; + import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; import ContentWrapper from "../../components/contentWrapper"; @@ -231,6 +234,14 @@ export default class SalaryFile extends React.Component { }); } + showColumn = () => { + const { salaryFileStore: { tableStore } } = this.props; + console.log("showColumn:", tableStore.setColSetVisible(true)); + tableStore.setColSetVisible(true); + tableStore.tableColSet(true); + console.log("showColumn:") + } + render() { const { salaryFileStore } = this.props; const { @@ -432,10 +443,15 @@ export default class SalaryFile extends React.Component { dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 > + searchOperationItem={ + renderRightOperation() + } + /> + { this.handlePageChange(value) }} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 8f8abd24..b84932c4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -425,8 +425,9 @@ export default class Programme extends React.Component { measure={'%'} title={ { handleOnSave(); }} From 029876f694c779a5fe430bb8e0df59b26ae2f9a5 Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 14 Jun 2022 10:16:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=B4=A6=E5=A5=97=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/ledger/salaryItemForm.js | 24 ++++++++++++++++--- .../pages/ledger/step3/AddSalaryItemModal.js | 2 ++ .../pages/ledger/step3/canMoveItem.js | 11 ++++----- pc4mobx/hrmSalary/stores/ledger.js | 15 +++++++++--- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js index 1514cbf8..49e698e8 100644 --- a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js @@ -82,10 +82,27 @@ export default class SalaryItemForm extends React.Component { setItemGroups(newItemGroups) } + // 修改列表数据顺序 + handleItemDataSourceChange(dataSource, item) { + const { ledgerStore: {itemGroups, setItemGroups} } = this.props; + dataSource.map((data, index) => { + data.sortedIndex = index + }) + itemGroups = itemGroups ? [...itemGroups] : [] + itemGroups.map(groupItem => { + if(groupItem.id == item.id) { + groupItem.items = dataSource + } + }) + setItemGroups(itemGroups) + } + render() { const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible, baseInfoRequest}} = this.props; const { canEdit="true" } = baseInfoRequest; const { previewVisible } = this.state; + + return (
@@ -119,10 +136,11 @@ export default class SalaryItemForm extends React.Component { { itemGroups && itemGroups.map(item => { if(item.items) { - item.items && item.items.map(i => {i.key = i.id}) return ( - {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/> - ) + {this.handleItemDataSourceChange(dataSource, item)}} + title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/> + ) } return "" } diff --git a/pc4mobx/hrmSalary/pages/ledger/step3/AddSalaryItemModal.js b/pc4mobx/hrmSalary/pages/ledger/step3/AddSalaryItemModal.js index adc764a6..6fb24a9d 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step3/AddSalaryItemModal.js +++ b/pc4mobx/hrmSalary/pages/ledger/step3/AddSalaryItemModal.js @@ -56,9 +56,11 @@ export default class AddSalaryItemModal extends React.Component { let selectItems = [] addSalaryItemDataSource.map(item => { + item = {...item} selectedRowKeys.map(key => { if(item.id == key) { item.salaryItemId = item.id + item.key = item.id selectItems.push(item) } }) diff --git a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js index 792b7b70..39a45e56 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js +++ b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js @@ -127,11 +127,6 @@ export default class CanMoveItem extends React.Component { }); } - handleTableDrop = (datas) => { - // TODO - console.log("datas:", datas); - } - render() { const {disabled, ledgerStore: {setAddItemVisible, addItemVisible}} = this.props; const { selectedRowKeys, formalModalVisible, addCategoryVisible } = this.state; @@ -181,8 +176,10 @@ export default class CanMoveItem extends React.Component { moveRow: record, })} pagination={false} - onDrop={(datas) => this.handleTableDrop(datas)} - draggable={true}/> + onDrop={(datas) => this.props.onDataSourceChange(datas)} + draggable={true} + + /> } { this.state.addItemVisible && (this.itemGroups = itemGroups); + setItemGroups = (itemGroups) => { + itemGroups = itemGroups ? [...itemGroups] : [] + itemGroups && itemGroups.map(item => { + if(item.items) { + item.items && item.items.map(i => {i.key = i.id}) + } + }) + this.itemGroups = itemGroups + }; @action addItemGroup = (name) => { @@ -687,13 +695,14 @@ export class LedgerStore { API.getLedgerItemForm({ salarySobId: this.salarySobId }).then((res) => { if (res.status) { this.empFields = res.data.empFields; - this.itemGroups = res.data.itemGroups; + let itemGroups = res.data.itemGroups; let defaultItems = { id: "default", name: "未分类", items: res.data.items, }; - this.itemGroups.unshift(defaultItems); + itemGroups.unshift(defaultItems); + this.setItemGroups(itemGroups) API.empFieldList().then((ires) => { if (res.status) { this.empBrowserList = ires.data.map((item) => { From 6ae75883b0fab5be72938cc3e636a051bc5eaab1 Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 14 Jun 2022 10:23:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js index 49e698e8..1f9bb180 100644 --- a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js @@ -88,13 +88,13 @@ export default class SalaryItemForm extends React.Component { dataSource.map((data, index) => { data.sortedIndex = index }) - itemGroups = itemGroups ? [...itemGroups] : [] - itemGroups.map(groupItem => { + let itemResultGroups = itemGroups ? [...itemGroups] : [] + itemResultGroups.map(groupItem => { if(groupItem.id == item.id) { groupItem.items = dataSource } }) - setItemGroups(itemGroups) + setItemGroups(itemResultGroups) } render() { From c4502f1e1b01e8eddc9ff5398b013773b28526bd Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 14 Jun 2022 11:17:03 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/payroll/stepForm/showSettingForm.js | 54 +++++++++++++++++-- pc4mobx/hrmSalary/stores/payroll.js | 3 ++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js index 4da037e8..10f914c5 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js @@ -32,6 +32,42 @@ export default class ShowSettingForm extends React.Component { setSalaryTemplateShowSet(request); } + handleDownClick(index) { + const {payrollStore: {salaryItemSet, setSalaryItemSet}} = this.props + let downItem = salaryItemSet[index + 1]; + let thisItem = salaryItemSet[index] + let resultSet = [...salaryItemSet] + resultSet[index] = downItem; + resultSet[index + 1] = thisItem; + setSalaryItemSet(resultSet) + } + + handleUpClick(index) { + const {payrollStore: {salaryItemSet, setSalaryItemSet}} = this.props + let upItem = salaryItemSet[index - 1] + let thisItem = salaryItemSet[index] + let resultSet = [...salaryItemSet] + resultSet[index] = upItem + resultSet[index - 1] = thisItem; + setSalaryItemSet(resultSet) + } + + handleDeleteItem(group, item) { + const { payrollStore : {salaryItemSet, setSalaryItemSet}} = this.props; + console.log("item:", item); + let resultSalaryItemSet = [...salaryItemSet] + resultSalaryItemSet.map(sourceGroup => { + if(sourceGroup.id == group.id) { + sourceGroup.items.map((sourceItem, index) => { + if(sourceItem.id == item.id) { + sourceGroup.items.splice(index, 1) + } + }) + } + }) + setSalaryItemSet(resultSalaryItemSet) + } + render() { const { payrollStore } = this.props; const { salaryTemplateShowSet } = payrollStore; @@ -132,12 +168,24 @@ export default class ShowSettingForm extends React.Component {
薪资项目设置
{ - salaryItemSet.map(group => ( + salaryItemSet.map((group, index) => (
-
{group.groupName}
+
{group.groupName} + { + index < salaryItemSet.length - 1 && + {this.handleDownClick(index)}} + /> + } + + { + index > 0 && {this.handleUpClick(index)}}/> + } +
{group.items.map(item => ( - {item.name} + {item.name} {this.handleDeleteItem(group, item)}}/> ))}
diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index ed987caf..571923ad 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -69,6 +69,9 @@ export class payrollStore { @action setSalaryTemplateShowSet = (salaryTemplateShowSet) => this.salaryTemplateShowSet = salaryTemplateShowSet + @action + setSalaryItemSet = (salaryItemSet) => this.salaryItemSet = salaryItemSet + // 初始化操作 @action doInit = () => { From 3413f8fc0bfff24b7c1fe2e2c531286214b55a57 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Tue, 14 Jun 2022 11:18:37 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/components/importModal/index.js | 3 ++- .../components/importModal/modalStep1.js | 17 ++++++++++------- .../attendance/editSlideContent.js | 2 +- .../pages/dataAcquisition/attendance/index.js | 2 +- pc4mobx/hrmSalary/pages/salaryFile/index.js | 6 ++++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index e72c2608..5815c3de 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -68,7 +68,7 @@ export default class ImportModal extends React.Component { } render() { - const { step, slideDataSource } = this.props; + const { step, slideDataSource, isInit } = this.props; return ( { this.props.step == 0 && ( this.setState({hasData})} - /> + { + this.props.isInit && + this.setState({hasData})} + /> + }

2. 第二步,请一定要确定Excel文档中的格式是模板中的格式,没有被修改掉;

3. 第三步,选择填写好的Excel文档,点击“下一步”按钮进行数据预览;

diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js index cbfad2eb..8fb10562 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js @@ -56,7 +56,7 @@ export default class EditSlideContent extends React.Component {
{ this.props.salaryYearMonth != "" && -
考勤周期: {moment(this.props.salaryYearMonth + "-01").startOf("month").format("YYYY-MM-DD")} 至 {moment(this.props.salaryYearMonth + "-01").endOf("month").format("YYYY-MM-DD")}
+
考勤周期: {this.props.salaryYearMonth}
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 0f1e2698..85f8819a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -183,7 +183,7 @@ export default class Attendance extends React.Component { handleViewAttendance(record) { const { attendanceStore: {setSlideVisiable}} = this.props; this.recordId = record.id - this.salaryYearMonth = record.salaryYearMonth + this.salaryYearMonth = record.attendCycle setSlideVisiable(true) } diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 01d1e624..0bc0f1c0 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -60,6 +60,7 @@ export default class SalaryFile extends React.Component { selectedTab: 0, editSlideVisible: false, importType: "", + isInit: false, //是否是初始化导入 modalVisiable: false, step: 0, recordSlideVisible: false, @@ -313,12 +314,12 @@ export default class SalaryFile extends React.Component { title: "信息确认", content: `若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入,点击确定继续导入`, onOk: () => { - this.setState({ importType: e.key, modalVisiable: true, step: 0 }); + this.setState({ importType: e.key, isInit: true, modalVisiable: true, step: 0 }); }, onCancel() {}, }); } else { - this.setState({ importType: e.key, modalVisiable: true, step: 0 }); + this.setState({ importType: e.key, isInit: false, modalVisiable: true, step: 0 }); } }; @@ -478,6 +479,7 @@ export default class SalaryFile extends React.Component { init={() => { this.handleInitModal(); }} + isInit={this.state.isInit} params={{}} columns={previewColumns} step={step} From f3f07a46123f1d5e637e295d4979fa1dfc3fc50b Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Tue, 14 Jun 2022 11:32:35 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E7=9A=84=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/components/importModal/modalStep1.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep1.js b/pc4mobx/hrmSalary/components/importModal/modalStep1.js index c050c8ac..567d5b6c 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep1.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep1.js @@ -25,7 +25,11 @@ export default class ModalStep1 extends React.Component { render() { const { datetime, taxAgentId, hasData } = this.state - const { taxAgentStore: {taxAgentOption} } = this.props; + const { taxAgentStore: {taxAgentOption}, isInit } = this.props; + let downloadExtra= ''; + if(isInit){ + downloadExtra= hasData === '1' ? `&hasData=true` : `&hasData=false`; + } const dragger = { name: 'file', multiple: false, @@ -84,7 +88,7 @@ export default class ModalStep1 extends React.Component {

1. 第一步,请选择导出的Excel文件或 { (typeof this.props.templateLink) == "string" ? - 点击这里下载模板 + 点击这里下载模板 : {this.props.templateLink()}}>点击这里下载模板 }