Browse Source

material integration

pull/1/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
1dde6ba8e5
  1. 2
      src/function/ganttConfig.js
  2. 33
      src/function/materialResource.js
  3. 4
      src/index.html

2
src/function/ganttConfig.js

@ -2,6 +2,8 @@ const ganttId = getUrlParameter("gantt_id");
const readOnly = getUrlParameter("ro");
const proyekId = getUrlParameter("proyek_id");
let base_url = getUrlParameter("base_url");
const adwIntegrationUrl = "http://ospro-api.adyawinsa.com:9083/api/";
const adwAuthToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjAyIiwiZXhwIjoxNjkxODMwNDkzfQ.DvBQIOZsdFndWsliPCZT65Y6G5Xx4vWBKz8Rhe7rvRA";
let userToVersionGanttId = 0
let activityId = 0;

33
src/function/materialResource.js

@ -132,6 +132,36 @@ $(document).ready(function () {
}
});
$('#select-material-integration').select2({
dropdownParent: materialModal,
placeholder: 'Pilih material',
allowClear: true,
ajax: {
url: `${adwIntegrationUrl}stock_master`,
type: "GET",
processData: false,
contentType: false,
headers: {
'Authorization': adwAuthToken,
},
processResults: function (data) {
var dataIntegrasiMaterial = [];
if (data) {
for(var i = 0; i < data.data.length; i++){
var newData = {
id: data.data[i].description,
text: data.data[i].description,
}
dataIntegrasiMaterial.push(newData);
}
}
return {
results: dataIntegrasiMaterial
};
}
}
});
$("#form-assign-material").on('submit', function (e) {
e.preventDefault();
@ -139,7 +169,7 @@ $(document).ready(function () {
$('#btn-assign-material').prop("disabled", true);
// /request-material/add
let desc_req_material = $("#description-req-material").val();
let desc_req_material = $("#select-material-integration").val();
let required_date = $("#required-date-req-material").val();
let plan_date = $("#required-date-plan-material").val();
let uom = $("#uom-req-material").val();
@ -156,7 +186,6 @@ $(document).ready(function () {
qty: formatReplaceTitikRibuan(qty_planning),
price: formatReplaceTitikRibuan(price)
}
console.log("PPPPP", payload);
$.ajax({
data: JSON.stringify(payload),
url: `${base_url}request-material/add`,

4
src/index.html

@ -286,8 +286,8 @@
<div class="form-row">
<div class="col-md-2 form-group">
<label>Description</label>
<input type="text" id="description-req-material" name="descriptionReqMaterial"
class="form-control form-control-sm" />
<select id="select-material-integration" name="descriptionReqMaterial" class="form-control form-control-sm"
style="width:100%;"></select>
</div>
<div class="col-md-2 form-group">
<label>Price (IDR)</label>

Loading…
Cancel
Save