diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index e06144ba..fbc1e5be 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -79,33 +79,35 @@ class Index extends Component { renderTabBtns = () => { const { selectedKey, selectedRowKeys } = this.state; - const { calcDetail } = this.props; + const { calcDetail, taxAgentStore: { showOperateBtn } } = this.props; let tabBtns = []; - switch (selectedKey) { - case "range": - tabBtns = [ - this.handleDeletePCitem()}/>, - ids && this.handleUserBrowserChange(ids.split(","))} - > - - , - , - - ]; - calcDetail && tabBtns.splice(0, 2); - break; - case "add": - case "sub": - tabBtns = [ - - ]; - break; - default: - break; + if (showOperateBtn) { + switch (selectedKey) { + case "range": + tabBtns = [ + this.handleDeletePCitem()}/>, + ids && this.handleUserBrowserChange(ids.split(","))} + > + + , + , + + ]; + calcDetail && tabBtns.splice(0, 2); + break; + case "add": + case "sub": + tabBtns = [ + + ]; + break; + default: + break; + } } return tabBtns; }; @@ -204,7 +206,7 @@ class Index extends Component { }; render() { - const { calculateStore: { PCSearchForm }, calcDetail } = this.props; + const { calculateStore: { PCSearchForm }, taxAgentStore: { showOperateBtn }, calcDetail } = this.props; const { selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, columns, dataSource @@ -282,7 +284,7 @@ class Index extends Component { onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth /> { let width = ""; @@ -303,8 +305,8 @@ class Index extends Component { title: getLabel(30585, "操作"), width: 120, render: (_, record) => ( - {calcDetail ? null : this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}} + {(calcDetail || !showOperateBtn) ? null : this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}} ) } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 32b87feb..e1f8d361 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -238,7 +238,7 @@ class EditCalcTable extends Component { "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), "查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"), - "解锁": getLabel(111, "解锁") + "解锁": getLabel(111, "解锁"), "查看": getLabel(111, "查看") }; this.setState({ originPayloadData: { ...payload, i18n } }); const childFrameObj = document.getElementById("atdTable"); @@ -248,7 +248,7 @@ class EditCalcTable extends Component { const { pageInfo } = this.state; const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId }, - calcDetail = false + taxAgentStore: { showOperateBtn }, calcDetail = false } = this.props; const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams(); const payload = { @@ -269,11 +269,11 @@ class EditCalcTable extends Component { const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload, - calcDetail, - columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({ + calcDetail: (calcDetail || !showOperateBtn), showSee: !showOperateBtn, + columns: _.every(traverse(columns, (calcDetail || !showOperateBtn)), (it, idx) => !it.fixed) ? _.map(traverse(columns, (calcDetail || !showOperateBtn)), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false - })) : traverse(columns, calcDetail) + })) : traverse(columns, (calcDetail || !showOperateBtn)) }); }); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index a8280592..61084c48 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -21,7 +21,7 @@ import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; -@inject("calculateStore") +@inject("calculateStore", "taxAgentStore") @observer class Index extends Component { constructor(props) { @@ -209,7 +209,7 @@ class Index extends Component { }); }; renderReqBtns = () => { - const { routeParams: { salaryAcctRecordId } } = this.props; + const { routeParams: { salaryAcctRecordId }, taxAgentStore: { showOperateBtn } } = this.props; const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state; const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo; let reqBtns = []; @@ -246,6 +246,7 @@ class Index extends Component { isOpenApproval && reqBtns.unshift(); + !showOperateBtn && (reqBtns = reqBtns.slice(-1)); accountExceptInfo && reqBtns.unshift( this.downloadTxtfile(accountExceptInfo)}/>); diff --git a/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/config.js b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/config.js new file mode 100644 index 00000000..66737736 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/config.js @@ -0,0 +1,133 @@ +export const conditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["username"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["adjustItem"], + fieldcol: 12, + label: "项目名称", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "RANGEPICKER", + domkey: ["operateTime1", "operateTime2"], + fieldcol: 12, + label: "操作日期", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "17", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["operatorIds"], + fieldcol: 12, + label: "操作人", + lanId: 111, + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.js b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.js index c19b7a98..5e4f5b12 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.js @@ -8,52 +8,100 @@ * @description: */ import React, { Component } from "react"; -import { WeaLoadingGlobal, WeaLocaleProvider, WeaRangePicker, WeaTop } from "ecCom"; +import { WeaForm } from "comsMobx"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaRangePicker, WeaSearchGroup, WeaTable, WeaTop } from "ecCom"; +import FormInfo from "../../../../components/FormInfo"; import * as API from "../../../../apis/custom-apis/azInterface"; import { Button } from "antd"; +import { conditions } from "./config"; +import moment from "moment"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); class Index extends Component { constructor(props) { super(props); this.state = { - dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - effectiveTime: [] + dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, conditions: [], + effectiveTime: [moment().startOf("month").format("YYYY-MM-DD"), moment().endOf("month").format("YYYY-MM-DD")], + payload: {} }; } componentDidMount() { + this.setState({ + conditions: _.map(conditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => form.initFormFields(this.state.conditions)); this.getAZAdjustList(); } getAZAdjustList = () => { + const { departmentIds, positionIds, operatorIds, operateTime1, operateTime2 } = form.getFormParams(); const payload = { - ...this.state.pageInfo, effectiveTime: this.state.effectiveTime + ...form.getFormParams(), ...this.state.pageInfo, effectiveTime: this.state.effectiveTime, + departmentIds: departmentIds ? departmentIds.split(",") : [], + positionIds: positionIds ? positionIds.split(",") : [], + operatorIds: operatorIds ? operatorIds.split(",") : [], + operateTime: operateTime1 ? [operateTime1, operateTime2] : [] }; + this.setState({ loading: true, payload }); API.getAZAdjustList(payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { - console.log(data); + const { columns, pageInfo: { list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ + pageInfo: { current, pageSize, total }, dataSource, + columns: _.map(columns, o => ({ dataIndex: o.column, title: o.text, width: o.width })) + }); } }); }; handleExport = () => { WeaLoadingGlobal.start(); - const payload = { effectiveTime: this.state.effectiveTime }; - const promise = API.exportAzAdjustList(payload); + const promise = API.exportAzAdjustList(this.state.payload); }; render() { - const { effectiveTime } = this.state; + const { effectiveTime, loading, pageInfo, columns, dataSource, conditions } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getAZAdjustList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getAZAdjustList()); + } + }; return ( } iconBgcolor="#F14A2D" buttons={[ - this.setState({ effectiveTime: v })}/>, + this.setState({ effectiveTime: v }, () => this.getAZAdjustList())}/>, ]}> -
-
); +
+ + +
+ + +
+
+ +
+ + ); } } diff --git a/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.less b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.less index 6ae5c6ad..48def804 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.less +++ b/pc4mobx/hrmSalary/pages/custom-pages/az/salaryFileReports/index.less @@ -2,4 +2,26 @@ height: 100%; background: #f6f6f6; padding: 8px 16px 0 16px; + + .advanceSearchGroup { + padding: 0; + background: #FFF; + margin-bottom: 8px; + } + + .hideContent .wea-content { + display: none; + } + + .advanceSearchGroupButtons { + display: flex; + justify-content: center; + align-items: center; + padding: 8px 0; + border-top: 1px solid #dadada; + } + + .wea-new-table { + background: #FFF; + } } diff --git a/pc4mobx/hrmSalary/stores/custom-stores/az/index.js b/pc4mobx/hrmSalary/stores/custom-stores/az/index.js new file mode 100644 index 00000000..153baf5c --- /dev/null +++ b/pc4mobx/hrmSalary/stores/custom-stores/az/index.js @@ -0,0 +1,2 @@ +export class AZStore { +} diff --git a/pc4mobx/hrmSalary/stores/custom-stores/index.js b/pc4mobx/hrmSalary/stores/custom-stores/index.js index 7be35b6b..67450725 100644 --- a/pc4mobx/hrmSalary/stores/custom-stores/index.js +++ b/pc4mobx/hrmSalary/stores/custom-stores/index.js @@ -1,2 +1,5 @@ +import { AZStore } from "./az"; + module.exports = { + AZStore: new AZStore() //艾志 };