bug修复
This commit is contained in:
parent
33e5009585
commit
1823149ae2
|
|
@ -40,20 +40,24 @@ export default class SelectFieldModal extends React.Component {
|
|||
// 公式项改变
|
||||
handleFormalChange(item, value, flag) {
|
||||
item.checked = value == 1 ? true: false
|
||||
let fieldData = {...this.state.fieldData}
|
||||
if(flag) { // 公式项
|
||||
this.fieldData.formulaItems.map(fieldItem => {
|
||||
fieldData.formulaItems.map(fieldItem => {
|
||||
if(item.salaryItemId == fieldItem.salaryItemId) {
|
||||
fieldItem.checked = item.checked
|
||||
}
|
||||
})
|
||||
} else { // 输入项
|
||||
this.fieldData.inputItems.map(fieldItem => {
|
||||
fieldData.inputItems.map(fieldItem => {
|
||||
if(item.salaryItemId == fieldItem.salaryItemId) {
|
||||
fieldItem.checked = item.checked
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.setState({
|
||||
fieldData
|
||||
})
|
||||
this.fieldData = fieldData
|
||||
}
|
||||
|
||||
// 添加按钮点击回调
|
||||
|
|
@ -62,6 +66,46 @@ export default class SelectFieldModal extends React.Component {
|
|||
this.props.onCancel()
|
||||
}
|
||||
|
||||
// 标题checkbox点击
|
||||
handleTitleCheckboxChange(value, flag) {
|
||||
let checked = value == 1 ? true: false
|
||||
let fieldData = {...this.state.fieldData}
|
||||
if(flag === 'formula') {
|
||||
fieldData.formulaItems.map(fieldItem => {
|
||||
fieldItem.checked = checked
|
||||
})
|
||||
} else if(flag === "input") {
|
||||
fieldData.inputItems.map(fieldItem => {
|
||||
fieldItem.checked = checked
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
fieldData
|
||||
})
|
||||
|
||||
this.fieldData = fieldData;
|
||||
}
|
||||
|
||||
// 只显示已选中
|
||||
showSelectedChange(value) {
|
||||
let checked = value == 1 ? true: false
|
||||
let fieldData = {...this.fieldData}
|
||||
if(checked) {
|
||||
if(fieldData.formulaItems) {
|
||||
fieldData.formulaItems = fieldData.formulaItems.filter(fieldItem => fieldItem.checked)
|
||||
}
|
||||
if(fieldData.inputItems) {
|
||||
fieldData.inputItems = fieldData.inputItems.filter(fieldItem => fieldItem.checked)
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({
|
||||
fieldData
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const { fieldData } = this.state;
|
||||
return (
|
||||
|
|
@ -74,7 +118,7 @@ export default class SelectFieldModal extends React.Component {
|
|||
</div>
|
||||
<div style={{marginTop: "20px"}}>
|
||||
<div style={{height: "40px", lineHeight: "40px"}}>
|
||||
<WeaCheckbox content="公式项"/>
|
||||
<WeaCheckbox content="公式项" onChange={(value) => {this.handleTitleCheckboxChange(value, "formula")}}/>
|
||||
</div>
|
||||
<div style={{height: "100px", border: "1px solid #f2f2f2", margin: "10px", padding: "10px", overflowY: 'scroll'}}>
|
||||
<Row>
|
||||
|
|
@ -89,7 +133,7 @@ export default class SelectFieldModal extends React.Component {
|
|||
|
||||
<div style={{marginTop: "20px"}}>
|
||||
<div style={{height: "50px", lineHeight: "50px"}}>
|
||||
<WeaCheckbox content="输入项"/>
|
||||
<WeaCheckbox content="输入项" onChange={(value) => {this.handleTitleCheckboxChange(value, "input")}}/>
|
||||
</div>
|
||||
<div style={{height: "100px", border: "1px solid #f2f2f2", margin: "10px", padding: "10px", overflowY: "scroll"}}>
|
||||
<Row>
|
||||
|
|
@ -103,7 +147,7 @@ export default class SelectFieldModal extends React.Component {
|
|||
</div>
|
||||
|
||||
<div style={{marginTop: "20px"}}>
|
||||
<WeaCheckbox content="只显示已选中"/>
|
||||
<WeaCheckbox content="只显示已选中" onChange={(value) => {this.showSelectedChange(value)}}/>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -67,13 +67,17 @@ export default class SalaryDetail extends React.Component {
|
|||
result.oldWidth = result.width;
|
||||
result.width = "150px";
|
||||
if(result.children) {
|
||||
result.width = null;
|
||||
result.width = (result.children.length * 150) + "px";
|
||||
result.children.map(child => {
|
||||
child.title = child.text
|
||||
child.dataIndex = child.column
|
||||
child.width = "150px";
|
||||
})
|
||||
}
|
||||
|
||||
if(result.dataIndex === "taxAgentName" || result.dataIndex === "username" || result.dataIndex === "departmentName") {
|
||||
result.fixed = "left"
|
||||
}
|
||||
return result;
|
||||
})
|
||||
columns.push({
|
||||
|
|
@ -84,7 +88,6 @@ export default class SalaryDetail extends React.Component {
|
|||
return <a onClick={() => {this.handleEdit(record)}}>编辑</a>
|
||||
}
|
||||
})
|
||||
console.log("columns: ", columns);
|
||||
return columns;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ export default class SalaryItemChangeList extends React.Component {
|
|||
// 页面跳转
|
||||
handlePageChange(value) {
|
||||
this.searchParams.current = value
|
||||
const { salaryFileStore: {singleSalaryItemList} } = this.props;
|
||||
singleSalaryItemList(this.searchParams)
|
||||
const { salaryFileStore: {fetchSingleSalaryItemList} } = this.props;
|
||||
fetchSingleSalaryItemList(this.searchParams)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -246,7 +246,6 @@ export default class Archives extends React.Component {
|
|||
// getColumns={this.getColumns}
|
||||
// onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/> */}
|
||||
|
||||
<CustomTable
|
||||
loading={loading}
|
||||
columns={this.getColumns()}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { removePropertyCondition } from '../util/response'
|
||||
|
||||
import * as API from '../apis/welfareArchive'; // 引入API接口文件
|
||||
|
||||
|
|
@ -91,8 +92,9 @@ export class ArchivesStore {
|
|||
getCondition = () => {
|
||||
API.getCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.condition = res.data.condition;
|
||||
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from 'comsMobx';
|
|||
|
||||
import * as API from '../apis/cumDeduct'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -62,8 +63,9 @@ export class CumDeductStore {
|
|||
getCondition = () => {
|
||||
API.getCumDeductSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.condition = res.data.condition;
|
||||
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
|
||||
import * as API from '../apis/cumSituation'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
|
|
@ -60,8 +61,9 @@ export class CumSituationStore {
|
|||
getCondition = () => {
|
||||
API.getCumSituationSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.condition = res.data.condition;
|
||||
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { observable, action, toJS } from 'mobx';
|
||||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
import { removePropertyCondition } from '../util/response';
|
||||
|
||||
import * as API from '../apis/otherDeduct'; // 引入API接口文件
|
||||
import * as TaxAgentApi from '../apis/taxAgent'
|
||||
|
|
@ -61,8 +62,9 @@ export class OtherDeductStore {
|
|||
getCondition = () => {
|
||||
API.getOtherDeductSaCondition().then(action(res => {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.condition = res.data.condition;
|
||||
this.form.initFormFields(res.data.condition); // 渲染高级搜索form表单
|
||||
let condition = removePropertyCondition(res.data.condition)
|
||||
this.condition = condition;
|
||||
this.form.initFormFields(condition); // 渲染高级搜索form表单
|
||||
} else {
|
||||
message.error(res.errormsg || '接口调用失败!')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,95 @@ import { WeaSwitch } from 'comsMobx';
|
|||
import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
export const getCustomSearchs = (form, condition, col, isCenter) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let items = [];
|
||||
let group = [];
|
||||
isFormInit && condition &&
|
||||
condition.map(c =>{
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com:(
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} // label 标签的文本
|
||||
labelCol={{span: `${fields.labelcol}`}} // label标签占一行比例
|
||||
wrapperCol={{span: `${fields.fieldcol}`}} // 右侧控件占一行比例
|
||||
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
>
|
||||
<WeaSwitch
|
||||
fieldConfig={fields}
|
||||
form={form}
|
||||
formParams={formParams}
|
||||
/>
|
||||
</WeaFormItem>),
|
||||
colSpan:1,
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
if(items.length > 0) {
|
||||
group.push(
|
||||
<WeaSearchGroup
|
||||
col={col || 1} // 高级搜索列布局列数
|
||||
needTigger={true} // 是否开启收缩
|
||||
title={''} // 高级搜索标题
|
||||
showGroup={true} // 是否开启面板
|
||||
items={items} // 条目数组数据
|
||||
center={isCenter || false} // 内容是否居中:一般弹框需要
|
||||
/>)
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
// export const getSearchs = (form, condition, col, isCenter) => {
|
||||
// const { isFormInit } = form;
|
||||
// const formParams = form.getFormParams();
|
||||
// let group = [];
|
||||
// isFormInit && condition && condition.map(c =>{
|
||||
// let items = [];
|
||||
// c.items.map(fields => {
|
||||
// items.push({
|
||||
// com:(
|
||||
// <WeaFormItem
|
||||
// label={`${fields.label}`} // label 标签的文本
|
||||
// labelCol={{span: `${fields.labelcol}`}} // label标签占一行比例
|
||||
// wrapperCol={{span: `${fields.fieldcol}`}} // 右侧控件占一行比例
|
||||
// error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
// tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
// >
|
||||
// <WeaSwitch
|
||||
// fieldConfig={fields}
|
||||
// form={form}
|
||||
// formParams={formParams}
|
||||
// />
|
||||
// </WeaFormItem>),
|
||||
// colSpan:1,
|
||||
// })
|
||||
// });
|
||||
// group.push(
|
||||
// <WeaSearchGroup
|
||||
// col={col || 1} // 高级搜索列布局列数
|
||||
// needTigger={true} // 是否开启收缩
|
||||
// title={c.title || ''} // 高级搜索标题
|
||||
// showGroup={c.defaultshow} // 是否开启面板
|
||||
// items={items} // 条目数组数据
|
||||
// center={isCenter || false} // 内容是否居中:一般弹框需要
|
||||
// />)
|
||||
// });
|
||||
// return group;
|
||||
// }
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
export const getSearchs = (form, condition, col, isCenter) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
console.log("formParams: ", formParams);
|
||||
let group = [];
|
||||
console.log("condition:", condition);
|
||||
isFormInit && condition && condition.map(c =>{
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
|
|
|
|||
|
|
@ -1,150 +0,0 @@
|
|||
import { Spin } from 'antd';
|
||||
import { WeaSwitch } from 'comsMobx';
|
||||
import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
export const getCustomSearchs = (form, condition, col, isCenter) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let items = [];
|
||||
let group = [];
|
||||
isFormInit && condition &&
|
||||
condition.map(c =>{
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com:(
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} // label 标签的文本
|
||||
labelCol={{span: `${fields.labelcol}`}} // label标签占一行比例
|
||||
wrapperCol={{span: `${fields.fieldcol}`}} // 右侧控件占一行比例
|
||||
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
>
|
||||
<WeaSwitch
|
||||
fieldConfig={fields}
|
||||
form={form}
|
||||
formParams={formParams}
|
||||
/>
|
||||
</WeaFormItem>),
|
||||
colSpan:1,
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
if(items.length > 0) {
|
||||
group.push(
|
||||
<WeaSearchGroup
|
||||
col={col || 1} // 高级搜索列布局列数
|
||||
needTigger={true} // 是否开启收缩
|
||||
title={''} // 高级搜索标题
|
||||
showGroup={true} // 是否开启面板
|
||||
items={items} // 条目数组数据
|
||||
center={isCenter || false} // 内容是否居中:一般弹框需要
|
||||
/>)
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
// export const getSearchs = (form, condition, col, isCenter) => {
|
||||
// const { isFormInit } = form;
|
||||
// const formParams = form.getFormParams();
|
||||
// let group = [];
|
||||
// isFormInit && condition && condition.map(c =>{
|
||||
// let items = [];
|
||||
// c.items.map(fields => {
|
||||
// items.push({
|
||||
// com:(
|
||||
// <WeaFormItem
|
||||
// label={`${fields.label}`} // label 标签的文本
|
||||
// labelCol={{span: `${fields.labelcol}`}} // label标签占一行比例
|
||||
// wrapperCol={{span: `${fields.fieldcol}`}} // 右侧控件占一行比例
|
||||
// error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
// tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
// >
|
||||
// <WeaSwitch
|
||||
// fieldConfig={fields}
|
||||
// form={form}
|
||||
// formParams={formParams}
|
||||
// />
|
||||
// </WeaFormItem>),
|
||||
// colSpan:1,
|
||||
// })
|
||||
// });
|
||||
// group.push(
|
||||
// <WeaSearchGroup
|
||||
// col={col || 1} // 高级搜索列布局列数
|
||||
// needTigger={true} // 是否开启收缩
|
||||
// title={c.title || ''} // 高级搜索标题
|
||||
// showGroup={c.defaultshow} // 是否开启面板
|
||||
// items={items} // 条目数组数据
|
||||
// center={isCenter || false} // 内容是否居中:一般弹框需要
|
||||
// />)
|
||||
// });
|
||||
// return group;
|
||||
// }
|
||||
|
||||
// 渲染form表单: 一般对form的渲染都统一使用该方法
|
||||
export const getSearchs = (form, condition, col, isCenter) => {
|
||||
const { isFormInit } = form;
|
||||
const formParams = form.getFormParams();
|
||||
let group = [];
|
||||
isFormInit && condition && condition.map(c =>{
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
items.push({
|
||||
com:(
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} // label 标签的文本
|
||||
labelCol={{span: `${fields.labelcol}`}} // label标签占一行比例
|
||||
wrapperCol={{span: `${fields.fieldcol}`}} // 右侧控件占一行比例
|
||||
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
>
|
||||
<WeaSwitch
|
||||
fieldConfig={fields}
|
||||
form={form}
|
||||
formParams={formParams}
|
||||
/>
|
||||
</WeaFormItem>),
|
||||
colSpan:1,
|
||||
})
|
||||
});
|
||||
group.push(
|
||||
<WeaSearchGroup
|
||||
col={col || 1} // 高级搜索列布局列数
|
||||
needTigger={true} // 是否开启收缩
|
||||
title={c.title || ''} // 高级搜索标题
|
||||
showGroup={c.defaultshow} // 是否开启面板
|
||||
items={items} // 条目数组数据
|
||||
center={isCenter || false} // 内容是否居中:一般弹框需要
|
||||
/>)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
// 页面加载中效果处理
|
||||
export const renderLoading = (loading) => (
|
||||
<div className="wea-demo-loading">
|
||||
<Spin spinning={loading} />
|
||||
</div>
|
||||
)
|
||||
|
||||
// 无权限处理
|
||||
export const renderNoright = () => (
|
||||
<WeaAlertPage>
|
||||
<div>
|
||||
{getLabel(2012,'对不起,您暂时没有权限!')}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
|
||||
// 暂无数据处理
|
||||
export const renderNoData = () => (
|
||||
<WeaAlertPage>
|
||||
<div>
|
||||
暂无数据
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* 删除属性为空的属性
|
||||
* @param {*} obj
|
||||
* @returns
|
||||
*/
|
||||
export const removeProperty = (obj) => {
|
||||
Object.keys(obj).forEach(item => {
|
||||
if (obj[item] === undefined || obj[item] === null || obj[item] === 'null') delete obj[item]
|
||||
})
|
||||
return obj
|
||||
}
|
||||
|
||||
/**
|
||||
* condition删除为空的属性
|
||||
*/
|
||||
export const removePropertyCondition = (condition) => {
|
||||
condition.forEach(group => {
|
||||
group.items && group.items.forEach(item => {
|
||||
removeProperty(item)
|
||||
if(item.browserConditionParam) {
|
||||
removeProperty(item.browserConditionParam)
|
||||
}
|
||||
})
|
||||
})
|
||||
return condition
|
||||
}
|
||||
Loading…
Reference in New Issue