Initial import
This commit is contained in:
31
one-ui/agreement/x_old/one-md-company-releaser-new/api.js
Normal file
31
one-ui/agreement/x_old/one-md-company-releaser-new/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function lookup(token, search,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/lookup', { token: token, search: search, 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 + 'companynewx/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 + 'companynewx/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 selectcompanytype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/selectcompanytype',{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 savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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
|
||||
};
|
||||
}
|
||||
}
|
||||
207
one-ui/agreement/x_old/one-md-company-releaser-new/api/mou.js
Normal file
207
one-ui/agreement/x_old/one-md-company-releaser-new/api/mou.js
Normal file
@@ -0,0 +1,207 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/lookupmou', { 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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function search(token, code,name) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/search', {
|
||||
token:token,
|
||||
code: code,
|
||||
nama: name
|
||||
|
||||
});
|
||||
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 searchmethode(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/searchmethode',{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 getsexreg(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/getsexreg',{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 getvaluetypex(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/getvaluetypex',{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 save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/save',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 newmultirule(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/newmultirule',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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/deletenatmultirule',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 sendorder(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/sendorder',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 getnatmultirule(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/getnatmultirule',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 searchcompany(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/searchcompany',{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 getmou(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/getmou',{id:prm.Nat_TestID,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 savenewnatmultirule(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/savenewnatmultirule',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 saveeditnatmultirule(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/saveeditnatmultirule',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 savemultirulelang(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/savemultirulelang', 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 deletenatmultirule(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/deletenatmultirule',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 searchtest(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/searchtest',{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 searchtestqualitative(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/searchtestqualitative',{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 savereflextest(token,multiruleid,nilai,testid,isquantitative,extremelow,extremehigh,linieritas,limitdetection,isnotapplicable,ordertests) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/savereflextest', {
|
||||
token:token,
|
||||
multiruleid: multiruleid,
|
||||
nilai: nilai,
|
||||
testid: testid,
|
||||
isquantitative: isquantitative,
|
||||
extremelow: extremelow,
|
||||
extremehigh: extremehigh,
|
||||
linieritas: linieritas,
|
||||
limitdetection: limitdetection,
|
||||
isnotapplicable: isnotapplicable,
|
||||
ordertests: ordertests
|
||||
});
|
||||
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 updatereflextest(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'nat_multirule/updatereflextest', {
|
||||
id:prm.id,
|
||||
multiruleid: prm.multiruleid,
|
||||
nilai: prm.nilai,
|
||||
testid: prm.testid,
|
||||
isquantitative: prm.isquantitative,
|
||||
extremelow: prm.extremelow,
|
||||
extremehigh: prm.extremehigh,
|
||||
linieritas: prm.linieritas,
|
||||
limitdetection: prm.limitdetection,
|
||||
isnotapplicable: prm.isnotapplicable,
|
||||
ordertests:prm.ordertests,
|
||||
deleted_ordertests: prm.deleted_ordertests,
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,557 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<v-flex xs12>
|
||||
|
||||
<v-card class="mb-2">
|
||||
<v-subheader red--text text--lighten-1>
|
||||
Reflex Test
|
||||
<v-flex text-md-right>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xnatmultirules" :loading="isLoading" :pagination.sync="pagination" class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-html="props.item.nilai">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.Nat_MultiRuleRuleIsNotApplicable">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.low">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.normal">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.high">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.negative">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.borderline">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.positive">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">
|
||||
<v-icon class="ml-3" color="primary" @click="editFormMultiRule(props.item)">edit</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination v-model="page" :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogquantitative" persistent max-width="900px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Reflex Test : {{xnattest.Nat_TestName}} [ {{this.xnilai}} ]</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formmultirule" lazy-validation>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="xextremelow" label="Extreme Low" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="xlinieritas" label="Linieritas" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="xextremehigh" label="Extreme High" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-model="xlimitdetection" label="Limit Detection" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs6 pa-1>
|
||||
<div>
|
||||
<v-btn @click="changeBtnFlagNotApplicable(xisnotapplicable)" v-if="xisnotapplicable === 'N'" small color="error">
|
||||
<v-icon left>close</v-icon> NOT APPLICABLE</v-btn>
|
||||
<v-btn @click="changeBtnFlagNotApplicable(xisnotapplicable)" v-if="xisnotapplicable === 'Y'" small color="success">
|
||||
<v-icon left>check</v-icon> NOT APPLICABLE</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-autocomplete label="Pemeriksaan" v-model="xorderautotest" :items="xorderautotests" :search-input.sync="search_test" auto-select-first
|
||||
no-filter item-text="Nat_TestName" return-object no-data-text="Cari Pemeriksaan"
|
||||
outline small>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.Nat_TestName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select outline item-text="M_ValueName" class="mini-select" return-object :items="xvaluetypexes" v-model="xvaluetypex"
|
||||
label="Nilai"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<span @click="addTest()" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pt-2 pb-1>
|
||||
<table style="
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
border: 0px;
|
||||
" class="px">
|
||||
<tr>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" width="40%" class="pa-2 grey lighten-1 white--text">TEST
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" width="40%" class="pa-2 grey lighten-1 white--text">NILAI
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" width="20%" class="pa-2 grey lighten-1 white--text">HAPUS
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="mini-input" v-for="(vpx,idx) in xordertests">
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;
|
||||
text-align:left;
|
||||
vertical-align:left;" align="left">{{vpx.Nat_TestName}}
|
||||
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-left pl-3">{{vpx.nilai}}</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-center pr-2"><span v-if="vpx.editable == 'N'">{{idx + 1}}</span>
|
||||
<v-icon v-else-if="vpx.editable == 'Y'" color="#c75c3a" @click="deleteDataPx(idx)">delete</v-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<tfoot>
|
||||
</tfoot>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormMultiRule()">Tutup</v-btn>
|
||||
<v-btn v-if="this.xid === '0'" color="grey darken-1" flat @click="saveFormReflexTest()">Simpan</v-btn>
|
||||
<v-btn v-if="this.xid !== '0'" color="grey darken-1" flat @click="updateFormReflexTest()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-md-test-conclusion-dialog-normal-value': httpVueLoader(
|
||||
'./oneMdTestConclusionDialogNormalValue.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
methods: {
|
||||
changeBtnFlagNotApplicable(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.xisnotapplicable = newval
|
||||
console.log(this.xisnotapplicable)
|
||||
},
|
||||
updateDialogFormMultiRule() {
|
||||
this.$store.commit("multirule/update_dialog_form_quantitative", false)
|
||||
},
|
||||
openFormMultiRule() {
|
||||
this.$refs.formmultirule.reset()
|
||||
this.$refs.formmultirule.resetValidation()
|
||||
this.$store.commit("multirule/update_dialog_form_quantitative", true)
|
||||
},
|
||||
addTest() {
|
||||
var oldArr = this.$store.state.multirule.ordertests
|
||||
var arrTest = this.$store.state.multirule.orderautotest
|
||||
var arrValue = this.$store.state.multirule.selected_valuetypex
|
||||
var arrAll = _.assignIn(arrTest, arrValue)
|
||||
oldArr.push(_.assignIn(arrTest, arrValue))
|
||||
this.searchtest = ''
|
||||
this.$store.commit("multirule/update_orderautotests", [])
|
||||
this.$store.commit("multirule/update_orderautotest", {})
|
||||
this.$store.commit("multirule/update_valuetypexes", [])
|
||||
this.$store.commit("multirule/update_selected_valuetypex", {})
|
||||
|
||||
},
|
||||
deleteDataPx(idx) {
|
||||
var inx = parseInt(idx);
|
||||
var xrow = this.$store.state.multirule.ordertests[inx]
|
||||
if (parseInt(xrow.xid) !== 0) {
|
||||
var xdeltest = this.$store.state.multirule.deleted_ordertests
|
||||
xdeltest.push(xrow)
|
||||
this.$store.commit("multirule/update_deleted_ordertests", xdeltest)
|
||||
}
|
||||
var oldArr = this.$store.state.multirule.ordertests
|
||||
oldArr.splice(inx, 1)
|
||||
this.$store.commit("multirule/update_ordertests", oldArr)
|
||||
},
|
||||
editFormMultiRule(data) {
|
||||
console.log('editform')
|
||||
console.log(data.nilai)
|
||||
this.xid = data.Nat_MultiRuleRuleID
|
||||
this.xmultiruleid = data.Nat_MultiRuleID
|
||||
this.xnilai = data.nilai
|
||||
this.xextremelow = this.xnattest.Nat_MultiRuleExtremeLow
|
||||
this.xextremehigh = this.xnattest.Nat_MultiRuleExtremeHigh
|
||||
this.xlinieritas = this.xnattest.Nat_MultiRuleLinieritas
|
||||
this.xlimitdetection = this.xnattest.Nat_MultiRuleLimitDetection
|
||||
this.xisnotapplicable = data.Nat_MultiRuleRuleIsNotApplicable
|
||||
this.$store.commit("multirule/update_ordertests", data.tests)
|
||||
this.$store.commit("multirule/update_dialog_form_quantitative", true)
|
||||
},
|
||||
saveFormReflexTest() {
|
||||
this.$store.dispatch("multirule/savereflextest", {
|
||||
Nat_MultiRuleRuleNat_MultiRuleID: this.xmultiruleid,
|
||||
Nat_MultiRuleNilai: this.xnilai,
|
||||
testid: this.xnattest.Nat_TestID,
|
||||
isquantitative: this.xnattest.Nat_TestIsQuantitative,
|
||||
extremelow: this.xextremelow,
|
||||
extremehigh: this.xextremehigh,
|
||||
linieritas: this.xlinieritas,
|
||||
limitdetection: this.xlimitdetection,
|
||||
isnotapplicable: this.xisnotapplicable,
|
||||
ordertests: this.xordertests
|
||||
})
|
||||
|
||||
},
|
||||
updateFormReflexTest() {
|
||||
this.$store.dispatch("multirule/updatereflextest", {
|
||||
id: this.xid,
|
||||
multiruleid: this.xmultiruleid,
|
||||
nilai: this.xnilai,
|
||||
testid: this.xnattest.Nat_TestID,
|
||||
isquantitative: this.xnattest.Nat_TestIsQuantitative,
|
||||
extremelow: this.xextremelow,
|
||||
extremehigh: this.xextremehigh,
|
||||
linieritas: this.xlinieritas,
|
||||
limitdetection: this.xlimitdetection,
|
||||
isnotapplicable: this.xisnotapplicable,
|
||||
ordertests: this.xordertests,
|
||||
deleted_ordertests: this.$store.state.multirule.deleted_ordertests
|
||||
})
|
||||
|
||||
},
|
||||
thr_search_test: _.debounce(function () {
|
||||
this.$store.dispatch("multirule/searchtest", this.search_test)
|
||||
}, 2000)
|
||||
},
|
||||
computed: {
|
||||
dialogquantitative() {
|
||||
return this.$store.state.multirule.dialog_form_quantitative
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.multirule.search_status == 1
|
||||
},
|
||||
xnattest() {
|
||||
return this.$store.state.multirule.selected_multirule
|
||||
},
|
||||
xnatmultirules() {
|
||||
return this.$store.state.multirule.natmultirules
|
||||
},
|
||||
xfiltermethode() {
|
||||
return this.$store.state.multirule.filter_methodes
|
||||
},
|
||||
xselected_filter_methode: {
|
||||
get() {
|
||||
return this.$store.state.multirule.selected_filter_methode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_selected_filter_methode", val)
|
||||
}
|
||||
},
|
||||
xtests() {
|
||||
return this.$store.state.multirule.tests
|
||||
},
|
||||
xtest: {
|
||||
get() {
|
||||
return this.$store.state.multirule.test
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_test", val)
|
||||
}
|
||||
},
|
||||
xisnotapplicable: {
|
||||
get() {
|
||||
return this.$store.state.multirule.isnotapplicable
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_isnotapplicable", val)
|
||||
}
|
||||
},
|
||||
xvaluexs() {
|
||||
return this.$store.state.multirule.valuexs
|
||||
},
|
||||
xvaluex: {
|
||||
get() {
|
||||
return this.$store.state.multirule.valuex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_valuex", val)
|
||||
}
|
||||
},
|
||||
xspilih: {
|
||||
get() {
|
||||
return this.$store.state.multirule.spilih
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_spilih", val)
|
||||
}
|
||||
},
|
||||
xsmultiruleid: {
|
||||
get() {
|
||||
return this.$store.state.multirule.smultiruleid
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_smultiruleid", val)
|
||||
}
|
||||
},
|
||||
xvaluetypees() {
|
||||
return this.$store.state.multirule.valuetypees
|
||||
},
|
||||
xvaluetype: {
|
||||
get() {
|
||||
return this.$store.state.multirule.selected_valuetype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_selected_valuetype", val)
|
||||
}
|
||||
},
|
||||
xnilai: {
|
||||
get() {
|
||||
return this.$store.state.multirule.nilai
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_nilai", val)
|
||||
}
|
||||
},
|
||||
xorderautotests() {
|
||||
return this.$store.state.multirule.orderautotests
|
||||
},
|
||||
xorderautotest: {
|
||||
get() {
|
||||
return this.$store.state.multirule.orderautotest
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_orderautotest", val)
|
||||
}
|
||||
},
|
||||
xordertests() {
|
||||
return this.$store.state.multirule.ordertests
|
||||
},
|
||||
xvaluetypexes() {
|
||||
return this.$store.state.multirule.valuetypexes
|
||||
},
|
||||
xvaluetypex: {
|
||||
get() {
|
||||
return this.$store.state.multirule.selected_valuetypex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_selected_valuetypex", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
menufilterdatestart: false,
|
||||
menufilterdateend: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
items: [],
|
||||
name: '',
|
||||
xelow: '',
|
||||
xehigh: '',
|
||||
xextremehigh: '',
|
||||
xextremelow: '',
|
||||
xlimitdetection: '',
|
||||
xlinieritas: '',
|
||||
search_test: '',
|
||||
xid: 0,
|
||||
xmultiruleid: 0,
|
||||
page: 1,
|
||||
headers: [{
|
||||
text: "NILAI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "5%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "NOT APLICABLE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "5%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "LOW",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "NORMAL",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "HIGH",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "NEGATIVE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "BORDERLINE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "POSITIVE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "5%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
}
|
||||
|
||||
],
|
||||
headers_search: [{
|
||||
text: "PASIEN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "BARCODE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "ALMARI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "25%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "RAK",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "POSISI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'trx_id ASC',
|
||||
totalItems: this.$store.state.multirule.total_transactions
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
search_test(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.multirule.update_autocomplete_status == 1) return
|
||||
this.thr_search_test()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,459 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout>
|
||||
<v-text-field class="xs4 ma-1" label="Kode" placeholder="Cari..." outline v-model="code" hide-details></v-text-field>
|
||||
<v-text-field class="xs4 ma-1" label="Pemeriksaan" placeholder="Cari..." outline v-model="name" hide-details></v-text-field>
|
||||
<span @click="searchTest" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="multirules" :loading="isLoading" :pagination.sync="pagination" class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestCode}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestName}}</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination v-model="page" :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
|
||||
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogformorder" 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-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete label="Perusahaan*" v-model="xcompany" :items="xcompanies" :search-input.sync="search_company" auto-select-first
|
||||
no-filter item-text="M_CompanyName" return-object :loading="isLoading" no-data-text="Pilih Perusahaan">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requirexcompany')" class="error pl-2 pr-2" style="color:#fff">Pilih perusahaan dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-select item-text="M_MouName" return-object :items="xmous" v-model="xmou" label="MOU*"></v-select>
|
||||
<p v-if="checkError('requirexmou')" class="error pl-2 pr-2" style="color:#fff">Pilih MOU dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-menu ref="menusdate" v-model="menusdate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
|
||||
offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field v-model="startComputedDateFormatted" label="Tgl. Order*" readonly v-on="on" @blur="date = deFormatedDate(startComputedDateFormatted)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xsdate" no-title @input="menusdate = false"></v-date-picker>
|
||||
<p v-if="checkError('requirexsdate')" class="error pl-2 pr-2" style="color:#fff">Tanggal order harus diisi dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field v-model="xnote" label="Catatan"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="grey darken-1" flat @click="updateDialogFormOrder()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="grey darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="grey darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogstatusorder" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Status</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-timeline>
|
||||
<v-timeline-item v-for="(status, i) in xstatuss" :key="i" :waktu="status.waktu" :user="status.user" small>
|
||||
<template>
|
||||
<span :class="`headline font-weight-bold cyan--text`" v-text="status.status"></span>
|
||||
</template>
|
||||
<div class="py-3">
|
||||
<h2 :class="`headline font-weight-light mb-3 cyan--text`"></h2>
|
||||
<div>
|
||||
{{status.waktu}}
|
||||
<p> [ {{status.user}} ] </p>
|
||||
</div>
|
||||
</div>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="grey darken-1" flat @click="updateDialogStatusOrder()">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("multirule/getsexreg")
|
||||
|
||||
this.$store.dispatch("multirule/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.multirule.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.Nat_TestID == this.$store.state.multirule.selected_multirule
|
||||
.Nat_TestID
|
||||
|
||||
},
|
||||
searchTest() {
|
||||
this.$store.dispatch("multirule/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.multirule.no_save == 0) {
|
||||
this.$store.commit("multirule/update_selected_multirule", pat)
|
||||
this.$store.commit("multirule/update_act_comp", 'edit')
|
||||
this.$store.commit("multirule/update_extremelow", pat.Nat_MultiRuleExtremeLow)
|
||||
this.$store.commit("multirule/update_extremehigh", pat.Nat_MultiRuleExtremeHigh)
|
||||
this.$store.commit("multirule/update_linieritas", pat.Nat_MultiRuleLinieritas)
|
||||
this.$store.commit("multirule/update_limitdetection", pat.Nat_MultiRuleLimitDetection)
|
||||
this.$store.commit("multirule/update_isnotapplicable", pat.Nat_MultiRuleRuleIsNotApplicable)
|
||||
this.$store.dispatch("multirule/getnatmultirule", {
|
||||
id: pat.Nat_TestID,
|
||||
isquantitative: pat.Nat_TestIsQuantitative
|
||||
})
|
||||
this.$store.dispatch("multirule/getvaluetypex", pat.Nat_TestIsQuantitative)
|
||||
} else {
|
||||
this.$store.commit("multirule/update_open_alert_confirmation", true)
|
||||
}
|
||||
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("multirule/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("multirule/update_no_save", 0)
|
||||
this.$store.commit("multirule/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("multirule/update_alert_success", val)
|
||||
},
|
||||
updateDialogFormOrder() {
|
||||
this.$store.commit("multirule/update_dialog_form_order", false)
|
||||
},
|
||||
updateDialogStatusOrder() {
|
||||
this.$store.commit("multirule/update_dialog_status_order", false)
|
||||
},
|
||||
setNewOrder() {
|
||||
this.$store.commit("multirule/update_selected_multirule", {})
|
||||
this.$store.commit("multirule/update_act_comp", 'new')
|
||||
this.$store.commit("multirule/update_dialog_form_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
setStatusOrder() {
|
||||
this.$store.commit("multirule/update_selected_multirule", {})
|
||||
this.$store.commit("multirule/update_dialog_status_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
saveFormPerusahaan() {
|
||||
this.$store.commit("multirule/update_errors", [])
|
||||
var errors = this.$store.state.multirule.errors
|
||||
if (_.isEmpty(this.xcompany)) {
|
||||
errors.push("requirexcompany")
|
||||
}
|
||||
if (_.isEmpty(this.xmou)) {
|
||||
errors.push("requirexmou")
|
||||
}
|
||||
if (_.isEmpty(this.xsdate)) {
|
||||
errors.push("requirexsdate")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
this.$store.dispatch("multirule/newmultirule", {
|
||||
companyid: this.xcompany.M_CompanyID,
|
||||
mouid: this.xmou.M_MouID,
|
||||
sdate: this.xsdate,
|
||||
note: this.xnote
|
||||
})
|
||||
}
|
||||
},
|
||||
thr_search_company: _.debounce(function () {
|
||||
this.$store.dispatch("multirule/searchcompany", this.search_company)
|
||||
}, 2000),
|
||||
closeDialogSuccess() {
|
||||
let arrmultirule = this.$store.state.multirule.multirules
|
||||
var idx = _.findIndex(arrmultirule, item => item.Nat_TestID === this.$store.state
|
||||
.multirule.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("multirule/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("multirule/update_dialog_success", false)
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.multirule.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.multirule.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.multirule.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.multirule.search_status == 1
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.multirule.act_comp
|
||||
},
|
||||
multirules() {
|
||||
return this.$store.state.multirule.multirules
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.multirule.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
dialogformorder() {
|
||||
return this.$store.state.multirule.dialog_form_order
|
||||
},
|
||||
dialogstatusorder() {
|
||||
return this.$store.state.multirule.dialog_status_order
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.multirule.date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_date", val)
|
||||
}
|
||||
},
|
||||
xnote: {
|
||||
get() {
|
||||
return this.$store.state.multirule.note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_note", val)
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.multirule.companies
|
||||
},
|
||||
xcompany: {
|
||||
get() {
|
||||
return this.$store.state.multirule.company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_company", val)
|
||||
this.$store.dispatch("multirule/getmou", this.$store.state.multirule.company)
|
||||
}
|
||||
},
|
||||
xmous() {
|
||||
return this.$store.state.multirule.mous
|
||||
},
|
||||
xmou: {
|
||||
get() {
|
||||
return this.$store.state.multirule.mou
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_mou", val)
|
||||
}
|
||||
},
|
||||
startComputedDateFormatted() {
|
||||
return this.formatDate(this.xsdate)
|
||||
},
|
||||
xsdate: {
|
||||
get() {
|
||||
return this.$store.state.multirule.sdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("multirule/update_sdate", val)
|
||||
}
|
||||
},
|
||||
xstatuss() {
|
||||
return this.$store.state.multirule.statuss
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
code: '',
|
||||
name: '',
|
||||
search_company: '',
|
||||
menusdate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
page: 1,
|
||||
headers: [{
|
||||
text: "KODE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "40%",
|
||||
class: "pa-2 grey lighten-1 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
ascending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'Nat_TestCode',
|
||||
totalItems: this.$store.state.multirule.total_multirules
|
||||
},
|
||||
statuss: [{
|
||||
waktu: '16-07-2019 10:00',
|
||||
status: 'Order Dibuat',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 11:00',
|
||||
status: 'Order Dikirim',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 12:00',
|
||||
status: 'Order dikonfirmasi',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 13:00',
|
||||
status: 'Telah dibuat Surat Jalan',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 14:00',
|
||||
status: 'Kurir akan mengambil sampel',
|
||||
user: 'Satria Subiantoro'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.multirule.update_autocomplete_status == 1) return
|
||||
this.thr_search_company()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,818 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<v-flex xs12>
|
||||
<v-card class="mb-2" color="white">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>Agreement Perusahaan : {{xcompany.name}}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormMou(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
|
||||
<table>
|
||||
<tr>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">NO.</th>
|
||||
<th width="15%" class="text-md-center pt-2 pb-2">NAMA</th>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">TGL MULAI</th>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">TGL AKHIR</th>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">DASAR</th>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">KLASIFIKASI OMZET</th>
|
||||
<th width="10%" class="text-md-center pt-2 pb-2">TIPE</th>
|
||||
<th width="15%" class="text-md-center pt-2 pb-2">VERIFIKASI</th>
|
||||
<th width="15%" class="text-md-center pt-2 pb-2">RILIS</th>
|
||||
|
||||
<th class="text-md-center pt-2 pb-2">AKSI</th>
|
||||
</tr>
|
||||
<tr v-if="mous.length > 0 " v-for="(mou,idx) in mous">
|
||||
<td class="text-md-left pl-3">{{mou.number}}</td>
|
||||
<td class="text-md-left pl-3">{{mou.name}}</td>
|
||||
<td class="text-md-center">{{mou.startdate}}</td>
|
||||
<td class="text-md-center">{{mou.enddate}}</td>
|
||||
<td class="text-md-center">{{mou.basename}}</td>
|
||||
<td class="text-md-center">{{mou.M_OmzetTypeName}}</td>
|
||||
<td class="text-md-center">{{mou.M_MouTypeName}}</td>
|
||||
<td class="text-md-center">
|
||||
<p style="margin-bottom:0px">{{mou.verifydate}}</p>
|
||||
<p style="margin-bottom:0px">{{mou.verifyuser}}</p>
|
||||
</td>
|
||||
<td class="text-md-center">
|
||||
<p style="margin-bottom:0px">{{mou.releasedate}}</p>
|
||||
<p style="margin-bottom:0px">{{mou.releaseuser}}</p>
|
||||
</td>
|
||||
<td align="center" class="text-md-center">
|
||||
<v-btn v-if="mou.isreleased == 'N'" @click="editFormMou(mou)" depressed small color="primary">
|
||||
<v-icon>edit</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="mou.isreleased == 'N'" @click="deleteMou(mou)" depressed small color="error">
|
||||
<v-icon>delete</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="mou.isverified == 'N'" @click="verifyMou(mou)" depressed small color="success">
|
||||
<v-icon>check</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="mou.isverified == 'Y' && mou.isreleased == 'N'" @click="releaseMou(mou)" depressed small color="primary">
|
||||
<v-icon>check</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="mou.isverified == 'Y' && mou.isreleased == 'Y'" @click="unreleaseMou(mou)" depressed small color="primary">
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
<v-btn v-if="mou.isverified == 'Y' && mou.isreleased == 'N'" @click="unverifyMou(mou)" depressed small color="success">
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="mous.length === 0">
|
||||
<td align="center" style="height:50px;text-align:center" colspan="11">Belum ada data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealertmou" 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>
|
||||
{{msgalertmou}}
|
||||
</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="dialogdeletealertmou = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlertMou()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogverifyalertmou" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Konfirmasi
|
||||
</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>
|
||||
{{msgalertmou}}
|
||||
</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="dialogverifyalertmou = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeVerifyAlertMou()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogunverifyalertmou" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Konfirmasi
|
||||
</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>
|
||||
{{msgalertmou}}
|
||||
</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="dialogunverifyalertmou = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeUnVerifyAlertMou()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogreleasealertmou" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Konfirmasi
|
||||
</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>
|
||||
{{msgalertmou}}
|
||||
</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="dialogreleasealertmou = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeReleaseAlertMou()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogunreleasealertmou" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Konfirmasi
|
||||
</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>
|
||||
{{msgalertmou}}
|
||||
</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="dialogunreleasealertmou = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeUnReleaseAlertMou()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogmou" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Agreement</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompanymou" v-model="validmou" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
PERUSAHAAN : {{xcompany.name}} <span> [ <span style="color:#2196F3;font-weight: 900;">{{number}} </span> ]
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field label="Nama" v-model="name"></v-text-field>
|
||||
<p v-if="checkError('requirename')" class="error pl-2 pr-2" style="color:#fff">Nama harus diisi dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field label="No Ref" v-model="refnumber"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-menu ref="menustartdate" v-model="menustartdate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
|
||||
offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field v-model="startComputedDateFormatted" label="Tgl. Mulai" readonly v-on="on" @blur="date = deFormatedDate(startComputedDateFormatted)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xstartdate" no-title @input="menustartdate = false"></v-date-picker>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-menu ref="menuenddate" v-model="menuenddate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
|
||||
offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field v-model="endComputedDateFormatted" label="Tgl. Selesai" readonly v-on="on" @blur="date = deFormatedDate(endComputedDateFormatted)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xenddate" no-title @input="menuenddate = false"></v-date-picker>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-flex xs12>
|
||||
|
||||
<v-select item-text="basename" return-object :items="xbases" v-model="xbase" label="Dasar Agreement"></v-select>
|
||||
<p v-if="checkError('requirebase')" class="error pl-2 pr-2" style="color:#fff">Dasar Agreement harus diisi dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="M_OmzetTypeName" return-object :items="xomzettypes" v-model="xomzettype" label="Klasifikasi Omset"></v-select>
|
||||
<p v-if="checkError('requireomzet')" class="error pl-2 pr-2" style="color:#fff">Klasifikasi Omset harus diisi dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="M_MouTypeName" return-object :items="xmoutypes" v-model="xmoutype" label="Tipe Agreement"></v-select>
|
||||
<p v-if="checkError('requiremoutypr')" class="error pl-2 pr-2" style="color:#fff">Tipe Agreement harus diisi dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="M_AgingTypeName" return-object :items="xagingtypes" v-model="xagingtype" label="Tipe Aging"></v-select>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea v-model="xnote" label="Catatan"></v-textarea>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="isbill" label="Bill ?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-if="this.isbill === false" label="Min DP (Persen)" v-model="mindp"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="isaging" label="Aging on Hold ?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-if="this.isaging === true" label="Keterangan Aging on Hold" v-model="agingnote"></v-text-field>
|
||||
<p v-if="checkError('requireaging')" class="error pl-2 pr-2" style="color:#fff">Keterangan Aging harus diisi dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-checkbox v-model="isemail" label="Otomatis Kirim Email?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field v-if="this.isemail === true" label="Email" v-model="mouemail"></v-text-field>
|
||||
<p v-if="checkError('requireemail')" class="error pl-2 pr-2" style="color:#fff">Alamat Email harus diisi dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-checkbox v-model="isdefault" label="Default ?"></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-checkbox v-model="isfavorit" label="Favorite ?"></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="updateDialogFormMou()">Tutup</v-btn>
|
||||
<v-btn color="blue darken-1" flat @click="saveFormMou()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background: white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table>tr>td:first {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-date-picker': httpVueLoader('../../common/oneDatePicker.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
items: [],
|
||||
emailRules: [
|
||||
v => !!v || 'Alamat email harus diisi'
|
||||
],
|
||||
headers: [{
|
||||
text: "NAME",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "30%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "STARTDATE",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "ENDDATE",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "ISBILL",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Action",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
}
|
||||
],
|
||||
isLoading: false,
|
||||
color: "success",
|
||||
validmou: false,
|
||||
xid: 0,
|
||||
name: "",
|
||||
number: "",
|
||||
refnumber: "",
|
||||
mindp: "",
|
||||
agingnote: "",
|
||||
xnote: "",
|
||||
mouemail: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
isbill: "",
|
||||
isdefault: "",
|
||||
isfavorit: "",
|
||||
isaging: "",
|
||||
isemail: "",
|
||||
menustartdate: false,
|
||||
menuenddate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
|
||||
dialogdeletealertmou: false,
|
||||
dialogverifyalertmou: false,
|
||||
dialogreleasealertmou: false,
|
||||
dialogunreleasealertmou: false,
|
||||
dialogunverifyalertmou: false,
|
||||
msgalertmou: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("mou/selectbase")
|
||||
this.$store.dispatch("mou/selectomzettype")
|
||||
this.$store.dispatch("mou/selectmoutype")
|
||||
this.$store.dispatch("mou/selectagingtype")
|
||||
},
|
||||
computed: {
|
||||
mous() {
|
||||
return this.$store.state.mou.mous
|
||||
},
|
||||
xcompany() {
|
||||
return this.$store.state.company.selected_company
|
||||
},
|
||||
dialogmou() {
|
||||
return this.$store.state.mou.dialog_form_mou
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.mou.errors
|
||||
},
|
||||
startComputedDateFormatted() {
|
||||
return this.formatDate(this.xstartdate)
|
||||
},
|
||||
xstartdate: {
|
||||
get() {
|
||||
return this.$store.state.mou.startdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_startdate", val)
|
||||
}
|
||||
},
|
||||
endComputedDateFormatted() {
|
||||
return this.formatDate(this.xenddate)
|
||||
},
|
||||
xenddate: {
|
||||
get() {
|
||||
return this.$store.state.mou.enddate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_enddate", val)
|
||||
}
|
||||
},
|
||||
xbases() {
|
||||
return this.$store.state.mou.bases
|
||||
},
|
||||
xbase: {
|
||||
get() {
|
||||
return this.$store.state.mou.base
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_base", val)
|
||||
}
|
||||
|
||||
},
|
||||
xomzettypes() {
|
||||
return this.$store.state.mou.omzettypes
|
||||
},
|
||||
xomzettype: {
|
||||
get() {
|
||||
return this.$store.state.mou.omzettype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_omzettype", val)
|
||||
}
|
||||
|
||||
},
|
||||
xmoutypes() {
|
||||
return this.$store.state.mou.moutypes
|
||||
},
|
||||
xmoutype: {
|
||||
get() {
|
||||
return this.$store.state.mou.moutype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_moutype", val)
|
||||
}
|
||||
|
||||
},
|
||||
xagingtypes() {
|
||||
return this.$store.state.mou.agingtypes
|
||||
},
|
||||
xagingtype: {
|
||||
get() {
|
||||
return this.$store.state.mou.agingtype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("mou/update_agingtype", val)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateDialogFormMou() {
|
||||
this.$store.commit("mou/update_dialog_form_mou", false)
|
||||
},
|
||||
openFormMou(val) {
|
||||
this.xid = val
|
||||
this.name = ''
|
||||
this.number = ''
|
||||
this.refnumber = ''
|
||||
this.xstartdate = moment(new Date()).format('YYYY-MM-DD')
|
||||
this.xenddate = moment(new Date()).format('YYYY-MM-DD')
|
||||
this.isbill = ''
|
||||
this.isdefault = ''
|
||||
this.favorite = ''
|
||||
this.isaging = ''
|
||||
this.isemail = ''
|
||||
this.mindp = ''
|
||||
this.agingnote = ''
|
||||
this.xnote = ''
|
||||
this.mouemail = ''
|
||||
this.$store.commit("mou/update_moutype", {})
|
||||
this.$store.commit("mou/update_agingtype", {})
|
||||
this.$store.commit("mou/update_omzettype", {})
|
||||
this.$store.commit("mou/update_base", {})
|
||||
this.$store.commit("mou/update_dialog_form_mou", true)
|
||||
},
|
||||
editFormMou(val) {
|
||||
// this.$store.commit("mou/update_error_name", false)
|
||||
this.xid = val.id
|
||||
this.name = val.name
|
||||
this.number = val.number
|
||||
this.refnumber = val.refnumber
|
||||
this.startdate = val.xstartdate
|
||||
this.enddate = val.xenddate
|
||||
this.isbill = val.isbill === 'N' ? false : true
|
||||
this.isdefault = val.isdefault === 'N' ? false : true
|
||||
this.isfavorit = val.isfavorit === 'N' ? false : true
|
||||
this.isaging = val.isaging === 'N' ? false : true
|
||||
this.isemail = val.isemail === 'N' ? false : true
|
||||
this.mindp = val.mindp
|
||||
this.agingnote = val.agingnote
|
||||
this.xnote = val.xnote
|
||||
this.mouemail = val.mouemail
|
||||
var bases = this.$store.state.mou.bases
|
||||
var idx_base = _.findIndex(bases, function (o) {
|
||||
return o.baseid == val.baseid
|
||||
})
|
||||
var base = bases[idx_base]
|
||||
this.$store.commit("mou/update_base", base)
|
||||
|
||||
var omzettypes = this.$store.state.mou.omzettypes
|
||||
var idx_omzettype = _.findIndex(omzettypes, function (o) {
|
||||
return o.M_OmzetTypeID == val.M_OmzetTypeID
|
||||
})
|
||||
var omzettype = omzettypes[idx_omzettype]
|
||||
this.$store.commit("mou/update_omzettype", omzettype)
|
||||
|
||||
var moutypes = this.$store.state.mou.moutypes
|
||||
var idx_moutype = _.findIndex(moutypes, function (o) {
|
||||
return o.M_MouTypeID == val.M_MouTypeID
|
||||
})
|
||||
var moutype = moutypes[idx_moutype]
|
||||
this.$store.commit("mou/update_moutype", moutype)
|
||||
|
||||
var agingtypes = this.$store.state.mou.agingtypes
|
||||
var idx_agingtype = _.findIndex(agingtypes, function (o) {
|
||||
return o.M_AgingTypeID == val.M_AgingTypeID
|
||||
})
|
||||
var agingtype = agingtypes[idx_agingtype]
|
||||
this.$store.commit("mou/update_agingtype", agingtype)
|
||||
this.$store.commit("mou/update_dialog_form_mou", true)
|
||||
this.$store.commit("mou/update_startdate", val.M_MouStartDate)
|
||||
this.$store.commit("mou/update_enddate", val.M_MouEndDate)
|
||||
},
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.mou.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveFormMou() {
|
||||
this.$store.commit("mou/update_errors", [])
|
||||
var errors = this.$store.state.mou.errors
|
||||
if (this.name === '') {
|
||||
errors.push("requirename")
|
||||
}
|
||||
if (_.isEmpty(this.xbase)) {
|
||||
errors.push("requirebase")
|
||||
}
|
||||
if (_.isEmpty(this.xomzettype)) {
|
||||
errors.push("requireomzet")
|
||||
}
|
||||
if (_.isEmpty(this.xmoutype)) {
|
||||
errors.push("requiremoutypr")
|
||||
}
|
||||
if (this.isemail === true && this.mouemail === '') {
|
||||
errors.push("requireemail")
|
||||
}
|
||||
if (this.isaging === true && this.agingnote === '') {
|
||||
errors.push("requireaging")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
this.$store.dispatch("mou/save", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name,
|
||||
startdate: this.xstartdate,
|
||||
enddate: this.xenddate,
|
||||
isbill: this.isbill === true ? "Y" : "N",
|
||||
isdefault: this.isdefault === true ? "Y" : "N",
|
||||
isfavorit: this.isfavorit === true ? "Y" : "N",
|
||||
isaging: this.isaging === true ? "Y" : "N",
|
||||
isemail: this.isemail === true ? "Y" : "N",
|
||||
number: this.number,
|
||||
refnumber: this.refnumber,
|
||||
mindp: this.mindp,
|
||||
agingnote: this.isaging === true ? this.agingnote : "",
|
||||
xnote: this.xnote,
|
||||
mouemail: this.isemail === true ? this.mouemail : "",
|
||||
base: this.xbase.baseid,
|
||||
omzettype: this.xomzettype.M_OmzetTypeID,
|
||||
moutype: this.xmoutype.M_MouTypeID,
|
||||
agingtype: this.xagingtype.M_AgingTypeID
|
||||
})
|
||||
}
|
||||
},
|
||||
set_date2(x) {
|
||||
this.startdate = x.new_date
|
||||
},
|
||||
set_date3(x) {
|
||||
this.enddate = x.new_date
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("company/update_alert_success", val)
|
||||
},
|
||||
deleteMou(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertmou = "Yakin, mau hapus agreement ini?"
|
||||
this.dialogdeletealertmou = true
|
||||
},
|
||||
closeDeleteAlertMou() {
|
||||
this.$store.dispatch("mou/delete", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name
|
||||
})
|
||||
this.dialogdeletealertmou = false
|
||||
},
|
||||
verifyMou(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertmou = "Apakah Anda yakin akan mem-verifikasi agreement ini?"
|
||||
this.dialogverifyalertmou = true
|
||||
},
|
||||
closeVerifyAlertMou() {
|
||||
this.$store.dispatch("mou/verify", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name
|
||||
})
|
||||
this.dialogverifyalertmou = false
|
||||
},
|
||||
releaseMou(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertmou = "Apakah Anda yakin akan merilis agreement ini?"
|
||||
this.dialogreleasealertmou = true
|
||||
},
|
||||
closeReleaseAlertMou() {
|
||||
this.$store.dispatch("mou/release", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name
|
||||
})
|
||||
this.dialogreleasealertmou = false
|
||||
},
|
||||
unreleaseMou(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertmou = "Apakah Anda yakin akan membatalkan rilis agreement ini?"
|
||||
this.dialogunreleasealertmou = true
|
||||
},
|
||||
closeUnReleaseAlertMou() {
|
||||
this.$store.dispatch("mou/unrelease", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name
|
||||
})
|
||||
this.dialogunreleasealertmou = false
|
||||
},
|
||||
unverifyMou(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertmou = "Apakah Anda yakin akan membatalkan verifikasi agreement ini?"
|
||||
this.dialogunverifyalertmou = true
|
||||
},
|
||||
closeUnVerifyAlertMou() {
|
||||
this.$store.dispatch("mou/unverify", {
|
||||
xid: this.xid,
|
||||
companyid: this.$store.state.company.selected_company.id,
|
||||
companyname: this.$store.state.company.selected_company.name,
|
||||
name: this.name
|
||||
})
|
||||
this.dialogunverifyalertmou = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
77
one-ui/agreement/x_old/one-md-company-releaser-new/index.php
Normal file
77
one-ui/agreement/x_old/one-md-company-releaser-new/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 xs3 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 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/oneNavbarComponent.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>
|
||||
@@ -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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,720 @@
|
||||
// 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_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
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_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_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.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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} 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 selectcompanytype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(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_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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,403 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/mou.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
mous: [],
|
||||
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: {},
|
||||
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_progress:false
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_progress(state,val) {
|
||||
state.dialog_progress = 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_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 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 })
|
||||
} 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
|
||||
})
|
||||
}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 {
|
||||
let resp = await api.lookup(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_mous", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 })
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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_progress", 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 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,0 +1,816 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/multirule.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id: -1,
|
||||
last_saved_id: -1,
|
||||
x_pat_id: 0,
|
||||
act: 'edit',
|
||||
act_comp: 'new',
|
||||
act_pat: 'new',
|
||||
act_send: 'N',
|
||||
get_data_status: 0,
|
||||
search_multirule: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
dialog_form_multirule: false,
|
||||
dialog_edit_form_multirule: false,
|
||||
dialog_form_quantitative: false,
|
||||
dialog_edit_form_quantitative: false,
|
||||
dialog_form_qualitative: false,
|
||||
dialog_edit_form_qualitative: false,
|
||||
dialog_status_order: false,
|
||||
norm: '',
|
||||
multirule_name: '',
|
||||
multirules: [],
|
||||
total_multirules: 0,
|
||||
multirule_natmultirule: [],
|
||||
date: '',
|
||||
note: '',
|
||||
sdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
companies: [],
|
||||
company: {},
|
||||
mous: [],
|
||||
mou: {},
|
||||
total_multirule: 0,
|
||||
selected_multirule: {},
|
||||
save_status: 0,
|
||||
btn_save_seen: true,
|
||||
pgrs_save: false,
|
||||
save_error_message: '',
|
||||
no_save: 0,
|
||||
open_alert_confirmation: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
dialog_success: false,
|
||||
dialog_confirmation_delete: false,
|
||||
msg_confirmation_delete: "",
|
||||
dialog_confirmation_send: false,
|
||||
msg_confirmation_send: "",
|
||||
dialog_confirmation_delete_pat: false,
|
||||
msg_confirmation_delete_pat: "",
|
||||
autocomplete_status: 0,
|
||||
dialog_form_natmultirule: false,
|
||||
errors: [],
|
||||
natmultirules: [],
|
||||
minage: '',
|
||||
maxage: '',
|
||||
minvalue: '',
|
||||
maxvalue: '',
|
||||
note: '',
|
||||
description: '',
|
||||
sexes: [],
|
||||
selected_sex: {},
|
||||
valuetypexes: [],
|
||||
selected_valuetypex: {},
|
||||
valuetypees: [],
|
||||
selected_valuetype: {},
|
||||
valuequalitativees: [],
|
||||
selected_valuequalitative: {},
|
||||
tests: [],
|
||||
test: {},
|
||||
testqualitatives: [],
|
||||
testqualitative: {},
|
||||
statuss: [],
|
||||
open_print_note: false,
|
||||
methodes: [],
|
||||
methode: {},
|
||||
multiruletypees: [],
|
||||
selected_multiruletype: {},
|
||||
flages: [],
|
||||
selected_flag: {},
|
||||
ageunites: [],
|
||||
selected_ageunit: {},
|
||||
validdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
extremelow: '',
|
||||
extremehigh: '',
|
||||
linieritas: '',
|
||||
limitdetection: '',
|
||||
isnotapplicable: 'N',
|
||||
nilai: '',
|
||||
orderautotests: [],
|
||||
orderautotest: {},
|
||||
ordertests: [],
|
||||
deleted_ordertests: [],
|
||||
error_name:false
|
||||
|
||||
},
|
||||
mutations: {
|
||||
update_x_pat_id(state, val) {
|
||||
state.x_pat_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_act_comp(state, val) {
|
||||
state.act_comp = val
|
||||
},
|
||||
update_act_pat(state, val) {
|
||||
state.act_pat = val
|
||||
},
|
||||
update_act_send(state, val) {
|
||||
state.act_send = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, multirule) {
|
||||
state.search_error_message = multirule
|
||||
},
|
||||
update_search_multirule(state, multirule) {
|
||||
state.search_multirule = multirule
|
||||
},
|
||||
update_dialog_form_multirule(state, val) {
|
||||
state.dialog_form_multirule = val
|
||||
},
|
||||
update_dialog_edit_form_multirule(state, val) {
|
||||
state.dialog_edit_form_multirule = val
|
||||
},
|
||||
update_dialog_form_quantitative(state, val) {
|
||||
state.dialog_form_quantitative = val
|
||||
},
|
||||
update_dialog_edit_form_quantitative(state, val) {
|
||||
state.dialog_edit_form_quantitative = val
|
||||
},
|
||||
update_dialog_form_qualitative(state, val) {
|
||||
state.dialog_form_qualitative = val
|
||||
},
|
||||
update_dialog_edit_form_qualitative(state, val) {
|
||||
state.dialog_edit_form_qualitative = val
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
},
|
||||
update_multirule_name(state, val) {
|
||||
state.multirule_name = val
|
||||
},
|
||||
update_date(state, val) {
|
||||
state.date = val
|
||||
},
|
||||
update_sdate(state, val) {
|
||||
state.sdate = val
|
||||
},
|
||||
update_note(state, val) {
|
||||
state.note = val
|
||||
},
|
||||
update_multirules(state, data) {
|
||||
state.multirules = data
|
||||
},
|
||||
update_selected_multirule(state, val) {
|
||||
state.selected_multirule = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_btn_save_seen(state, val) {
|
||||
state.btn_save_seen = val
|
||||
},
|
||||
update_pgrs_save(state, val) {
|
||||
state.pgrs_save = val
|
||||
},
|
||||
update_save_error_message(state, msg) {
|
||||
state.save_error_message = ''
|
||||
},
|
||||
update_no_save(state, val) {
|
||||
state.no_save = val
|
||||
},
|
||||
update_open_alert_confirmation(state, val) {
|
||||
state.open_alert_confirmation = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_dialog_success(state, val) {
|
||||
state.dialog_success = val
|
||||
},
|
||||
update_dialog_confirmation_delete(state, val) {
|
||||
state.dialog_confirmation_delete = val
|
||||
},
|
||||
update_msg_confirmation_delete(state, val) {
|
||||
state.msg_confirmation_delete = val
|
||||
},
|
||||
update_dialog_confirmation_send(state, val) {
|
||||
state.dialog_confirmation_send = val
|
||||
},
|
||||
update_msg_confirmation_send(state, val) {
|
||||
state.msg_confirmation_send = val
|
||||
},
|
||||
update_dialog_confirmation_delete_pat(state, val) {
|
||||
state.dialog_confirmation_delete_pat = val
|
||||
},
|
||||
update_msg_confirmation_delete_pat(state, val) {
|
||||
state.msg_confirmation_delete_pat = val
|
||||
},
|
||||
update_natmultirules(state, val) {
|
||||
state.natmultirules = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_natmultirule(state, val) {
|
||||
state.dialog_form_natmultirule = val
|
||||
},
|
||||
update_label_natmultirule(state, val) {
|
||||
state.label_natmultirule = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_company(state, val) {
|
||||
state.company = val
|
||||
},
|
||||
update_mous(state, val) {
|
||||
state.mous = val
|
||||
},
|
||||
update_mou(state, val) {
|
||||
state.mou = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_multirules(state, val) {
|
||||
state.total_multirules = val
|
||||
},
|
||||
update_minage(state, val) {
|
||||
state.minage = val
|
||||
},
|
||||
update_maxage(state, val) {
|
||||
state.maxage = val
|
||||
},
|
||||
update_minvalue(state, val) {
|
||||
state.minvalue = val
|
||||
},
|
||||
update_maxvalue(state, val) {
|
||||
state.maxvalue = val
|
||||
},
|
||||
update_note(state, val) {
|
||||
state.note = val
|
||||
},
|
||||
update_description(state, val) {
|
||||
state.description = val
|
||||
},
|
||||
update_noref(state, val) {
|
||||
state.noref = val
|
||||
},
|
||||
update_nama_pasien(state, val) {
|
||||
state.namapasien = val
|
||||
},
|
||||
update_sexes(state, val) {
|
||||
state.sexes = val
|
||||
},
|
||||
update_selected_sex(state, val) {
|
||||
state.selected_sex = val
|
||||
},
|
||||
update_valuetypexes(state, val) {
|
||||
state.valuetypexes = val
|
||||
},
|
||||
update_selected_valuetypex(state, val) {
|
||||
state.selected_valuetypex = val
|
||||
},
|
||||
update_valuetypees(state, val) {
|
||||
state.valuetypees = val
|
||||
},
|
||||
update_selected_valuetype(state, val) {
|
||||
state.selected_valuetype = val
|
||||
},
|
||||
update_valuequalitativees(state, val) {
|
||||
state.valuequalitativees = val
|
||||
},
|
||||
update_selected_valuequalitative(state, val) {
|
||||
state.selected_valuequalitative = val
|
||||
},
|
||||
update_tests(state, data) {
|
||||
state.tests = data
|
||||
},
|
||||
update_test(state, val) {
|
||||
state.test = val
|
||||
},
|
||||
update_testqualitatives(state, data) {
|
||||
state.testqualitatives = data
|
||||
},
|
||||
update_testqualitative(state, val) {
|
||||
state.testqualitative = val
|
||||
},
|
||||
update_ordertests(state, data) {
|
||||
state.ordertests = data
|
||||
},
|
||||
update_deleted_ordertests(state, data) {
|
||||
state.deleted_ordertests = data
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_open_print_note(state, val) {
|
||||
state.open_print_note = val
|
||||
},
|
||||
update_methodes(state, data) {
|
||||
state.methodes = data
|
||||
},
|
||||
update_methode(state, val) {
|
||||
state.methode = val
|
||||
},
|
||||
update_multiruletypees(state, val) {
|
||||
state.multiruletypees = val
|
||||
},
|
||||
update_selected_multiruletype(state, val) {
|
||||
state.selected_multiruletype = val
|
||||
},
|
||||
update_flages(state, val) {
|
||||
state.flages = val
|
||||
},
|
||||
update_selected_flag(state, val) {
|
||||
state.selected_flag = val
|
||||
},
|
||||
update_ageunites(state, val) {
|
||||
state.ageunites = val
|
||||
},
|
||||
update_selected_ageunit(state, val) {
|
||||
state.selected_ageunit = val
|
||||
},
|
||||
update_validdate(state, val) {
|
||||
state.validdate = val
|
||||
},
|
||||
update_extremelow(state, val) {
|
||||
state.extremelow = val
|
||||
},
|
||||
update_extremehigh(state, val) {
|
||||
state.extremehigh = val
|
||||
},
|
||||
update_linieritas(state, val) {
|
||||
state.linieritas = val
|
||||
},
|
||||
update_limitdetection(state, val) {
|
||||
state.limitdetection = val
|
||||
},
|
||||
update_isnotapplicable(state, val) {
|
||||
state.isnotapplicable = val
|
||||
},
|
||||
update_nilai(state, val) {
|
||||
state.nilai = val
|
||||
},
|
||||
update_orderautotests(state, data) {
|
||||
state.orderautotests = data
|
||||
},
|
||||
update_orderautotest(state, val) {
|
||||
state.orderautotest = val
|
||||
},
|
||||
update_error_name(state, val) {
|
||||
state.error_name = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_multirule", 1)
|
||||
try {
|
||||
let resp = await api.search(one_token(), prm.code, prm.name)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_multirule", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_multirule", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_multirules", data.records)
|
||||
context.commit("update_total_multirules", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
|
||||
context.commit("update_selected_multirule", data.records[0])
|
||||
var pat = data.records[0]
|
||||
context.commit("update_multirule_name", pat.Nat_TestName)
|
||||
context.commit("update_extremelow", pat.Nat_MultiRuleExtremeLow)
|
||||
context.commit("update_extremehigh", pat.Nat_MultiRuleExtremeHigh)
|
||||
context.commit("update_linieritas", pat.Nat_MultiRuleLinieritas)
|
||||
context.commit("update_limitdetection", pat.Nat_MultiRuleLimitDetection)
|
||||
context.dispatch("getnatmultirule", {
|
||||
id: pat.Nat_TestID,
|
||||
isquantitative: pat.Nat_TestIsQuantitative
|
||||
})
|
||||
context.dispatch("getvaluetypex", pat.Nat_TestIsQuantitative)
|
||||
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_multirule", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getsexreg(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getsexreg(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_valuetypees", data.records.valuetypees)
|
||||
context.commit("update_valuequalitativees", data.records.valuequalitativees)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getvaluetypex(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getvaluetypex(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_valuetypexes", data.records.valuetypexes)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_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("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_last_id", prm.Nat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async newmultirule(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.newmultirule(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
console.log(resp.data.id)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data berhasil disimpan"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_form_multirule", false)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.xdelete(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_last_id", 0)
|
||||
context.commit("update_dialog_confirmation_delete", false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_extremelow", '')
|
||||
context.commit("update_extremehigh", '')
|
||||
context.commit("update_linieritas", '')
|
||||
context.commit("update_limitdetection", '')
|
||||
context.dispatch("getnatmultirule", {
|
||||
id: prm.testid, isquantitative: prm.isquantitative
|
||||
})
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async sendorder(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.sendorder(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_send", false)
|
||||
context.commit("update_last_id", prm.Nat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Permintaan nomor " + prm.Nat_TestNumber + " sudah berhasil dikirim ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async getnatmultirule(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getnatmultirule(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
|
||||
}
|
||||
context.commit("update_natmultirules", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async searchmethode(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchmethode(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_methodes", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchcompany(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcompany(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_companies", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async getmou(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getmou(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_mous", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async searchtest(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchtest(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
|
||||
}
|
||||
var pat = data.records[0]
|
||||
context.commit("update_orderautotests", resp.data.records)
|
||||
context.dispatch("getvaluetypex", pat.Nat_TestIsQuantitative)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchtestqualitative(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchtestqualitative(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_testqualitatives", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async savenewnatmultirule(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savenewnatmultirule(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_natmultirule", false)
|
||||
context.commit("update_last_id", prm.Nat_MultiRuleNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data normal value pemeriksaan " + prm.Nat_TestName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async saveeditnatmultirule(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveeditnatmultirule(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_natmultirule", false)
|
||||
context.commit("update_last_id", prm.Nat_MultiRuleNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data nilai normal pemeriksaan " + prm.Nat_TestName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async savemultirulelang(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savemultirulelang(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_natmultirule", false)
|
||||
context.commit("update_last_id", prm.Nat_MultiRuleNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan bahasa nilai normal sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async deletenatmultirule(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletenatmultirule(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_delete_pat", false)
|
||||
context.commit("update_last_id", prm.Nat_MultiRuleNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data nilai normal " + prm.Nat_MultiRuleName + " dari pemeriksaan " + prm.Nat_TestName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async savereflextest(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.savereflextest(one_token(),prm.Nat_MultiRuleRuleNat_MultiRuleID,prm.Nat_MultiRuleNilai,prm.testid,prm.isquantitative,prm.extremelow,prm.extremehigh,prm.linieritas,prm.limitdetection, prm.isnotapplicable, prm.ordertests)
|
||||
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_error_name", false)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_quantitative", false)
|
||||
var msg = "Data sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_extremelow", prm.extremelow)
|
||||
context.commit("update_extremehigh", prm.extremehigh)
|
||||
context.commit("update_linieritas", prm.linieritas)
|
||||
context.commit("update_limitdetection", prm.limitdetection)
|
||||
context.dispatch("getnatmultirule", {
|
||||
id: prm.testid, isquantitative: prm.isquantitative
|
||||
})
|
||||
} else {
|
||||
context.commit("update_error_name", true)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async updatereflextest(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.updatereflextest(one_token(),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_error_name", false)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_quantitative", false)
|
||||
var msg = "Data sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
context.commit("update_extremelow", prm.extremelow)
|
||||
context.commit("update_extremehigh", prm.extremehigh)
|
||||
context.commit("update_linieritas", prm.linieritas)
|
||||
context.commit("update_limitdetection", prm.limitdetection)
|
||||
context.dispatch("getnatmultirule", {
|
||||
id: prm.testid, isquantitative: prm.isquantitative
|
||||
})
|
||||
}else{
|
||||
context.commit("update_error_name", true)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
one-ui/agreement/x_old/one-md-company-releaser-new/store.js
Normal file
27
one-ui/agreement/x_old/one-md-company-releaser-new/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: {
|
||||
|
||||
}
|
||||
});
|
||||
31
one-ui/agreement/x_old/one-md-company-verifikator-v2/api.js
Normal file
31
one-ui/agreement/x_old/one-md-company-verifikator-v2/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function lookup(token, search,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/lookup', { token: token, search: search, 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 + 'companynewx/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 + 'companynewx/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 selectcompanytype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/selectcompanytype',{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 savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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
|
||||
};
|
||||
}
|
||||
}
|
||||
207
one-ui/agreement/x_old/one-md-company-verifikator-v2/api/mou.js
Normal file
207
one-ui/agreement/x_old/one-md-company-verifikator-v2/api/mou.js
Normal file
@@ -0,0 +1,207 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/lookupmou', { 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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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
|
||||
};
|
||||
}
|
||||
}
|
||||
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
File diff suppressed because it is too large
Load Diff
@@ -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 xs3 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 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/oneNavbarComponent.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>
|
||||
@@ -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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,720 @@
|
||||
// 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_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
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_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_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.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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} 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 selectcompanytype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(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_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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/mou.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
mous: [],
|
||||
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: {},
|
||||
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
|
||||
},
|
||||
mutations: {
|
||||
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_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 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 })
|
||||
} 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
|
||||
})
|
||||
}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 {
|
||||
let resp = await api.lookup(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_mous", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 })
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 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,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: {
|
||||
|
||||
}
|
||||
});
|
||||
31
one-ui/agreement/x_old/one-md-company-verifikator-v3/api.js
Normal file
31
one-ui/agreement/x_old/one-md-company-verifikator-v3/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function lookup(token, search,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/lookup', { token: token, search: search, 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 + 'companynewx/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 + 'companynewx/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 selectcompanytype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/selectcompanytype',{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 savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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 + 'companynewx/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
|
||||
};
|
||||
}
|
||||
}
|
||||
207
one-ui/agreement/x_old/one-md-company-verifikator-v3/api/mou.js
Normal file
207
one-ui/agreement/x_old/one-md-company-verifikator-v3/api/mou.js
Normal file
@@ -0,0 +1,207 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/lookupmou', { 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 + 'companynewx2/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 + 'companynewx2/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 + 'companynewx2/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 selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companynewx2/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
|
||||
};
|
||||
}
|
||||
}
|
||||
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
File diff suppressed because it is too large
Load Diff
@@ -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 xs3 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 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/oneNavbarComponent.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>
|
||||
@@ -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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,720 @@
|
||||
// 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_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
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_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_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.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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} 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 selectcompanytype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(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_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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,557 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/mou.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
mous: [],
|
||||
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: {},
|
||||
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: ''
|
||||
},
|
||||
mutations: {
|
||||
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_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 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
|
||||
})
|
||||
} 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
|
||||
})
|
||||
} 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 {
|
||||
let resp = await api.lookup(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_mous", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 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,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: {
|
||||
|
||||
}
|
||||
});
|
||||
31
one-ui/agreement/x_old/one-md-company-verifikator-v4/api.js
Normal file
31
one-ui/agreement/x_old/one-md-company-verifikator-v4/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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function lookup(token, search,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/lookup', { token: token, search: search, 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 + 'companyv4/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 + 'companyv4/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 selectcompanytype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/selectcompanytype',{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 savecompanybusiness(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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
|
||||
};
|
||||
}
|
||||
}
|
||||
224
one-ui/agreement/x_old/one-md-company-verifikator-v4/api/mou.js
Normal file
224
one-ui/agreement/x_old/one-md-company-verifikator-v4/api/mou.js
Normal file
@@ -0,0 +1,224 @@
|
||||
const URL = "/one-api/v1/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/lookupmou', { 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 lookupreleasebyid(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 + 'companyv4/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 selectagingtype(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'companyv4/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
|
||||
};
|
||||
}
|
||||
}
|
||||
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
File diff suppressed because it is too large
Load Diff
@@ -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 xs3 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-company-list></one-md-company-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 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/oneNavbarComponent.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>
|
||||
@@ -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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,720 @@
|
||||
// 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_companytype: false,
|
||||
dialog_form_companybusiness: false,
|
||||
dialog_edit_form_company: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all: 'N',
|
||||
errors: [],
|
||||
companytypes: [],
|
||||
companytype: {},
|
||||
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_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_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.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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} 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 selectcompanytype(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.selectcompanytype(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_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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,584 @@
|
||||
// 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: {},
|
||||
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
|
||||
},
|
||||
mutations: {
|
||||
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_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 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
|
||||
})
|
||||
} 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
|
||||
})
|
||||
} 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 {
|
||||
let resp = await api.lookup(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_mous", data.records)
|
||||
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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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
|
||||
})
|
||||
}
|
||||
} 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 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,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