Commit 81961ca8 authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents f035e50d 34a1f518
......@@ -110,6 +110,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const searchAM = (body) => api.post('/approval_matrix/search_approval_matrix', body)
const createAM = (body) => api.post('/approval_matrix/create_approval_matrix', body)
const updateAM = (body) => api.post('/approval_matrix/update_approval_matrix', body)
const updateVAM = (body) => api.post('/approval_matrix/visual_approval_matrix', body)
const checkUploadAM = (body) => api.post('/approval_matrix/check_import_approval_matrix', body)
const uploadAM = (body) => api.post('/approval_matrix/check_import_approval_matrix', body)
//User
const getUser = () => api.get('user/get_all_user')
......@@ -189,6 +192,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
searchAM,
createAM,
updateAM,
updateVAM,
checkUploadAM,
uploadAM,
getUser,
getDetailUser,
searchUser,
......
......@@ -35,6 +35,7 @@ const Images = {
berhasil: require('./berhasil.svg'),
up: require('./up.svg'),
down: require('./down.svg'),
close: require('./close.svg'),
//Image
triputra: require('./triputra.png'),
......
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<path id="gi74onwb9a" d="M.898.157l-.74.74c-.212.211-.209.546 0 .754l14.19 14.193c.21.209.546.208.754 0l.74-.74c.212-.212.209-.547 0-.755L1.653.156C1.547.052 1.412 0 1.275 0 1.14 0 1.002.052.898.157z"/>
</defs>
<g fill="none" fill-rule="evenodd">
<path d="M0 0H24V24H0z" transform="translate(-4 -4)"/>
<g transform="translate(-4 -4) translate(4 4)">
<path stroke="#FFF" stroke-linecap="round" stroke-width="2" d="M1.143 1.143L14.857 14.857M14.857 1.143L1.143 14.857"/>
</g>
</g>
</svg>
......@@ -132,6 +132,10 @@
/* display: ''; */
justify-content: 'center';
align-items: 'center' }
.popup-content-middle {
position: relative;
margin: auto;
width: 800px; }
.popup-content {
position: relative;
margin: auto;
......@@ -6,6 +6,7 @@ import * as R from 'ramda'
import format from "date-fns/format";
import localeID from "date-fns/locale/id"
import api from "../../api";
import Images from '../../assets/Images';
export default class CreateApprovalMatrix extends Component {
constructor(props) {
......@@ -22,7 +23,9 @@ export default class CreateApprovalMatrix extends Component {
endDate: '',
userData: [],
value: null,
date: new Date()
date: new Date(),
errorOrder: false,
msgErrOrder: '',
}
}
......@@ -105,22 +108,34 @@ export default class CreateApprovalMatrix extends Component {
let data = this.state
let isDate = type !== '' ? true : false
if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd') }, () => {
this.setState({ startDate: format(e, 'yyyy-MM-dd'),
errorOrder: false,
msgErrOrder: '',
// }, () => {
// console.log(this.state.startDate)
})
} else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
this.setState({ endDate: format(e, 'yyyy-MM-dd'),
errorOrder: false,
msgErrOrder: '',
// }, () => {
// console.log(this.state.endDate)
})
} else {
// this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}})
this.setState({
errorOrder: false,
msgErrOrder: '',
})
}
}
validasi() {
if (R.isNil(this.state.typeId)) return alert("Tipe Persetujuan is Required.");
if (R.isEmpty(this.state.order)) return alert("Order is Required.");
if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrOrder: 'Order is Required.'})
}
if (R.isNil(this.state.userId)) return alert("Pemberi Persetujuan is Required.");
if (R.isNil(this.state.operatorId)) return alert("Operator is Required.");
if (!R.isEmpty(this.state.startDate) && !R.isEmpty(this.state.endDate) && (this.state.startDate > this.state.endDate)) return alert("Masa Berlaku Tidak Boleh Kurang Dari Tanggal Mulai");
......@@ -156,7 +171,7 @@ export default class CreateApprovalMatrix extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......@@ -224,6 +239,8 @@ export default class CreateApprovalMatrix extends Component {
id="order"
label="Order"
value={this.state.order}
error={this.state.errorOrder}
helperText={this.state.msgErrOrder}
onChange={(e) => this.setState({ order: e.target.value })}
inputProps={{
style: {
......
......@@ -5,6 +5,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import * as R from 'ramda'
import format from "date-fns/format";
import api from "../../api";
import Images from '../../assets/Images';
const operator = [
{
......@@ -189,7 +190,7 @@ export default class EditApprovalMatrix extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -47,13 +47,13 @@ export default class VisualisasiAM extends Component {
api.create().getTypeAM().then((response) => {
if (response.data.status == 'success') {
let data = response.data.data
// console.log(data)
let typeData = data.map((item) => {
return {
approval_type_id: item.approval_type_id,
approval_type_name: item.approval_type_name
}
})
// console.log(userData)
let typeProps = {
options: typeData,
getOptionLabel: (option) => option.approval_type_name,
......@@ -73,7 +73,7 @@ export default class VisualisasiAM extends Component {
api.create().searchAM(body).then(response => {
if (response.data.status == 'success') {
let data = response.data.data
console.log(data)
// console.log(data)
let listVisual = []
data.map((item, index) => {
let indexId = listVisual.findIndex((val) => val.orderId == item.orders)
......@@ -82,13 +82,15 @@ export default class VisualisasiAM extends Component {
orderId: item.orders,
data: [item]
})
console.log(listVisual);
// console.log(listVisual);
} else {
listVisual[indexId].data.push(item)
// console.log('listVisual');
// console.log(listVisual);
}
})
this.setState({ listApproval: listVisual})
console.log(listVisual);
// console.log(listVisual);
} else {
alert(response.data.message)
}
......@@ -100,33 +102,43 @@ export default class VisualisasiAM extends Component {
let orderIdFrom = listApproval[fromIndex].orderId
listApproval[fromIndex].orderId = listApproval[toIndex].orderId
listApproval[toIndex].orderId = orderIdFrom
that.setState({listEdit: listApproval})
that.setState({listEdit: listApproval}, () => console.log(this.state.listEdit))
}
handleSave() {
let data = []
this.state.listEdit.map((item,index) => {
item.data.map((items,index) => {
data.push({
approval_matrix_id: items.approval_matrix_id,
approval_type_id: items.approval_type_id,
approval_type_name: items.approval_type_name,
created: items.created,
end_date: items.end_date,
fullname: items.fullname,
operator_type_id: items.operator_type_id,
operator_type_name: items.operator_type_name,
orders: item.orderId,
start_date: items.start_date,
status: items.status,
updated: items.updated,
user_id: items.user_id
if (this.state.listEdit.length == 0) {
this.state.listApproval.map((item,index) => {
item.data.map((items,index) => {
data.push({
approval_matrix_id: items.approval_matrix_id,
approval_type_id: items.approval_type_id,
operator_type_id: items.operator_type_id,
orders: item.orderId,
user_id: items.user_id
})
})
})
})
} else {
this.state.listEdit.map((item,index) => {
item.data.map((items,index) => {
data.push({
approval_matrix_id: items.approval_matrix_id,
approval_type_id: items.approval_type_id,
operator_type_id: items.operator_type_id,
orders: item.orderId,
user_id: items.user_id
})
})
})
}
setTimeout(() => {
this.setState({listOriginal: data})
let payload = {
approval_type_id: data[0].approval_type_id,
approval_matrix_detail : data
}
this.setState({listOriginal: payload})
this.props.updateVAM(this.state.listOriginal)
}, 500);
}
......
......@@ -5,6 +5,7 @@ import api from '../../../api';
import { DatePicker } from '@material-ui/pickers';
import { format } from 'date-fns';
import * as R from 'ramda'
import Images from '../../../assets/Images';
export default class CreateParameter extends Component {
constructor(props) {
......@@ -377,7 +378,7 @@ export default class CreateParameter extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......@@ -697,7 +698,7 @@ export default class CreateParameter extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -777,7 +777,7 @@ export default class Parameter extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -5,6 +5,7 @@ import { DateTimePicker, KeyboardDatePicker, DatePicker } from "@material-ui/pic
import format from "date-fns/format";
import Autocomplete from '@material-ui/lab/Autocomplete';
import api from '../../../api';
import Images from '../../../assets/Images';
export default class CreatePerusahaan extends Component {
constructor(props) {
......@@ -123,7 +124,7 @@ export default class CreatePerusahaan extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -5,6 +5,7 @@ import * as R from 'ramda'
import api from '../../../api'
import Autocomplete from '@material-ui/lab/Autocomplete'
import { format } from 'date-fns'
import Images from '../../../assets/Images'
export default class EditPerusahaan extends Component {
constructor(props) {
......@@ -177,7 +178,7 @@ export default class EditPerusahaan extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -607,7 +607,7 @@ export default class Perusahaan extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -109,6 +109,11 @@ export default class VisualPerusahaan extends Component {
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', fontSize: 16, paddingTop: 8 }}>Hirarki Perusahaan</label>
</div>
<div style={{ display: 'flex', paddingRight: 25, paddingLeft: 25 }}>
<label style={{ color: '#51c6ea', width: '20%', fontSize: 11 }}>Master Data / Perusahaan /
<span style={{ color: 'white', width: '20%', fontSize: 11 }}> Visualisasi</span>
</label>
</div>
<div style={{ padding: 25, width: '100%' }}>
<div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4'}}>
<Nestable
......@@ -118,42 +123,6 @@ export default class VisualPerusahaan extends Component {
ref={el => this.refNestable = el}
onChange={(e) => this.setState({items: e}, () => console.log(JSON.stringify(e)))}
/>
{/* <TreeView
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
>
<TreeItem nodeId="1" label="Triputra Investindo Arya">
<TreeItem nodeId="2" label="TAP Group" >
<TreeItem nodeId="3" label="Gawi Bandep Sawit" />
<TreeItem nodeId="4" label="Etam Buana Lestari" />
</TreeItem>
<TreeItem nodeId="11" label="Puninar Group">
<TreeItem nodeId="21" label="TAP Group" >
<TreeItem nodeId="31" label="Gawi Bandep Sawit" />
<TreeItem nodeId="41" label="Etam Buana Lestari" />
</TreeItem>
</TreeItem>
<TreeItem nodeId="12" label="Daya Group">
<TreeItem nodeId="22" label="TAP Group" >
<TreeItem nodeId="32" label="Gawi Bandep Sawit" />
<TreeItem nodeId="42" label="Etam Buana Lestari" />
</TreeItem>
</TreeItem>
</TreeItem>
<TreeItem nodeId="5" label="Documents">
<TreeItem nodeId="10" label="OSS" />
<TreeItem nodeId="6" label="Material-UI">
<TreeItem nodeId="7" label="src">
<TreeItem nodeId="8" label="index.js" />
<TreeItem nodeId="9" label="tree-view.js" />
</TreeItem>
</TreeItem>
</TreeItem>
</TreeView> */}
</div>
</div>
<div className="row" style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 15, paddingLeft: 15, paddingBottom: 25 }}>
......
......@@ -877,7 +877,7 @@ export default class ReportItems extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -504,7 +504,7 @@ export default class UnitBisnis extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -6,6 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import { titleCase } from '../../../library/Utils';
import format from "date-fns/format";
import { DatePicker } from '@material-ui/pickers';
import Images from '../../../assets/Images';
export default class CreateReportItems extends Component {
constructor(props) {
......@@ -284,7 +285,7 @@ export default class CreateReportItems extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -6,6 +6,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
import api from '../../../api';
import * as R from 'ramda'
import { titleCase } from '../../../library/Utils';
import Images from '../../../assets/Images';
export default class EditReportItems extends Component {
constructor(props) {
......@@ -289,7 +290,7 @@ export default class EditReportItems extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -3,6 +3,7 @@ import { TextField, Typography } from '@material-ui/core';
import * as R from 'ramda'
import { DateTimePicker, KeyboardDatePicker, DatePicker } from "@material-ui/pickers";
import format from "date-fns/format";
import Images from '../../../assets/Images';
export default class CreateUnitBisnis extends Component {
constructor(props) {
......@@ -118,7 +119,7 @@ export default class CreateUnitBisnis extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......@@ -306,7 +307,7 @@ export default class CreateUnitBisnis extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -550,7 +550,7 @@ export default class UserRole extends Component {
className="btn btn-circle btn-white"
onClick={() => this.setState({ visibleUpload: false })}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -9,6 +9,7 @@ import RemoveIcon from '@material-ui/icons/Remove';
import AddIcon from '@material-ui/icons/Add';
import { DatePicker } from '@material-ui/pickers';
import * as R from 'ramda'
import Images from '../../../assets/Images';
const CustomCheckbox = withStyles({
root: {
......@@ -274,7 +275,7 @@ export default class AddUser extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
......@@ -8,6 +8,7 @@ import format from "date-fns/format";
import RemoveIcon from '@material-ui/icons/Remove';
import AddIcon from '@material-ui/icons/Add';
import * as R from 'ramda'
import Images from '../../../assets/Images';
const CustomCheckbox = withStyles({
root: {
......@@ -310,7 +311,7 @@ export default class EditUser extends Component {
className="btn btn-circle btn-white"
onClick={() => this.props.onClickClose()}
>
<i className="fa fa-lg fa-times" style={{ color: 'white' }} />
<img src={Images.close}/>
</button>
</div>
</div>
......
This diff is collapsed.
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