Merge branch 'hotfix/V2-0216' into develop

# Conflicts:
#	pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js
#	pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
#	pc4mobx/hrmSalary/pages/salaryItem/index.js
This commit is contained in:
黎永顺 2023-02-15 17:28:02 +08:00
commit c99bbbcb6d
9 changed files with 99 additions and 67 deletions

View File

@ -36,8 +36,8 @@ class FieldSlide extends Component {
componentDidMount() {
const { taxAgentStore } = this.props;
this.commonEnumList();
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
getTaxAgentSelectListAsAdmin();
const { fetchTaxAgentOption } = taxAgentStore;
fetchTaxAgentOption();
}
componentWillReceiveProps(nextProps, nextContext) {
@ -171,7 +171,7 @@ class FieldSlide extends Component {
};
render() {
const { title, visible, editId, taxAgentStore: { showOperateBtn, taxAgentAdminOption }, onCancel } = this.props;
const { title, visible, editId, taxAgentStore: { taxAgentOption }, onCancel } = this.props;
const {
loading,
name,
@ -199,7 +199,7 @@ class FieldSlide extends Component {
subtitle={title}
tabs={[]}
loading={loading}
showOperateBtn={showOperateBtn}
showOperateBtn={true}
editable={true}
onSave={this.saveFieldInfo}
/>
@ -249,7 +249,7 @@ class FieldSlide extends Component {
multiple
viewAttr={3}
value={taxAgentIds}
options={taxAgentAdminOption}
options={taxAgentOption}
onChange={value => this.handleChangeFields("taxAgentIds", value)}
/>
</WeaFormItem>

View File

@ -7,7 +7,7 @@
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { inject, observer } from "mobx-react";
import { message, Modal, Switch } from "antd";
import { Switch } from "antd";
import { salaryFieldList } from "../../../apis/fieldManage";
@inject("taxAgentStore")
@ -70,11 +70,11 @@ class FieldTable extends Component {
item.render = (text, record) => {
return <div className="optWrapper">
<a href="javascript:void(0);" className="mr10"
onClick={() => onEditLedger(record)}>{showOperateBtn ? "编辑" : "查看"}</a>
{/*{*/}
{/* showOperateBtn &&*/}
{/* <a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>*/}
{/*}*/}
onClick={() => onEditLedger(record)}>编辑</a>
{
// showOperateBtn &&
<a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>
}
</div>;
};
} else {

View File

@ -42,7 +42,7 @@ class FieldManagement extends Component {
deleteSalaryField(filedIds).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.setState({ doSearch: !this.state.doSearch })
this.setState({ doSearch: !this.state.doSearch });
} else {
message.error(errormsg || "删除失败");
}
@ -83,7 +83,8 @@ class FieldManagement extends Component {
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
showDropIcon={false}
buttons={showOperateBtn ? btns : btns.slice(-1)}
// buttons={showOperateBtn ? btns : btns.slice(-1)}
buttons={btns}
>
<div className="fieldManageWrapper">
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}

View File

@ -21,7 +21,7 @@ class LedgerBaseSetting extends Component {
constructor(props) {
super(props);
this.state = {
baseForm: baseSettingFormItem,
baseForm: [],
settingBaseInfo: {
name: "",
taxAgentId: "",
@ -38,13 +38,16 @@ class LedgerBaseSetting extends Component {
};
}
componentDidMount() {
componentWillMount() {
this.getTaxAgentSelectListAsAdmin();
this.commonEenumList();
}
componentDidMount() {
// this.getTaxAgentSelectListAsAdmin();
// this.commonEenumList();
if (this.props.visible && this.props.editId) {
this.getLedgerBasicForm(this.props.editId);
}
}
componentWillReceiveProps(nextProps, nextContext) {
@ -98,9 +101,8 @@ class LedgerBaseSetting extends Component {
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
if (status) {
const { baseForm } = this.state;
this.setState({
baseForm: _.map(baseForm, it => {
baseForm: _.map(baseSettingFormItem, it => {
if (it.key === "taxAgentId") {
return {
...it,
@ -109,11 +111,11 @@ class LedgerBaseSetting extends Component {
}
return { ...it };
})
});
}, () => this.commonEenumList());
}
});
};
commonEenumList= ()=>{
commonEenumList = () => {
const payload = {
enumClass: "com.engine.salary.enums.salarysob.IncomeCategoryEnum"
};
@ -133,7 +135,7 @@ class LedgerBaseSetting extends Component {
});
}
});
}
};
handleChangeField = (key, value) => {
const { onSaveParams } = this.props;
const { settingBaseInfo } = this.state;

View File

@ -175,7 +175,6 @@ class LedgerSalaryItemNormal extends Component {
>
<LedgerSalaryItemTable
dataSource={items}
selectedRowKeys={field.selectedRowKeys || []}
onDropCategoryItem={(data) => onDropCategoryItem(field, data)}
onHandleItemhide={(data) => onHandleItemhide(field, data)}
onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
@ -216,7 +215,7 @@ const TitleNormalComp = (props) => {
name, onEditCategory, onDeleteCategory,
sortedIndex, dataSourceLen, uuid, onUpgo,
onDowngo, selectedRowKeys = [], onDeleteCategoryItems,
onAddCategoryItems
onAddCategoryItems, items
} = props;
return <div className="titleNormalWrapper">
<div className="titleWrapper">
@ -226,7 +225,7 @@ const TitleNormalComp = (props) => {
<i className="icon-coms-edit" title="编辑" onClick={() => onEditCategory(name, uuid)}/>
}
{
name !== "未分类" &&
name !== "未分类" && _.isEmpty(items) &&
<i className="icon-coms-Delete" title="删除" onClick={() => onDeleteCategory(uuid)}/>
}
{

View File

@ -21,21 +21,39 @@ export default class MobilePayroll extends React.Component {
}
componentWillMount() {
const type = getQueryString("type");
this.id = getQueryString("id");
const { mySalaryStore: { init } } = this.props;
init();
type !== "phone" && init(false);
this.getMySalaryBill(this.id);
}
getMySalaryBill = (id) => {
getMySalaryBill = (salaryInfoId) => {
const { mySalaryStore: { getMySalaryBill } } = this.props;
getMySalaryBill(id).then(result => {
const params = this.getUrlkey();
const payload = {
salaryInfoId,
..._.omit(params, ["id", "_key", "type"])
};
getMySalaryBill(payload).then(result => {
this.setState({
mySalaryBillData: result
});
});
};
getUrlkey = () => {
let url = window.location.href;
let params = {},
arr = url.split("?");
if (arr.length <= 1)
return params;
arr = arr[1].split("&");
for (var i = 0, l = arr.length; i < l; i++) {
var a = arr[i].split("=");
params[a[0]] = a[1];
}
return params;
};
render() {
const { mySalaryBillData } = this.state;
@ -48,29 +66,33 @@ export default class MobilePayroll extends React.Component {
overflowY: "hidden",
paddingBottom: "20px"
}}>
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={this.props.mySalaryStore}>
<div className="templatePreview">
<div className="contentWrapper">
{
type === "phone" ?
<PhoneTemplate
isPreview
isMsgPreview
salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)}
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []}
/> :
{
type === "phone" ?
<div className="templatePreview">
<div className="contentWrapper">
<PhoneTemplate
isPreview
isMsgPreview
salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)}
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []}
/>
</div>
</div>
:
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={this.props.mySalaryStore}>
<div className="templatePreview">
<div className="contentWrapper">
<ComputerTemplate
isPreview
isMsgPreview
salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)}
salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : JSON.stringify([])}
/>
}
</div>
</div>
</Authority>
</div>
</div>
</Authority>
}
</div>
);
}

View File

@ -51,8 +51,8 @@ export default class SalaryItem extends React.Component {
componentWillMount() { // 初始化渲染页面
const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props;
const { commonEnumList } = salaryFileStore;
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
getTaxAgentSelectListAsAdmin();
const { fetchTaxAgentOption } = taxAgentStore;
fetchTaxAgentOption();
commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
getTableDatas({}).then(res => {
this.setState({
@ -132,7 +132,7 @@ export default class SalaryItem extends React.Component {
}
});
{
showOperateBtn &&
// showOperateBtn &&
columns.push({
title: "",
key: "moreOperate",
@ -142,7 +142,7 @@ export default class SalaryItem extends React.Component {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
<a onClick={() => {
<a href="javascript: void(0);" onClick={() => {
this.handleDeleteItem(record);
}}>删除</a>
</Menu.Item>
@ -206,11 +206,11 @@ export default class SalaryItem extends React.Component {
const {
salaryItemStore,
salaryFileStore,
taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentAdminOption }
taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
} = this.props;
const { userStatusList } = salaryFileStore;
const { selectedRowKeys } = this.state;
const { loading, deleteItemRequest, getTableDatas, initRequest } = salaryItemStore;
const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
const {
tableDataSource,
tableColumns,
@ -252,7 +252,7 @@ export default class SalaryItem extends React.Component {
<Dropdown.Button overlay={menu} type="primary" style={{ marginRight: "10px" }}>新增</Dropdown.Button>
}
{
showOperateBtn &&
(showOperateBtn || showSalaryItemBtn) &&
<Button
type="primary"
style={{ marginRight: "10px" }}
@ -413,7 +413,7 @@ export default class SalaryItem extends React.Component {
record={this.record} editable={this.state.editable}
isAdd={this.state.isAdd} request={request}
userStatusList={userStatusList}
taxAgentAdminOption={taxAgentAdminOption}
taxAgentAdminOption={taxAgentOption}
onChange={(value) => {
handleSaveSlideChange(value);
}}/>

View File

@ -47,6 +47,7 @@ export default class Programme extends React.Component {
// 增加编辑功能重写columns绑定事件
getColumns = columns => {
const { taxAgentStore: { showOperateBtn } } = this.props;
let newColumns = columns.filter(
item => item.dataIndex !== "id" && item.dataIndex !== "paymentArea"
);
@ -85,15 +86,16 @@ export default class Programme extends React.Component {
render: (text, record) => {
return (
<a
href="javascript:void(0);"
onClick={() => {
this.onEdit(record);
}}>
编辑
{showOperateBtn ? "编辑" : "查看"}
</a>
);
}
});
newColumns.push({
showOperateBtn && newColumns.push({
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {

View File

@ -37,27 +37,32 @@ export class MySalaryStore {
this.loading = true;
this.hasRight = false;
};
@action setMySalaryBill= (mySalaryBill)=> {this.mySalaryBill= mySalaryBill};
@action init = async props => {
@action setMySalaryBill = (mySalaryBill) => {
this.mySalaryBill = mySalaryBill;
};
@action init = async (isRoot = true) => {
this.clear();
//1.check is need second verify
if (window.doCheckSecondaryVerify4ec) {
window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, this.getData);
window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => this.getData({
...data,
isRoot
}));
} else {
//4.loaddata
this.getData({ status: "1", token: "" });
this.getData({ status: "1", token: "", isRoot });
}
};
@action
getData = async (params = {}) => {
if (_.isEmpty(params)) return;
const { status, token } = params;
const { status, isRoot, token } = params;
if (status == "1") {
// Object.assign(this._reqParams, { token });
// this.getFormData({ viewAttr: 1 });
this.hasRight = true;
this.mySalaryBillList()
isRoot && this.mySalaryBillList();
} else {
this.hasRight = false;
}
@ -148,17 +153,18 @@ export class MySalaryStore {
// 我的工资单详情
@action
getMySalaryBill = (salaryInfoId) => {
return new Promise((resolve, reject)=>{
API.mySalaryBill({ salaryInfoId }).then(res => {
const payload = Object.prototype.toString.call(salaryInfoId) === "[object Number]" ? { salaryInfoId } : { ...salaryInfoId };
return new Promise((resolve, reject) => {
API.mySalaryBill(payload).then(res => {
if (res.status) {
this.mySalaryBill = res.data;
resolve(res.data)
resolve(res.data);
} else {
message.error(res.errormsg || "获取失败");
reject("获取失败")
reject("获取失败");
}
});
})
});
};
@action