导入优化
This commit is contained in:
parent
4310a8c307
commit
fd13d72510
|
|
@ -145,6 +145,11 @@ export default class CompareDetail extends React.Component {
|
|||
exportComparisonResult(this.id)
|
||||
}
|
||||
|
||||
// 线下对比导入
|
||||
handleComparisonFinish() {
|
||||
this.handleSearch(this.state.searchValue)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { calculateStore: {comparisonResultPageInfo, comparisonResultTableStore, loading}} = this.props;
|
||||
const { importModalVisible, searchValue } = this.state;
|
||||
|
|
@ -210,6 +215,9 @@ export default class CompareDetail extends React.Component {
|
|||
importModalVisible && <CompareDetailImportModal
|
||||
visiable={importModalVisible}
|
||||
id={this.id}
|
||||
onFinish={() => {
|
||||
this.handleComparisonFinish()
|
||||
}}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
importModalVisible: false
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ export default class CompareDetailImportModal extends React.Component {
|
|||
slideDataSource={comparisonPreviewDataSource}
|
||||
importResult={comparisonImportAcctResult}
|
||||
onFinish={() => {
|
||||
this.handleFinish()
|
||||
this.props.onCancel();
|
||||
this.props.onFinish();
|
||||
}}
|
||||
previewImport={(params) => {previewComparisonResult(params)}}
|
||||
importFile={(params) => {importComparisonExcelAcctResult(params)}}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,17 @@ export default class SalaryItemForm extends React.Component {
|
|||
setItemGroups(groups)
|
||||
}
|
||||
|
||||
// 薪资项目
|
||||
handleItemDataSourceChange(dataSource, item) {
|
||||
const { ledgerStore: {itemGroups, setItemGroups} } = this.props;
|
||||
let newItemGroups = [...itemGroups]
|
||||
newItemGroups.map(group => {
|
||||
group.id = item.id
|
||||
group.items = dataSource
|
||||
})
|
||||
setItemGroups(newItemGroups)
|
||||
}
|
||||
|
||||
render() {
|
||||
const {ledgerStore: {itemGroups, salaryItems, empBrowserList, setAddCategoryVisible, addCategoryVisible}} = this.props;
|
||||
return (
|
||||
|
|
@ -79,7 +90,7 @@ export default class SalaryItemForm extends React.Component {
|
|||
itemGroups && itemGroups.map(item => {
|
||||
item.items.map(i => {i.key = i.id})
|
||||
return (
|
||||
<CanMoveItem dataSource={item.items} title={item.name} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
<CanMoveItem dataSource={item.items} onDataSourceChange={(dataSource) => {this.handleItemDataSourceChange(dataSource, item)}}title={item.name} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default class CanMoveItem extends React.Component {
|
|||
if(record.canEdit) {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.handleFormulaClick(record.formulaId)
|
||||
this.handleFormulaClick(record.formulaId, record)
|
||||
}}>{text}</a>
|
||||
)
|
||||
} else {
|
||||
|
|
@ -39,11 +39,13 @@ export default class CanMoveItem extends React.Component {
|
|||
}
|
||||
|
||||
this.formulaId = ""
|
||||
this.record = {}
|
||||
}
|
||||
|
||||
// 编辑公式
|
||||
handleFormulaClick(formulaId) {
|
||||
handleFormulaClick(formulaId, record) {
|
||||
this.formulaId = formulaId
|
||||
this.record = record
|
||||
this.setState({
|
||||
formalModalVisible: true
|
||||
})
|
||||
|
|
@ -81,7 +83,16 @@ export default class CanMoveItem extends React.Component {
|
|||
|
||||
// 保存
|
||||
handleSaveFormal(data) {
|
||||
console.log("data: " + data);
|
||||
let record = {...this.record}
|
||||
record.formulaId = data.id
|
||||
let dataSource = [...this.props.dataSource]
|
||||
dataSource.map(item => {
|
||||
if(item.id == record.id) {
|
||||
item.formulaId = data.id
|
||||
item.formulaContent = data.formula
|
||||
}
|
||||
})
|
||||
this.props.onDataSourceChange(dataSource)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -109,16 +109,17 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<Radio.Group disabled={editable? false: true} value={valueType} onChange={(e) => {
|
||||
this.handleChange({valueType: e.target.value})
|
||||
}}>
|
||||
<Radio value={1}>输入</Radio>
|
||||
<Radio value={2}>公式</Radio>
|
||||
<Radio key={1} value={"1"}>输入</Radio>
|
||||
<Radio key={2} value={"2"}>公式</Radio>
|
||||
<Radio key={3} value={"3"}>SQL</Radio>
|
||||
</Radio.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
{
|
||||
valueType == 2 && <Row className="formItem">
|
||||
( valueType == 2 || valueType == 3 ) && <Row className="formItem">
|
||||
<Col span={4}>公式</Col>
|
||||
<Col span={20}>
|
||||
<div style={{width: "100%", lineHeight: '30px', height: "30px", border: "1px solid rgb(217, 217, 217)"}}
|
||||
<div style={{width: "100%", lineHeight: '30px', minHeight: "30px", border: "1px solid rgb(217, 217, 217)"}}
|
||||
onClick={() => this.handleShowFormal()}
|
||||
>
|
||||
{formulaContent}
|
||||
|
|
@ -140,6 +141,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<FormalFormModal
|
||||
formulaId={formulaId}
|
||||
visible={formalModalVisible}
|
||||
valueType={valueType}
|
||||
onSaveFormal={(data) => {
|
||||
this.handleSaveFormal(data)
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export default class FormalFormModal extends React.Component {
|
|||
this.group = {};
|
||||
this.field = {};
|
||||
this.parameters = []
|
||||
this.referenceType = ""
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
|
@ -27,6 +28,7 @@ export default class FormalFormModal extends React.Component {
|
|||
value: data.formula
|
||||
})
|
||||
this.parameters = data.parameters
|
||||
this.referenceType = data.referenceType
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -60,7 +62,8 @@ export default class FormalFormModal extends React.Component {
|
|||
validateType:'number',
|
||||
extendParam:'{}',
|
||||
formula: this.state.value,
|
||||
parameters: this.parameters
|
||||
parameters: this.parameters,
|
||||
referenceType: this.referenceType == "" ? this.props.valueType == "2" ? "formula" : this.props.valueType == "3" ? "SQL" : "" : this.referenceType
|
||||
}
|
||||
|
||||
saveFormual(params).then(data => {
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ export class calculateStore {
|
|||
// 核算结果--列表
|
||||
@action
|
||||
acctResultList = (salaryAcctRecordId, employeeName = "", current = 1) => {
|
||||
this.loading = true
|
||||
API.acctResultList({salaryAcctRecordId, employeeName, current}).then(res => {
|
||||
if(res.status) {
|
||||
this.acctResultListTableStore.getDatas(res.data.dataKey.datas)
|
||||
|
|
@ -263,6 +264,7 @@ export class calculateStore {
|
|||
} else {
|
||||
message.error(res.errormsg || "")
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue