hotfix/2.9.42308.02
This commit is contained in:
parent
bc3632e054
commit
ce462fe51a
|
|
@ -36,7 +36,6 @@ class SalaryItemForm extends Component {
|
|||
const { key } = item;
|
||||
switch (key) {
|
||||
case "useDefault":
|
||||
case "sortedIndex":
|
||||
case "dataType":
|
||||
case "description":
|
||||
return {
|
||||
|
|
@ -44,6 +43,8 @@ class SalaryItemForm extends Component {
|
|||
viewAttr: (!isLedger && ((editable && record.canEdit) || isAdd)) ? 2 : 1,
|
||||
display: !isLedger
|
||||
};
|
||||
case "sortedIndex":
|
||||
return { ...item };
|
||||
case "useInEmployeeSalary":
|
||||
return {
|
||||
...item,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { message } from "antd";
|
|||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from "../apis/calculate";
|
||||
import { toDecimal_n } from "../util";
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -492,7 +493,7 @@ export class calculateStore {
|
|||
..._.map(cur.salaryItems, it => {
|
||||
return {
|
||||
salaryItemId: it.salaryItemId,
|
||||
resultValue: it.resultValue
|
||||
resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
@ -501,7 +502,7 @@ export class calculateStore {
|
|||
const issuedAndReissueItems = this.acctresultDetailForm.issuedAndReissueItems.map(item => {
|
||||
let record = {};
|
||||
record.salaryItemId = item.salaryItemId;
|
||||
record.resultValue = item.resultValue;
|
||||
record.resultValue = (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue;
|
||||
return record;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -109,3 +109,24 @@ export const format_with_regex = (number) => {
|
|||
export const getDomkes = (conditions) => {
|
||||
return _.map(conditions[0].items, it => it.domkey[0]);
|
||||
};
|
||||
|
||||
export const padding0 = (num, length) => {
|
||||
for (let len = ("" + num).length; len < length; len++) {
|
||||
num = "0" + num;
|
||||
}
|
||||
return "0." + num;
|
||||
};
|
||||
export const toDecimal_n = (x, num) => {
|
||||
if (isNaN(parseFloat(x))) return false;
|
||||
let f = Math.round(x * 100) / 100;
|
||||
let s = f.toString();
|
||||
let rs = s.indexOf(".");
|
||||
if (rs < 0) {
|
||||
rs = s.length;
|
||||
s += ".";
|
||||
}
|
||||
while (s.length <= rs + num) {
|
||||
s += "0";
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue