Commit 8d4d3d4e authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'rifka' into 'master'

add email column in upload preview apprv

See merge request !257
parents 4a5b3424 1d481be1
......@@ -55,7 +55,7 @@ export default class ApprovalMatrix extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
console.log(resp)
if (err) {
console.log(err);
}
......@@ -63,12 +63,14 @@ export default class ApprovalMatrix extends Component {
let isi = resp.rows.slice(3)
let payload = []
isi.map((item, index) => {
console.log(item)
if (item.length > 0) {
payload.push({
id: index + 1,
approval_type_name: item[0] === undefined ? "" : item[0],
orders: item[1] === undefined ? "" : item[1],
fullname: item[2] === undefined ? "" : item[2],
email: item[2] === undefined ? "" : item[2],
// fullname: item[2] === undefined ? "" : item[2],
operator_type_name: item[3] === undefined ? "" : item[3],
start_date: item[4] === undefined ? "" : item[4],
end_date: item[5] === undefined ? "" : item[5],
......@@ -95,6 +97,7 @@ export default class ApprovalMatrix extends Component {
return [
item.approval_type_name,
item.orders,
item.email,
item.fullname,
item.operator_type_name,
item.start_date,
......@@ -108,16 +111,16 @@ export default class ApprovalMatrix extends Component {
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('approval_type_name'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('approval_type_name'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="approvaltype">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="approvaltype">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -133,16 +136,16 @@ export default class ApprovalMatrix extends Component {
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('orders'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('orders'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="order">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="order">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -153,21 +156,46 @@ export default class ApprovalMatrix extends Component {
}
}
},
{
name: "Approver Email",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('email'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="email">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
}
<ReactTooltip border={true} id="email" place="bottom" type="light" effect="solid" />
</div >
);
}
}
},
{
name: "Approver Name",
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('fullname'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('fullname'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="fullname">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="fullname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -183,16 +211,16 @@ export default class ApprovalMatrix extends Component {
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('operator_type_name'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('operator_type_name'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="operatorname">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="operatorname">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -208,16 +236,16 @@ export default class ApprovalMatrix extends Component {
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="startdate">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="startdate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -233,16 +261,16 @@ export default class ApprovalMatrix extends Component {
options: {
customBodyRender: (val, tableMeta) => {
let check = null
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (tableMeta.rowData[7] != null) {
check = tableMeta.rowData[7].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="enddate">
{tableMeta.rowData[7] != null && check > -1 ?
<a data-tip={tableMeta.rowData[7][check].message} data-for="enddate">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val === "" ? "Empty" : val}</span>
......@@ -580,6 +608,7 @@ export default class ApprovalMatrix extends Component {
filter: false,
sort: false,
customBodyRender: (val, tableMeta) => {
console.log(tableMeta)
return (
this.state.btnedit && (
<div style={{ display: 'flex' }}>
......
......@@ -612,7 +612,11 @@ export default class BudgetTahunan extends Component {
{this.state.visibleTP && (
<TaxPlanning
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
/>
)}
......
......@@ -15,7 +15,7 @@ import { ExcelRenderer } from 'react-excel-renderer';
import ReactTooltip from "react-tooltip";
import PopUpFailedSave from "../../library/PopUpFailedSave";
import Constant from "../../library/Constant";
import PopUpDelete from "../ApprovalMatrix/PopUpDelete";
import PopUpDelete from "../ApprovalMatrix/PopUpDeleteAM";
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......
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