Commit d86e9c9a authored by Internship UKSW 2019's avatar Internship UKSW 2019

Initial commit

parent 005bde6a
......@@ -32,12 +32,27 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<style>
.footer {
position: fixed;
left: 0;
bottom: 0;
height: 35px;
width: 100%;
background-color: rgb(80, 80, 80);
color: white;
text-align: center;
}
</style>
<title>Document Management</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div class="footer">
<p class="py-1">(c) 2020 - PT Visionet Data Internasional</p>
</div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
......
public/logo-visionet.png

4.93 KB | W: | H:

public/logo-visionet.png

3.67 KB | W: | H:

public/logo-visionet.png
public/logo-visionet.png
public/logo-visionet.png
public/logo-visionet.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -8,6 +8,9 @@ export class DataTableApprovalDocument extends Component {
componentDidMount = () => {
this.$el = $(this.el)
var table = this.$el.DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.props.data,
columns: [
{ title: "No", width: 30 },
......
......@@ -7,6 +7,9 @@ export class DataTableHome extends Component {
componentDidMount = () => {
this.$el = $(this.el)
var table = this.$el.DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.props.data,
columns: [
{ title: "No", width: 30 },
......
......@@ -8,6 +8,9 @@ export class DataTableManageUser extends Component {
componentDidMount = () => {
this.$el = $(this.el)
var table = this.$el.DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.props.data,
columns: [
{ title: "No", width: 30 },
......
......@@ -8,6 +8,9 @@ export class DataTableMyDocument extends Component {
componentDidMount = () => {
this.$el = $(this.el)
var table = this.$el.DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.props.data,
columns: [
{ title: "No", width: 30 },
......
......@@ -9,6 +9,7 @@ import './DocumentManagement.css';
const $ = require('jquery');
$.DataTable = require('datatables.net');
var tableScope, tableReference;
class FormApprover extends Component {
constructor(props) {
......@@ -25,6 +26,8 @@ class FormApprover extends Component {
pageReject: false,
pageScope: false,
pageReference: false,
isTableScopeDraw: false,
isTableReferenceDraw: false,
dataRevisionHistory: [],
dataAuditTrail: [],
remark: "",
......@@ -223,9 +226,9 @@ class FormApprover extends Component {
}
}
if (checked) {
datarow.push(1);
datarow.push(dataDepartmentList[i].DepartmentCode[0] + "-" + dataDepartmentList[i].Department[0] + " true");
} else {
datarow.push(0);
datarow.push(dataDepartmentList[i].DepartmentCode[0] + "-" + dataDepartmentList[i].Department[0] + " false");
}
this.state.dataScopes.push(datarow);
}
......@@ -250,16 +253,18 @@ class FormApprover extends Component {
}
}
if (checked) {
datarow.push(1);
datarow.push(dataReferences[i].subject[0] + " true");
} else {
datarow.push(0);
datarow.push(dataReferences[i].subject[0] + " false");
}
datarow.push(dataReferences[i].subject[0]);
this.state.dataReferences.push(datarow);
}
}
}
var tableScope = $('#tableScope').DataTable({
tableScope = $('#tableScope').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataScopes,
columns: [
{ title: "Department" },
......@@ -277,11 +282,10 @@ class FormApprover extends Component {
orderable: false,
targets: 1,
render: function (data, type, row) {
return "<input type='checkbox' name='listAddScope[]' " + ((data == 1) ? "checked" : "") + " value='" + data + "'/>";
return "<input type='checkbox' name='listAddScope[]' " + ((data.includes("true")) ? "checked" : "") + " value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableScope.on("change", "input", function (e) {
e.preventDefault();
......@@ -303,17 +307,17 @@ class FormApprover extends Component {
let data = tableScope.row($(this).parents("tr")).data();
let listAddScope = document.getElementsByName("listAddScope[]");
for (let i = 0; i < listAddScope.length; i++) {
if (listAddScope[i].value == data[0]) {
if (listAddScope[i].value.includes(data[0])) {
if (listAddScope[i].checked) {
listAddScope[i].checked = false;
let j = self.state.copyScopes.indexOf(listAddScope[i].value);
let j = self.state.copyScopes.indexOf(data[0]);
self.state.copyScopes.splice(j, 1);
if (self.state.copyScopes.length == 0) {
self.state.validAddScope = false;
}
} else {
listAddScope[i].checked = true;
self.state.copyScopes.push(listAddScope[i].value);
self.state.copyScopes.push(data[0]);
self.state.validAddScope = true;
}
self.setState({ validAddScope: self.state.validAddScope });
......@@ -321,7 +325,10 @@ class FormApprover extends Component {
}
}
})
var tableReference = $('#tableReference').DataTable({
tableReference = $('#tableReference').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataReferences,
columns: [
{ title: "Code" },
......@@ -363,11 +370,10 @@ class FormApprover extends Component {
orderable: false,
targets: 4,
render: function (data, type, row) {
return "<input type='checkbox' name='listReference[]' " + ((data == 1) ? "checked" : "") + " value='" + data + "'/>";
return "<input type='checkbox' name='listReference[]' " + ((data.includes("true")) ? "checked" : "") + " value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableReference.on("change", "input", function (e) {
e.preventDefault();
......@@ -389,17 +395,17 @@ class FormApprover extends Component {
let data = tableReference.row($(this).parents("tr")).data();
let listReference = document.getElementsByName("listReference[]");
for (let i = 0; i < listReference.length; i++) {
if (listReference[i].value == data[1]) {
if (listReference[i].value.includes(data[1])) {
if (listReference[i].checked) {
listReference[i].checked = false;
let j = self.state.copyReferences.indexOf(listReference[i].value);
let j = self.state.copyReferences.indexOf(data[1]);
self.state.copyReferences.splice(j, 1);
if (self.state.copyReferences.length == 0) {
self.state.validAddReference = false;
}
} else {
listReference[i].checked = true;
self.state.copyReferences.push(listReference[i].value);
self.state.copyReferences.push(data[1]);
self.state.validAddReference = true;
}
self.setState({ validAddReference: self.state.validAddReference });
......@@ -941,12 +947,16 @@ class FormApprover extends Component {
}
}
}
changePageScope = () => {
changePageScope = async () => {
let clonePage = this.state.page.slice();
let clonePageScope = this.state.pageScope;
clonePage[2] = !this.state.page[2];
clonePageScope = !this.state.pageScope;
this.setState({ page: clonePage, pageScope: clonePageScope })
await this.setState({ page: clonePage, pageScope: clonePageScope })
if (!this.state.isTableScopeDraw) {
tableScope.columns.adjust().draw();
this.setState({ isTableScopeDraw: true });
}
}
//fungsi halaman add scope
handleSubmitScope = async () => {
......@@ -1013,12 +1023,16 @@ class FormApprover extends Component {
}
}
}
changePageReference = () => {
changePageReference = async () => {
let clonePage = this.state.page.slice();
let clonePageReference = this.state.pageReference;
clonePage[3] = !this.state.page[3];
clonePageReference = !this.state.pageReference;
this.setState({ page: clonePage, pageReference: clonePageReference });
await this.setState({ page: clonePage, pageReference: clonePageReference });
if (!this.state.isTableReferenceDraw) {
tableReference.columns.adjust().draw();
this.setState({ isTableReferenceDraw: true });
}
}
handleAddCode = (subject) => {
let code;
......
......@@ -6,6 +6,7 @@ import './DocumentManagement.css';
const $ = require('jquery');
$.DataTable = require('datatables.net');
var tableScope, tableReference;
class FormCreate extends Component {
constructor(props) {
......@@ -17,6 +18,8 @@ class FormCreate extends Component {
optionScopes: ["All Department"],
pageScope: false,
pageReference: false,
isTableScopeDraw: false,
isTableReferenceDraw: false,
businessUnit: JSON.parse(localStorage.getItem('dataLogin')).user_dpt[0],//doc
documentType: "",//doc
revisionCode: "R0",//doc
......@@ -91,7 +94,10 @@ class FormCreate extends Component {
this.state.dataReferences.push(datarow);
}
}
var tableScope = $('#tableScope').DataTable({
tableScope = $('#tableScope').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataScopes,
columns: [
{ title: "Department" },
......@@ -112,8 +118,7 @@ class FormCreate extends Component {
return "<input type='checkbox' name='listAddScope[]' value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableScope.on("change", "input", function (e) {
e.preventDefault();
......@@ -153,7 +158,10 @@ class FormCreate extends Component {
}
}
})
var tableReference = $('#tableReference').DataTable({
tableReference = $('#tableReference').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataReferences,
columns: [
{ title: "Code" },
......@@ -198,8 +206,7 @@ class FormCreate extends Component {
return "<input type='checkbox' name='listReference[]' value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableReference.on("change", "input", function (e) {
e.preventDefault();
......@@ -517,12 +524,16 @@ class FormCreate extends Component {
}
}
}
changePageScope = () => {
changePageScope = async () => {
let clonePage = this.state.page.slice();
let clonePageScope = this.state.pageScope;
clonePage[1] = !this.state.page[1];
clonePageScope = !this.state.pageScope;
this.setState({ page: clonePage, pageScope: clonePageScope })
await this.setState({ page: clonePage, pageScope: clonePageScope });
if (!this.state.isTableScopeDraw) {
tableScope.columns.adjust().draw();
this.setState({ isTableScopeDraw: true });
}
}
//fungsi halaman add scope
handleSubmitScope = async () => {
......@@ -589,12 +600,16 @@ class FormCreate extends Component {
}
}
}
changePageReference = () => {
changePageReference = async () => {
let clonePage = this.state.page.slice();
let clonePageReference = this.state.pageReference;
clonePage[2] = !this.state.page[2];
clonePageReference = !this.state.pageReference;
this.setState({ page: clonePage, pageReference: clonePageReference });
await this.setState({ page: clonePage, pageReference: clonePageReference });
if (!this.state.isTableReferenceDraw) {
tableReference.columns.adjust().draw();
this.setState({ isTableReferenceDraw: true });
}
}
handleAddCode = (subject) => {
let code;
......@@ -1119,9 +1134,7 @@ class FormCreate extends Component {
}
</div>
<div hidden={!this.state.pageScope}>
<div className="form-group">
<table className="display" width="100%" id="tableScope"></table>
</div>
<div className="form-group row">
<div className="col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right">
<Button color="danger" onClick={() => this.changePageScope()}>&nbsp;Cancel&nbsp;</Button> &nbsp;&nbsp;
......@@ -1181,9 +1194,7 @@ class FormCreate extends Component {
}
</div>
<div hidden={!this.state.pageReference}>
<div className="form-group">
<table className="display" width="100%" id="tableReference"></table>
</div>
<div className="form-group row">
<div className="col-xl-12 col-lg-12 col-md-12 col-sm-12 text-right">
<Button color="danger" onClick={() => this.changePageReference()}>&nbsp;Cancel&nbsp;</Button> &nbsp;&nbsp;
......
......@@ -91,7 +91,7 @@ class FormLogin extends Component {
return (
<div>
<Navbar color="dark" dark expand="lg">
<NavbarBrand href="/"><img src="logo-visionet.png" alt="visionet" width="140px" height="70px" /></NavbarBrand>
<NavbarBrand href="/"><img src="logo-visionet.png" alt="visionet" width="160px" height="45px"/></NavbarBrand>
</Navbar>
<div className="login-form">
<div className="container">
......
......@@ -9,6 +9,7 @@ import './DocumentManagement.css';
const $ = require('jquery');
$.DataTable = require('datatables.net');
var tableScope, tableReference;
class FormRevision extends Component {
constructor(props) {
......@@ -24,6 +25,8 @@ class FormRevision extends Component {
optionScopes: ["All Department"],
pageScope: false,
pageReference: false,
isTableScopeDraw: false,
isTableReferenceDraw: false,
dataRevisionHistory: [],
dataAuditTrail: [],
remark: "",
......@@ -129,7 +132,7 @@ class FormRevision extends Component {
if (revisionDate.includes("+00:00")) {
revisionDate = revisionDate.replace("+00:00", "");
}
if (dataRevision[dataRevision.length-1].status.includes("Waiting for Approval")) {
if (dataRevision[dataRevision.length - 1].status.includes("Waiting for Approval")) {
revisionDate = "-";
}
if (effectiveDate.includes("+00:00")) {
......@@ -218,9 +221,9 @@ class FormRevision extends Component {
}
}
if (checked) {
datarow.push(1);
datarow.push(dataDepartmentList[i].DepartmentCode[0] + "-" + dataDepartmentList[i].Department[0] + " true");
} else {
datarow.push(0);
datarow.push(dataDepartmentList[i].DepartmentCode[0] + "-" + dataDepartmentList[i].Department[0] + " false");
}
this.state.dataScopes.push(datarow);
}
......@@ -245,16 +248,18 @@ class FormRevision extends Component {
}
}
if (checked) {
datarow.push(1);
datarow.push(dataReferences[i].subject[0] + " true");
} else {
datarow.push(0);
datarow.push(dataReferences[i].subject[0] + " false");
}
datarow.push(dataReferences[i].subject[0]);
this.state.dataReferences.push(datarow);
}
}
}
var tableScope = $('#tableScope').DataTable({
tableScope = $('#tableScope').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataScopes,
columns: [
{ title: "Department" },
......@@ -272,11 +277,10 @@ class FormRevision extends Component {
orderable: false,
targets: 1,
render: function (data, type, row) {
return "<input type='checkbox' name='listAddScope[]' " + ((data == 1) ? "checked" : "") + " value='" + data + "'/>";
return "<input type='checkbox' name='listAddScope[]' " + ((data.includes("true")) ? "checked" : "") + " value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableScope.on("change", "input", function (e) {
e.preventDefault();
......@@ -298,17 +302,17 @@ class FormRevision extends Component {
let data = tableScope.row($(this).parents("tr")).data();
let listAddScope = document.getElementsByName("listAddScope[]");
for (let i = 0; i < listAddScope.length; i++) {
if (listAddScope[i].value == data[0]) {
if (listAddScope[i].value.includes(data[0])) {
if (listAddScope[i].checked) {
listAddScope[i].checked = false;
let j = self.state.copyScopes.indexOf(listAddScope[i].value);
let j = self.state.copyScopes.indexOf(data[0]);
self.state.copyScopes.splice(j, 1);
if (self.state.copyScopes.length == 0) {
self.state.validAddScope = false;
}
} else {
listAddScope[i].checked = true;
self.state.copyScopes.push(listAddScope[i].value);
self.state.copyScopes.push(data[0]);
self.state.validAddScope = true;
}
self.setState({ validAddScope: self.state.validAddScope });
......@@ -316,7 +320,10 @@ class FormRevision extends Component {
}
}
})
var tableReference = $('#tableReference').DataTable({
tableReference = $('#tableReference').DataTable({
scrollY: "250px",
scrollCollapse: true,
paging: false,
data: this.state.dataReferences,
columns: [
{ title: "Code" },
......@@ -358,11 +365,10 @@ class FormRevision extends Component {
orderable: false,
targets: 4,
render: function (data, type, row) {
return "<input type='checkbox' name='listReference[]' " + ((data == 1) ? "checked" : "") + " value='" + data + "'/>";
return "<input type='checkbox' name='listReference[]' " + ((data.includes("true")) ? "checked" : "") + " value='" + data + "'/>";
}
}
],
lengthMenu: [[25, 50, 75, 100], [25, 50, 75, 100]]
]
})
tableReference.on("change", "input", function (e) {
e.preventDefault();
......@@ -384,17 +390,17 @@ class FormRevision extends Component {
let data = tableReference.row($(this).parents("tr")).data();
let listReference = document.getElementsByName("listReference[]");
for (let i = 0; i < listReference.length; i++) {
if (listReference[i].value == data[1]) {
if (listReference[i].value.includes(data[1])) {
if (listReference[i].checked) {
listReference[i].checked = false;
let j = self.state.copyReferences.indexOf(listReference[i].value);
let j = self.state.copyReferences.indexOf(data[1]);
self.state.copyReferences.splice(j, 1);
if (self.state.copyReferences.length == 0) {
self.state.validAddReference = false;
}
} else {
listReference[i].checked = true;
self.state.copyReferences.push(listReference[i].value);
self.state.copyReferences.push(data[1]);
self.state.validAddReference = true;
}
self.setState({ validAddReference: self.state.validAddReference });
......@@ -687,12 +693,16 @@ class FormRevision extends Component {
}
}
}
changePageScope = () => {
changePageScope = async () => {
let clonePage = this.state.page.slice();
let clonePageScope = this.state.pageScope;
clonePage[2] = !this.state.page[2];
clonePageScope = !this.state.pageScope;
this.setState({ page: clonePage, pageScope: clonePageScope })
await this.setState({ page: clonePage, pageScope: clonePageScope });
if (!this.state.isTableScopeDraw) {
tableScope.columns.adjust().draw();
this.setState({ isTableScopeDraw: true });
}
}
//fungsi halaman add scope
handleSubmitScope = async () => {
......@@ -759,12 +769,16 @@ class FormRevision extends Component {
}
}
}
changePageReference = () => {
changePageReference = async () => {
let clonePage = this.state.page.slice();
let clonePageReference = this.state.pageReference;
clonePage[3] = !this.state.page[3];
clonePageReference = !this.state.pageReference;
this.setState({ page: clonePage, pageReference: clonePageReference });
await this.setState({ page: clonePage, pageReference: clonePageReference });
if (!this.state.isTableReferenceDraw) {
tableReference.columns.adjust().draw();
this.setState({ isTableReferenceDraw: true });
}
}
handleAddCode = (subject) => {
let code;
......
......@@ -132,7 +132,7 @@ class Navbar1 extends Component {
</div>
</div>
<Navbar color="dark" dark expand="lg">
<NavbarBrand href="#"><img src="logo-visionet.png" alt="visionet" width="140px" height="70px" /></NavbarBrand>
<NavbarBrand href="#"><img src="logo-visionet.png" alt="visionet" width="160px" height="45px" /></NavbarBrand>
<NavbarToggler onClick={this.toggle} />
<Collapse isOpen={this.state.isOpen} navbar>
<Nav className="mr-auto" navbar>
......
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