系统数字输入框保留小数位数配置

This commit is contained in:
黎永顺 2023-08-25 16:12:05 +08:00
parent 4462753f28
commit 78e08d7c26
9 changed files with 52 additions and 41 deletions

View File

@ -129,16 +129,8 @@ const Routes = (
</Route>
<Route key="ledger" path="ledger" component={Ledger}/>
<Route key="calculate" path="calculate" component={Calculate}/>
<Route
key="calculateDetail"
path="calculateDetail"
component={CalculateDetail}
/>
<Route
key="placeOnFileDetail"
path="placeOnFileDetail"
component={PlaceOnFileDetail}
/>
<Route key="calculateDetail" path="calculateDetail" component={CalculateDetail}/>
<Route key="placeOnFileDetail" path="placeOnFileDetail" component={PlaceOnFileDetail}/>
<Route key="compareDetail" path="compareDetail" component={CompareDetail}/>
<Route key="payroll" path="payroll" component={Payroll}/>
<Route key="watermarkPreview" path="payroll/watermark/preview" component={WatermarkPreview}/>

View File

@ -353,18 +353,10 @@ export default class CalculateDetail extends React.Component {
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
return buttons;
};
const topTab = [
{
title: "人员确认",
viewcondition: "0"
},
{
title: "薪资核算",
viewcondition: "1"
}
{ title: "人员确认", viewcondition: "0" },
{ title: "薪资核算", viewcondition: "1" }
];
const adBtn = [
// 高级搜索内部按钮
<Button type="primary" onClick={() => {
@ -407,19 +399,19 @@ export default class CalculateDetail extends React.Component {
return (
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={{ loading: false, hasRight: payrollPermission && calculateAuth }}>
<div style={{ overflowY: "hidden", height: "100%" }}>
<div className="calculate-layout">
<WeaTab
datas={topTab}
selectedKey={selectedKey}
keyParam="viewcondition"
onChange={v => this.setState({ selectedKey: v })}
searchType={selectedKey == 1 ? ["base", "advanced"] : []} // base基础搜索框 advanced显示高级搜索按钮
searchType={selectedKey === "1" ? ["base", "advanced"] : []} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调
buttons={selectedKey == 1 ? renderRightOperation() : []}
buttons={selectedKey === "1" ? renderRightOperation() : []}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
@ -431,9 +423,9 @@ export default class CalculateDetail extends React.Component {
} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
/>
{selectedKey == 0 && <UserSure/>}
{selectedKey == 1 && <SalaryDetail onChangeAccountIds={(ids) => this.setState({ accountIds: ids })}
employeeName={this.state.searchItemsValue}/>}
{selectedKey === "0" && <UserSure/>}
{selectedKey === "1" && <SalaryDetail onChangeAccountIds={(ids) => this.setState({ accountIds: ids })}
employeeName={this.state.searchItemsValue}/>}
{acctResultImportVisiable &&
<AcctResultImportModal
visiable={acctResultImportVisiable}

View File

@ -1,3 +1,17 @@
.calculate-layout {
height: 100%;
overflow-y: hidden;
background: #f6f6f6;
.wea-tab .wea-tab-right {
background: #f6f6f6;
}
.wea-input-focus {
background: transparent;
}
}
.userSure {
padding: 20px;
@ -8,7 +22,20 @@
.formWrapper {
line-height: 40px;
border-bottom: 1px solid #eee;
border: 1px solid #eee;
background: #fff;
.ant-col-12 {
padding: 0 16px;
}
& > div:first-child {
border-bottom: 1px solid #eee;
& > div:first-child {
border-right: 1px solid #e5e5e5;
}
}
}
.operateBarWrapper {
@ -59,8 +86,8 @@
}
.salaryDetail {
padding: 10px 20px;
overflow-y: scroll;
padding: 10px;
overflow-y: auto;
.salaryBarWrapper {
padding: 10px;
@ -140,7 +167,8 @@
.placeOnFileDetail {
height: 100%;
overflow-y: auto;
overflow-y: hidden;
background: #f6f6f6;
.tabWrapper {
height: 47px;

View File

@ -29,11 +29,11 @@ class IssuedAndReissueTable extends Component {
/>
</span>,
render: (text, record) => {
const { canEdit } = record;
const { canEdit, pattern } = record;
return <WeaInputNumber
disabled={!canEdit}
min={0}
precision={2}
precision={pattern || 2}
value={text || 0}
onChange={(value) => onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")}
/>;

View File

@ -37,10 +37,10 @@ class PayrollItemsTable extends Component {
</span>,
width: "20%",
render: (text, record) => {
const { canEdit, dataType } = record;
const { canEdit, dataType, pattern } = record;
return dataType === "number" ? <WeaInputNumber
disabled={!canEdit}
precision={2}
precision={pattern || 2}
value={text || 0}
onChange={(value) => onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)}
/> : <WeaInput

View File

@ -162,7 +162,6 @@ export default class PlaceOnFileDetail extends React.Component {
};
return (
<div className="placeOnFileDetail">
<CustomTab
searchOperationItem={
@ -170,7 +169,7 @@ export default class PlaceOnFileDetail extends React.Component {
}
/>
<div className="tabWrapper" style={{ borderBottom: "none" }}>
<span>薪资所属月{baseSalarySobCycle.salaryMonth}</span>
<span style={{ marginRight: 10 }}>薪资所属月{baseSalarySobCycle.salaryMonth}</span>
<WeaHelpfulTip
width={100}
title={`薪资周期\n

View File

@ -147,7 +147,7 @@ class LedgerSalaryItemNormal extends Component {
const newDateSource = _.map(dataSource, item => {
return {
...item,
items: _.filter(item.items || [], child => child.name.indexOf(salaryItemKeywords) !== -1)
items: _.filter(item.items || [], child => (child.name.indexOf(salaryItemKeywords) !== -1 || child.formulaContent.indexOf(salaryItemKeywords) !== -1))
};
});
return (
@ -262,7 +262,7 @@ const TitleComp = (props) => {
<Button type="ghost" onClick={() => onAddCategory()} style={{ marginRight: 10 }}>新增分类</Button>
}
<WeaInputSearch value={salaryItemKeywords} onChange={onChange}
placeholder={getLabel(111, "请输入薪资项目名称")}
placeholder={getLabel(111, "请输入薪资项目名称或者公式名称")}
/>
</div>
</div>;

View File

@ -255,9 +255,9 @@ class LedgerSalaryItemTable extends Component {
dataIndex: "valueType",
key: "valueType",
render: (e, record) => {
const { valueType } = record;
const { valueType, formulaContent } = record;
const key = !_.isNil(valueType) ? valueType : "";
return <span> {key.toString() === "1" ? "输入" : key.toString() === "2" ? "自定义公式" : key.toString() === "3" ? "SQL" : ""} </span>;
return <span> {key.toString() === "1" ? "输入" : key.toString() === "2" ? formulaContent : key.toString() === "3" ? formulaContent : ""} </span>;
}
},
{

View File

@ -152,7 +152,7 @@ export default class SalaryFileViewSlide extends React.Component {
item.dataType === "number" ?
<WeaInputNumber
value={!_.isNil(item.value) ? item.value : 0}
precision={2}
precision={item.pattern || 2}
viewAttr={selectedKey === "pending" ? 2 : 1}
onChange={value => {
item.value = value;