Commit b082fe19 authored by d.arizona's avatar d.arizona

zz

parent f54623bb
...@@ -182,15 +182,15 @@ export default class BalanceSheetMR extends Component { ...@@ -182,15 +182,15 @@ export default class BalanceSheetMR extends Component {
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (item.type_report_id === 3) { if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) { // if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true // err = true
} // }
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) { if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true err = true
} }
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) { // if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true // err = true
} // }
} }
if (indexIDzz === -1) { if (indexIDzz === -1) {
dataTable.push([ dataTable.push([
...@@ -230,15 +230,15 @@ export default class BalanceSheetMR extends Component { ...@@ -230,15 +230,15 @@ export default class BalanceSheetMR extends Component {
} }
res.map((item, index) => { res.map((item, index) => {
if (item.type_report_id === 3) { if (item.type_report_id === 3) {
if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) { // if (item.balance_sheet.mtd_vs_previous_month == "" && Number(item.balance_sheet.percent_act_vs_previous_month) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_previous_month) > this.state.maxValue) {
err = true // err = true
} // }
if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) { if (item.balance_sheet.mtd_vs_mb == "" && Number(item.balance_sheet.percent_act_vs_mb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_mb) > this.state.maxValue) {
err = true err = true
} }
if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) { // if (item.balance_sheet.mtd_vs_rb == "" && Number(item.balance_sheet.percent_act_vs_rb) < this.state.minValue || Number(item.balance_sheet.percent_act_vs_rb) > this.state.maxValue) {
err = true // err = true
} // }
} }
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
...@@ -367,7 +367,13 @@ export default class BalanceSheetMR extends Component { ...@@ -367,7 +367,13 @@ export default class BalanceSheetMR extends Component {
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleBSMR: false, loading: true }) this.setState({ visibleUpload: false, visibleBSMR: false, loading: true })
let err = false
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
if (item.type_report_id === 3) {
if (item.mtd_vs_mb == "" && Number(item.percent_act_vs_mb) < this.state.minValue || Number(item.percent_act_vs_mb) > this.state.maxValue) {
err = true
}
}
return [ return [
item.type_report_id, item.type_report_id,
item.item_report_id, item.item_report_id,
...@@ -379,19 +385,19 @@ export default class BalanceSheetMR extends Component { ...@@ -379,19 +385,19 @@ export default class BalanceSheetMR extends Component {
item.master_budget === "" ? "" : item.master_budget, item.master_budget === "" ? "" : item.master_budget,
item.rolling_budget === "" ? "" : item.rolling_budget, item.rolling_budget === "" ? "" : item.rolling_budget,
item.actual === "" ? "" : item.actual, item.actual === "" ? "" : item.actual,
item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month, item.actual_previous_month === null ? "0.0" : item.actual_previous_month === "" ? "0.0" : item.actual_previous_month,
// item.amount_act_vs_previous_month === "" ? "" : item.amount_act_vs_previous_month, item.amount_act_vs_previous_month === "" ? "0.0" : item.amount_act_vs_previous_month,
// item.percent_act_vs_previous_month === "" ? "" : item.percent_act_vs_previous_month, item.percent_act_vs_previous_month === "" ? "0.0" : item.percent_act_vs_previous_month,
// item.amount_act_vs_mb === "" ? "" : item.amount_act_vs_mb, item.amount_act_vs_mb === "" ? "0.0" : item.amount_act_vs_mb,
// item.percent_act_vs_mb === "" ? "9.0" : item.percent_act_vs_mb, item.percent_act_vs_mb === "" ? "0.0" : item.percent_act_vs_mb,
// item.amount_act_vs_rb === "" ? "1" : item.amount_act_vs_rb, item.amount_act_vs_rb === "" ? "0.0" : item.amount_act_vs_rb,
// item.percent_act_vs_rb === "" ? "" : item.percent_act_vs_rb, item.percent_act_vs_rb === "" ? "0.0" : item.percent_act_vs_rb,
0, // 0,
0, // 0,
0, // 0,
0, // 0,
0, // 0,
0, // 0,
item.mtd_vs_previous_month, item.mtd_vs_previous_month,
item.mtd_vs_mb, item.mtd_vs_mb,
item.mtd_vs_rb, item.mtd_vs_rb,
...@@ -533,11 +539,12 @@ export default class BalanceSheetMR extends Component { ...@@ -533,11 +539,12 @@ export default class BalanceSheetMR extends Component {
dataTable.map((i, index) => { dataTable.map((i, index) => {
if(i[0] === 3) { if(i[0] === 3) {
// console.log(i); // console.log(i);
if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) { // if ( i[17] === "" && (Number(i[12]) < this.state.minValue || Number(i[12]) > this.state.maxValue)) {
console.log('msk 1'); // console.log('msk 1');
// console.log(i); // // console.log(i);
err = true // err = true
} else if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) { // } else
if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
console.log('msk 2'); console.log('msk 2');
err = true err = true
} }
......
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