Commit 137d6338 authored by Riri Novita's avatar Riri Novita

push

parent eb45c224
...@@ -289,6 +289,8 @@ const create = (type = "") => { ...@@ -289,6 +289,8 @@ const create = (type = "") => {
const validateSubmitReportBS = (body) => api.post('transaction/monthly_report_bs/validate_save', body) const validateSubmitReportBS = (body) => api.post('transaction/monthly_report_bs/validate_save', body)
const validateSubmitReportMR = (body) => api.post('transaction/monthly_report/validate_save', body) const validateSubmitReportMR = (body) => api.post('transaction/monthly_report/validate_save', body)
const validateSubmitReportMRTP = (body) => api.post('transaction/monthly_report_tp/validate_save', body) const validateSubmitReportMRTP = (body) => api.post('transaction/monthly_report_tp/validate_save', body)
const validateSubmitReportOI = (body) => api.post('transaction/monthly_report_oi/validate_save', body)
// MonthlyPL // MonthlyPL
const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body) const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
...@@ -522,7 +524,8 @@ const create = (type = "") => { ...@@ -522,7 +524,8 @@ const create = (type = "") => {
validateSubmitReportMR, validateSubmitReportMR,
validateSubmitReportMRTP, validateSubmitReportMRTP,
validateSubmitReportBS, validateSubmitReportBS,
validateSubmitReportPL validateSubmitReportPL,
validateSubmitReportOI
} }
} }
......
...@@ -21,6 +21,15 @@ const LightTooltip = withStyles((theme) => ({ ...@@ -21,6 +21,15 @@ const LightTooltip = withStyles((theme) => ({
}, },
}))(Tooltip); }))(Tooltip);
const LightTooltipError = withStyles((theme) => ({
tooltip: {
backgroundColor: theme.palette.common.white,
color: 'rgba(255, 0, 0, 0.87)',
boxShadow: theme.shadows[1],
fontSize: 11,
},
}))(Tooltip);
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3()); const getMuiTheme = () => createMuiTheme(ct.customTable3());
...@@ -47,8 +56,19 @@ export default class OperatingIndicatorMR extends Component { ...@@ -47,8 +56,19 @@ export default class OperatingIndicatorMR extends Component {
loading: true, loading: true,
visibleOI: true, visibleOI: true,
minValue: 0, minValue: 0,
maxValue: 0 maxValue: 0,
updateBy: '-',
notesUpdate: '-',
templateNull: true
} }
this.fileHandler = this.fileHandler.bind(this);
}
componentDidMount() {
// this.getItemHierarki()
this.getSettingControl()
this.getLatestUpdate()
// console.log(this.props.permission.create);
} }
getLatestUpdate() { getLatestUpdate() {
...@@ -57,6 +77,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -57,6 +77,7 @@ export default class OperatingIndicatorMR extends Component {
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null
} }
api.create().getLastestUpdateMROI(payload).then(response => { api.create().getLastestUpdateMROI(payload).then(response => {
// console.log(response.data) // console.log(response.data)
...@@ -65,18 +86,22 @@ export default class OperatingIndicatorMR extends Component { ...@@ -65,18 +86,22 @@ export default class OperatingIndicatorMR extends Component {
this.setState({ this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
}) })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
} }
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
componentDidMount() {
// this.getItemHierarki()
this.getSettingControl()
this.getLatestUpdate()
console.log(this.props.permission.create);
}
getSettingControl() { getSettingControl() {
let body = { let body = {
group: 'THRESHOLD_VARIANCE', group: 'THRESHOLD_VARIANCE',
...@@ -89,8 +114,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -89,8 +114,8 @@ export default class OperatingIndicatorMR extends Component {
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ this.setState({
minValue: response.data.data[0] ? response.data.data[0].min_value : -5, minValue: response.data.data[0] ? Number(response.data.data[0].min_value) : -5,
maxValue: response.data.data[0] ? response.data.data[0].max_value : 5, maxValue: response.data.data[0] ? Number(response.data.data[0].max_value) : 5,
}, () => { }, () => {
this.getItemHierarki() this.getItemHierarki()
}) })
...@@ -137,15 +162,15 @@ export default class OperatingIndicatorMR extends Component { ...@@ -137,15 +162,15 @@ export default class OperatingIndicatorMR extends Component {
item.description, item.description,
item.uom === "" ? null : item.uom, item.uom === "" ? null : item.uom,
item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook, item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook,
item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.master_budget, item.monthly_report.master_budget === null ? "10.0" : item.monthly_report.rolling_outlook === "" ? "10.0" : item.monthly_report.master_budget,
item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget, item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget,
item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual, item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual,
item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb, item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb,
item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb, item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb,
item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb, item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb,
item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb, item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb,
item.monthly_report.mtd_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.mtd_vs_mb, item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb,
item.monthly_report.mtd_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.mtd_vs_rb, item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb,
item.order, item.order,
]) ])
} }
...@@ -167,15 +192,15 @@ export default class OperatingIndicatorMR extends Component { ...@@ -167,15 +192,15 @@ export default class OperatingIndicatorMR extends Component {
item.description, item.description,
item.uom === "" ? null : item.uom, item.uom === "" ? null : item.uom,
item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook, item.monthly_report.rolling_outlook === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_outlook,
item.monthly_report.master_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.master_budget, item.monthly_report.master_budget === null ? "10.0" : item.monthly_report.rolling_outlook === "" ? "10.0" : item.monthly_report.master_budget,
item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget, item.monthly_report.rolling_budget === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.rolling_budget,
item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual, item.monthly_report.actual === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.actual,
item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb, item.monthly_report.amount_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_mb,
item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb, item.monthly_report.percent_act_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_mb,
item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb, item.monthly_report.amount_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.amount_act_vs_rb,
item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb, item.monthly_report.percent_act_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.percent_act_vs_rb,
item.monthly_report.mtd_vs_mb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.mtd_vs_mb, item.monthly_report.mtd_vs_mb === null ? "" : item.monthly_report.mtd_vs_mb,
item.monthly_report.mtd_vs_rb === null ? "0.0" : item.monthly_report.rolling_outlook === "" ? "0.0" : item.monthly_report.mtd_vs_rb, item.monthly_report.mtd_vs_rb === null ? "" : item.monthly_report.mtd_vs_rb,
item.order, item.order,
]) ])
if (item.children !== null) { if (item.children !== null) {
...@@ -187,7 +212,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -187,7 +212,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}) })
console.log(dataTable); console.log(dataTable);
this.setState({ dataTable, loading: false }) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true })
} }
}) })
} }
...@@ -278,8 +303,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -278,8 +303,8 @@ export default class OperatingIndicatorMR extends Component {
item_report: i[2] === undefined ? "" : String(i[2]).trim(), item_report: i[2] === undefined ? "" : String(i[2]).trim(),
uom: i[3] === undefined ? "" : String(i[3]).trim(), uom: i[3] === undefined ? "" : String(i[3]).trim(),
actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(), actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
mtd_vs_mb: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(), mtd_vs_mb: i[5] === undefined ? "" : String(i[5]).trim(),
mtd_vs_rb: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(), mtd_vs_rb: i[6] === undefined ? "" : String(i[6]).trim(),
}) })
} }
}) })
...@@ -321,10 +346,14 @@ export default class OperatingIndicatorMR extends Component { ...@@ -321,10 +346,14 @@ export default class OperatingIndicatorMR extends Component {
item.master_budget, item.master_budget,
item.rolling_budget, item.rolling_budget,
item.actual, item.actual,
item.amount_act_vs_mb, 0,
item.percent_act_vs_mb, 0,
item.amount_act_vs_rb, 0,
item.percent_act_vs_rb, 0,
// item.amount_act_vs_mb,
// item.percent_act_vs_mb,
// item.amount_act_vs_rb,
// item.percent_act_vs_rb,
item.mtd_vs_mb, item.mtd_vs_mb,
item.mtd_vs_rb, item.mtd_vs_rb,
item.order, item.order,
...@@ -339,7 +368,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -339,7 +368,7 @@ export default class OperatingIndicatorMR extends Component {
uploadOI(type) { uploadOI(type) {
let data = [] let data = []
console.log(this.state.dataTable) // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
item_report_id: i[1], item_report_id: i[1],
...@@ -352,8 +381,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -352,8 +381,8 @@ export default class OperatingIndicatorMR extends Component {
percent_act_vs_mb: String(Number(i[12]).toFixed(1)), percent_act_vs_mb: String(Number(i[12]).toFixed(1)),
amount_act_vs_rb: String(Number(i[13]).toFixed(1)), amount_act_vs_rb: String(Number(i[13]).toFixed(1)),
percent_act_vs_rb: String(Number(i[14]).toFixed(1)), percent_act_vs_rb: String(Number(i[14]).toFixed(1)),
mtd_vs_mb: String(Number(i[15]).toFixed(1)), mtd_vs_mb: String(i[15]),
mtd_vs_rb: String(Number(i[16]).toFixed(1)), mtd_vs_rb: String(i[16]),
}) })
}) })
let body = { let body = {
......
...@@ -342,7 +342,7 @@ export default class ProfitLossMR extends Component { ...@@ -342,7 +342,7 @@ export default class ProfitLossMR extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) console.log(resp)
if (err) { if (err) {
console.log(err); console.log(err);
} }
...@@ -359,9 +359,9 @@ export default class ProfitLossMR extends Component { ...@@ -359,9 +359,9 @@ export default class ProfitLossMR extends Component {
item_report: i[2] === undefined ? "" : String(i[2]).trim(), item_report: i[2] === undefined ? "" : String(i[2]).trim(),
notes: i[3] === undefined ? "" : String(i[3]).trim(), notes: i[3] === undefined ? "" : String(i[3]).trim(),
actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(), actual: i[4] === undefined ? "0" : reg.test(String(i[4])) === false ? "0" : String(i[4]).trim(),
mtd_vs_previous_month: i[5] === undefined ? "0" : reg.test(String(i[5])) === false ? "0" : String(i[5]).trim(), mtd_vs_previous_month: i[5] === undefined ? "" : String(i[5]).trim(),
mtd_vs_mb: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(), mtd_vs_mb: i[6] === undefined ? "" : String(i[6]).trim(),
mtd_vs_rb: i[7] === undefined ? "0" : reg.test(String(i[7])) === false ? "0" : String(i[7]).trim(), mtd_vs_rb: i[7] === undefined ? "" : String(i[7]).trim(),
}) })
} }
}) })
...@@ -393,7 +393,7 @@ export default class ProfitLossMR extends Component { ...@@ -393,7 +393,7 @@ export default class ProfitLossMR extends Component {
item.formula, item.formula,
item.level, item.level,
item.item_report, item.item_report,
item.notes === null ? "" : item.notes === "" ? "" : item.notes, item.notes,
item.rolling_outlook === null ? "" : item.rolling_outlook === "" ? "" : item.rolling_outlook, item.rolling_outlook === null ? "" : item.rolling_outlook === "" ? "" : item.rolling_outlook,
item.master_budget === "" ? "" : item.master_budget, item.master_budget === "" ? "" : item.master_budget,
item.rolling_budget === "" ? "" : item.rolling_budget, item.rolling_budget === "" ? "" : item.rolling_budget,
...@@ -412,9 +412,9 @@ export default class ProfitLossMR extends Component { ...@@ -412,9 +412,9 @@ export default class ProfitLossMR extends Component {
// item.percent_act_vs_mb, // item.percent_act_vs_mb,
// item.amount_act_vs_rb, // item.amount_act_vs_rb,
// item.percent_act_vs_rb, // item.percent_act_vs_rb,
item.mtd_vs_previous_month === "" ? "" : item.mtd_vs_previous_month, item.mtd_vs_previous_month ,
item.mtd_vs_mb === "" ? "" : item.mtd_vs_mb, item.mtd_vs_mb ,
item.mtd_vs_rb === "" ? "" : item.mtd_vs_rb === null ? '' : item.mtd_vs_rb, item.mtd_vs_rb ,
item.orders, item.orders,
item.error item.error
] ]
...@@ -533,13 +533,6 @@ export default class ProfitLossMR extends Component { ...@@ -533,13 +533,6 @@ export default class ProfitLossMR extends Component {
err = true err = true
} }
}) })
// if (err === true) {
// console.log('error');
// this.setState({ loading: false, buttonError: true, saveDraft: false })
// } else {
// console.log('g error');
// this.setState({ loading: false, buttonError: false, saveDraft: false })
// }
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
...@@ -551,7 +544,7 @@ export default class ProfitLossMR extends Component { ...@@ -551,7 +544,7 @@ export default class ProfitLossMR extends Component {
"months": this.props.month.month_id, "months": this.props.month.month_id,
"profit_loss": data "profit_loss": data
} }
console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create().validateSubmitReportPL(payload).then((response) => { api.create().validateSubmitReportPL(payload).then((response) => {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -608,8 +601,8 @@ export default class ProfitLossMR extends Component { ...@@ -608,8 +601,8 @@ export default class ProfitLossMR extends Component {
// } // }
const handleText = (value, tableMeta, type) => { const handleText = (value, tableMeta, type) => {
dataTable2[tableMeta.rowIndex][type] = value // dataTable2[tableMeta.rowIndex][type] = value
// let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value
// console.log(dataTable2[tableMeta.rowIndex]); // console.log(dataTable2[tableMeta.rowIndex]);
} }
const handleChange = (value, tableMeta, type) => { const handleChange = (value, tableMeta, type) => {
...@@ -846,11 +839,12 @@ export default class ProfitLossMR extends Component { ...@@ -846,11 +839,12 @@ export default class ProfitLossMR extends Component {
color: "#5198ea" color: "#5198ea"
}}} }}}
placeholder="" placeholder=""
value={tableMeta.rowData[6]}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
defaultValue={value} defaultValue={tableMeta.rowData[6]}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleText(event.target.value, tableMeta, 6) handleText(event.target.value, tableMeta, 0)
// console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
...@@ -1570,16 +1564,17 @@ export default class ProfitLossMR extends Component { ...@@ -1570,16 +1564,17 @@ export default class ProfitLossMR extends Component {
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : {tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null :
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
// value={value} // value={tableMeta.rowData[19]}
control={ control={
tableMeta.rowData[19] === "" && (Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue) ? tableMeta.rowData[19] === "" && (Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue) ?
<LightTooltipError title={"MTD Explanation vs Prev. Month is Reqiured"} arrow> <LightTooltipError title={"MTD Explanation vs Prev. Month is Reqiured"} arrow>
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={false}
// value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1589,7 +1584,7 @@ export default class ProfitLossMR extends Component { ...@@ -1589,7 +1584,7 @@ export default class ProfitLossMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 19) handleText(event.target.value, tableMeta, 0)
}} }}
/> />
</LightTooltipError> </LightTooltipError>
...@@ -1599,16 +1594,17 @@ export default class ProfitLossMR extends Component { ...@@ -1599,16 +1594,17 @@ export default class ProfitLossMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : 'black', color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right' textAlign: 'right'
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 19) handleText(event.target.value, tableMeta, 0)
}} }}
/> />
} }
...@@ -1632,6 +1628,7 @@ export default class ProfitLossMR extends Component { ...@@ -1632,6 +1628,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={false}
// value={tableMeta.rowData[20]}
defaultValue={tableMeta.rowData[20]} defaultValue={tableMeta.rowData[20]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1641,7 +1638,7 @@ export default class ProfitLossMR extends Component { ...@@ -1641,7 +1638,7 @@ export default class ProfitLossMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 20) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
</LightTooltipError> : </LightTooltipError> :
...@@ -1650,16 +1647,17 @@ export default class ProfitLossMR extends Component { ...@@ -1650,16 +1647,17 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[20]}
defaultValue={tableMeta.rowData[20]} defaultValue={tableMeta.rowData[20]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : 'black', color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right' textAlign: 'right'
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 20) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
} }
...@@ -1683,6 +1681,7 @@ export default class ProfitLossMR extends Component { ...@@ -1683,6 +1681,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={false}
// value={tableMeta.rowData[21]}
defaultValue={tableMeta.rowData[21]} defaultValue={tableMeta.rowData[21]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1692,7 +1691,7 @@ export default class ProfitLossMR extends Component { ...@@ -1692,7 +1691,7 @@ export default class ProfitLossMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 21) handleText(event.target.value, tableMeta, 2)
}} }}
/> />
</LightTooltipError> : </LightTooltipError> :
...@@ -1701,16 +1700,17 @@ export default class ProfitLossMR extends Component { ...@@ -1701,16 +1700,17 @@ export default class ProfitLossMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[21]}
defaultValue={tableMeta.rowData[21]} defaultValue={tableMeta.rowData[21]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : 'black', color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right' textAlign: 'right'
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 21) handleText(event.target.value, tableMeta, 2)
}} }}
/> />
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment