Initial import
This commit is contained in:
0
one-ui/ibl/one-md-company-admin/action.js
Normal file
0
one-ui/ibl/one-md-company-admin/action.js
Normal file
31
one-ui/ibl/one-md-company-admin/api.js
Normal file
31
one-ui/ibl/one-md-company-admin/api.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t02/search_bank";
|
||||
|
||||
export async function searchBank(query, page, rowPerPage = 15) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
query: query,
|
||||
page: page,
|
||||
rowPerPage: rowPerPage
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
data.query = query;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
92
one-ui/ibl/one-md-company-admin/api/area.js
Normal file
92
one-ui/ibl/one-md-company-admin/api/area.js
Normal file
@@ -0,0 +1,92 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/v1/clinic/fo/";
|
||||
|
||||
export async function search_province(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_province', {
|
||||
search: search
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_city(province_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_city', {
|
||||
search: search,
|
||||
province_id: province_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_district(city_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_district', {
|
||||
search: search,
|
||||
city_id: city_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_kelurahan(district_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_kelurahan', {
|
||||
search: search,
|
||||
district_id: district_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
460
one-ui/ibl/one-md-company-admin/api/company.js
Normal file
460
one-ui/ibl/one-md-company-admin/api/company.js
Normal file
@@ -0,0 +1,460 @@
|
||||
const URL = "/one-api/ibl/";
|
||||
|
||||
export async function lookup(token, search, group,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/lookup', { token: token, search: search, group : group, all:all });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/addnewcompany', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function update(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/editcompany', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateafterrelease(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/editcompanyafterrelease', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/deletecompany', { id: id, token:token });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function savecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/addnewcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function updatecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/editcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function deletecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/deletecompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanygrouptype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectcompanygrouptype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanygrouptypefilter(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectcompanygrouptypefilter',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanytype(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectcompanytype',{token:token,id:prm.M_CompanyTypeGroupID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/addnewcompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function updatecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/editcompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function deletecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/deletecompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanybusiness(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectcompanybusiness',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selecthierarchy(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selecthierarchy',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanylevel(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectcompanylevel',{token:token,id:prm.id});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/searchcity',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchdoctor(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/searchdoctor',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcompanylevel(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/searchcompanylevel',{token:token,name:prm.name,id:prm.id});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getstaff(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getstaff',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getprovince(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getprovince',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getcity',{id:prm.M_ProvinceID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getdistrict',{id:prm.M_CityID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
330
one-ui/ibl/one-md-company-admin/api/mou.js
Normal file
330
one-ui/ibl/one-md-company-admin/api/mou.js
Normal file
@@ -0,0 +1,330 @@
|
||||
const URL = "/one-api/ibl/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/addnewmou', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function saveafterrelease(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/saveafterrelease', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function checkacuanharga(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/checkacuanharga',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getstaff(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/getstaff',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/deletemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function xverify(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/verifymou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xunverify(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/unverifymou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xrelease(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/releasemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xunrelease(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/unreleasemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookup(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/lookupmou', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupreleasebyid(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/lookupreleasebyid', { id: id, token:token });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbase(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectbase',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectomzettype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectomzettype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectmoutype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectmoutype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbilltype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectbilltype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbranch(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectbranch',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/selectagingtype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadattachment(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyadmin/uploadattachment', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,757 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealert" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<v-layout row>
|
||||
<v-flex pb-1 xs12>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pr-2 xs12>
|
||||
{{msgalert}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialogdeletealert = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlert()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card class="scroll-container" style="/*max-height:645px;overflow: auto;*/">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>PERUSAHAAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormPerusahaan()" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :color="color" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
|
||||
{{msgsnackbar}}
|
||||
<v-btn flat @click="updateAlert_success(false)">
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
|
||||
<v-list-tile>
|
||||
<input type="text" v-model="xsearch" class="textinput" placeholder="Cari ..." />
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div v-for="(vs,index) in vcompanys">
|
||||
|
||||
<v-layout pa-2 v-if="isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxsolid" xs10>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-html="vs.description" v-on="on"></span>
|
||||
</template>
|
||||
<span>{{vs.name}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxsolid text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<v-icon style="color:#ffffff" @click="editPerusahaan(vs)">edit</v-icon>
|
||||
<v-icon style="color:#ffffff" @click="deletePerusahaan(vs)">clear</v-icon>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-layout pa-2 v-if="!isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxoutline" xs10>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-html="vs.description" v-on="on"></span>
|
||||
</template>
|
||||
<span>{{vs.name}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxoutline text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<v-icon style="color:red" @click="editPerusahaan(vs)">edit</v-icon>
|
||||
<v-icon style="color:red" @click="deletePerusahaan(vs)">clear</v-icon>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-center" pt-3 xs12>
|
||||
<p style="margin-bottom:2px;color: rgba(0,0,0,0.54);font-size:12px;">Menampilkan <span class="red--text">{{xtotalfiltercompanys}}</span> dari <span class="red--text">{{xtotalcompanys}}</span> total data</p>
|
||||
<v-btn small v-if="xshowall === 'N'" flat @click="updateShowAll('Y')" color="primary" dark>Tampilkan Semua</v-btn>
|
||||
<v-btn small v-if="xshowall === 'Y'" flat @click="updateShowAll('N')" color="primary" dark>Batasi data</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogcompany" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Perusahaan</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompany" v-model="valid" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="companyname" label="Nama Perusahaan" :rules="nameRules" required></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select item-text="M_CompanyTypeName" :disabled="readonlytypecompany" return-object :items="xcompanytypes" v-model="xcompanytype"
|
||||
label="Tipe Perusahaan"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field :disabled="readonlytypecompanynew" v-model="companytypenew" label="Tipe Perusahaan Baru"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<v-autocomplete label="Dokter" v-model="doctor" :items="xdoctors" :search-input.sync="search_doctor" auto-select-first no-filter
|
||||
item-text="M_DoctorNames" return-object :loading="isLoading" no-data-text="Pilih Dokter">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_DoctorNames"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select item-text="M_StaffName" :disabled="readonlystaff" return-object :items="xstaffs" v-model="xstaff"
|
||||
label="Makerting"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-autocomplete label="Kota" v-model="cityaddress" :items="xcities" :search-input.sync="search_city" auto-select-first no-filter
|
||||
item-text="M_CityName" return-object :loading="isLoading" no-data-text="Pilih Kota">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select
|
||||
item-text="M_DistrictName"
|
||||
return-object
|
||||
:items="xdistricts"
|
||||
v-model="districtaddress"
|
||||
label="Kecamatan*"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select
|
||||
item-text="M_KelurahanName"
|
||||
return-object
|
||||
:items="xkelurahans"
|
||||
v-model="kelurahanaddress"
|
||||
label="Kelurahan / Desa*"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companypic" label="PIC Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="companyaddress" label="Alamat Perusahaan" :rules="addressRules" required></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companyphone" label="Telpon Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companyemail" label="Email Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="isdefault" label="Default?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="islabfrom" label="Rekanan Yang Merujuk?"></v-checkbox>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="islabto" label="Rekanan Tujuan ?"></v-checkbox>
|
||||
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormPerusahaan()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.textinput {
|
||||
-webkit-transition: width 0.4s ease-in-out;
|
||||
transition: width 0.4s ease-in-out;
|
||||
background-color: white;
|
||||
background-position: 10px 10px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 40px;
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #607d8b;
|
||||
|
||||
}
|
||||
|
||||
.textinput:focus {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.textinput:focus::-webkit-input-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:focus::-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.boxoutline {
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxoutline:hover {
|
||||
background: rgba(0, 0, 0, 0.07) !important;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.boxsolid {
|
||||
color: #ffffff;
|
||||
border: 1px solid #ffffff;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #f44336;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxsolid:hover {
|
||||
background: #f44336de;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
color: "success",
|
||||
valid: false,
|
||||
companyname: '',
|
||||
companytypenew: '',
|
||||
companyaddress: '',
|
||||
companyphone: '',
|
||||
companyemail: '',
|
||||
companypic: '',
|
||||
companymindp: '',
|
||||
search_city: '',
|
||||
search_doctor: '',
|
||||
nameRules: [
|
||||
v => !!v || 'Nama Perusahaan harus diisi'
|
||||
],
|
||||
addressRules: [
|
||||
v => !!v || 'Alamat Perusahaan harus diisi'
|
||||
],
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
xid: 0,
|
||||
xsearch: "",
|
||||
isdefault: "",
|
||||
islabfrom: "",
|
||||
islabto: "",
|
||||
isnewcompanytype: false,
|
||||
readonlytypecompany: false,
|
||||
readonlystaff: false,
|
||||
readonlytypecompanynew: false
|
||||
}),
|
||||
async mounted() {
|
||||
await this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
await this.$store.dispatch("company/selectcompanytype")
|
||||
await this.$store.dispatch("company/selectstaff")
|
||||
},
|
||||
computed: {
|
||||
xact() {
|
||||
return this.$store.state.company.act
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.company.errors
|
||||
},
|
||||
xshowall() {
|
||||
return this.$store.state.company.show_all
|
||||
},
|
||||
vcompanys() {
|
||||
return this.$store.state.company.companys
|
||||
},
|
||||
xtotalcompanys() {
|
||||
return this.$store.state.company.total_companys
|
||||
},
|
||||
xtotalfiltercompanys() {
|
||||
return this.$store.state.company.total_filter_companys
|
||||
},
|
||||
dialogcompany() {
|
||||
return this.$store.state.company.dialog_form_company
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.company.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.company.msg_success
|
||||
},
|
||||
lookupstatus() {
|
||||
return this.$store.state.company.lookup_company
|
||||
},
|
||||
xcompanytypes() {
|
||||
return this.$store.state.company.companytypes
|
||||
},
|
||||
xcompanytype: {
|
||||
get() {
|
||||
return this.$store.state.company.companytype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_companytype", val)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
xstaffs() {
|
||||
return this.$store.state.company.staffs
|
||||
},
|
||||
xstaff: {
|
||||
get() {
|
||||
return this.$store.state.company.staff
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_staff", val)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return this.$store.state.company.search_status == 1
|
||||
},
|
||||
xcities() {
|
||||
return this.$store.state.company.cities
|
||||
},
|
||||
cityaddress: {
|
||||
get() {
|
||||
return this.$store.state.company.city_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_city_address", val)
|
||||
this.$store.dispatch("company/getdistrict", this.$store.state.company.city_address)
|
||||
}
|
||||
},
|
||||
xdoctors() {
|
||||
return this.$store.state.company.doctors
|
||||
},
|
||||
doctor: {
|
||||
get() {
|
||||
return this.$store.state.company.doctor
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_doctor", val)
|
||||
}
|
||||
},
|
||||
xdistricts(){
|
||||
return this.$store.state.company.districts
|
||||
},
|
||||
districtaddress:{
|
||||
get() {
|
||||
return this.$store.state.company.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_district_address",val)
|
||||
this.$store.dispatch("company/getkelurahan",this.$store.state.company.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans(){
|
||||
return this.$store.state.company.kelurahans
|
||||
},
|
||||
kelurahanaddress:{
|
||||
get() {
|
||||
return this.$store.state.company.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_kelurahan_address",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateShowAll(val) {
|
||||
this.$store.commit("company/update_show_all", val)
|
||||
this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.company.selected_company.id
|
||||
},
|
||||
subname(name) {
|
||||
var xname = name
|
||||
if (xname.length > 18) {
|
||||
xname = xname.substring(0, 18) + '...'
|
||||
}
|
||||
return xname
|
||||
},
|
||||
async selectMe(sc) {
|
||||
await this.$store.commit("company/update_selected_company", sc)
|
||||
await this.$store.dispatch("mou/lookup", {
|
||||
id: this.$store.state.company.selected_company.id
|
||||
})
|
||||
//set staff
|
||||
let staff_id = 0
|
||||
try {
|
||||
staff_id = this.$store.state.company.selected_company.M_StaffID
|
||||
for(let idx=0; idx < this.$store.state.company.staffs.length ; idx++) {
|
||||
let stf = this.$store.state.company.staffs[idx]
|
||||
if (stf.M_StaffID == staff_id ) {
|
||||
this.$store.commit("company/update_staff",stf)
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
},
|
||||
updateDialogFormPerusahaan() {
|
||||
this.$store.commit("company/update_dialog_form_company", false)
|
||||
},
|
||||
openFormPerusahaan() {
|
||||
this.search_city = ''
|
||||
this.$store.commit("company/update_cities", [])
|
||||
this.cityaddress = {}
|
||||
this.search_doctor = ''
|
||||
this.$store.commit("company/update_doctors", [])
|
||||
this.doctor = {}
|
||||
this.$store.commit("company/update_districts",[])
|
||||
this.districtaddress = {}
|
||||
this.$store.commit("company/update_kelurahans",[])
|
||||
this.kelurahanaddress = {}
|
||||
this.companytypenew = ""
|
||||
this.$refs.formcompany.reset()
|
||||
this.$refs.formcompany.resetValidation()
|
||||
this.$store.commit("company/update_act", 'new')
|
||||
this.$store.commit("company/update_dialog_form_company", true)
|
||||
|
||||
|
||||
},
|
||||
thr_search_city: _.debounce(function () {
|
||||
this.$store.dispatch("company/searchcity", this.search_city)
|
||||
}, 2000),
|
||||
thr_search_doctor: _.debounce(function () {
|
||||
this.$store.dispatch("company/searchdoctor", this.search_doctor)
|
||||
}, 2000),
|
||||
saveFormPerusahaan() {
|
||||
if (this.$refs.formcompany.validate()) {
|
||||
var newcompanytype = this.companytypenew
|
||||
if ((_.isEmpty(this.companytypenew))) {
|
||||
this.$store.dispatch("company/save", {
|
||||
name: this.companyname,
|
||||
address: this.companyaddress,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: this.xcompanytype.M_CompanyTypeID,
|
||||
staff: this.xstaff.M_StaffID,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch("company/save", {
|
||||
name: this.companyname,
|
||||
address: this.companyaddress,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: 0,
|
||||
staff: 0,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
updateFormPerusahaan() {
|
||||
if (this.$refs.formcompany.validate()) {
|
||||
var newcompanytype = this.companytypenew
|
||||
if (newcompanytype == "") {
|
||||
this.$store.dispatch("company/update", {
|
||||
id: this.xid,
|
||||
name: this.companyname,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
address: this.companyaddress,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: this.xcompanytype.M_CompanyTypeID,
|
||||
staff: this.xstaff.M_StaffID,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch("company/update", {
|
||||
id: this.xid,
|
||||
name: this.companyname,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan: this.kelurahanaddress.M_KelurahanID,
|
||||
address: this.companyaddress,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: 0,
|
||||
staff: 0,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("company/update_alert_success", val)
|
||||
},
|
||||
editPerusahaan(data) {
|
||||
this.xid = data.id
|
||||
this.companyname = data.name
|
||||
this.$store.commit("company/update_cities", [{
|
||||
M_CityID: data.M_CityID,
|
||||
M_CityName: data.M_CityName
|
||||
}])
|
||||
this.cityaddress = {
|
||||
M_CityID: data.M_CityID,
|
||||
M_CityName: data.M_CityName
|
||||
}
|
||||
this.$store.commit("company/update_doctors", [{
|
||||
M_DoctorID: data.M_DoctorID,
|
||||
M_DoctorNames: data.M_DoctorNames
|
||||
}])
|
||||
this.doctor = {
|
||||
M_DoctorID: data.M_DoctorID,
|
||||
M_DoctorNames: data.M_DoctorNames
|
||||
}
|
||||
this.$store.commit("company/update_districts", [{
|
||||
M_DistrictID: data.M_DistrictID,
|
||||
M_DistrictName: data.M_DistrictName
|
||||
}])
|
||||
this.districtaddress = {
|
||||
M_DistrictID: data.M_DistrictID,
|
||||
M_DistrictName: data.M_DistrictName
|
||||
}
|
||||
this.$store.commit("company/update_kelurahans", [{
|
||||
M_KelurahanID: data.M_KelurahanID,
|
||||
M_KelurahanName: data.M_KelurahanName
|
||||
}])
|
||||
this.kelurahanaddress = {
|
||||
M_KelurahanID: data.M_KelurahanID,
|
||||
M_KelurahanName: data.M_KelurahanName
|
||||
}
|
||||
this.companyaddress = data.address
|
||||
this.companyphone = data.phone
|
||||
this.companyemail = data.email
|
||||
this.companypic = data.pic
|
||||
this.companytypenew = ""
|
||||
this.isdefault = data.isdefault === 'N' ? false : true
|
||||
this.islabfrom = data.islabfrom === 'N' ? false : true
|
||||
this.islabto = data.islabto === 'N' ? false : true
|
||||
this.$store.commit("company/update_act", 'edit')
|
||||
this.$store.commit("company/update_dialog_form_company", true)
|
||||
var companytypes = this.$store.state.company.companytypes
|
||||
var idx_companytype = _.findIndex(companytypes, function (o) {
|
||||
return o.M_CompanyTypeID == data.companytypeid
|
||||
})
|
||||
var companytype = companytypes[idx_companytype]
|
||||
this.$store.commit("company/update_companytype", companytype)
|
||||
},
|
||||
deletePerusahaan(data) {
|
||||
this.xid = data.id
|
||||
var xdata = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
mous: 'xxx'
|
||||
}
|
||||
this.$store.commit("company/update_selected_company", xdata)
|
||||
this.msgalert = "Yakin, mau hapus company " + data.name + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
changeNewCompanyType(value) {
|
||||
this.readonlytypecompany = value === true ? true : false
|
||||
this.readonlytypecompanynew = value === true ? false : true
|
||||
},
|
||||
newCompanyType() {
|
||||
readonlytypecompany: true
|
||||
readonlytypecompanynew: false
|
||||
},
|
||||
closeDeleteAlert() {
|
||||
this.$store.dispatch("company/delete", {
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
if (val !== old && this.lookupstatus !== 1) {
|
||||
console.log(val)
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
}
|
||||
},
|
||||
search_city(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.company.update_autocomplete_status == 1) return
|
||||
this.thr_search_city()
|
||||
},
|
||||
search_doctor(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.company.update_autocomplete_status == 1) return
|
||||
this.thr_search_doctor()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
1533
one-ui/ibl/one-md-company-admin/components/oneMdCompanyList.vue
Normal file
1533
one-ui/ibl/one-md-company-admin/components/oneMdCompanyList.vue
Normal file
File diff suppressed because it is too large
Load Diff
3581
one-ui/ibl/one-md-company-admin/components/oneMdMouList.vue
Normal file
3581
one-ui/ibl/one-md-company-admin/components/oneMdMouList.vue
Normal file
File diff suppressed because it is too large
Load Diff
77
one-ui/ibl/one-md-company-admin/index.php
Normal file
77
one-ui/ibl/one-md-company-admin/index.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs8 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-md-mou-list></one-md-mou-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../libs/vendor/vue.js"></script>
|
||||
<script src="../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponentNoMenu.vue'),
|
||||
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
|
||||
'one-md-company-list': httpVueLoader('./components/oneMdCompanyList.vue'),
|
||||
'one-md-mou-list' : httpVueLoader('./components/oneMdMouList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
194
one-ui/ibl/one-md-company-admin/modules/area.js
Normal file
194
one-ui/ibl/one-md-company-admin/modules/area.js
Normal file
@@ -0,0 +1,194 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/area.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
provinces: [],
|
||||
cities: [],
|
||||
districts: [],
|
||||
villages: [],
|
||||
|
||||
total_provinces: 0,
|
||||
total_cities: 0,
|
||||
total_districts: 0,
|
||||
total_villages: 0,
|
||||
|
||||
total_display: 0,
|
||||
|
||||
selected_province: {},
|
||||
selected_city: {},
|
||||
selected_district: {},
|
||||
selected_village: {}
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_area(state, data) {
|
||||
state[data.type] = data.records
|
||||
state['total_'+data.type] = data.total
|
||||
state.total_display = data.total_display
|
||||
|
||||
if (["provinces", "districts", "villages"].indexOf(data.type) > -1)
|
||||
state['selected_'+ data.type.substring(0, data.type.length-1) ] = null
|
||||
else if (data.type == "cities")
|
||||
state['selected_city'] = null
|
||||
|
||||
for (let i in data.records) {
|
||||
if (data.records[i].is_default == "Y") {
|
||||
|
||||
if (["provinces", "districts", "villages"].indexOf(data.type) > -1)
|
||||
state['selected_'+ data.type.substring(0, data.type.length-1) ] = data.records[i]
|
||||
|
||||
else if (data.type == "cities")
|
||||
state['selected_city'] = data.records[i]
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
update_selected_area(state, val) {
|
||||
state['selected_'+val.type] = val.val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search_province(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'city'})
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'district'})
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
// context.commit("update_selected_area", {type:'city',val:null})
|
||||
// context.commit("update_selected_area", {type:'district',val:null})
|
||||
// context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_province(context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'provinces'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.dispatch("search_city")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_city(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'district'})
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
context.commit("update_selected_area", {type:'district',val:null})
|
||||
context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_city(context.state.selected_province.M_ProvinceID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'cities'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
context.dispatch("search_district")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_district(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_district(context.state.selected_city.M_CityID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'districts'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
context.dispatch("search_kelurahan")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_kelurahan(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.search_kelurahan(context.state.selected_district.M_DistrictID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'villages'
|
||||
}
|
||||
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
822
one-ui/ibl/one-md-company-admin/modules/company.js
Normal file
822
one-ui/ibl/one-md-company-admin/modules/company.js
Normal file
@@ -0,0 +1,822 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/company.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
act: 'new',
|
||||
actcompanytype: 'new',
|
||||
actcompanybusiness: 'new',
|
||||
lookup_company: 0,
|
||||
lookup_error_message: '',
|
||||
companys: [],
|
||||
total_companys: 0,
|
||||
total_filter_companys: 0,
|
||||
selected_company: {
|
||||
name: "[ Belum memilih Kelompok Pelanggan ]"
|
||||
},
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_company: false,
|
||||
dialog_form_company_afterrelease: false,
|
||||
dialog_form_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
companygrouptypes: [],
|
||||
companygrouptype: {},
|
||||
companygrouptypefilters: [],
|
||||
companygrouptypefilter: {},
|
||||
staffs: [],
|
||||
staff: {},
|
||||
companylevels: [],
|
||||
companylevel: {},
|
||||
companybusinesss: [],
|
||||
companybusiness: {},
|
||||
hierarkis: [],
|
||||
hierarki: {},
|
||||
doctors: [],
|
||||
doctor: {},
|
||||
get_data_status: 0,
|
||||
get_data_error_message: '',
|
||||
cities: [],
|
||||
cities_address: {},
|
||||
autocomplete_status: 0,
|
||||
search_status: 0,
|
||||
provinces: [],
|
||||
province_address: {},
|
||||
citys: [],
|
||||
city_address: {},
|
||||
districts: [],
|
||||
district_address: {},
|
||||
kelurahans: [],
|
||||
kelurahan_address: {}
|
||||
},
|
||||
mutations: {
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_show_all(state, val) {
|
||||
state.show_all = val
|
||||
},
|
||||
update_lookup_error_message(state, status) {
|
||||
state.lookup_error_message = status
|
||||
},
|
||||
update_lookup_company(state, status) {
|
||||
state.lookup_company = status
|
||||
},
|
||||
update_companys(state, data) {
|
||||
state.companys = data.records
|
||||
state.total_companys = data.total
|
||||
state.total_filter_companys = data.total_filter
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_company(state, val) {
|
||||
state.dialog_form_company = val
|
||||
},
|
||||
update_dialog_form_company_afterrelease(state, val) {
|
||||
state.dialog_form_company_afterrelease = val
|
||||
},
|
||||
update_dialog_form_companytype(state, val) {
|
||||
state.dialog_form_companytype = val
|
||||
},
|
||||
update_dialog_form_companybusiness(state, val) {
|
||||
state.dialog_form_companybusiness = val
|
||||
},
|
||||
update_dialog_edit_form_company(state, val) {
|
||||
state.dialog_edit_form_company = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_companytypes(state, data) {
|
||||
state.companytypes = data
|
||||
},
|
||||
update_companytype(state, val) {
|
||||
state.companytype = val
|
||||
},
|
||||
update_companygrouptypes(state, data) {
|
||||
state.companygrouptypes = data
|
||||
},
|
||||
update_companygrouptype(state, val) {
|
||||
state.companygrouptype = val
|
||||
},
|
||||
update_companygrouptypefilters(state, data) {
|
||||
state.companygrouptypefilters = data
|
||||
},
|
||||
update_companygrouptypefilter(state, val) {
|
||||
state.companygrouptypefilter = val
|
||||
},
|
||||
update_staffs(state, data) {
|
||||
state.staffs = data
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_companylevels(state, data) {
|
||||
state.companylevels = data
|
||||
},
|
||||
update_companylevel(state, val) {
|
||||
state.companylevel = val
|
||||
},
|
||||
update_companybusinesss(state, data) {
|
||||
state.companybusinesss = data
|
||||
},
|
||||
update_companybusiness(state, val) {
|
||||
state.companybusiness = val
|
||||
},
|
||||
update_hierarkis(state, data) {
|
||||
state.hierarkis = data
|
||||
},
|
||||
update_hierarki(state, val) {
|
||||
state.hierarki = val
|
||||
},
|
||||
update_doctors(state, data) {
|
||||
state.doctors = data
|
||||
},
|
||||
update_doctor(state, val) {
|
||||
state.doctor = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_get_data_error_message(state, val) {
|
||||
state.get_data_error_message = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = val
|
||||
},
|
||||
update_cities_address(state, val) {
|
||||
state.cities_address = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_provinces(state, val) {
|
||||
state.provinces = val
|
||||
},
|
||||
update_province_address(state, val) {
|
||||
state.province_address = val
|
||||
},
|
||||
update_citys(state, val) {
|
||||
state.citys = val
|
||||
},
|
||||
update_city_address(state, val) {
|
||||
state.city_address = val
|
||||
},
|
||||
update_districts(state, val) {
|
||||
state.districts = val
|
||||
},
|
||||
update_district_address(state, val) {
|
||||
state.district_address = val
|
||||
},
|
||||
update_kelurahans(state, val) {
|
||||
state.kelurahans = val
|
||||
},
|
||||
update_kelurahan_address(state, val) {
|
||||
state.kelurahan_address = val
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
actions: {
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_company", 1)
|
||||
try {
|
||||
let resp = await api.lookup(one_token(), prm.search, prm.group, prm.all)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_company", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_company", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companys", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_company", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async update(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.update(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
}else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updateafterrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updateafterrelease(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company_afterrelease", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.companyid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
var msg = "Schedule " + prm.companyname + " sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_company", {})
|
||||
context.dispatch("lookup", {
|
||||
search: ""
|
||||
})
|
||||
context.commit("sampletype/update_company_sampletype", [], {
|
||||
root: true
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async savecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updatecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updatecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async deletecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanygrouptype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
|
||||
let resp = await api.selectcompanygrouptype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companygrouptypes", resp.data.records.companygrouptypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanygrouptypefilter(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
|
||||
let resp = await api.selectcompanygrouptypefilter(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companygrouptypefilters", resp.data.records.companygrouptypes)
|
||||
context.commit("update_companygrouptypefilter", resp.data.records.companygrouptypes[0])
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanytype(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async savecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanylevel(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanylevel(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companylevels", resp.data.records.companylevels)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selecthierarchy(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selecthierarchy(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_hierarkis", resp.data.records.hierarchys)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updatecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updatecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async deletecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanybusiness(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanybusiness(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectdoctor(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectdoctor(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_doctors", resp.data.records.doctors)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchcity(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcity(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_cities", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchdoctor(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchdoctor(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_doctors", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchcompanylevel(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcompanylevel(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companylevels", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async getprovince(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getprovince(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_provinces", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getcity(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getcity(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_citys", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getstaff(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getstaff(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_staffs", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getdistrict(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getdistrict(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_districts", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getkelurahan(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getkelurahan(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_kelurahans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
874
one-ui/ibl/one-md-company-admin/modules/mou.js
Normal file
874
one-ui/ibl/one-md-company-admin/modules/mou.js
Normal file
@@ -0,0 +1,874 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/mou.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
mous: [],
|
||||
moureleases: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_mou: false,
|
||||
dialog_status_order: false,
|
||||
lookup_mou: 0,
|
||||
search_status: 0,
|
||||
errors: [],
|
||||
startdate: moment(new Date()).format('DD-MM-YYYY'),
|
||||
enddate: moment(new Date()).format('DD-MM-YYYY'),
|
||||
bases: [],
|
||||
base: {},
|
||||
omzettypes: [],
|
||||
omzettype: {},
|
||||
billtypes: [],
|
||||
billtype: {},
|
||||
branchs: [],
|
||||
branch: {},
|
||||
moutypes: [],
|
||||
moutype: {},
|
||||
agingtypes: [],
|
||||
agingtype: {},
|
||||
statuss: [],
|
||||
jpa1_name: '',
|
||||
jpa2_name: '',
|
||||
jpa3_name: '',
|
||||
jpa4_name: '',
|
||||
jpa1_percent: 0,
|
||||
jpa2_percent: 0,
|
||||
jpa3_percent: 0,
|
||||
jpa4_percent: 0,
|
||||
dialog_alert_verif: false,
|
||||
msgalertverif: '',
|
||||
dialog_form_viewrelease: false,
|
||||
xsearch: '',
|
||||
dialog_attachment:false,
|
||||
show_progrees_upload: false,
|
||||
errors_upload:[],
|
||||
dialog_error:false,
|
||||
formData:null,
|
||||
attachment_files:null,
|
||||
urls: [],
|
||||
total_page_mou:0,
|
||||
current_page:1,
|
||||
staffs: [],
|
||||
staff: {},
|
||||
checkacuanharga: '',
|
||||
isacuanharga: false,
|
||||
dialog_acuan_harga: false
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_acuan_harga(state, data) {
|
||||
state.dialog_acuan_harga = data
|
||||
},
|
||||
update_isacuanharga(state, data) {
|
||||
state.isacuanharga = data
|
||||
},
|
||||
update_checkacuanharga(state, data) {
|
||||
state.checkacuanharga = data
|
||||
},
|
||||
update_staffs(state, data) {
|
||||
state.staffs = data
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_total_page_mou(state, val) {
|
||||
state.total_page_mou = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_urls(state, val) {
|
||||
state.urls = val
|
||||
},
|
||||
update_attachment_files(state, val) {
|
||||
state.attachment_files = val
|
||||
},
|
||||
update_formData(state, val) {
|
||||
state.formData = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_dialog_attachment(state, val) {
|
||||
state.dialog_attachment = val
|
||||
},
|
||||
update_show_progrees_upload(state, val) {
|
||||
state.show_progrees_upload = val
|
||||
},
|
||||
update_errors_upload(state, val) {
|
||||
state.errors_upload = val
|
||||
},
|
||||
update_xsearch(state,val) {
|
||||
state.xsearch = val
|
||||
},
|
||||
update_moureleases(state, val) {
|
||||
state.moureleases = val
|
||||
},
|
||||
update_dialog_form_viewrelease(state, val) {
|
||||
state.dialog_form_viewrelease = val
|
||||
},
|
||||
update_dialog_alert_verif(state, val) {
|
||||
state.dialog_alert_verif = val
|
||||
},
|
||||
update_msgalertverif(state, val) {
|
||||
state.msgalertverif = val
|
||||
},
|
||||
update_jpa1_name(state, val) {
|
||||
state.jpa1_name = val
|
||||
},
|
||||
update_jpa2_name(state, val) {
|
||||
state.jpa2_name = val
|
||||
},
|
||||
update_jpa3_name(state, val) {
|
||||
state.jpa3_name = val
|
||||
},
|
||||
update_jpa4_name(state, val) {
|
||||
state.jpa4_name = val
|
||||
},
|
||||
update_jpa1_percent(state, val) {
|
||||
state.jpa1_percent = val
|
||||
},
|
||||
update_jpa2_percent(state, val) {
|
||||
state.jpa2_percent = val
|
||||
},
|
||||
update_jpa3_percent(state, val) {
|
||||
state.jpa3_percent = val
|
||||
},
|
||||
update_jpa4_percent(state, val) {
|
||||
state.jpa4_percent = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_mous(state, data) {
|
||||
state.mous = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_mou(state, val) {
|
||||
state.dialog_form_mou = val
|
||||
},
|
||||
update_lookup_mou(state, val) {
|
||||
state.lookup_mou = val
|
||||
},
|
||||
update_startdate(state, val) {
|
||||
state.startdate = val
|
||||
},
|
||||
update_enddate(state, val) {
|
||||
state.enddate = val
|
||||
},
|
||||
update_bases(state, data) {
|
||||
state.bases = data
|
||||
},
|
||||
update_base(state, val) {
|
||||
state.base = val
|
||||
},
|
||||
update_omzettypes(state, data) {
|
||||
state.omzettypes = data
|
||||
},
|
||||
update_omzettype(state, val) {
|
||||
state.omzettype = val
|
||||
},
|
||||
update_billtypes(state, data) {
|
||||
state.billtypes = data
|
||||
},
|
||||
update_billtype(state, val) {
|
||||
state.billtype = val
|
||||
},
|
||||
update_branchs(state, data) {
|
||||
state.branchs = data
|
||||
},
|
||||
update_branch(state, val) {
|
||||
state.branch = val
|
||||
},
|
||||
update_moutypes(state, data) {
|
||||
state.moutypes = data
|
||||
},
|
||||
update_moutype(state, val) {
|
||||
state.moutype = val
|
||||
},
|
||||
update_agingtypes(state, data) {
|
||||
state.agingtypes = data
|
||||
},
|
||||
update_agingtype(state, val) {
|
||||
state.agingtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async uploadattachment(context,prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
//prm.id = context.state.selected_fna.id
|
||||
// prm.token = one_token()
|
||||
let resp = await api.uploadattachment(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_formData", null)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_formData", null)
|
||||
context.commit("update_dialog_attachment", false)
|
||||
|
||||
context.commit("update_attachment_files", data.records)
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
|
||||
if(resp.data.errors && resp.data.errors.length > 0){
|
||||
console.log(resp.data.errors)
|
||||
context.commit("update_errors_upload", resp.data.errors)
|
||||
context.commit("update_dialog_error", true)
|
||||
} else {
|
||||
var number = prm.get('number');
|
||||
|
||||
var msg = "Upload file " + number + " berhasil"
|
||||
context.commit("company/update_msg_success", msg, { root: true })
|
||||
context.commit("company/update_alert_success", true, { root: true })
|
||||
}
|
||||
let xprm = {
|
||||
id: context.state.company.selected_company.id,
|
||||
search: context.state.search,
|
||||
current_page: context.state.current_page
|
||||
}
|
||||
context.dispatch("lookup", xprm)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", msg)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_mou", false)
|
||||
var msg = "Agreement " + prm.companyname + " sudah update dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async saveafterrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveafterrelease(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", msg)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_mou", false)
|
||||
var msg = "Agreement " + prm.companyname + " sudah update dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookupx(context, prm) {
|
||||
context.commit("update_lookup_mou", 1)
|
||||
try {
|
||||
let resp = await api.lookupx(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_mou", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_mou", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_mous", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_mou", 3)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_mous", data.records)
|
||||
context.commit("update_total_page_mou", data.total_page)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async lookupreleasebyid(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.lookupreleasebyid(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_moureleases", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah dihapus dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async verify(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xverify(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", note)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah diverifikasi"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async unverify(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xunverify(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Verifikasi Agreement " + prm.name + " dari company " + prm.companyname + " sudah dibatalkan"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async release(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xrelease(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah dirilis"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async unrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xunrelease(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Rilis Agreement " + prm.name + " dari company " + prm.companyname + " sudah dibatalkan"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectbase(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectbase(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_bases", resp.data.records.bases)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectomzettype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectomzettype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_omzettypes", resp.data.records.omzettypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectbilltype(context) {
|
||||
context.commit("company/update_get_data_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.selectbilltype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, { root: true })
|
||||
context.commit("company/update_get_data_error_message", "", { root: true })
|
||||
context.commit("update_billtypes", resp.data.records.billtypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", e.message, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getstaff(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getstaff(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_staffs", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async checkacuanharga(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.checkacuanharga(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
console.log(data.records[0].x_count)
|
||||
if(parseInt(data.records[0].x_count) > 0){
|
||||
context.commit("update_dialog_acuan_harga", true)
|
||||
let note = 'Sudah ada acuan harga di ' + data.records[0].note
|
||||
context.commit("update_checkacuanharga", note)
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async selectbranch(context) {
|
||||
context.commit("company/update_get_data_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.selectbranch(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, { root: true })
|
||||
context.commit("company/update_get_data_error_message", "", { root: true })
|
||||
context.commit("update_branchs", resp.data.records.branchs)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", e.message, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectmoutype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectmoutype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_moutypes", resp.data.records.moutypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectagingtype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectagingtype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_agingtypes", resp.data.records.agingtypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
one-ui/ibl/one-md-company-admin/mutation.js
Normal file
0
one-ui/ibl/one-md-company-admin/mutation.js
Normal file
27
one-ui/ibl/one-md-company-admin/store.js
Normal file
27
one-ui/ibl/one-md-company-admin/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import company from "./modules/company.js";
|
||||
import mou from "./modules/mou.js";
|
||||
import area from "./modules/area.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
company: company,
|
||||
mou: mou,
|
||||
area: area,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
0
one-ui/ibl/one-md-company-verifikator/action.js
Normal file
0
one-ui/ibl/one-md-company-verifikator/action.js
Normal file
31
one-ui/ibl/one-md-company-verifikator/api.js
Normal file
31
one-ui/ibl/one-md-company-verifikator/api.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t02/search_bank";
|
||||
|
||||
export async function searchBank(query, page, rowPerPage = 15) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
query: query,
|
||||
page: page,
|
||||
rowPerPage: rowPerPage
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
data.query = query;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
92
one-ui/ibl/one-md-company-verifikator/api/area.js
Normal file
92
one-ui/ibl/one-md-company-verifikator/api/area.js
Normal file
@@ -0,0 +1,92 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/v1/clinic/fo/";
|
||||
|
||||
export async function search_province(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_province', {
|
||||
search: search
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_city(province_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_city', {
|
||||
search: search,
|
||||
province_id: province_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_district(city_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_district', {
|
||||
search: search,
|
||||
city_id: city_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_kelurahan(district_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_kelurahan', {
|
||||
search: search,
|
||||
district_id: district_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
460
one-ui/ibl/one-md-company-verifikator/api/company.js
Normal file
460
one-ui/ibl/one-md-company-verifikator/api/company.js
Normal file
@@ -0,0 +1,460 @@
|
||||
const URL = "/one-api/ibl/";
|
||||
|
||||
export async function lookup(token, search, group,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/lookup', { token: token, search: search, group : group, all:all });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/addnewcompany', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function update(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/editcompany', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateafterrelease(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/editcompanyafterrelease', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/deletecompany', { id: id, token:token });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function savecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/addnewcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function updatecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/editcompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function deletecompanytype(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/deletecompanytype', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanygrouptype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectcompanygrouptype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanygrouptypefilter(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectcompanygrouptypefilter',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanytype(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectcompanytype',{token:token,id:prm.M_CompanyTypeGroupID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/addnewcompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function updatecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/editcompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function deletecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/deletecompanybusiness', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanybusiness(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectcompanybusiness',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selecthierarchy(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selecthierarchy',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectcompanylevel(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectcompanylevel',{token:token,id:prm.id});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/searchcity',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchdoctor(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/searchdoctor',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchcompanylevel(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/searchcompanylevel',{token:token,name:prm.name,id:prm.id});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getstaff(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getstaff',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getprovince(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getprovince',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getcity',{id:prm.M_ProvinceID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getdistrict',{id:prm.M_CityID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
330
one-ui/ibl/one-md-company-verifikator/api/mou.js
Normal file
330
one-ui/ibl/one-md-company-verifikator/api/mou.js
Normal file
@@ -0,0 +1,330 @@
|
||||
const URL = "/one-api/ibl/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/addnewmou', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function saveafterrelease(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/saveafterrelease', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function checkacuanharga(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/checkacuanharga',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getstaff(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/getstaff',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/deletemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function xverify(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/verifymou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xunverify(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/unverifymou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xrelease(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/releasemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function xunrelease(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/unreleasemou', { id: id ,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookup(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/lookupmou', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function lookupreleasebyid(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/lookupreleasebyid', { id: id, token:token });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbase(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectbase',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectomzettype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectomzettype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectmoutype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectmoutype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbilltype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectbilltype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectbranch(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectbranch',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/selectagingtype',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function uploadattachment(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyverif/uploadattachment', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,757 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealert" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<v-layout row>
|
||||
<v-flex pb-1 xs12>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pr-2 xs12>
|
||||
{{msgalert}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialogdeletealert = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlert()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card class="scroll-container" style="/*max-height:645px;overflow: auto;*/">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>PERUSAHAAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormPerusahaan()" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :color="color" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
|
||||
{{msgsnackbar}}
|
||||
<v-btn flat @click="updateAlert_success(false)">
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
|
||||
<v-list-tile>
|
||||
<input type="text" v-model="xsearch" class="textinput" placeholder="Cari ..." />
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div v-for="(vs,index) in vcompanys">
|
||||
|
||||
<v-layout pa-2 v-if="isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxsolid" xs10>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-html="vs.description" v-on="on"></span>
|
||||
</template>
|
||||
<span>{{vs.name}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxsolid text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<v-icon style="color:#ffffff" @click="editPerusahaan(vs)">edit</v-icon>
|
||||
<v-icon style="color:#ffffff" @click="deletePerusahaan(vs)">clear</v-icon>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-layout pa-2 v-if="!isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxoutline" xs10>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-html="vs.description" v-on="on"></span>
|
||||
</template>
|
||||
<span>{{vs.name}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxoutline text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<v-icon style="color:red" @click="editPerusahaan(vs)">edit</v-icon>
|
||||
<v-icon style="color:red" @click="deletePerusahaan(vs)">clear</v-icon>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-center" pt-3 xs12>
|
||||
<p style="margin-bottom:2px;color: rgba(0,0,0,0.54);font-size:12px;">Menampilkan <span class="red--text">{{xtotalfiltercompanys}}</span> dari <span class="red--text">{{xtotalcompanys}}</span> total data</p>
|
||||
<v-btn small v-if="xshowall === 'N'" flat @click="updateShowAll('Y')" color="primary" dark>Tampilkan Semua</v-btn>
|
||||
<v-btn small v-if="xshowall === 'Y'" flat @click="updateShowAll('N')" color="primary" dark>Batasi data</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogcompany" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Perusahaan</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompany" v-model="valid" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="companyname" label="Nama Perusahaan" :rules="nameRules" required></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select item-text="M_CompanyTypeName" :disabled="readonlytypecompany" return-object :items="xcompanytypes" v-model="xcompanytype"
|
||||
label="Tipe Perusahaan"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field :disabled="readonlytypecompanynew" v-model="companytypenew" label="Tipe Perusahaan Baru"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<v-autocomplete label="Dokter" v-model="doctor" :items="xdoctors" :search-input.sync="search_doctor" auto-select-first no-filter
|
||||
item-text="M_DoctorNames" return-object :loading="isLoading" no-data-text="Pilih Dokter">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_DoctorNames"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select item-text="M_StaffName" :disabled="readonlystaff" return-object :items="xstaffs" v-model="xstaff"
|
||||
label="Makerting"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-autocomplete label="Kota" v-model="cityaddress" :items="xcities" :search-input.sync="search_city" auto-select-first no-filter
|
||||
item-text="M_CityName" return-object :loading="isLoading" no-data-text="Pilih Kota">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select
|
||||
item-text="M_DistrictName"
|
||||
return-object
|
||||
:items="xdistricts"
|
||||
v-model="districtaddress"
|
||||
label="Kecamatan*"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select
|
||||
item-text="M_KelurahanName"
|
||||
return-object
|
||||
:items="xkelurahans"
|
||||
v-model="kelurahanaddress"
|
||||
label="Kelurahan / Desa*"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companypic" label="PIC Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="companyaddress" label="Alamat Perusahaan" :rules="addressRules" required></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companyphone" label="Telpon Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="companyemail" label="Email Perusahaan"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="isdefault" label="Default?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="islabfrom" label="Rekanan Yang Merujuk?"></v-checkbox>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="islabto" label="Rekanan Tujuan ?"></v-checkbox>
|
||||
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormPerusahaan()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.textinput {
|
||||
-webkit-transition: width 0.4s ease-in-out;
|
||||
transition: width 0.4s ease-in-out;
|
||||
background-color: white;
|
||||
background-position: 10px 10px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 40px;
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #607d8b;
|
||||
|
||||
}
|
||||
|
||||
.textinput:focus {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.textinput:focus::-webkit-input-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:focus::-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.boxoutline {
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxoutline:hover {
|
||||
background: rgba(0, 0, 0, 0.07) !important;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.boxsolid {
|
||||
color: #ffffff;
|
||||
border: 1px solid #ffffff;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #f44336;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxsolid:hover {
|
||||
background: #f44336de;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
color: "success",
|
||||
valid: false,
|
||||
companyname: '',
|
||||
companytypenew: '',
|
||||
companyaddress: '',
|
||||
companyphone: '',
|
||||
companyemail: '',
|
||||
companypic: '',
|
||||
companymindp: '',
|
||||
search_city: '',
|
||||
search_doctor: '',
|
||||
nameRules: [
|
||||
v => !!v || 'Nama Perusahaan harus diisi'
|
||||
],
|
||||
addressRules: [
|
||||
v => !!v || 'Alamat Perusahaan harus diisi'
|
||||
],
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
xid: 0,
|
||||
xsearch: "",
|
||||
isdefault: "",
|
||||
islabfrom: "",
|
||||
islabto: "",
|
||||
isnewcompanytype: false,
|
||||
readonlytypecompany: false,
|
||||
readonlystaff: false,
|
||||
readonlytypecompanynew: false
|
||||
}),
|
||||
async mounted() {
|
||||
await this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
await this.$store.dispatch("company/selectcompanytype")
|
||||
await this.$store.dispatch("company/selectstaff")
|
||||
},
|
||||
computed: {
|
||||
xact() {
|
||||
return this.$store.state.company.act
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.company.errors
|
||||
},
|
||||
xshowall() {
|
||||
return this.$store.state.company.show_all
|
||||
},
|
||||
vcompanys() {
|
||||
return this.$store.state.company.companys
|
||||
},
|
||||
xtotalcompanys() {
|
||||
return this.$store.state.company.total_companys
|
||||
},
|
||||
xtotalfiltercompanys() {
|
||||
return this.$store.state.company.total_filter_companys
|
||||
},
|
||||
dialogcompany() {
|
||||
return this.$store.state.company.dialog_form_company
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.company.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.company.msg_success
|
||||
},
|
||||
lookupstatus() {
|
||||
return this.$store.state.company.lookup_company
|
||||
},
|
||||
xcompanytypes() {
|
||||
return this.$store.state.company.companytypes
|
||||
},
|
||||
xcompanytype: {
|
||||
get() {
|
||||
return this.$store.state.company.companytype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_companytype", val)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
xstaffs() {
|
||||
return this.$store.state.company.staffs
|
||||
},
|
||||
xstaff: {
|
||||
get() {
|
||||
return this.$store.state.company.staff
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_staff", val)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return this.$store.state.company.search_status == 1
|
||||
},
|
||||
xcities() {
|
||||
return this.$store.state.company.cities
|
||||
},
|
||||
cityaddress: {
|
||||
get() {
|
||||
return this.$store.state.company.city_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_city_address", val)
|
||||
this.$store.dispatch("company/getdistrict", this.$store.state.company.city_address)
|
||||
}
|
||||
},
|
||||
xdoctors() {
|
||||
return this.$store.state.company.doctors
|
||||
},
|
||||
doctor: {
|
||||
get() {
|
||||
return this.$store.state.company.doctor
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_doctor", val)
|
||||
}
|
||||
},
|
||||
xdistricts(){
|
||||
return this.$store.state.company.districts
|
||||
},
|
||||
districtaddress:{
|
||||
get() {
|
||||
return this.$store.state.company.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_district_address",val)
|
||||
this.$store.dispatch("company/getkelurahan",this.$store.state.company.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans(){
|
||||
return this.$store.state.company.kelurahans
|
||||
},
|
||||
kelurahanaddress:{
|
||||
get() {
|
||||
return this.$store.state.company.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_kelurahan_address",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateShowAll(val) {
|
||||
this.$store.commit("company/update_show_all", val)
|
||||
this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.company.selected_company.id
|
||||
},
|
||||
subname(name) {
|
||||
var xname = name
|
||||
if (xname.length > 18) {
|
||||
xname = xname.substring(0, 18) + '...'
|
||||
}
|
||||
return xname
|
||||
},
|
||||
async selectMe(sc) {
|
||||
await this.$store.commit("company/update_selected_company", sc)
|
||||
await this.$store.dispatch("mou/lookup", {
|
||||
id: this.$store.state.company.selected_company.id
|
||||
})
|
||||
//set staff
|
||||
let staff_id = 0
|
||||
try {
|
||||
staff_id = this.$store.state.company.selected_company.M_StaffID
|
||||
for(let idx=0; idx < this.$store.state.company.staffs.length ; idx++) {
|
||||
let stf = this.$store.state.company.staffs[idx]
|
||||
if (stf.M_StaffID == staff_id ) {
|
||||
this.$store.commit("company/update_staff",stf)
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
},
|
||||
updateDialogFormPerusahaan() {
|
||||
this.$store.commit("company/update_dialog_form_company", false)
|
||||
},
|
||||
openFormPerusahaan() {
|
||||
this.search_city = ''
|
||||
this.$store.commit("company/update_cities", [])
|
||||
this.cityaddress = {}
|
||||
this.search_doctor = ''
|
||||
this.$store.commit("company/update_doctors", [])
|
||||
this.doctor = {}
|
||||
this.$store.commit("company/update_districts",[])
|
||||
this.districtaddress = {}
|
||||
this.$store.commit("company/update_kelurahans",[])
|
||||
this.kelurahanaddress = {}
|
||||
this.companytypenew = ""
|
||||
this.$refs.formcompany.reset()
|
||||
this.$refs.formcompany.resetValidation()
|
||||
this.$store.commit("company/update_act", 'new')
|
||||
this.$store.commit("company/update_dialog_form_company", true)
|
||||
|
||||
|
||||
},
|
||||
thr_search_city: _.debounce(function () {
|
||||
this.$store.dispatch("company/searchcity", this.search_city)
|
||||
}, 2000),
|
||||
thr_search_doctor: _.debounce(function () {
|
||||
this.$store.dispatch("company/searchdoctor", this.search_doctor)
|
||||
}, 2000),
|
||||
saveFormPerusahaan() {
|
||||
if (this.$refs.formcompany.validate()) {
|
||||
var newcompanytype = this.companytypenew
|
||||
if ((_.isEmpty(this.companytypenew))) {
|
||||
this.$store.dispatch("company/save", {
|
||||
name: this.companyname,
|
||||
address: this.companyaddress,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: this.xcompanytype.M_CompanyTypeID,
|
||||
staff: this.xstaff.M_StaffID,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch("company/save", {
|
||||
name: this.companyname,
|
||||
address: this.companyaddress,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: 0,
|
||||
staff: 0,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
updateFormPerusahaan() {
|
||||
if (this.$refs.formcompany.validate()) {
|
||||
var newcompanytype = this.companytypenew
|
||||
if (newcompanytype == "") {
|
||||
this.$store.dispatch("company/update", {
|
||||
id: this.xid,
|
||||
name: this.companyname,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan : this.kelurahanaddress.M_KelurahanID,
|
||||
address: this.companyaddress,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: this.xcompanytype.M_CompanyTypeID,
|
||||
staff: this.xstaff.M_StaffID,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch("company/update", {
|
||||
id: this.xid,
|
||||
name: this.companyname,
|
||||
city: this.cityaddress.M_CityID,
|
||||
doctor: this.doctor.M_DoctorID,
|
||||
district: this.districtaddress.M_DistrictID,
|
||||
kelurahan: this.kelurahanaddress.M_KelurahanID,
|
||||
address: this.companyaddress,
|
||||
phone: this.companyphone,
|
||||
email: this.companyemail,
|
||||
pic: this.companypic,
|
||||
companytypenew: this.companytypenew,
|
||||
companytype: 0,
|
||||
staff: 0,
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
islabfrom: this.islabfrom === true ? "Y" : "N",
|
||||
islabto: this.islabto === true ? "Y" : "N"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("company/update_alert_success", val)
|
||||
},
|
||||
editPerusahaan(data) {
|
||||
this.xid = data.id
|
||||
this.companyname = data.name
|
||||
this.$store.commit("company/update_cities", [{
|
||||
M_CityID: data.M_CityID,
|
||||
M_CityName: data.M_CityName
|
||||
}])
|
||||
this.cityaddress = {
|
||||
M_CityID: data.M_CityID,
|
||||
M_CityName: data.M_CityName
|
||||
}
|
||||
this.$store.commit("company/update_doctors", [{
|
||||
M_DoctorID: data.M_DoctorID,
|
||||
M_DoctorNames: data.M_DoctorNames
|
||||
}])
|
||||
this.doctor = {
|
||||
M_DoctorID: data.M_DoctorID,
|
||||
M_DoctorNames: data.M_DoctorNames
|
||||
}
|
||||
this.$store.commit("company/update_districts", [{
|
||||
M_DistrictID: data.M_DistrictID,
|
||||
M_DistrictName: data.M_DistrictName
|
||||
}])
|
||||
this.districtaddress = {
|
||||
M_DistrictID: data.M_DistrictID,
|
||||
M_DistrictName: data.M_DistrictName
|
||||
}
|
||||
this.$store.commit("company/update_kelurahans", [{
|
||||
M_KelurahanID: data.M_KelurahanID,
|
||||
M_KelurahanName: data.M_KelurahanName
|
||||
}])
|
||||
this.kelurahanaddress = {
|
||||
M_KelurahanID: data.M_KelurahanID,
|
||||
M_KelurahanName: data.M_KelurahanName
|
||||
}
|
||||
this.companyaddress = data.address
|
||||
this.companyphone = data.phone
|
||||
this.companyemail = data.email
|
||||
this.companypic = data.pic
|
||||
this.companytypenew = ""
|
||||
this.isdefault = data.isdefault === 'N' ? false : true
|
||||
this.islabfrom = data.islabfrom === 'N' ? false : true
|
||||
this.islabto = data.islabto === 'N' ? false : true
|
||||
this.$store.commit("company/update_act", 'edit')
|
||||
this.$store.commit("company/update_dialog_form_company", true)
|
||||
var companytypes = this.$store.state.company.companytypes
|
||||
var idx_companytype = _.findIndex(companytypes, function (o) {
|
||||
return o.M_CompanyTypeID == data.companytypeid
|
||||
})
|
||||
var companytype = companytypes[idx_companytype]
|
||||
this.$store.commit("company/update_companytype", companytype)
|
||||
},
|
||||
deletePerusahaan(data) {
|
||||
this.xid = data.id
|
||||
var xdata = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
mous: 'xxx'
|
||||
}
|
||||
this.$store.commit("company/update_selected_company", xdata)
|
||||
this.msgalert = "Yakin, mau hapus company " + data.name + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
changeNewCompanyType(value) {
|
||||
this.readonlytypecompany = value === true ? true : false
|
||||
this.readonlytypecompanynew = value === true ? false : true
|
||||
},
|
||||
newCompanyType() {
|
||||
readonlytypecompany: true
|
||||
readonlytypecompanynew: false
|
||||
},
|
||||
closeDeleteAlert() {
|
||||
this.$store.dispatch("company/delete", {
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("company/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
if (val !== old && this.lookupstatus !== 1) {
|
||||
console.log(val)
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
}
|
||||
},
|
||||
search_city(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.company.update_autocomplete_status == 1) return
|
||||
this.thr_search_city()
|
||||
},
|
||||
search_doctor(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.company.update_autocomplete_status == 1) return
|
||||
this.thr_search_doctor()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
3575
one-ui/ibl/one-md-company-verifikator/components/oneMdMouList.vue
Normal file
3575
one-ui/ibl/one-md-company-verifikator/components/oneMdMouList.vue
Normal file
File diff suppressed because it is too large
Load Diff
77
one-ui/ibl/one-md-company-verifikator/index.php
Normal file
77
one-ui/ibl/one-md-company-verifikator/index.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs8 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-md-mou-list></one-md-mou-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../libs/vendor/vue.js"></script>
|
||||
<script src="../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../libs/one_global.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponentNoMenu.vue'),
|
||||
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
|
||||
'one-md-company-list': httpVueLoader('./components/oneMdCompanyList.vue'),
|
||||
'one-md-mou-list' : httpVueLoader('./components/oneMdMouList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
194
one-ui/ibl/one-md-company-verifikator/modules/area.js
Normal file
194
one-ui/ibl/one-md-company-verifikator/modules/area.js
Normal file
@@ -0,0 +1,194 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/area.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search: '',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
provinces: [],
|
||||
cities: [],
|
||||
districts: [],
|
||||
villages: [],
|
||||
|
||||
total_provinces: 0,
|
||||
total_cities: 0,
|
||||
total_districts: 0,
|
||||
total_villages: 0,
|
||||
|
||||
total_display: 0,
|
||||
|
||||
selected_province: {},
|
||||
selected_city: {},
|
||||
selected_district: {},
|
||||
selected_village: {}
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search(state,val) {
|
||||
state.search=val
|
||||
},
|
||||
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_area(state, data) {
|
||||
state[data.type] = data.records
|
||||
state['total_'+data.type] = data.total
|
||||
state.total_display = data.total_display
|
||||
|
||||
if (["provinces", "districts", "villages"].indexOf(data.type) > -1)
|
||||
state['selected_'+ data.type.substring(0, data.type.length-1) ] = null
|
||||
else if (data.type == "cities")
|
||||
state['selected_city'] = null
|
||||
|
||||
for (let i in data.records) {
|
||||
if (data.records[i].is_default == "Y") {
|
||||
|
||||
if (["provinces", "districts", "villages"].indexOf(data.type) > -1)
|
||||
state['selected_'+ data.type.substring(0, data.type.length-1) ] = data.records[i]
|
||||
|
||||
else if (data.type == "cities")
|
||||
state['selected_city'] = data.records[i]
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
update_selected_area(state, val) {
|
||||
state['selected_'+val.type] = val.val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search_province(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'city'})
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'district'})
|
||||
// context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
// context.commit("update_selected_area", {type:'city',val:null})
|
||||
// context.commit("update_selected_area", {type:'district',val:null})
|
||||
// context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_province(context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'provinces'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.dispatch("search_city")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_city(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'district'})
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
context.commit("update_selected_area", {type:'district',val:null})
|
||||
context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_city(context.state.selected_province.M_ProvinceID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'cities'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
context.dispatch("search_district")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_district(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
context.commit("update_area", {records:[], total:0, total_display:0, type:'village'})
|
||||
context.commit("update_selected_area", {type:'village',val:null})
|
||||
try {
|
||||
let resp = await api.search_district(context.state.selected_city.M_CityID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'districts'
|
||||
}
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
context.dispatch("search_kelurahan")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_kelurahan(context) {
|
||||
// City
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.search_kelurahan(context.state.selected_district.M_DistrictID, context.state.search)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_display: resp.data.total_display,
|
||||
type: 'villages'
|
||||
}
|
||||
|
||||
context.commit("update_area", data)
|
||||
context.commit("update_search_status", 1)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
822
one-ui/ibl/one-md-company-verifikator/modules/company.js
Normal file
822
one-ui/ibl/one-md-company-verifikator/modules/company.js
Normal file
@@ -0,0 +1,822 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/company.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
act: 'new',
|
||||
actcompanytype: 'new',
|
||||
actcompanybusiness: 'new',
|
||||
lookup_company: 0,
|
||||
lookup_error_message: '',
|
||||
companys: [],
|
||||
total_companys: 0,
|
||||
total_filter_companys: 0,
|
||||
selected_company: {
|
||||
name: "[ Belum memilih Kelompok Pelanggan ]"
|
||||
},
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_company: false,
|
||||
dialog_form_company_afterrelease: false,
|
||||
dialog_form_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
companygrouptypes: [],
|
||||
companygrouptype: {},
|
||||
companygrouptypefilters: [],
|
||||
companygrouptypefilter: {},
|
||||
staffs: [],
|
||||
staff: {},
|
||||
companylevels: [],
|
||||
companylevel: {},
|
||||
companybusinesss: [],
|
||||
companybusiness: {},
|
||||
hierarkis: [],
|
||||
hierarki: {},
|
||||
doctors: [],
|
||||
doctor: {},
|
||||
get_data_status: 0,
|
||||
get_data_error_message: '',
|
||||
cities: [],
|
||||
cities_address: {},
|
||||
autocomplete_status: 0,
|
||||
search_status: 0,
|
||||
provinces: [],
|
||||
province_address: {},
|
||||
citys: [],
|
||||
city_address: {},
|
||||
districts: [],
|
||||
district_address: {},
|
||||
kelurahans: [],
|
||||
kelurahan_address: {}
|
||||
},
|
||||
mutations: {
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_show_all(state, val) {
|
||||
state.show_all = val
|
||||
},
|
||||
update_lookup_error_message(state, status) {
|
||||
state.lookup_error_message = status
|
||||
},
|
||||
update_lookup_company(state, status) {
|
||||
state.lookup_company = status
|
||||
},
|
||||
update_companys(state, data) {
|
||||
state.companys = data.records
|
||||
state.total_companys = data.total
|
||||
state.total_filter_companys = data.total_filter
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_company(state, val) {
|
||||
state.dialog_form_company = val
|
||||
},
|
||||
update_dialog_form_company_afterrelease(state, val) {
|
||||
state.dialog_form_company_afterrelease = val
|
||||
},
|
||||
update_dialog_form_companytype(state, val) {
|
||||
state.dialog_form_companytype = val
|
||||
},
|
||||
update_dialog_form_companybusiness(state, val) {
|
||||
state.dialog_form_companybusiness = val
|
||||
},
|
||||
update_dialog_edit_form_company(state, val) {
|
||||
state.dialog_edit_form_company = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_companytypes(state, data) {
|
||||
state.companytypes = data
|
||||
},
|
||||
update_companytype(state, val) {
|
||||
state.companytype = val
|
||||
},
|
||||
update_companygrouptypes(state, data) {
|
||||
state.companygrouptypes = data
|
||||
},
|
||||
update_companygrouptype(state, val) {
|
||||
state.companygrouptype = val
|
||||
},
|
||||
update_companygrouptypefilters(state, data) {
|
||||
state.companygrouptypefilters = data
|
||||
},
|
||||
update_companygrouptypefilter(state, val) {
|
||||
state.companygrouptypefilter = val
|
||||
},
|
||||
update_staffs(state, data) {
|
||||
state.staffs = data
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_companylevels(state, data) {
|
||||
state.companylevels = data
|
||||
},
|
||||
update_companylevel(state, val) {
|
||||
state.companylevel = val
|
||||
},
|
||||
update_companybusinesss(state, data) {
|
||||
state.companybusinesss = data
|
||||
},
|
||||
update_companybusiness(state, val) {
|
||||
state.companybusiness = val
|
||||
},
|
||||
update_hierarkis(state, data) {
|
||||
state.hierarkis = data
|
||||
},
|
||||
update_hierarki(state, val) {
|
||||
state.hierarki = val
|
||||
},
|
||||
update_doctors(state, data) {
|
||||
state.doctors = data
|
||||
},
|
||||
update_doctor(state, val) {
|
||||
state.doctor = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_get_data_error_message(state, val) {
|
||||
state.get_data_error_message = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = val
|
||||
},
|
||||
update_cities_address(state, val) {
|
||||
state.cities_address = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_provinces(state, val) {
|
||||
state.provinces = val
|
||||
},
|
||||
update_province_address(state, val) {
|
||||
state.province_address = val
|
||||
},
|
||||
update_citys(state, val) {
|
||||
state.citys = val
|
||||
},
|
||||
update_city_address(state, val) {
|
||||
state.city_address = val
|
||||
},
|
||||
update_districts(state, val) {
|
||||
state.districts = val
|
||||
},
|
||||
update_district_address(state, val) {
|
||||
state.district_address = val
|
||||
},
|
||||
update_kelurahans(state, val) {
|
||||
state.kelurahans = val
|
||||
},
|
||||
update_kelurahan_address(state, val) {
|
||||
state.kelurahan_address = val
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
actions: {
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_company", 1)
|
||||
try {
|
||||
let resp = await api.lookup(one_token(), prm.search, prm.group, prm.all)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_company", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_company", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_companys", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_company", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async update(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.update(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
}else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updateafterrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updateafterrelease(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_company_afterrelease", false)
|
||||
context.commit("update_dialog_form_companytype", false)
|
||||
context.commit("update_dialog_form_companybusiness", false)
|
||||
var msg = "Kelompok Pelanggan " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", {
|
||||
search: "",
|
||||
all: context.show_all
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.companyid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
var msg = "Schedule " + prm.companyname + " sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_company", {})
|
||||
context.dispatch("lookup", {
|
||||
search: ""
|
||||
})
|
||||
context.commit("sampletype/update_company_sampletype", [], {
|
||||
root: true
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async savecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updatecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updatecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async deletecompanytype(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletecompanytype(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanygrouptype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
|
||||
let resp = await api.selectcompanygrouptype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companygrouptypes", resp.data.records.companygrouptypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanygrouptypefilter(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
|
||||
let resp = await api.selectcompanygrouptypefilter(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companygrouptypefilters", resp.data.records.companygrouptypes)
|
||||
context.commit("update_companygrouptypefilter", resp.data.records.companygrouptypes[0])
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanytype(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companytypes", resp.data.records.companytypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async savecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_errors", [])
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanylevel(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanylevel(one_token(),prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companylevels", resp.data.records.companylevels)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selecthierarchy(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selecthierarchy(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_hierarkis", resp.data.records.hierarchys)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updatecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updatecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async deletecompanybusiness(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletecompanybusiness(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectcompanybusiness(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanybusiness(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_companybusinesss", resp.data.records.companybusinesss)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectdoctor(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectdoctor(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
context.commit("update_get_data_error_message", "")
|
||||
context.commit("update_doctors", resp.data.records.doctors)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
context.commit("update_get_data_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchcity(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcity(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_cities", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchdoctor(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchdoctor(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_doctors", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchcompanylevel(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcompanylevel(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companylevels", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async getprovince(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getprovince(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_provinces", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getcity(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getcity(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_citys", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getstaff(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getstaff(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_staffs", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getdistrict(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getdistrict(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_districts", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getkelurahan(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getkelurahan(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_kelurahans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
874
one-ui/ibl/one-md-company-verifikator/modules/mou.js
Normal file
874
one-ui/ibl/one-md-company-verifikator/modules/mou.js
Normal file
@@ -0,0 +1,874 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/mou.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
mous: [],
|
||||
moureleases: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_mou: false,
|
||||
dialog_status_order: false,
|
||||
lookup_mou: 0,
|
||||
search_status: 0,
|
||||
errors: [],
|
||||
startdate: moment(new Date()).format('DD-MM-YYYY'),
|
||||
enddate: moment(new Date()).format('DD-MM-YYYY'),
|
||||
bases: [],
|
||||
base: {},
|
||||
omzettypes: [],
|
||||
omzettype: {},
|
||||
billtypes: [],
|
||||
billtype: {},
|
||||
branchs: [],
|
||||
branch: {},
|
||||
moutypes: [],
|
||||
moutype: {},
|
||||
agingtypes: [],
|
||||
agingtype: {},
|
||||
statuss: [],
|
||||
jpa1_name: '',
|
||||
jpa2_name: '',
|
||||
jpa3_name: '',
|
||||
jpa4_name: '',
|
||||
jpa1_percent: 0,
|
||||
jpa2_percent: 0,
|
||||
jpa3_percent: 0,
|
||||
jpa4_percent: 0,
|
||||
dialog_alert_verif: false,
|
||||
msgalertverif: '',
|
||||
dialog_form_viewrelease: false,
|
||||
xsearch: '',
|
||||
dialog_attachment:false,
|
||||
show_progrees_upload: false,
|
||||
errors_upload:[],
|
||||
dialog_error:false,
|
||||
formData:null,
|
||||
attachment_files:null,
|
||||
urls: [],
|
||||
total_page_mou:0,
|
||||
current_page:1,
|
||||
staffs: [],
|
||||
staff: {},
|
||||
checkacuanharga: '',
|
||||
isacuanharga: false,
|
||||
dialog_acuan_harga: false
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_acuan_harga(state, data) {
|
||||
state.dialog_acuan_harga = data
|
||||
},
|
||||
update_isacuanharga(state, data) {
|
||||
state.isacuanharga = data
|
||||
},
|
||||
update_checkacuanharga(state, data) {
|
||||
state.checkacuanharga = data
|
||||
},
|
||||
update_staffs(state, data) {
|
||||
state.staffs = data
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_total_page_mou(state, val) {
|
||||
state.total_page_mou = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_urls(state, val) {
|
||||
state.urls = val
|
||||
},
|
||||
update_attachment_files(state, val) {
|
||||
state.attachment_files = val
|
||||
},
|
||||
update_formData(state, val) {
|
||||
state.formData = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_dialog_attachment(state, val) {
|
||||
state.dialog_attachment = val
|
||||
},
|
||||
update_show_progrees_upload(state, val) {
|
||||
state.show_progrees_upload = val
|
||||
},
|
||||
update_errors_upload(state, val) {
|
||||
state.errors_upload = val
|
||||
},
|
||||
update_xsearch(state,val) {
|
||||
state.xsearch = val
|
||||
},
|
||||
update_moureleases(state, val) {
|
||||
state.moureleases = val
|
||||
},
|
||||
update_dialog_form_viewrelease(state, val) {
|
||||
state.dialog_form_viewrelease = val
|
||||
},
|
||||
update_dialog_alert_verif(state, val) {
|
||||
state.dialog_alert_verif = val
|
||||
},
|
||||
update_msgalertverif(state, val) {
|
||||
state.msgalertverif = val
|
||||
},
|
||||
update_jpa1_name(state, val) {
|
||||
state.jpa1_name = val
|
||||
},
|
||||
update_jpa2_name(state, val) {
|
||||
state.jpa2_name = val
|
||||
},
|
||||
update_jpa3_name(state, val) {
|
||||
state.jpa3_name = val
|
||||
},
|
||||
update_jpa4_name(state, val) {
|
||||
state.jpa4_name = val
|
||||
},
|
||||
update_jpa1_percent(state, val) {
|
||||
state.jpa1_percent = val
|
||||
},
|
||||
update_jpa2_percent(state, val) {
|
||||
state.jpa2_percent = val
|
||||
},
|
||||
update_jpa3_percent(state, val) {
|
||||
state.jpa3_percent = val
|
||||
},
|
||||
update_jpa4_percent(state, val) {
|
||||
state.jpa4_percent = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_mous(state, data) {
|
||||
state.mous = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_mou(state, val) {
|
||||
state.dialog_form_mou = val
|
||||
},
|
||||
update_lookup_mou(state, val) {
|
||||
state.lookup_mou = val
|
||||
},
|
||||
update_startdate(state, val) {
|
||||
state.startdate = val
|
||||
},
|
||||
update_enddate(state, val) {
|
||||
state.enddate = val
|
||||
},
|
||||
update_bases(state, data) {
|
||||
state.bases = data
|
||||
},
|
||||
update_base(state, val) {
|
||||
state.base = val
|
||||
},
|
||||
update_omzettypes(state, data) {
|
||||
state.omzettypes = data
|
||||
},
|
||||
update_omzettype(state, val) {
|
||||
state.omzettype = val
|
||||
},
|
||||
update_billtypes(state, data) {
|
||||
state.billtypes = data
|
||||
},
|
||||
update_billtype(state, val) {
|
||||
state.billtype = val
|
||||
},
|
||||
update_branchs(state, data) {
|
||||
state.branchs = data
|
||||
},
|
||||
update_branch(state, val) {
|
||||
state.branch = val
|
||||
},
|
||||
update_moutypes(state, data) {
|
||||
state.moutypes = data
|
||||
},
|
||||
update_moutype(state, val) {
|
||||
state.moutype = val
|
||||
},
|
||||
update_agingtypes(state, data) {
|
||||
state.agingtypes = data
|
||||
},
|
||||
update_agingtype(state, val) {
|
||||
state.agingtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async uploadattachment(context,prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
//prm.id = context.state.selected_fna.id
|
||||
// prm.token = one_token()
|
||||
let resp = await api.uploadattachment(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_formData", null)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_formData", null)
|
||||
context.commit("update_dialog_attachment", false)
|
||||
|
||||
context.commit("update_attachment_files", data.records)
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
|
||||
if(resp.data.errors && resp.data.errors.length > 0){
|
||||
console.log(resp.data.errors)
|
||||
context.commit("update_errors_upload", resp.data.errors)
|
||||
context.commit("update_dialog_error", true)
|
||||
} else {
|
||||
var number = prm.get('number');
|
||||
|
||||
var msg = "Upload file " + number + " berhasil"
|
||||
context.commit("company/update_msg_success", msg, { root: true })
|
||||
context.commit("company/update_alert_success", true, { root: true })
|
||||
}
|
||||
let xprm = {
|
||||
id: context.state.company.selected_company.id,
|
||||
search: context.state.search,
|
||||
current_page: context.state.current_page
|
||||
}
|
||||
context.dispatch("lookup", xprm)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", msg)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_mou", false)
|
||||
var msg = "Agreement " + prm.companyname + " sudah update dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async saveafterrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveafterrelease(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", msg)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_mou", false)
|
||||
var msg = "Agreement " + prm.companyname + " sudah update dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookupx(context, prm) {
|
||||
context.commit("update_lookup_mou", 1)
|
||||
try {
|
||||
let resp = await api.lookupx(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_mou", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_mou", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_mous", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_mou", 3)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_mous", data.records)
|
||||
context.commit("update_total_page_mou", data.total_page)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async lookupreleasebyid(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.lookupreleasebyid(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_moureleases", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah dihapus dong"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async verify(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xverify(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
var msg = resp.message
|
||||
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
|
||||
var note = str.replace('\\n)\\n\"}"', '')
|
||||
console.log(note)
|
||||
context.commit("update_msgalertverif", note)
|
||||
context.commit("update_dialog_alert_verif", true)
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah diverifikasi"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async unverify(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xunverify(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Verifikasi Agreement " + prm.name + " dari company " + prm.companyname + " sudah dibatalkan"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async release(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xrelease(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Agreement " + prm.name + " dari company " + prm.companyname + " sudah dirilis"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async unrelease(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xunrelease(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Rilis Agreement " + prm.name + " dari company " + prm.companyname + " sudah dibatalkan"
|
||||
context.commit("company/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookup", {
|
||||
id: prm.companyid,
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectbase(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectbase(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_bases", resp.data.records.bases)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectomzettype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectomzettype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_omzettypes", resp.data.records.omzettypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectbilltype(context) {
|
||||
context.commit("company/update_get_data_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.selectbilltype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, { root: true })
|
||||
context.commit("company/update_get_data_error_message", "", { root: true })
|
||||
context.commit("update_billtypes", resp.data.records.billtypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", e.message, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getstaff(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getstaff(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_staffs", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async checkacuanharga(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.checkacuanharga(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
console.log(data.records[0].x_count)
|
||||
if(parseInt(data.records[0].x_count) > 0){
|
||||
context.commit("update_dialog_acuan_harga", true)
|
||||
let note = 'Sudah ada acuan harga di ' + data.records[0].note
|
||||
context.commit("update_checkacuanharga", note)
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async selectbranch(context) {
|
||||
context.commit("company/update_get_data_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.selectbranch(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, { root: true })
|
||||
context.commit("company/update_get_data_error_message", "", { root: true })
|
||||
context.commit("update_branchs", resp.data.records.branchs)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, { root: true })
|
||||
context.commit("company/update_get_data_error_message", e.message, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectmoutype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectmoutype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_moutypes", resp.data.records.moutypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectagingtype(context) {
|
||||
context.commit("company/update_get_data_status", 1, {
|
||||
root: true
|
||||
})
|
||||
try {
|
||||
let resp = await api.selectagingtype(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("company/update_get_data_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", "", {
|
||||
root: true
|
||||
})
|
||||
context.commit("update_agingtypes", resp.data.records.agingtypes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("company/update_get_data_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("company/update_get_data_error_message", e.message, {
|
||||
root: true
|
||||
})
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
one-ui/ibl/one-md-company-verifikator/mutation.js
Normal file
0
one-ui/ibl/one-md-company-verifikator/mutation.js
Normal file
27
one-ui/ibl/one-md-company-verifikator/store.js
Normal file
27
one-ui/ibl/one-md-company-verifikator/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import company from "./modules/company.js";
|
||||
import mou from "./modules/mou.js";
|
||||
import area from "./modules/area.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
company: company,
|
||||
mou: mou,
|
||||
area: area,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user