Commit e0cec4e0 authored by EKSAD's avatar EKSAD

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

parents 38e8b011 22820550
......@@ -1448,6 +1448,18 @@
"@babel/runtime": "^7.4.4"
}
},
"@material-ui/lab": {
"version": "4.0.0-alpha.56",
"resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.56.tgz",
"integrity": "sha512-xPlkK+z/6y/24ka4gVJgwPfoCF4RCh8dXb1BNE7MtF9bXEBLN/lBxNTK8VAa0qm3V2oinA6xtUIdcRh0aeRtVw==",
"requires": {
"@babel/runtime": "^7.4.4",
"@material-ui/utils": "^4.10.2",
"clsx": "^1.0.4",
"prop-types": "^15.7.2",
"react-is": "^16.8.0"
}
},
"@material-ui/pickers": {
"version": "3.2.10",
"resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.2.10.tgz",
......
......@@ -8,6 +8,7 @@
"@date-io/moment": "^2.8.0",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/pickers": "^3.2.10",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
......
......@@ -84,8 +84,17 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
const updateUnitBisnis = (body) => api.post('/business_unit/update_business_unit', body)
const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body)
// Perusahaan
const getPerusahaan = () => api.get('company/get_all_company')
const createPerusahaan = (body) => api.post('/company/create_company', body)
const updatePerusahaan = (body) => api.post('/company/update_company', body)
// APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
const getApprovedByAM = () => api.get('approval_matrix/get_all_approver')
const createAM = (body) => api.post('/approval_matrix/create_approval_matrix', body)
const updateAM = (body) => api.post('/approval_matrix/update_approval_matrix', body)
// ------
// STEP 3
......@@ -117,7 +126,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
createUnitBisnis,
updateUnitBisnis,
searchUnitBisnis,
getAM
getAM,
getPerusahaan,
createPerusahaan,
updatePerusahaan
getApprovedByAM,
createAM,
updateAM
}
}
......
......@@ -78,12 +78,6 @@ export default class ApprovalMatrix extends Component {
getData() {
api.create().getAM().then((response) => {
// console.log(response)
let datas = response.data.data
let listData = datas.map((item, index) => {
return [item.fullname ]
})
console.log(listData)
if(response.status == null){
alert(response.problem)
}
......@@ -127,6 +121,17 @@ export default class ApprovalMatrix extends Component {
// Delayed logic goes here
}
createAM = (payload) => {
this.setState({ visibleCreate: false })
api.create().createAM(payload).then(response => {
if (response.data.status == 'success') {
this.getData()
} else {
alert(response.data.message)
}
})
}
render() {
const columns = [{
name: "Action",
......@@ -366,6 +371,7 @@ export default class ApprovalMatrix extends Component {
<CreateApprovalMatrix
onClickClose={() => this.setState({ visibleCreate: false })}
data={this.state.listData}
createAM={this.createAM.bind(this)}
/>
)}
{this.state.visibleEdit && (
......
......@@ -126,7 +126,7 @@ export default class EditApprovalMatrix extends Component {
</div>
</div>
<div className="column-2">
<div className="" style={{ paddingTop: 4, paddingRight: 10, paddingBottom: 10, paddingLeft: 10, borderRadius: 5 }}>
<div className="" style={{ padding: 10, paddingLeft: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="type"
......@@ -134,7 +134,8 @@ export default class EditApprovalMatrix extends Component {
label="Tipe Persetujuan"
value={this.props.data.approval_type_name}
onChange={(e) => null}
selectProps={{
SelectProps={{
// native: true,
style: {
fontSize: 11
}
......
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