diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index a41a7c07..b953fa9b 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -235,6 +235,10 @@ export const updateLockStatus = (params) => { export const updateLockEmpStatus = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lockEmp", params); }; +// 单元格锁定 +export const updateLockEmpCellStatus = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lock", params); +}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 96e717fe..d7ffbc62 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -8,7 +8,12 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; -import { acctResultList, updateLockEmpStatus, updateLockStatus } from "../../../../../apis/calculate"; +import { + acctResultList, + updateLockEmpCellStatus, + updateLockEmpStatus, + updateLockStatus +} from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; @@ -135,7 +140,7 @@ class EditCalcTable extends Component { }); }; updateEmpLockStatus = (payload) => { - const { lockStatus } = payload; + const { lockStatus, salaryItemId } = payload; Modal.confirm({ title: getLabel(131329, "信息确认"), content:
@@ -166,13 +171,16 @@ class EditCalcTable extends Component { }, 500); }); const { routeParams: { salaryAcctRecordId } } = this.props; - updateLockEmpStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => { + const params = salaryItemId ? payload : { ...payload, salaryAcctRecordId }; + const APIFunction = salaryItemId ? updateLockEmpCellStatus : updateLockEmpStatus; + APIFunction(params).then(({ status, errormsg }) => { + clearInterval(this.timerLock); + this.setState({ + progressVisible: false, + progress: 0 + }); if (status) { - clearInterval(this.timerLock); - this.setState({ - progressVisible: false, - progress: 0 - }, () => this.queryCalcResultList()); + this.queryCalcResultList(); } else { message.error(errormsg); } @@ -224,8 +232,8 @@ class EditCalcTable extends Component { "点击锁定所有解锁的项目值": getLabel(543649, "点击锁定所有解锁的项目值"), "点击解锁所有锁定的项目值": getLabel(543648, "点击解锁所有锁定的项目值"), "锁定的项目值": getLabel(543647, "锁定的项目值"), - "当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"), - "当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"), + "当前状态锁定,右击解锁": getLabel(111, "当前状态锁定,右击解锁"), + "当前状态未锁定,右击锁定": getLabel(111, "当前状态未锁定,右击锁定"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index bc3f7755..045f4b8c 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -76,6 +76,8 @@ height: 100%; width: 100%; overflow-y: auto; + padding: 8px 16px 0 16px; + background: #F6F6F6; .wea-new-table { background: #fff; @@ -83,7 +85,7 @@ .ant-table-tbody { .ant-table-row-indent { - display: none!important; + display: none !important; } td:not(.ant-table-selection-column) { diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less index 52564e0a..9e4ced1a 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.less +++ b/pc4mobx/hrmSalary/pages/declare/index.less @@ -1,7 +1,8 @@ .generateDeclarationDetail { - .tabWrapper{ + .tabWrapper { padding-left: 10px } + .tableWrapper { height: calc(100vh - 48px); overflow: auto; @@ -34,7 +35,8 @@ .declare-body { height: 100%; width: 100%; - padding: 16px; + padding: 8px 16px 0 16px; + background: #F6F6F6; overflow-y: auto; .wea-new-table { diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js index ad3cd14a..840da963 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js @@ -127,7 +127,7 @@ class FieldTable extends Component { pagination={pagination} loading={loading} columns={this.getColumns()} - scroll={{ y: "calc(100vh - 152px)" }} + scroll={{ y: "calc(100vh - 175px)" }} /> ); } diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/index.js b/pc4mobx/hrmSalary/pages/fieldManagement/index.js index 65da711e..b0d483c9 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/index.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/index.js @@ -99,7 +99,7 @@ class FieldManagement extends Component { ]; return ( } iconBgcolor="#F14A2D" + title="字段管理" icon={} iconBgcolor="#F14A2D" className="fieldManageWrapper" buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={[ @@ -109,26 +109,23 @@ class FieldManagement extends Component { } ]} > -
- this.handleDeleteField([record.id])} - onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} - /> - this.setState({ - slideparams: { - ...slideparams, - record: { ...slideparams.record, ...record } - } - })} - onCancel={this.handleResetField} - onRefreshList={() => this.setState({ doSearch: !doSearch })} - /> - {/*操作日志*/} - this.setState({ logDialogVisible: false })}/> -
+ this.handleDeleteField([record.id])} + onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/> + this.setState({ + slideparams: { + ...slideparams, + record: { ...slideparams.record, ...record } + } + })} + onCancel={this.handleResetField} + onRefreshList={() => this.setState({ doSearch: !doSearch })} + /> + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/>
); } diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/index.less b/pc4mobx/hrmSalary/pages/fieldManagement/index.less index 4053721e..3fefa7cc 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/index.less +++ b/pc4mobx/hrmSalary/pages/fieldManagement/index.less @@ -1,3 +1,15 @@ + +.fieldManageWrapper { + .wea-new-top-content { + background: #F6F6F6; + padding: 8px 16px 0 16px; + } + + .wea-new-table { + background: #FFF; + } +} + .slideOuterWrapper { .wea-form-item-group { margin: 16px; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js index 2e48ba54..1c176f06 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js @@ -232,11 +232,11 @@ const TitleNormalComp = (props) => { onDeleteCategory(uuid)}/> } { - sortedIndex !== 0 && showOperateBtn && + name !== getLabel(111, "未分类") && sortedIndex !== 0 && showOperateBtn && onUpgo(sortedIndex)}/> } { - sortedIndex !== dataSourceLen - 1 && showOperateBtn && + name !== getLabel(111, "未分类") && sortedIndex !== dataSourceLen - 2 && showOperateBtn && onDowngo(sortedIndex)}/> }
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js index a95d9048..821ba416 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js @@ -15,8 +15,7 @@ import { getTaxAgentSelectList } from "../../../apis/taxAgent"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; -@inject("ledgerStore") -@observer +@inject("ledgerStore") @observer class LedgerSearchComp extends Component { constructor(props) { super(props); @@ -36,14 +35,11 @@ class LedgerSearchComp extends Component { this.setState({ conditions: _.map(searchConditions, o => { return { - ...o, - items: _.map(o.items, j => { + ...o, items: _.map(o.items, j => { if (getKey(j) === "taxAgentId") { return { - ...j, - options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({ - key: g.id, - showname: g.content + ...j, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({ + key: g.id, showname: g.content }))] }; } @@ -62,19 +58,16 @@ class LedgerSearchComp extends Component { let items = []; c.items.map(fields => { items.push({ - com: ( - - - ), - colSpan: 2 + com: ( + + ), colSpan: 2 }); }); - group.push( - ); + group.push(); }); return group; }; @@ -82,12 +75,7 @@ class LedgerSearchComp extends Component { render() { const { conditions } = this.state; const { ledgerStore: { searchForm } } = this.props; - return ( -
- {this.formRender(searchForm, conditions)} - -
- ); + return (
{this.formRender(searchForm, conditions)}
); } } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index ab4af5ba..0150b1e0 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -106,9 +106,9 @@ class LedgerSlide extends Component { if (!it.salarySobId) delete it.id; return { ...it }; }), - itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), item => { + itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), (item, index) => { return { - ...item, + ...item, sortedIndex: index, items: _.map(item.items, it => { delete it.originFormulaContent; delete it.originSqlContent; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.js b/pc4mobx/hrmSalary/pages/ledgerPage/index.js index d053ae3b..ebd64818 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/index.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.js @@ -71,10 +71,9 @@ class Index extends Component { const { taxAgentStore } = this.props; const { showOperateBtn } = taxAgentStore; const btns = [ - , + , this.setState({ doSearch: !doSearch })}/> ]; return ( diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/index.less index 182042bf..6ad92082 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.less @@ -1,5 +1,11 @@ .ledgerWrapper { height: 100%; + padding: 8px 16px 0 16px; + background: #F6F6F6; + + .wea-new-table { + background: #FFF; + } .tdEllipsis { display: inline-block; @@ -12,8 +18,6 @@ .ledgerSearch-Wrapper { min-width: 350px; - margin-top: 5px; - margin-right: 70px; position: relative; & > button { diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less index 52e92374..721202f8 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less @@ -1,4 +1,8 @@ .mySalary_wrapper { + .wea-new-top-req-content { + padding: 8px 16px; + } + .wea-transfer-list-wrapper { border: none; } diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js index f3734cbc..50df1c24 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js @@ -1,3 +1,4 @@ +import React, { Component } from "react"; import { WeaSwitch } from "comsMobx"; import { WeaButtonIcon, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js index 16dd0855..4a702b64 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js @@ -16,17 +16,13 @@ import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; -@inject("standingBookStore") -@observer +@inject("standingBookStore") @observer class WelfareRecordQuery extends Component { constructor(props) { super(props); this.state = { conditions: [], - dateRange: [ - moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), - moment(new Date()).endOf("year").format("YYYY-MM") - ] + dateRange: [moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM")] }; } @@ -36,8 +32,7 @@ class WelfareRecordQuery extends Component { this.setState({ conditions: _.map(welfareRQConditions, item => { return { - ...item, - items: _.map(item.items, o => { + ...item, items: _.map(item.items, o => { if (getKey(o) === "taxAgents") { return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) }; } @@ -63,28 +58,22 @@ class WelfareRecordQuery extends Component { let items = []; c.items.map(fields => { items.push({ - com: ( - - - ) + com: ( + + ) }); }); - group.push( - - this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/> - ) - }, - ...items - ]} - />); + group.push( + this.setState({ dateRange: v }, () => this.getWelfareRecordList())}/> + ) + }, ...items]} + />); }); return group; }; @@ -101,9 +90,7 @@ class WelfareRecordQuery extends Component { render() { const { standingBookStore: { welfareRQForm } } = this.props; const { conditions } = this.state; - return ( -
{this.renderForm(welfareRQForm, conditions)}
- ); + return (
{this.renderForm(welfareRQForm, conditions)}
); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less index 38dae0ed..8da302a1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less @@ -57,24 +57,22 @@ //社保福利台账页面重构 .salary-welfare-record { - min-width: 1000px; - overflow: auto; - width: 100%; - height: 100%; - background: #f6f6f6; - .salary-welfare-record-content { width: 100%; height: 100%; - padding: 8px 16px; + padding: 8px 16px 0 16px; + background: #F6F6F6; display: flex; flex-direction: column; .salary-welfare-record-query { width: 100%; + padding: 0 8px; + margin-bottom: 8px; height: 46px; display: flex; align-items: center; + background: #FFF; .wea-search-group { width: 100%; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js index f4089c44..80083d56 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js @@ -123,50 +123,45 @@ class StandingBook extends Component { const rightBtns = []; - return ( -
- } - iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} - showDropIcon onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={[ - { - key: "log", icon: , - content: getLabel(545781, "操作日志") - } - ]} - > -
- { - this.setState({ - queryForm: { ...queryForm, ...payload } - }, () => this.wfListRef.wrappedInstance.getWelfareRecordList()); - }} - onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })} - /> - this.wfListRef = dom} queryForm={queryForm} - onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/> -
- this.setState({ - accountDialog: { ...accountDialog, visible: false, title: "", loading: false } - })} onOk={this.handleAccount} - /> - {/*操作日志*/} - this.setState({ logDialogVisible: false })}/> - {/*核算进度条*/} - { - this.state.progressVisible && - { - this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer)); - }} - /> - } -
+ return (} + iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record" + showDropIcon onDropMenuClick={this.onDropMenuClick} + dropMenuDatas={[ + { + key: "log", icon: , + content: getLabel(545781, "操作日志") + } + ]}> +
+ { + this.setState({ + queryForm: { ...queryForm, ...payload } + }, () => this.wfListRef.wrappedInstance.getWelfareRecordList()); + }} + onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })} + /> + this.wfListRef = dom} queryForm={queryForm} + onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
- ); + this.setState({ + accountDialog: { ...accountDialog, visible: false, title: "", loading: false } + })} onOk={this.handleAccount} + /> + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> + {/*核算进度条*/} + { + this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer)); + }} + /> + } +
); } } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..7813cde7 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -18,8 +18,7 @@ import * as API from "../../../../apis/variableSalary"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; -@inject("baseTableStore") -@observer +@inject("baseTableStore") @observer class Index extends Component { constructor(props) { super(props); @@ -38,39 +37,40 @@ 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: [ - ..._.map(salaryFileConditions, item => ({ - ...item, items: _.map(item.items, o => { - if (getKey(o) === "taxAgentIds") { - return { - ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - options: taxAgentOption, value: detail[getKey(o)] || "" - }; - } + conditions: [..._.map(salaryFileConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "taxAgentIds") { return { - ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - value: detail[getKey(o)] || "" + ...o, + viewAttr: !_.isEmpty(detail) ? 1 : 3, + label: getLabel(o.lanId, o.label), + value: detail[getKey(o)] || "", + options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content })) }; - }) - })), - { - items: _.map(data, o => ({ - conditionType: "INPUT", - domkey: [String(o.id)], - fieldcol: 14, - label: o.name, - labelcol: 6, - value: detail[`${String(o.id)}_variableItem`] || "", - viewAttr: !_.isEmpty(detail) ? 1 : 2 - })), - title: "", col: 2, - defaultshow: true - } - ] + } + return { + ...o, + viewAttr: !_.isEmpty(detail) ? 1 : 3, + label: getLabel(o.lanId, o.label), + value: detail[getKey(o)] || "" + }; + }) + })), { + items: _.map(data, o => ({ + conditionType: "INPUT", + domkey: [String(o.id)], + fieldcol: 14, + label: o.name, + labelcol: 6, + value: detail[`${String(o.id)}_variableItem`] || "", + viewAttr: 2 + })), title: "", col: 2, defaultshow: true + }] }, () => { VSSalaryFileForm.initFormFields(this.state.conditions); if (!_.isEmpty(detail)) { @@ -96,7 +96,7 @@ class Index extends Component { }, {}); }; save = () => { - const { baseTableStore: { VSSalaryFileForm }, onSearch, id } = this.props; + const { baseTableStore: { VSSalaryFileForm }, onSearch, detail: { id } } = this.props; VSSalaryFileForm.validateForm().then(f => { if (f.isValid) { const payload = VSSalaryFileForm.getFormParams(); @@ -117,17 +117,14 @@ class Index extends Component { }); }; renderTitle = () => { - const { loading } = this.state, { title, detail } = this.props; + const { loading } = this.state, { title } = this.props; return
{title}
- { - _.isEmpty(detail) && - - } +
; }; @@ -138,7 +135,7 @@ class Index extends Component { return ( onClose()} top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()} - content={
{getSearchs(VSSalaryFileForm, conditions)}
} + content={
{getSearchs(VSSalaryFileForm, conditions, 2, false)}
} />); } } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index c8917e45..415f7e33 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,12 +30,15 @@ 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 { baseTableStore: { VSalryForm, VExtraSalryForm } } = nextProps; const payload = { - salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), hasData: importDialog.hasData }; this.setState({ - importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + importDialog: { + ...importDialog, salaryMonth: VExtraSalryForm.getFormParams().salaryMonth, + link: `${importDialog.link}?${convertToUrlString(payload)}` + } }); } else { this.setState({ @@ -48,9 +51,10 @@ class Index extends Component { } handleImport = (payload) => { - const { taxAgentIds } = this.props; + const { baseTableStore: { VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; + const { taxAgentIds } = VExtraSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -64,14 +68,17 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
{ - const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; + const payload = { + ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + salaryMonth: val, hasData + }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -98,9 +105,12 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, taxAgentIds, ...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 f3b0e52a..9f583eee 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -9,26 +9,57 @@ */ 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 +@inject("baseTableStore") @observer 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: [], + 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(); @@ -56,10 +87,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,22 +103,22 @@ class Index extends Component { } }; getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds } = VSalryForm.getFormParams(); + const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), - ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] + ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { const { pageInfo: result } = data; const { list: dataSource, pageNum: current, pageSize, total } = result; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, dataSource - } - ); + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource + }); } }); }; @@ -94,13 +129,11 @@ class Index extends Component { }; handleDelete = (ids) => { Modal.confirm({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "确认删除吗?"), - onOk: () => { + title: getLabel(111, "信息确认"), content: getLabel(111, "确认删除吗?"), onOk: () => { API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "删除成功")); - this.getVariableSalaryList(); + this.setState({ selectedRowKeys: [] }, () => this.getVariableSalaryList()); } else { message.error(errormsg); } @@ -111,51 +144,68 @@ class Index extends Component { getColumns = () => { const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props; const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({ - dataIndex: it.dataIndex, title: it.title, align: "left", - width: 150, ellipsis: true + dataIndex: it.dataIndex, title: it.title, align: "left", width: 150, ellipsis: true })); 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(18609, "共"), "条": getLabel(18256, "条"), + "操作": getLabel(30585, "操作"), + "编辑": getLabel(111, "编辑"), + "共": getLabel(18609, "共"), + "条": getLabel(18256, "条"), "删除": getLabel(111, "删除") }; 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 ( - -
- -