Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-disable react/no-direct-mutation-state */
- import React, {Component} from 'react';
- import {connect} from 'react-redux';
- import 'react-table/react-table.css';
- import { withTranslation } from 'react-i18next';
- import { toastr } from 'react-redux-toastr';
- import { Modal, ModalHeader } from 'reactstrap';
- import ReactLoading from 'react-loading';
- import { fileUpload } from '../../../../store/actions/uploadActions';
- import { fetchIncoterms } from '../../../../store/actions/master/incotermsActions';
- import { getProposalTender } from '../../../../store/actions/tendering/proposalTenderActions';
- import { getVendorQuotation, submitVendorQuotation, updateVendorQuotation, submitScoring, getScoring } from '../../../../store/actions/tendering/quotationActions';
- import { fetchPurchasingOrg } from '../../../../store/actions/master/purchasingOrgActions';
- import { compareSemanticVersions } from '../../../../helpers/globalHelper';
- import Form from './Form';
- import PaktaIntegritas from '../modal/PaktaIntegritas';
- import Numeric from '../modal/Numeric';
- import Pengalaman from '../modal/Pengalaman';
- import TenagaAhli from '../modal/TenagaAhli';
- import ModalAspekTeknis from '../modal/ModalSyaratItem';
- import { deleteProposalTenderSyaratItem, fetchProposalTenderSyaratItem, saveProposalTenderSyaratItem, showProposalTenderSyaratItem, updateProposalTenderSyaratItem } from '../../../../store/actions/tendering/proposalTenderSyaratItemActions';
- import SweetAlert from 'react-bootstrap-sweetalert';
- class QuotationDetail extends Component {
- constructor(props) {
- super(props);
- this._isMounted = false;
- this.state = {
- paramId: this.props.location.pathname.split("/")[4],
- paramType: this.props.location.pathname.split("/")[3],
- modalOpen: false,
- modalOpenNumeric: false,
- modalOpenPengalaman: false,
- modalOpenTenagaAhli: false,
- modalOpenSyaratItem: false,
- selectedTeknis: '',
- sendData: {},
- tempData: {},
- pakta_integritas: {
- sendData: {
- status_approval: '',
- },
- purchasing_org: {}
- },
- quotation: {
- header: {
- ambang_batas: '',
- approved_at: '',
- bid_bond: '',
- bid_bond_value: '',
- bobot_komersil: '',
- bobot_teknis: '',
- created_at: '',
- created_by: '',
- delivery_location: '',
- delivery_time: '',
- id: '',
- incoterm_id: '',
- lingkup_pekerjaan: '',
- masa_berlaku: '',
- metode_aanwijzing_id: '',
- metode_evaluasi: '',
- metode_negosiasi: '',
- metode_pengadaan_id: '',
- metode_penyampaian_id: '',
- metode_aanwijzing: '',
- metode_pengadaan: '',
- metode_penyampaian: '',
- multiwinner: '',
- note_external: '',
- note_internal: '',
- number: '',
- order_placement: '',
- pra_qualification: '',
- purchasing_group_id: '',
- purchasing_org_id: '',
- purchasing_org_name: '',
- reference: '',
- status: '',
- status_aanwijzing: '',
- status_text: '',
- title: '',
- updated_at: '',
- updated_by: '',
- uuid: '',
- visibilitas_bid_open: '',
- current_step: '',
- company_name: '',
- },
- attachments: [],
- items: [],
- schedules: [],
- terms: [],
- errors: [],
- m_incoterm: [],
- tempQuotes: [],
- form_teknis: [],
- },
- loadings: {
- button: false,
- modal: false,
- pages: false,
- items: false,
- incoterm: false,
- buttonUpload: false,
- syarat_item_fetching: false,
- syarat_item_creating: false,
- syarat_item_getting: false,
- syarat_item_updating: false,
- syarat_item_deleting: false,
- syarat_item_getting_uuid: null,
- syarat_item_updating_uuid: null,
- syarat_item_deleting_uuid: null,
- },
- syarat_item_list: [],
- syarat_item_detail: {},
- swal: {
- show: false,
- type: null,
- uuid: null,
- }
- }
- }
- componentDidMount = () => {
- this._isMounted = true;
- if(this._isMounted){
- this.getProposalTender(this.state.paramId)
- this.fetchIncoterms('')
- this.fetchSyaratItem();
- }
- }
- componentWillUnmount() {
- this._isMounted = false;
- // fix Warning: Can't perform a React state update on an unmounted component
- this.setState = (state,callback)=>{
- return;
- };
- }
- fetchIncoterms = (params) => {
- if(this._isMounted){
- let select_params = (params !== '') ? {select: params} : {start: 0, length: 10};
- this.setState(({ loadings, quotation }) => ({
- loadings: { ...loadings, incoterm: true },
- quotation: { ...quotation, m_incoterm: [] }
- }));
- const resp = {
- "status": "success",
- "message": "Berhasil mendapatkan data.",
- "draw": 0,
- "recordsTotal": 2,
- "recordsFiltered": 2,
- "data": [
- {
- "id": "FOT",
- "uuid": "846f47a5-525e-4647-92f3-6a0865406b6b",
- "name": "FOT",
- "status": "y",
- "created_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "updated_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "created_at": "2021-12-15 08:42:12",
- "updated_at": "2021-12-15 08:42:12"
- },
- {
- "id": "FRA",
- "uuid": "854e9805-9d47-4fd0-a76b-759936205e69",
- "name": "FRANCO",
- "status": "y",
- "created_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "updated_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "created_at": "2021-12-15 08:42:02",
- "updated_at": "2021-12-15 08:42:02"
- }
- ],
- "queries": [
- {
- "query": "select count(*) as aggregate from \"incoterms\"",
- "bindings": [],
- "time": 0.54
- },
- {
- "query": "select count(*) as aggregate from \"incoterms\"",
- "bindings": [],
- "time": 0.24
- },
- {
- "query": "select * from \"incoterms\" order by \"id\" asc limit 10 offset 0",
- "bindings": [],
- "time": 0.38
- }
- ],
- "input": {
- "start": "0",
- "length": "10"
- }
- }
- // this.props.fetchIncoterms(select_params)
- // .then((resp) => {
- let m_incoterm = resp.data;
- let options = m_incoterm.map((dt) => {
- return { value: dt.id, label: dt.id+' - '+dt.name };
- })
- this.setState(({ loadings, quotation }) => ({
- loadings: { ...loadings, incoterm: false },
- quotation: { ...quotation, m_incoterm: options }
- }));
- // })
- // .catch((resp) => {
- // this.setState(({ loadings, quotation }) => ({
- // loadings: { ...loadings, incoterm: false },
- // quotation: { ...quotation, m_incoterm: [] }
- // }));
- // toastr.error(resp.data.status, resp.data.message);
- // });
- }
- }
- getProposalTender = (uuid, params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, items: true, button: true } }));
- // this.props.getProposalTender(uuid, params)
- const resp = {
- "status": "success",
- "message": "Berhasil mendapatkan data.",
- "data": {
- "id": 14,
- "uuid": "eea15423-3176-4023-9d05-613099822e0d",
- "title": "Biaya Pendampingan",
- "number": "PT/A000/202209/00009",
- "reference": null,
- "metode_pengadaan_id": 2,
- "pra_qualification": 0,
- "metode_aanwijzing_id": 2,
- "metode_penyampaian_id": "2s",
- "metode_evaluasi": "sistem_nilai",
- "metode_negosiasi": "non_auction",
- "order_placement": "paket",
- "multiwinner": "0",
- "bid_bond": "0",
- "bid_bond_value": null,
- "incoterm_id": "FOT",
- "visibilitas_bid_open": "privat",
- "delivery_location": "PPA",
- "masa_berlaku": 3,
- "delivery_time": 30,
- "lingkup_pekerjaan": null,
- "note_internal": null,
- "note_external": null,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "575992a8-6d47-4865-9765-748c42cab120",
- "created_at": "2022-09-09 09:01:12",
- "updated_at": "2022-09-10 06:41:43",
- "status_text": null,
- "bobot_teknis": "70",
- "bobot_komersil": "30",
- "ambang_batas": "60.00",
- "approved_at": "2022-09-10 06:41:43",
- "status_aanwijzing": null,
- "purchasing_org_id": "A000",
- "purchasing_group_id": "S01",
- "pq_start_date": null,
- "pq_end_date": null,
- "pq_start_time": null,
- "pq_end_time": null,
- "bid_administrasi": null,
- "bid_comersil": null,
- "pq_status": "d",
- "note_aanwijzing": null,
- "is_retender": "n",
- "retender_file": null,
- "retender_note": null,
- "bid_opening_bapp": null,
- "status_bo_task": null,
- "evaadmin_date": null,
- "evatek_date": null,
- "evakom_date": null,
- "bid_opening_date": null,
- "link_conference": "meet.google.com",
- "registration_status": "register",
- "attachments": [
- {
- "id": 64,
- "uuid": "8aeaef21-c401-457c-afdf-157bf3ef5bbd",
- "proposal_tender_id": 14,
- "purchasing_requisition_attachment_id": 33,
- "share": "0",
- "status": "d",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "type": "7",
- "description": "TOR-3",
- "file": "download2_1662710176.pdf",
- "document_number": "TOR-3",
- "document_date": "2022-07-30",
- "type_name": "TOR",
- "is_internal": "i"
- },
- {
- "id": 65,
- "uuid": "9265c585-b184-45dc-8c2c-7218ef5c2a1e",
- "proposal_tender_id": 14,
- "purchasing_requisition_attachment_id": 32,
- "share": "0",
- "status": "d",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "type": "6",
- "description": "DOkumen HPS 3",
- "file": "download3_1662710139.pdf",
- "document_number": "HPS-03",
- "document_date": "2022-07-30",
- "type_name": "OE/HPS",
- "is_internal": "i"
- },
- {
- "id": 66,
- "uuid": "b4135650-f684-4423-87b4-7253c3b3df25",
- "proposal_tender_id": 14,
- "purchasing_requisition_attachment_id": 31,
- "share": "0",
- "status": "d",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "type": "1",
- "description": "Dokumen memo 3",
- "file": "contoh_dokumen_upload_1662710084.pdf",
- "document_number": "Memo-03",
- "document_date": "2022-07-30",
- "type_name": "MEMO",
- "is_internal": "i"
- }
- ],
- "items": [
- {
- "id": 53,
- "uuid": "a1e7d0de-5abb-4158-b057-adad7d555510",
- "proposal_tender_id": 14,
- "purchasing_requisition_item_id": 153,
- "status": "y",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "purchasing_requisition_id": 62,
- "qty": 1,
- "purchase_requisition_service_id": null,
- "is_retender_itemize": null,
- "retender_approved_at": null,
- "note": null,
- "file": null,
- "retender_approved_by": null,
- "number_pr": "122000566",
- "pr_item_id": 153,
- "pr_item_uuid": "2703d962-e7af-48a5-9b65-15fa215d25e8",
- "item_no": 1,
- "material_id": "277",
- "short_text": "Baiya Pendampingan",
- "material_group_id": null,
- "material_group_name": null,
- "plant_id": "S101",
- "uom": "Currency",
- "per": 1,
- "tipe": "barang",
- "valuation_price": 150000000,
- "currency": "IDR",
- "long_text": null,
- "pr_status": "s",
- "pr_catatan_buyer": null,
- "total_price": "150000000.0000000000000000000000"
- }
- ],
- "edoc": [],
- "aanwijzing_attachment": [],
- "terms": [
- {
- "id": 164,
- "uuid": "31de01f7-93f0-4118-8018-0932db708b12",
- "proposal_tender_id": 14,
- "description": "Scoring",
- "bobot": null,
- "tipe": "2",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "19",
- "template_syarat_parent_id": null,
- "sub": null,
- "template_syarat_id": null,
- "tearing": []
- }
- ],
- "form_teknis": [
- {
- "id": 146,
- "uuid": "d12310c6-3161-489f-89af-25359d226d3a",
- "proposal_tender_id": 14,
- "description": "Pengalaman Perusahaan yang manufaktur dan galangan BUMN atau perusahaan Swasta dalam kurun waktu 3 (tiga) tahun terakhir",
- "bobot": null,
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "1",
- "template_syarat_parent_id": null,
- "sub": "1",
- "template_syarat_id": 196,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 2,
- "pengalaman": []
- },
- {
- "id": 147,
- "uuid": "c6c73ce2-33ae-416e-beb0-34b091e92ad0",
- "proposal_tender_id": 14,
- "description": "Pengalaman perusahaan di BUMN dan/atau anak perusahaan BUMN dalam 3 Tahun terakhir (terhitung sejak 2018)",
- "bobot": "12.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "7",
- "order_no": "1",
- "template_syarat_parent_id": 196,
- "sub": "1.1",
- "template_syarat_id": 197,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 148,
- "uuid": "0f43203d-f4b9-459a-9f58-3267276a995a",
- "proposal_tender_id": 14,
- "description": "Pengalaman perusahaan di perusahaan Swasta dalam 3 Tahun terakhir (terhitung sejak 2018)",
- "bobot": "8.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "5",
- "order_no": "2",
- "template_syarat_parent_id": 196,
- "sub": "1.2",
- "template_syarat_id": 198,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 149,
- "uuid": "184621ba-f4a1-4757-af42-588ac6b74417",
- "proposal_tender_id": 14,
- "description": "Kemampuan dan Jumlah Kecukupan Tenaga Ahli",
- "bobot": "60.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "2",
- "template_syarat_parent_id": null,
- "sub": "2",
- "template_syarat_id": 199,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 3,
- "pengalaman": []
- },
- {
- "id": 150,
- "uuid": "9ac0fff3-814d-45aa-a0d4-f19173777f13",
- "proposal_tender_id": 14,
- "description": "Jumlah Pengalaman Tenaga Ahli Engagement Partner",
- "bobot": null,
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "1",
- "template_syarat_parent_id": 199,
- "sub": "2.1",
- "template_syarat_id": 200,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 3,
- "pengalaman": []
- },
- {
- "id": 151,
- "uuid": "65b7eb34-e8f1-4de8-b89d-06093b3648d9",
- "proposal_tender_id": 14,
- "description": "Jumlah Tenaga Ahli Engagement Partner yang didedikasikan dalam proyek ini",
- "bobot": "7.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "4",
- "order_no": "1",
- "template_syarat_parent_id": 200,
- "sub": "2.1.1",
- "template_syarat_id": 201,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 152,
- "uuid": "d6a18b0a-08d5-43f8-a741-088bd31f0ead",
- "proposal_tender_id": 14,
- "description": "Lama Pengalaman Kerja (Tahun)",
- "bobot": "8.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "5",
- "order_no": "2",
- "template_syarat_parent_id": 200,
- "sub": "2.1.2",
- "template_syarat_id": 202,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 153,
- "uuid": "a065a50c-8e78-4099-9b14-f9f1df92f32a",
- "proposal_tender_id": 14,
- "description": "Jumlah Keterlibatan sebagai Agen Pemantau penerbit surat utang yang diterbitkan",
- "bobot": "13.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "8",
- "order_no": "3",
- "template_syarat_parent_id": 200,
- "sub": "2.1.3",
- "template_syarat_id": 203,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 154,
- "uuid": "df49ca20-faa3-4713-91d4-e2b9c5848d4a",
- "proposal_tender_id": 14,
- "description": "Jumlah Pengalaman Tenaga Ahli Senior Associate",
- "bobot": null,
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "2",
- "template_syarat_parent_id": 199,
- "sub": "2.2",
- "template_syarat_id": 204,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 3,
- "pengalaman": []
- },
- {
- "id": 155,
- "uuid": "2e27d79c-cc61-41ef-822d-d44408c8febe",
- "proposal_tender_id": 14,
- "description": "Jumlah Tenaga Ahli Senior Associate yang didedikasikan dalam proyek ini",
- "bobot": "5.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "3",
- "order_no": "1",
- "template_syarat_parent_id": 204,
- "sub": "2.2.1",
- "template_syarat_id": 205,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 156,
- "uuid": "51e75db5-a01e-49ca-899f-9aef46d1bcc8",
- "proposal_tender_id": 14,
- "description": "Lama Pengalaman Kerja (Tahun)",
- "bobot": "7.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "4",
- "order_no": "2",
- "template_syarat_parent_id": 204,
- "sub": "2.2.2",
- "template_syarat_id": 206,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 157,
- "uuid": "3ee21025-1a64-470f-af1a-7a28ee55b76e",
- "proposal_tender_id": 14,
- "description": "Jumlah Keterlibatan sebagai Agen Pemantau penerbit surat utang yang diterbitkan",
- "bobot": "7.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "4",
- "order_no": "3",
- "template_syarat_parent_id": 204,
- "sub": "2.2.3",
- "template_syarat_id": 208,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 158,
- "uuid": "2f3182ed-d123-47ef-a4a1-89087a83ac18",
- "proposal_tender_id": 14,
- "description": "Jumlah Pengalaman Junior Associate",
- "bobot": null,
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "3",
- "template_syarat_parent_id": 199,
- "sub": "2.3",
- "template_syarat_id": 209,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 3,
- "pengalaman": []
- },
- {
- "id": 159,
- "uuid": "6f938e7f-ea6d-4579-af7a-65b48434714e",
- "proposal_tender_id": 14,
- "description": "Jumlah Junior Associate yang didedikasikan dalam proyek ini",
- "bobot": "3.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "2",
- "order_no": "1",
- "template_syarat_parent_id": 209,
- "sub": "2.3.1",
- "template_syarat_id": 210,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 160,
- "uuid": "b4f8568f-9505-4928-a3b7-923f931d26ff",
- "proposal_tender_id": 14,
- "description": "Lama Pengalaman Kerja (Tahun)",
- "bobot": "3.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "2",
- "order_no": "2",
- "template_syarat_parent_id": 209,
- "sub": "2.3.2",
- "template_syarat_id": 211,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 161,
- "uuid": "e6bbfec6-8750-43ba-99e3-140a08397ace",
- "proposal_tender_id": 14,
- "description": "Jumlah Keterlibatan sebagai Agen Pemantau penerbit surat utang yang diterbitkan",
- "bobot": "7.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "4",
- "order_no": "3",
- "template_syarat_parent_id": 209,
- "sub": "2.3.3",
- "template_syarat_id": 212,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 162,
- "uuid": "5ee3ef0f-40d0-4c85-abf0-b88be3626e85",
- "proposal_tender_id": 14,
- "description": "Metodologi (bila diperlukan beauty contest)",
- "bobot": "20.00",
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "12",
- "order_no": "3",
- "template_syarat_parent_id": null,
- "sub": "3",
- "template_syarat_id": 213,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- },
- {
- "id": 163,
- "uuid": "94cefba5-d8a9-414a-bdb9-44134d52984c",
- "proposal_tender_id": 14,
- "description": "Lain-lain",
- "bobot": null,
- "tipe": "4",
- "attachment": "n",
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 05:08:33",
- "template_tipe_input": "numeric",
- "tampilkan_sub": "n",
- "passing_grade": "0",
- "order_no": "4",
- "template_syarat_parent_id": null,
- "sub": "4",
- "template_syarat_id": 228,
- "nilai": null,
- "scoring_teknis_id": null,
- "child_count": 0,
- "pengalaman": []
- }
- ],
- "kemampuan_pasok": [
- {
- "material_group": null,
- "sos_item": null,
- "sos_header": null,
- "buyer_name": "",
- "purchasing_org_name": null,
- "company_name": null
- }
- ],
- "status_bid_opening": [
- {
- "registration_status": "register",
- "registration_note": null,
- "registration_quotation": "register",
- "registration_quotation_note": null,
- "buyer_name": "",
- "purchasing_org_name": null,
- "company_name": null
- }
- ],
- "bid_opening": [],
- "evaluasi": [],
- "uuid_negosiasi": null,
- "negosiasi": [],
- "awarding": [],
- "awarding_status": "d",
- "awarding_status_text": "open",
- "berita_acara": [],
- "bo_start_date": {
- "id": 388,
- "uuid": "d745cddb-cb3d-478e-94e8-5d3dcc94b7d9",
- "jadwal_tender_id": 8,
- "jadwal_tender_name": "Quotation",
- "start_date": "2022-09-10",
- "end_date": "2022-09-10",
- "start_time": "05:01:00",
- "end_time": "19:00:00",
- "proposal_tender_id": 14,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 06:49:04",
- "jadwal_tender_code": "JT004"
- },
- "vendor_nego": [],
- "dokumen_pakta_integritas": {
- "vendor_id": "00000090",
- "file": "Dokumen_tes_1662692951.pdf",
- "status_approval": "setuju",
- "buyer_name": "",
- "purchasing_org_name": null,
- "company_name": null
- },
- "aanwijzing_ba": [],
- "buyer_name": "Parlindungan Nasution",
- "purchasing_org_name": "PT. Perusahaan Pengelolaan Aset",
- "company_name": "PT. Perusahaan Pengelolaan Aset",
- "schedules": [
- {
- "id": 385,
- "uuid": "d9db6588-eefb-4207-a5a3-00c361b40c37",
- "jadwal_tender_id": 5,
- "jadwal_tender_name": "Pengumuman",
- "start_date": "2022-09-10",
- "end_date": "2022-09-10",
- "start_time": "05:01:00",
- "end_time": "19:00:00",
- "proposal_tender_id": 14,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 06:44:21",
- "jadwal_tender_code": "JT001"
- },
- {
- "id": 386,
- "uuid": "484d9272-2925-49a2-8cb1-35ae2ee724ae",
- "jadwal_tender_id": 6,
- "jadwal_tender_name": "Registrasi",
- "start_date": "2022-09-10",
- "end_date": "2022-09-10",
- "start_time": "05:01:00",
- "end_time": "19:00:00",
- "proposal_tender_id": 14,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 06:46:22",
- "jadwal_tender_code": "JT002"
- },
- {
- "id": 387,
- "uuid": "e6f49804-50de-4e1e-aa95-19f3f22ca06f",
- "jadwal_tender_id": 7,
- "jadwal_tender_name": "Aanwijzing",
- "start_date": "2022-09-10",
- "end_date": "2022-09-10",
- "start_time": "05:01:00",
- "end_time": "19:00:00",
- "proposal_tender_id": 14,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 06:47:57",
- "jadwal_tender_code": "JT003"
- },
- {
- "id": 388,
- "uuid": "d745cddb-cb3d-478e-94e8-5d3dcc94b7d9",
- "jadwal_tender_id": 8,
- "jadwal_tender_name": "Quotation",
- "start_date": "2022-09-10",
- "end_date": "2022-09-10",
- "start_time": "05:01:00",
- "end_time": "19:00:00",
- "proposal_tender_id": 14,
- "status": "y",
- "created_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "updated_by": "95c5901d-0ae6-4ff9-ada4-6d6b4afc1516",
- "created_at": "2022-09-10 05:08:33",
- "updated_at": "2022-09-10 06:49:04",
- "jadwal_tender_code": "JT004"
- }
- ],
- "panitia_pengadaans": [],
- "metode_pengadaan": {
- "id": 2,
- "uuid": "b29e0737-756b-46d1-ad82-50a07d9ba812",
- "name": "Tender/Seleksi Terbatas",
- "status": "y",
- "created_by": null,
- "updated_by": null,
- "created_at": null,
- "updated_at": null,
- "tender_umum": "n",
- "kuorum": 2,
- "pra_qualification": "y",
- "company_id": "A000",
- "max_limit": null,
- "company_name": "PT. Perusahaan Pengelolaan Aset",
- "created_by_name": "",
- "updated_by_name": ""
- },
- "metode_aanwijzing": {
- "id": 2,
- "uuid": "0f63c333-893a-4132-833e-be6a67eb8e87",
- "name": "Aanwijzing Video Conference",
- "status": "y",
- "created_by": null,
- "updated_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "created_at": null,
- "updated_at": "2022-02-25 08:22:33"
- },
- "metode_penyampaian": {
- "id": "2s",
- "uuid": "a13ee79a-a534-4f92-9293-2a55ba0e699c",
- "name": "2 Amplop",
- "status": "y",
- "created_by": null,
- "updated_by": "77eea109-8f81-4996-aad2-e34ad11b4e42",
- "created_at": null,
- "updated_at": "2022-06-06 09:36:27"
- }
- }
- }
- // .then((resp) => {
- const data = resp.data;
- const setHeader = {...this.state.quotation.header}
- setHeader.ambang_batas = data.ambang_batas;
- setHeader.approved_at = data.approved_at;
- setHeader.bid_bond = data.bid_bond;
- setHeader.bid_bond_value = data.bid_bond_value;
- setHeader.bobot_komersil = data.bobot_komersil;
- setHeader.bobot_teknis = data.bobot_teknis;
- setHeader.created_at = data.created_at;
- setHeader.created_by = data.created_by;
- setHeader.delivery_location = data.delivery_location;
- setHeader.delivery_time = data.delivery_time;
- setHeader.id = data.id;
- setHeader.incoterm_id = data.incoterm_id;
- setHeader.lingkup_pekerjaan = data.lingkup_pekerjaan;
- setHeader.masa_berlaku = data.masa_berlaku;
- setHeader.metode_aanwijzing_id = data.metode_aanwijzing_id;
- setHeader.metode_evaluasi = data.metode_evaluasi;
- setHeader.metode_negosiasi = data.metode_negosiasi;
- setHeader.metode_pengadaan_id = data.metode_pengadaan_id;
- setHeader.metode_penyampaian_id = data.metode_penyampaian_id;
- setHeader.multiwinner = data.multiwinner;
- setHeader.note_external = data.note_external;
- setHeader.note_internal = data.note_internal;
- setHeader.number = data.number;
- setHeader.order_placement = data.order_placement;
- setHeader.pra_qualification = data.pra_qualification;
- setHeader.purchasing_group_id = data.purchasing_group_id;
- setHeader.purchasing_org_id = data.purchasing_org_id;
- setHeader.purchasing_org_name = data.purchasing_org_name;
- setHeader.reference = data.reference;
- setHeader.status = data.status;
- setHeader.status_aanwijzing = data.status_aanwijzing;
- setHeader.status_text = data.status_text;
- setHeader.title = data.title;
- setHeader.updated_at = data.updated_at;
- setHeader.updated_by = data.updated_by;
- setHeader.uuid = data.uuid;
- setHeader.visibilitas_bid_open = data.visibilitas_bid_open;
- setHeader.metode_aanwijzing = data.metode_aanwijzing;
- setHeader.metode_pengadaan = data.metode_pengadaan;
- setHeader.metode_penyampaian = data.metode_penyampaian;
- setHeader.current_step = data.current_step;
- setHeader.company_name = data.company_name;
- setHeader.link_conference = data.link_conference;
- let arr = [];
- let terms_arr = [];
- if(data.items.length > 0){
- data.items.sort((a,b) => a.proposal_tender_item_id-b.proposal_tender_item_id).sort((a,b) => a.purchasing_requisition_item_id-b.purchasing_requisition_item_id).forEach((item, key) => {
- const obj = {
- id: item.pr_item_id,
- value: '',
- child: (item.service_lines && item.service_lines.length > 0) ?
- item.service_lines.map(child => {
- return {
- id: child.purchasing_requisition_item_id,
- uuid: child.uuid,
- value: ''
- }
- })
- : []
- }
- arr.push(obj)
- })
- }
- if(data.metode_penyampaian_id === '2t' && parseInt(data.current_step) === 1){
- if(data.terms.length > 0){
- data.terms.forEach((item, key) => {
- if(item.tipe !== '6'){
- terms_arr.push(item)
- }
- })
- }
- } else {
- terms_arr = data.terms;
- }
- const newFormTeknis = [];
- // console.log("form_teknis", data.form_teknis);
- if(data.form_teknis && data.form_teknis.length > 0){
- data.form_teknis.forEach(item => {
- const pengalaman = item.template_tipe_input !== null && item.template_tipe_input === "numeric" ? [{
- template_tipe_input: item.template_tipe_input,
- proposal_tender_syarat_id: item.id,
- numeric: isNaN(parseInt(item.nilai)) ? 0 : parseInt(item.nilai)
- }] : item?.pengalaman;
- const propertyValues = Array.isArray(pengalaman) ? pengalaman : Object.values(pengalaman);
- newFormTeknis.push({
- attachment: item.attachment,
- bobot: item.bobot,
- created_at: item.created_at,
- created_by: item.created_by,
- description: item.description,
- nilai: item.nilai,
- id: item.id,
- order_no: item.order_no,
- passing_grade: item.passing_grade,
- proposal_tender_id: item.proposal_tender_id,
- status: item.status,
- sub: item.sub,
- sub_order: item.sub !== undefined && item.sub !== null && item.sub !== '' ? item.sub.length > 1 ? `${item.sub}.0` : `${item.sub}.0` : '',
- tampilkan_sub: item.tampilkan_sub,
- template_syarat_id: item.template_syarat_id,
- template_syarat_parent_id: item.template_syarat_parent_id,
- template_tipe_input: item.template_tipe_input,
- tipe: item.tipe,
- updated_at: item.updated_at,
- updated_by: item.updated_by,
- uuid: item.uuid,
- aspek_teknis: propertyValues,
- })
- })
- }
- this.setState(({ loadings, quotation }) => ({
- loadings: { ...loadings, button: false, items: false },
- quotation : {
- ...quotation,
- errors: [],
- items: data.items.sort((a,b) => a.proposal_tender_item_id-b.proposal_tender_item_id).sort((a,b) => a.purchasing_requisition_item_id-b.purchasing_requisition_item_id),
- schedules: data.schedules,
- terms: terms_arr,
- attachments: data.attachments,
- form_teknis: newFormTeknis.sort(compareSemanticVersions('sub_order')),
- header: setHeader,
- tempQuotes: arr
- }
- }), () => {
- this.fetchPurchasingOrg({id: data.purchasing_org_id})
- if(this.state.paramType === 'update'){
- this.getVendorQuotation(this.state.paramId)
- }
- });
- // })
- // .catch((resp) => {
- // this.setState(({ loadings }) => ({ loadings: { ...loadings, items: false, button: false } }));
- // toastr.error(resp.data.status, resp.data.message);
- // });
- }
- }
- getVendorQuotation = (uuid, params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: true, items: true } }));
- this.props.getVendorQuotation(uuid, params)
- .then((resp) => {
- let arr = [];
- let arr_quotes = [];
- toastr.success(resp.data.status, resp.data.message);
- const data = resp.data.data;
- if(data.items.length > 0){
- data.items.sort((a,b) => a.proposal_tender_item_id-b.proposal_tender_item_id).sort((a,b) => a.purchasing_requisition_item_id-b.purchasing_requisition_item_id).forEach((item, key) => {
- // const pt_items = this.state.quotation.items.filter( i => i.pr_item_id === item.purchasing_requisition_item_id)
- const obj = {
- created_at: item.created_at,
- created_by: item.created_by,
- delivery_time: item.delivery_time,
- id: item.id,
- proposal_tender_item_id: item.proposal_tender_item_id,
- purchasing_requisition_item_id: item.purchasing_requisition_item_id,
- proposal_tender_item_uuid: item.proposal_tender_item_uuid,
- qty: item.qty,
- quotation_id: item.quotation_id,
- quote: item.quote,
- remark: item.remark,
- long_text: item.spesifikasi,
- short_text: item.short_text,
- uom: item.uom,
- status: item.status,
- updated_at: item.updated_at,
- updated_by: item.updated_by,
- uuid: item.uuid,
- valuation_price: item.valuation_price,
- service_lines: item.services_lines !== undefined ? item.services_lines.length > 0 ? item.services_lines : [] : [],
- tipe: item.services_lines !== undefined ? item.services_lines.length > 0 ? 'jasa' : 'barang' : 'barang',
- }
- arr.push(obj)
- const objQuote = {
- id: item.purchasing_requisition_item_id,
- value: item.quote,
- child: item.services_lines !== undefined ?
- item.services_lines.length > 0 ?
- item.services_lines.map(child => {
- return {
- id: child.purchasing_requisition_item_id,
- uuid: child.uuid,
- value: item.quote
- }
- })
- : []
- : []
- }
- arr_quotes.push(objQuote)
- })
- }
- this.setState(({ loadings, tempData, quotation }) => ({
- loadings: { ...loadings, button: false, items: false },
- quotation : {
- ...quotation,
- tempQuotes: arr_quotes
- },
- tempData : {
- ...tempData,
- errors: [],
- bidbond: data.bidbond,
- bidbond_file: data.bidbond_file,
- bidbond_validity: data.bidbond_validity,
- date: data.date,
- location: data.location,
- note: data.note,
- number: data.number,
- validity: data.validity,
- incoterm_id: (data.incoterm_id===null) ? null : {value: data.incoterm_id, label: `${data.incoterm_id} - ${data.incoterm_name}`},
- items: arr.sort((a,b) => a.proposal_tender_item_id-b.proposal_tender_item_id).sort((a,b) => a.purchasing_requisition_item_id-b.purchasing_requisition_item_id),
- terms: data.attachments,
- }
- }));
- })
- .catch((resp) => {
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false }, sendData: {} }));
- toastr.error(resp.data.status, resp.data.message);
- this.props.history.push(`/task-vendor/quotation`)
- });
- }
- }
- fetchPurchasingOrg = (params) => {
- if(this._isMounted){
- // this.props.fetchPurchasingOrg(params)
- const resp = {
- "status": "success",
- "message": "Berhasil mendapatkan data.",
- "draw": 0,
- "recordsTotal": 0,
- "recordsFiltered": 0,
- "data": [],
- "queries": [
- {
- "query": "select count(*) as aggregate from (select * from (select \"purchasing_orgs\".*, \"companies\".\"name\" as \"company_name\" from \"purchasing_orgs\" left join \"companies\" on \"purchasing_orgs\".\"company_id\" = \"companies\".\"id\" order by \"purchasing_orgs\".\"id\" asc) as purchasing_orgs where \"company_id\" is null) count_row_table",
- "bindings": [],
- "time": 1
- },
- {
- "query": "select * from (select \"purchasing_orgs\".*, \"companies\".\"name\" as \"company_name\" from \"purchasing_orgs\" left join \"companies\" on \"purchasing_orgs\".\"company_id\" = \"companies\".\"id\" order by \"purchasing_orgs\".\"id\" asc) as purchasing_orgs where \"company_id\" is null",
- "bindings": [],
- "time": 0.43
- }
- ],
- "input": {
- "id": "A000"
- }
- }
- // .then((resp) => {
- const data = resp.data[0]
- this.setState(({ pakta_integritas }) => ({ pakta_integritas: { ...pakta_integritas, purchasing_org: data } }));
- // })
- // .catch((resp) => {
- // const errors = resp.data.errors;
- // if(errors){
- // var msg = Object.keys(errors).map((key) => { return <li key={key}>{errors[key]}</li> });
- // const toastr_msg = {component: ( <React.Fragment><ul>{msg}</ul></React.Fragment> )};
- // if(typeof errors === 'string'){ toastr.error(resp.data.message, errors); } else { toastr.error(resp.data.message, toastr_msg); }
- // } else {
- // toastr.error(resp.data.message);
- // }
- // });
- }
- }
- submitVendorQuotation = (params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: true } }));
- this.props.submitVendorQuotation(this.state.paramId, params)
- .then((resp) => {
- toastr.success(resp.data.status, resp.data.message);
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false }, modalOpen: false, sendData: {} }));
- this.props.history.push(`/task-vendor/quotation`)
- })
- .catch((resp) => {
- this.setState(({ loadings, quotation }) => (
- {
- loadings: { ...loadings, button: false, errors: resp.data.errors },
- quotation: { ...quotation, errors: (resp.data.errors===undefined ? [] : resp.data.errors) },
- modalOpen: false,
- sendData: {}
- }
- ));
- const errors = resp.data.errors;
- if(errors){
- var msg = Object.keys(errors).map((key) => { return <li key={key}>{errors[key]}</li> });
- const toastr_msg = {component: ( <React.Fragment><ul>{msg}</ul></React.Fragment> )};
- if(typeof errors === 'string'){ toastr.error(resp.data.message, errors); } else { toastr.error(resp.data.message, toastr_msg); }
- } else {
- toastr.error(resp.data.message);
- }
- });
- }
- }
- updateVendorQuotation = (params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: true } }));
- this.props.updateVendorQuotation(this.state.paramId, params)
- .then((resp) => {
- toastr.success(resp.data.status, resp.data.message);
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false }, modalOpen: false, sendData: {} }));
- this.props.history.push(`/task-vendor/quotation`)
- })
- .catch((resp) => {
- this.setState(({ loadings, quotation }) => (
- {
- loadings: { ...loadings, button: false, errors: resp.data.errors },
- quotation: { ...quotation, errors: (resp.data.errors===undefined ? [] : resp.data.errors) },
- modalOpen: false,
- sendData: {}
- }
- ));
- const errors = resp.data?.errors;
- if(errors){
- var msg = Object.keys(errors).map((key) => { return <li key={key}>{errors[key]}</li> });
- const toastr_msg = {component: ( <React.Fragment><ul>{msg}</ul></React.Fragment> )};
- if(typeof errors === 'string'){ toastr.error(resp.data.message, errors); } else { toastr.error(resp.data.message, toastr_msg); }
- } else {
- toastr.error(resp.data.message);
- }
- });
- }
- }
- toggleClose = () => {
- this.setState({ modalOpen: false, sendData: {} })
- }
- toggleOpen = (data) => {
- this.setState({ modalOpen: true, sendData: data })
- }
- toggleCloseNumeric = () => {
- this.setState({ modalOpenNumeric: false, selectedTeknis: '' })
- }
- toggleOpenNumeric = (data) => {
- this.setState({ modalOpenNumeric: true, selectedTeknis: data })
- }
- toggleClosePengalaman = () => {
- this.setState({ modalOpenPengalaman: false, selectedTeknis: '' })
- }
- toggleOpenPengalaman = (data) => {
- this.setState({ modalOpenPengalaman: true, selectedTeknis: data })
- }
- toggleCloseTenagaAhli = () => {
- this.setState({ modalOpenTenagaAhli: false, selectedTeknis: '' })
- }
- toggleOpenTenagaAhli = (data) => {
- this.setState({ modalOpenTenagaAhli: true, selectedTeknis: data })
- }
- submitAspekTeknis = (payload, type) => {
- let data = this.state.quotation.form_teknis[this.state.selectedTeknis]
- let aspek_teknis = data.aspek_teknis === undefined ? [] : type === 'numeric' ? [] : data.aspek_teknis;
- aspek_teknis.push(payload);
- data.aspek_teknis = aspek_teknis;
- this.state.quotation.form_teknis[this.state.selectedTeknis] = data;
- // console.log("this.state.quotation.form_teknis", this.state.quotation.form_teknis);
- }
- removeAspekTeknis = (id) => {
- let data = this.state.quotation.form_teknis[this.state.selectedTeknis];
- let aspek_teknis = data.aspek_teknis === undefined ? [] : data.aspek_teknis;
- aspek_teknis.splice(id, 1);
- data.aspek_teknis = aspek_teknis;
- this.state.quotation.form_teknis[this.state.selectedTeknis] = data;
- };
- editAspekTeknis = (index, type, value) => {
- let data = this.state.quotation.form_teknis[this.state.selectedTeknis]
- let aspek_teknis = data.aspek_teknis === undefined ? [] : type === 'numeric' ? [] : data.aspek_teknis;
- aspek_teknis[index] = value;
- data.aspek_teknis = aspek_teknis;
- this.state.quotation.form_teknis[this.state.selectedTeknis] = data;
- };
- toggleSubmit = () => {
- this.submitVendorQuotation(this.state.sendData);
- }
- toggleUpdate = () => {
- this.updateVendorQuotation(this.state.sendData);
- }
- submitScoring = (uuid, params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: true } }));
- this.props.submitScoring(uuid, params)
- .then((resp) => {
- toastr.success(resp.data.status, resp.data.message);
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false } }));
- // this.props.history.push(`/task-vendor/quotation`)
- })
- .catch((resp) => {
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false } }));
- const errors = resp.data.errors;
- if(errors){
- var msg = Object.keys(errors).map((key) => { return <li key={key}>{errors[key]}</li> });
- const toastr_msg = {component: ( <React.Fragment><ul>{msg}</ul></React.Fragment> )};
- if(typeof errors === 'string'){ toastr.error(resp.data.message, errors); } else { toastr.error(resp.data.message, toastr_msg); }
- } else {
- toastr.error(resp.data.message);
- }
- });
- }
- }
- getScoring = (uuid, params) => {
- if(this._isMounted){
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: true } }));
- this.props.getScoring(uuid, params)
- .then((resp) => {
- toastr.success(resp.data.status, resp.data.message);
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false } }));
- // this.props.history.push(`/task-vendor/quotation`)
- // console.log("resp", resp);
- })
- .catch((resp) => {
- this.setState(({ loadings }) => ({ loadings: { ...loadings, button: false } }));
- const errors = resp.data.errors;
- if(errors){
- var msg = Object.keys(errors).map((key) => { return <li key={key}>{errors[key]}</li> });
- const toastr_msg = {component: ( <React.Fragment><ul>{msg}</ul></React.Fragment> )};
- if(typeof errors === 'string'){ toastr.error(resp.data.message, errors); } else { toastr.error(resp.data.message, toastr_msg); }
- } else {
- toastr.error(resp.data.message);
- }
- });
- }
- }
- onAddSyaratItemClick = () => {
- this.setState({ modalOpenSyaratItem: true })
- }
- onCloseSyaratItemClick = () => {
- this.setState({ modalOpenSyaratItem: false })
- }
- onEditSyaratItemClick = async (uuid) => {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_getting: true, syarat_item_getting_uuid: uuid}}));
- try {
- // const resp = await this.props.showProposalTenderSyaratItem(uuid);
- const resp = {data: {data: {
- id: 1,
- uuid: 'abc',
- name: 'test',
- year: 2022,
- description: 'yyy',
- }}};
- this.setState({syarat_item_detail: resp.data.data, modalOpenSyaratItem: true});
- } catch(err) {
- toastr.error(err?.data?.message || "Opps Somethings Wrong");
- } finally {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_getting: false, syarat_item_getting_uuid: null}}));
- }
- }
- onDeleteSyaratItemClick = (uuid) => {
- this.setState(({swal}) => ({swal: {...swal, show: true, uuid, type: 'delete-syarat-item'}}));
- }
- fetchSyaratItem = async () => {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_fetching: true}}));
- try {
- // const resp = await this.props.fetchProposalTenderSyaratItem();
- const resp = {data: {data: [{
- id: 1,
- uuid: 'abc',
- name: 'test',
- year: 2022,
- description: 'yyy',
- }]}}
- this.setState({syarat_item_list: resp.data.data});
- } catch(err) {
- toastr.error(err?.data?.message || "Opps Somethings Wrong");
- } finally {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_fetching: false}}));
- }
- }
- saveSyaratItem = async (data) => {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_creating: true}}));
- try {
- const resp = await this.props.saveProposalTenderSyaratItem(data);
- toastr.success(resp.data.status, resp.data.message);
- this.fetchSyaratItem();
- } catch (err) {
- toastr.error(err?.data?.message || "Opps Somethings Wrong");
- } finally {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_creating: false}}));
- }
- }
- updateSyaratItem = async (data) => {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_updating: true, syarat_item_updating_uuid: this.state.syarat_item_detail.uuid}}));
- try {
- const resp = await this.props.updateProposalTenderSyaratItem(this.state.syarat_item_detail.uuid, data);
- toastr.success(resp.data.status, resp.data.message);
- this.fetchSyaratItem();
- } catch (err) {
- toastr.error(err?.data?.message || "Opps Somethings Wrong");
- } finally {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_updating: false, syarat_item_updating_uuid: null}}));
- }
- }
- deleteSyaratItem = async (uuid) => {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_deleting: true, syarat_item_deleting_uuid: uuid}}));
- try {
- const resp = await this.props.deleteProposalTenderSyaratItem(uuid);
- toastr.success(resp.data.status, resp.data.message);
- this.fetchSyaratItem();
- } catch (err) {
- toastr.error(err?.data?.message || "Opps Somethings Wrong");
- } finally {
- this.setState(({loadings}) => ({loadings: {...loadings, syarat_item_deleting: false, syarat_item_deleting_uuid: null}}));
- }
- }
- onSwalConfirm = () => {
- const { swal } = this.state;
- if(swal.type === 'delete-syarat-item'){
- this.deleteSyaratItem(swal.uuid);
- this.onSwalCancel();
- }
- }
- onSwalCancel = () => {
- this.setState({swal: {show: false, uuid: null, type: null}});
- }
- render(){
- const {t} = this.props;
- return (
- <div id="page-quote">
- <ol className="breadcrumb float-xl-right">
- <li className="breadcrumb-item">Home</li>
- <li className="breadcrumb-item">Task Vendor</li>
- <li className="breadcrumb-item active">Quotation</li>
- </ol>
- <h1 className="page-header">Quotation </h1>
- <Form
- parentState={this.state}
- parentProps={this.props}
- loadings={this.state.loadings}
- upload={this.props.fileUpload}
- fetchIncoterms={this.fetchIncoterms}
- submit={this.toggleOpen}
- update={this.toggleOpen}
- toggleCloseNumeric={this.toggleCloseNumeric}
- toggleOpenNumeric={this.toggleOpenNumeric}
- toggleClosePengalaman={this.toggleClosePengalaman}
- toggleOpenPengalaman={this.toggleOpenPengalaman}
- toggleCloseTenagaAhli={this.toggleCloseTenagaAhli}
- toggleOpenTenagaAhli={this.toggleOpenTenagaAhli}
- onAddSyaratItemClick={this.onAddSyaratItemClick}
- onEditSyaratItemClick={this.onEditSyaratItemClick}
- onDeleteSyaratItemClick={this.onDeleteSyaratItemClick}
- />
- <Modal isOpen={this.state.modalOpen} toggle={() => this.toggleClose()} className="modal-lg">
- <ModalHeader toggle={() => this.toggleClose()}>Persyaratan {this.state.modalType} </ModalHeader>
- {this.state.loadings.modal && (
- <center>
- <br />
- <ReactLoading type="cylon" color="#0f9e3e" />
- <br />
- </center>
- )}
- {this.state.loadings.modal === false && (
- <PaktaIntegritas
- parentState={this.state}
- parentProps={this.props}
- toggleClose={this.toggleClose}
- submit={this.toggleSubmit}
- update={this.toggleUpdate}
- />
- )}
- </Modal>
- {/* MODAL ASPEK */}
- <Modal isOpen={this.state.modalOpenNumeric} toggle={() => this.toggleCloseNumeric()} className="modal-lg">
- <ModalHeader toggle={() => this.toggleCloseNumeric()}>Input Data Numeric </ModalHeader>
- {this.state.loadings.modal && (<center><br /><ReactLoading type="cylon" color="#0f9e3e" /><br /></center>)}
- {this.state.loadings.modal === false && (
- <Numeric
- parentState={this.state}
- parentProps={this.props}
- submitScoring={this.submitScoring}
- getScoring={this.getScoring}
- toggleClose={this.toggleCloseNumeric}
- submitAspekTeknis={this.submitAspekTeknis}
- removeAspekTeknis={this.removeAspekTeknis}
- editAspekTeknis={this.editAspekTeknis}
- />
- )}
- </Modal>
- {/* MODAL PENGALAMAN */}
- <Modal isOpen={this.state.modalOpenPengalaman} toggle={() => this.toggleClosePengalaman()} className="modal-xl">
- <ModalHeader toggle={() => this.toggleClosePengalaman()}>Input Data Pengalaman </ModalHeader>
- {this.state.loadings.modal && (<center><br /><ReactLoading type="cylon" color="#0f9e3e" /><br /></center>)}
- {this.state.loadings.modal === false && (
- <Pengalaman
- parentState={this.state}
- parentProps={this.props}
- submitScoring={this.submitScoring}
- getScoring={this.getScoring}
- toggleClose={this.toggleClosePengalaman}
- submitAspekTeknis={this.submitAspekTeknis}
- removeAspekTeknis={this.removeAspekTeknis}
- editAspekTeknis={this.editAspekTeknis}
- />
- )}
- </Modal>
- {/* MODAL TENAGA AHLI */}
- <Modal isOpen={this.state.modalOpenTenagaAhli} toggle={() => this.toggleCloseTenagaAhli()} className="modal-xl">
- <ModalHeader toggle={() => this.toggleCloseTenagaAhli()}>Input Data Tenaga Ahli </ModalHeader>
- {this.state.loadings.modal && (<center><br /><ReactLoading type="cylon" color="#0f9e3e" /><br /></center>)}
- {this.state.loadings.modal === false && (
- <TenagaAhli
- parentState={this.state}
- parentProps={this.props}
- submitScoring={this.submitScoring}
- getScoring={this.getScoring}
- toggleClose={this.toggleCloseTenagaAhli}
- submitAspekTeknis={this.submitAspekTeknis}
- removeAspekTeknis={this.removeAspekTeknis}
- editAspekTeknis={this.editAspekTeknis}
- />
- )}
- </Modal>
- {/* MODAL SYARAT ITEM */}
- <Modal isOpen={this.state.modalOpenSyaratItem} toggle={this.onCloseSyaratItemClick} className="modal-md">
- <ModalHeader toggle={this.onCloseSyaratItemClick}>Input Data Syarat Item </ModalHeader>
- <ModalAspekTeknis
- data={this.state.syarat_item_detail}
- loadings={this.state.loadings}
- onSubmit={this.state.syarat_item_detail?.id ? this.updateSyaratItem : this.saveSyaratItem}
- onClose={this.onCloseSyaratItemClick}
- />
- </Modal>
- {this.state.swal.show && (
- <SweetAlert
- warning
- showCancel
- confirmBtnText={t("common:delete.approve-delete")}
- cancelBtnText={t("common:delete.cancel")}
- confirmBtnBsStyle="danger"
- cancelBtnBsStyle="default"
- title={t("common:delete.title-delete")}
- onConfirm={() => this.onSwalConfirm()}
- onCancel={() => this.onSwalCancel()}
- ></SweetAlert>
- )}
- </div>
- );
- }
- }
- const stateToProps = state => {
- return {
- sidebarDt: state.sidebarDt,
- access: state.sidebarDt.access,
- user: state.auth.user.data,
- temporary: state.temporary
- }
- }
- const dispatchToProps = dispatch => {
- return {
- fetchIncoterms: (params) => dispatch(fetchIncoterms(params)),
- fileUpload: (id, payload) => dispatch(fileUpload(id, payload)),
- getProposalTender: (uuid, params) => dispatch(getProposalTender(uuid, params)),
- getVendorQuotation: (uuid, params) => dispatch(getVendorQuotation(uuid, params)),
- submitVendorQuotation: (uuid, params) => dispatch(submitVendorQuotation(uuid, params)),
- updateVendorQuotation: (uuid, params) => dispatch(updateVendorQuotation(uuid, params)),
- fetchPurchasingOrg: (params) => dispatch(fetchPurchasingOrg(params)),
- submitScoring: (uuid, params) => dispatch(submitScoring(uuid, params)),
- getScoring: (uuid, params) => dispatch(getScoring(uuid, params)),
- fetchProposalTenderSyaratItem: (params) => dispatch(fetchProposalTenderSyaratItem(params)),
- showProposalTenderSyaratItem: (uuid) => dispatch(showProposalTenderSyaratItem(uuid)),
- deleteProposalTenderSyaratItem: (uuid) => dispatch(deleteProposalTenderSyaratItem(uuid)),
- saveProposalTenderSyaratItem: (params) => dispatch(saveProposalTenderSyaratItem(params)),
- updateProposalTenderSyaratItem: (uuid, params) => dispatch(updateProposalTenderSyaratItem(uuid, params)),
- }
- }
- export default connect(stateToProps, dispatchToProps)( withTranslation() (QuotationDetail));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement