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 && (1. 第一步,请选择导出的Excel文件或 { (typeof this.props.templateLink) == "string" ? - 点击这里下载模板 + 点击这里下载模板 : {this.props.templateLink()}}>点击这里下载模板 } {this.props.headerSetCompoent && this.props.headerSetCompoent }; - 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/ledger/salaryItemForm.js b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js index 1514cbf8..1f9bb180 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 + }) + let itemResultGroups = itemGroups ? [...itemGroups] : [] + itemResultGroups.map(groupItem => { + if(groupItem.id == item.id) { + groupItem.items = dataSource + } + }) + setItemGroups(itemResultGroups) + } + 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 && { + 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/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index aadfa25e..0bc0f1c0 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"; @@ -57,6 +60,7 @@ export default class SalaryFile extends React.Component { selectedTab: 0, editSlideVisible: false, importType: "", + isInit: false, //是否是初始化导入 modalVisiable: false, step: 0, recordSlideVisible: false, @@ -231,6 +235,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 { @@ -302,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 }); } }; @@ -432,10 +444,15 @@ export default class SalaryFile extends React.Component { dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 > + searchOperationItem={ + renderRightOperation() + } + /> + { this.handlePageChange(value) }} @@ -462,6 +479,7 @@ export default class SalaryFile extends React.Component { init={() => { this.handleInitModal(); }} + isInit={this.state.isInit} params={{}} columns={previewColumns} step={step} 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(); }} diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js index ca3b7b94..402b02b8 100644 --- a/pc4mobx/hrmSalary/stores/ledger.js +++ b/pc4mobx/hrmSalary/stores/ledger.js @@ -140,7 +140,15 @@ export class LedgerStore { }; @action - setItemGroups = (itemGroups) => (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) => { diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index df2ae15d..3694a57f 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 = () => {