20220505
This commit is contained in:
parent
7cef5512ae
commit
515c7bab01
|
|
@ -402,7 +402,7 @@ export const exportAcctResult = (salaryAcctRecordId) => {
|
|||
fetch('/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + salaryAcctRecordId ).then(res => res.blob().then(blob => {
|
||||
var filename=`薪资核算.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
|
|
|
|||
|
|
@ -58,9 +58,22 @@ export default class SalaryDetail extends React.Component {
|
|||
|
||||
// 获取列表的列
|
||||
getColumns() {
|
||||
const { calculateStore: {acctResultListTableStore }} = this.props;
|
||||
let columns = acctResultListTableStore.columns ? [...acctResultListTableStore.columns] : [];
|
||||
columns = columns.filter(item => item.hide == "false")
|
||||
const { calculateStore: {acctResultListColumns }} = this.props;
|
||||
let columns = acctResultListColumns ? [...acctResultListColumns] : []
|
||||
columns = columns.filter(item => item.hide == "FALSE").map(item => {
|
||||
let result = {...item}
|
||||
result.title = item.text;
|
||||
result.dataIndex = item.column
|
||||
result.oldWidth = result.width;
|
||||
result.width = null;
|
||||
if(result.children) {
|
||||
result.children.map(child => {
|
||||
child.title = child.text
|
||||
child.dataIndex = child.column
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})
|
||||
columns.push({
|
||||
title: '操作',
|
||||
key: "cz",
|
||||
|
|
@ -68,6 +81,7 @@ export default class SalaryDetail extends React.Component {
|
|||
return <a onClick={() => {this.handleEdit(record)}}>编辑</a>
|
||||
}
|
||||
})
|
||||
console.log("columns: " , columns)
|
||||
return columns;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react'
|
||||
import { Table, Icon } from 'antd'
|
||||
import { WeaTable } from 'ecCom'
|
||||
import { slideStep4Columns} from './columns'
|
||||
import "./index.less"
|
||||
import RuleEditModal from './step4/RuleEditModal'
|
||||
|
|
@ -46,7 +47,7 @@ export default class CalRulesForm extends React.Component {
|
|||
|
||||
convertAdjustmentType(index) {
|
||||
let nameList = ['取调整后薪资', '分段计薪', '取平均']
|
||||
return nameList[index]
|
||||
return nameList[Number(index) - 1]
|
||||
}
|
||||
|
||||
getSalaryItemName(salaryItemId) {
|
||||
|
|
@ -64,7 +65,7 @@ export default class CalRulesForm extends React.Component {
|
|||
let result = [...dataSoruce];
|
||||
return result.map(item => {
|
||||
let resultStr = "";
|
||||
resultStr += `${item.dayOfMonth}号(含)之前调薪,${this.convertAdjustmentType(item.beforeAdjustmentType)};${item.dayOfMonth}之后调薪,${this.convertAdjustmentType(item.afterAdjustmentType)}`
|
||||
resultStr += `${item.dayOfMonth}号(含)之前调薪,${this.convertAdjustmentType(item.beforeAdjustmentType)};${item.dayOfMonth}号之后调薪,${this.convertAdjustmentType(item.afterAdjustmentType)}`
|
||||
return {
|
||||
key: item.salaryItemId,
|
||||
salaryItemId: item.salaryItemId,
|
||||
|
|
@ -84,7 +85,7 @@ export default class CalRulesForm extends React.Component {
|
|||
<Icon className="iconItem" type="plus-square" onClick={() => {this.setState({modalVisible: true})}}/>
|
||||
</div>
|
||||
<div className="tableWrapper">
|
||||
<Table dataSource={datas} columns={this.state.slideStep4Columns}/>
|
||||
<WeaTable dataSource={datas} columns={this.state.slideStep4Columns} pagination={false}/>
|
||||
</div>
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import {Modal, Button, Icon } from 'antd'
|
||||
import { WeaTextarea } from 'ecCom'
|
||||
import { WeaTextarea, WeaInput } from 'ecCom'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
|
||||
@inject('salaryItemStore')
|
||||
|
|
@ -9,7 +9,8 @@ export default class FormalFormModal extends React.Component {
|
|||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
value: ''
|
||||
value: '',
|
||||
returnValue: ""
|
||||
}
|
||||
this.group = {};
|
||||
this.field = {};
|
||||
|
|
@ -20,7 +21,6 @@ export default class FormalFormModal extends React.Component {
|
|||
componentWillMount() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { salaryAcctImportTemplateParam, setSearchFields, detailFormual } = salaryItemStore;
|
||||
salaryAcctImportTemplateParam();
|
||||
setSearchFields([])
|
||||
if(this.props.formulaId) {
|
||||
detailFormual(this.props.formulaId).then(data => {
|
||||
|
|
@ -29,7 +29,32 @@ export default class FormalFormModal extends React.Component {
|
|||
})
|
||||
this.parameters = data.parameters
|
||||
this.referenceType = data.referenceType
|
||||
this.extendParam = data.extendParam
|
||||
if(this.extendParam && this.extendParam.length > 0) {
|
||||
this.extendParam.replace("\'", "\"")
|
||||
let extendParam = {}
|
||||
try {
|
||||
extendParam = JSON.parse(this.extendParam)
|
||||
} catch (ex) {
|
||||
|
||||
}
|
||||
|
||||
this.setState({
|
||||
returnValue: extendParam.sqlReturnKey ? extendParam.sqlReturnKey : ""
|
||||
})
|
||||
}
|
||||
let groupParams = {}
|
||||
if(this.referenceType == 'sql') {
|
||||
groupParams = {'referenceType':'sql'}
|
||||
}
|
||||
salaryAcctImportTemplateParam(groupParams);
|
||||
})
|
||||
} else {
|
||||
let groupParams = {}
|
||||
if(this.props.valueType == "3") {
|
||||
groupParams = {'referenceType':'sql'}
|
||||
}
|
||||
salaryAcctImportTemplateParam(groupParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -45,13 +70,22 @@ export default class FormalFormModal extends React.Component {
|
|||
const { salaryItemStore } = this.props;
|
||||
const { formualSearchField } = salaryItemStore;
|
||||
this.group = item;
|
||||
formualSearchField(item.key)
|
||||
let params = {}
|
||||
if(this.props.valueType == '3' || this.referenceType == "sql") {
|
||||
params = {
|
||||
extendParam: {
|
||||
'referenceType':'sql'
|
||||
}
|
||||
}
|
||||
}
|
||||
formualSearchField(item.key, params)
|
||||
}
|
||||
|
||||
// 保存
|
||||
handleSave() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { saveFormual } = salaryItemStore
|
||||
|
||||
let params = {
|
||||
name:'公式1',
|
||||
description:'备注',
|
||||
|
|
@ -60,7 +94,7 @@ export default class FormalFormModal extends React.Component {
|
|||
referenceType:'',
|
||||
returnType:'number',
|
||||
validateType:'number',
|
||||
extendParam:'{}',
|
||||
extendParam: this.state.returnValue && this.state.returnValue !== '' ? '{"sqlReturnKey":"'+this.state.returnValue+'"}' : "{}",
|
||||
formula: this.state.value,
|
||||
parameters: this.parameters,
|
||||
referenceType: this.referenceType == "" ? this.props.valueType == "2" ? "formula" : this.props.valueType == "3" ? "sql" : "" : this.referenceType
|
||||
|
|
@ -102,6 +136,11 @@ export default class FormalFormModal extends React.Component {
|
|||
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
|
||||
}
|
||||
onCancel={() => {this.props.onCancel()}}>
|
||||
{
|
||||
(this.props.valueType == "3" || this.referenceType == 'sql') && <div style={{marginBottom: '10px', lineHeight: "30px"}}>
|
||||
返回字段:<WeaInput style={{width: '150px'}} value={this.state.returnValue} onChange={(value) => {this.setState({returnValue: value})}} />
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
<WeaTextarea
|
||||
minRows={8}
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ export class calculateStore {
|
|||
this.loading = true
|
||||
API.acctResultList({salaryAcctRecordId, employeeName, current}).then(res => {
|
||||
if(res.status) {
|
||||
this.acctResultListTableStore.getDatas(res.data.dataKey.datas)
|
||||
// this.acctResultListTableStore.getDatas(res.data.dataKey.datas)
|
||||
this.acctResultListDateSource = res.data.pageInfo.list ? res.data.pageInfo.list: [];
|
||||
this.acctResultListPageInfo = res.data.pageInfo
|
||||
this.acctResultListColumns = res.data.columns;
|
||||
|
|
|
|||
|
|
@ -266,8 +266,8 @@ export class SalaryItemStore {
|
|||
|
||||
// 获取公式变量字段
|
||||
@action
|
||||
formualSearchField = (sourceId) => {
|
||||
API.formualSearchField({sourceId}).then(res => {
|
||||
formualSearchField = (sourceId, params = {}) => {
|
||||
API.formualSearchField({sourceId, ...params}).then(res => {
|
||||
if(res.status) {
|
||||
this.searchFields = res.data
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue