Initial import
This commit is contained in:
470
one-ui/test_x_old/vuex/one-fo-promise/api/samplecall.js
Normal file
470
one-ui/test_x_old/vuex/one-fo-promise/api/samplecall.js
Normal file
@@ -0,0 +1,470 @@
|
||||
const URL = "/one-api/mockup/fo/promise/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/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 gettests(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/gettests',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 getdatapromises(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getdatapromises',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 receivesample(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/receivesample',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 search_staff(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/search_staff',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 + 'promisenotok/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 search_patient(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/search_patient',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 getrequirements(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getrequirements',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 getstationstatus(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getstationstatus',{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 savenewpromise(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/savenewpromise',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 newsamplingcall(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/newsamplingcall',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 + 'promisenotok/deletesamplingcall',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 getaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getaddress',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 searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/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 getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/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 + 'promisenotok/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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function savenewaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/savenewaddress',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 saveeditaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/saveeditaddress',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 deleteaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/deleteaddress',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 getsampletypes(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getsampletypes',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 doaction(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/doaction',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 addnewlabel(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/addnewlabel',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 getdatanoterequirement(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/getdatanoterequirement',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 savenotesampling(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'promisenotok/savenotesampling',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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-card class="mt-2" v-for="(detail,index) in xtests" elevation="3" class="mb-2">
|
||||
<v-layout v-if="parseInt(detail.id) === 0" style="background:lightcoral;font-weight: 900;" align-center class="text-xs-center" row>
|
||||
<v-flex pl-1 pa-1 xs11>
|
||||
<h3 class="mono">{{detail.promisedatetime}}</h3>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs1>
|
||||
<v-flex text-xs-right>
|
||||
<v-btn @click="copypromise(detail)" style="min-width:10px;margin:0" flat small color="#825c59"><v-icon>file_copy</v-icon></v-btn>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex pa-1 xs12>
|
||||
<v-chip v-for="test in detail.arr_test" style="font-size: 16px;font-weight:500" label color="pink" text-color="white">
|
||||
{{test.name}}
|
||||
</v-chip>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</div>
|
||||
</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 = {
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.samplecall.selected_test.id
|
||||
},
|
||||
selectMe(test) {
|
||||
var tests = this.$store.state.samplecall.tests
|
||||
this.$store.commit("samplecall/update_selected_test",test)
|
||||
var idx = _.findIndex(tests, function(o) { return o.orderid == test.orderid })
|
||||
var prm = test
|
||||
prm.orderid = this.$store.state.samplecall.selected_patient.orderid
|
||||
this.$store.dispatch("samplecall/getdatapromises",prm)
|
||||
},
|
||||
copypromise(value){
|
||||
var xdatetime = value.promisedatetime
|
||||
this.$store.commit("samplecall/update_copied_promise",xdatetime)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isLoading() {
|
||||
return this.$store.state.samplecall.search_status == 1
|
||||
},
|
||||
xtests() {
|
||||
return this.$store.state.samplecall.tests
|
||||
},
|
||||
copiedpromise: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.copied_promise
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_copied_promise",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return;
|
||||
if (!val) return;
|
||||
if (val.length < 1) return;
|
||||
if (this.$store.state.samplecall.update_autocomplete_status == 1) return;
|
||||
this.thr_search_company();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
search_company: "",
|
||||
//isLoading: false,
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "TEST",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div >
|
||||
<v-layout style="margin-top:0" row>
|
||||
<v-flex xs12>
|
||||
<v-btn v-if="xdetails.length > 0" @click="save()" block color="primary">SIMPAN JANJI</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="max-height:550px;overflow: auto;" wrap>
|
||||
<v-card v-for="(detailinfo,index) in xdetails" elevation="3" class="mb-2">
|
||||
<v-layout v-if="parseInt(detailinfo.id) !== 0" style="background:lightcoral;" align-center class="text-xs-center" row>
|
||||
<v-flex pl-1 pa-1 xs1>
|
||||
|
||||
<v-btn @click="pastepromise(detailinfo,index)" style="min-width:10px;margin:0" flat small color="#825c59"><v-icon>note_add</v-icon></v-btn>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs8>
|
||||
<v-text-field
|
||||
placeholder="dd-mm-yyyy"
|
||||
mask="##-##-####"
|
||||
solo
|
||||
v-model="detailinfo.promisedate"
|
||||
@change="ChangeDate(detailinfo.promisedate,index)"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex pl-1 pa-1 xs3>
|
||||
<v-text-field
|
||||
placeholder="hh:mm"
|
||||
mask="##:##"
|
||||
solo
|
||||
v-model="detailinfo.promisetime"
|
||||
@change="ChangeTime(detailinfo.promisetime,index)"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex pa-1 xs12>
|
||||
<v-chip v-for="testinfo in detailinfo.arr_test" style="font-size: 16px;font-weight:500" label color="pink" text-color="white">
|
||||
{{testinfo.name}}
|
||||
</v-chip>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
xdetails:{
|
||||
get() {
|
||||
return this.$store.state.samplecall.details
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_details",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
patient_photo(){
|
||||
var photo = "https://www.sgm-inc.com/wp-content/uploads/2014/06/no-profile-male-img.gif"
|
||||
if(this.xselected_patient.M_PatientPhoto){
|
||||
photo = this.xselected_patient.M_PatientPhoto
|
||||
}
|
||||
console.log(photo)
|
||||
return photo
|
||||
},
|
||||
ChangeDate(value,index){
|
||||
console.log(value)
|
||||
console.log(index)
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisedate'] = value
|
||||
console.log(details)
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
},
|
||||
ChangeTime(value,index){
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisetime'] = value
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
},
|
||||
pastepromise(value,index){
|
||||
var xpromise = this.$store.state.samplecall.copied_promise
|
||||
var arr_datetime = xpromise.split(" ")
|
||||
var details = this.$store.state.samplecall.details
|
||||
details[index]['promisedate'] = arr_datetime[0]
|
||||
details[index]['promisetime'] = arr_datetime[1]
|
||||
this.$store.commit("samplecall/update_details",details)
|
||||
|
||||
},
|
||||
save(){
|
||||
var details = this.$store.state.samplecall.details
|
||||
var errors = []
|
||||
var errordate = ''
|
||||
details.forEach(function(arr,index) {
|
||||
var xDate = moment(arr.promisedate, 'DDMMYYYY', true)
|
||||
var isValidDate = xDate.isValid()
|
||||
var xTime = moment(arr.promisetime, 'HHmm', true)
|
||||
var isValidTime = xTime.isValid()
|
||||
var formateddate = moment(arr.promisedate,'DDMMYYYY').format('DD-MM-YYYY')
|
||||
var formatedtime = moment(arr.promisetime,'HHmm').format('HH:mm')
|
||||
if(!isValidDate || !isValidTime){
|
||||
errors.push(formateddate+' '+formatedtime)
|
||||
console.log(formateddate+' '+formatedtime)
|
||||
}
|
||||
else{
|
||||
details[index].promisedate = formateddate
|
||||
details[index].promisetime = formatedtime
|
||||
}
|
||||
console.log(errors)
|
||||
})
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.act = 'save'
|
||||
prm.orderid = this.$store.state.samplecall.selected_patient.orderid
|
||||
prm.search = {
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
}
|
||||
prm.newpromise = details
|
||||
this.$store.dispatch("samplecall/savenewpromise",prm)
|
||||
}
|
||||
else{
|
||||
errordate = errors.join(" ")
|
||||
this.$store.commit("samplecall/update_msg_info","<p style='color:red;font-weight:700;'>"+errordate+"</p><p>Janji adalah janji, jangan dibuat permainan, gunakan tanggal dan waktu yang benar</p>")
|
||||
this.$store.commit("samplecall/update_open_dialog_info",true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,301 @@
|
||||
<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 row>
|
||||
<v-flex pt-1 xs9>
|
||||
<v-text-field
|
||||
style="font-size:14px"
|
||||
label="No Reg"
|
||||
class="mr-1"
|
||||
outline
|
||||
v-on:keyup.enter="searchPatient"
|
||||
v-model="nolab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
<v-card >
|
||||
<v-layout style="height:500px;overflow: auto;" row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
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),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.labnumber }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'teal white--text':props.item.coming === 'Y','amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{ props.item.patient_fullname}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
</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("samplecall/getinitdata")
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
return p.orderid == this.$store.state.samplecall.selected_patient.orderid
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
nolab:this.nolab,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
var patients = this.$store.state.samplecall.patients
|
||||
this.$store.commit("samplecall/update_selected_patient",pat)
|
||||
this.$store.dispatch("samplecall/getdatapromises",{
|
||||
orderid:pat.orderid
|
||||
})
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("samplecall/update_no_save",0)
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
},
|
||||
setNewPatient(){
|
||||
//this.$store.commit("samplecall/update_selected_Patient",{})
|
||||
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrPatient = this.$store.state.samplecall.patients
|
||||
var idx = _.findIndex(arrPatient, item => item.M_PatientID === this.$store.state.samplecall.last_id)
|
||||
console.log(idx)
|
||||
var xcur_page = 1
|
||||
// if(idx !== -1)
|
||||
// xcur_page = this.$store.state.samplecall.current_page
|
||||
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
// current_page:xcur_page,
|
||||
lastid: idx
|
||||
})
|
||||
|
||||
this.$store.commit("samplecall/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
},
|
||||
thr_search_company: _.debounce(function() {
|
||||
this.$store.dispatch("samplecall/searchcompany", this.search_company);
|
||||
}, 2000),
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.samplecall.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.samplecall.search_status == 1
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.samplecall.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_station",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
xstatuses() {
|
||||
return this.$store.state.samplecall.statuses
|
||||
},
|
||||
xselectedstatus: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_status",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.samplecall.patients
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_current_page",val)
|
||||
this.$store.dispatch("samplecall/search",{
|
||||
name:this.name,
|
||||
nolab:this.nolab,
|
||||
stationid: this.xselectedstation.id,
|
||||
statusid: this.xselectedstatus.id,
|
||||
current_page:val,
|
||||
lastid: idx
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_total_page",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.samplecall.msg_info
|
||||
},
|
||||
name: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.name
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_name",val)
|
||||
}
|
||||
},
|
||||
nolab: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.nolab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_nolab",val)
|
||||
//this.searchPatient()
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.samplecall.companies;
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.samplecall.selected_company;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplecall/update_selected_company", val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return;
|
||||
if (!val) return;
|
||||
if (val.length < 1) return;
|
||||
if (this.$store.state.samplecall.update_autocomplete_status == 1) return;
|
||||
this.thr_search_company();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
search_company: "",
|
||||
//isLoading: false,
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
101
one-ui/test_x_old/vuex/one-fo-promise/index.php
Normal file
101
one-ui/test_x_old/vuex/one-fo-promise/index.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<!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 v-on:key="doSomething">
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<one-sample-call-so-list></one-sample-call-so-list>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="right" fill-height pa-1>
|
||||
<one-sample-call-so-detail></one-sample-call-so-detail>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="right" fill-height pa-1>
|
||||
<one-sample-call-so-info></one-sample-call-so-info>
|
||||
</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>
|
||||
<script src="../../../libs/one_print_barcode.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
window.calculate_age = function (inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
var year = now.diff(dob,'years')
|
||||
dob.add(year,'years')
|
||||
var month = now.diff(dob,'months')
|
||||
dob.add(month,'months')
|
||||
var day = now.diff(dob,'days')
|
||||
if (isNaN(year)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
mounted(){
|
||||
|
||||
},
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-sample-call-so-list': httpVueLoader('./components/oneSampleCallSOList.vue'),
|
||||
'one-sample-call-so-info': httpVueLoader('./components/oneSampleCallSOInfo.vue'),
|
||||
'one-sample-call-so-detail': httpVueLoader('./components/oneSampleCallSODetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
885
one-ui/test_x_old/vuex/one-fo-promise/modules/samplecall.js
Normal file
885
one-ui/test_x_old/vuex/one-fo-promise/modules/samplecall.js
Normal file
@@ -0,0 +1,885 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/samplecall.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'edit',
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_patient: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
preffix:'',
|
||||
patient_name:'',
|
||||
suffix:'',
|
||||
patients: [],
|
||||
selected_patient: {},
|
||||
sampletypes:[],
|
||||
selected_sampletype:{},
|
||||
companies:[{id:0,name:'Semua'}],
|
||||
selected_company:{id:0,name:'Semua'},
|
||||
total_patients:0,
|
||||
patient_address: [],
|
||||
stations:[],
|
||||
selected_station:{},
|
||||
statuses:[],
|
||||
selected_status:{},
|
||||
transaction_date:moment(new Date()).format('DD-MM-YYYY'),
|
||||
transaction_time:moment(new Date()).format("hh:mm"),
|
||||
phone:'',
|
||||
hp:'',
|
||||
email:'',
|
||||
pj:'N',
|
||||
dpj:'N',
|
||||
clinic:'N',
|
||||
is_default:'N',
|
||||
marketing_confirm:'N',
|
||||
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_delete_addr: false,
|
||||
msg_confirmation_delete_addr: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
label_address:'',
|
||||
addresses:[],
|
||||
cities:[],
|
||||
city_address:{},
|
||||
districts:[],
|
||||
district_address:{},
|
||||
kelurahans:[],
|
||||
kelurahan_address:{},
|
||||
description_address:'',
|
||||
errors:[],
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_page:1,
|
||||
total_page:1,
|
||||
dialog_requirement:false,
|
||||
requirements:[],
|
||||
selected_sample:{},
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
name:'',
|
||||
nolab:'',
|
||||
information_bahan:[],
|
||||
staff:{id:0,code:'',name:'BELUM ADA STAF',code:'',userid:''},
|
||||
dialog_note:false,
|
||||
msg_note:'',
|
||||
note_requirement:[],
|
||||
dialog_form_note:'',
|
||||
tests:[],
|
||||
selected_test:{},
|
||||
details:[],
|
||||
copied_promise:''
|
||||
},
|
||||
mutations: {
|
||||
update_copied_promise(state, val) {
|
||||
state.copied_promise = val
|
||||
},
|
||||
update_details(state, val) {
|
||||
state.details = val
|
||||
},
|
||||
update_tests(state, val) {
|
||||
state.tests = val
|
||||
},
|
||||
update_selected_test(state, val) {
|
||||
state.selected_test = val
|
||||
},
|
||||
update_dialog_form_note(state, val) {
|
||||
state.dialog_form_note = val
|
||||
},
|
||||
update_note_requirement(state, val) {
|
||||
state.note_requirement = val
|
||||
},
|
||||
update_dialog_note(state, val) {
|
||||
state.dialog_note = val
|
||||
},
|
||||
update_msg_note(state, val) {
|
||||
state.msg_note = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_staff(state, val) {
|
||||
state.staff = val
|
||||
},
|
||||
update_information_bahan(state, val) {
|
||||
state.information_bahan = val
|
||||
},
|
||||
update_name(state, val) {
|
||||
state.name = val
|
||||
},
|
||||
update_nolab(state, val) {
|
||||
state.nolab = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_selected_sample(state, val) {
|
||||
state.selected_sample = val
|
||||
},
|
||||
update_requirements(state, val) {
|
||||
state.requirements = val
|
||||
},
|
||||
update_dialog_requirement(state, val) {
|
||||
state.dialog_requirement = val
|
||||
},
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_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_addr(state, val) {
|
||||
state.act_addr = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, patient) {
|
||||
state.search_error_message = patient
|
||||
},
|
||||
update_search_patient(state, patient) {
|
||||
state.search_patient = patient
|
||||
},
|
||||
update_preffix(state, val) {
|
||||
state.preffix = val
|
||||
},
|
||||
update_patient_name(state, val) {
|
||||
state.patient_name = val
|
||||
},
|
||||
update_suffix(state, val) {
|
||||
state.suffix = val
|
||||
},
|
||||
update_patients(state, data) {
|
||||
state.patients = data
|
||||
},
|
||||
update_selected_patient(state, val) {
|
||||
state.selected_patient = val
|
||||
},
|
||||
update_sampletypes(state, data) {
|
||||
state.sampletypes = data
|
||||
},
|
||||
update_selected_sampletype(state, val) {
|
||||
state.selected_sampletype = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = val
|
||||
},
|
||||
update_statuses(state, val) {
|
||||
state.statuses = val
|
||||
},
|
||||
update_selected_status(state, val) {
|
||||
state.selected_status = val
|
||||
},
|
||||
update_phone(state, val) {
|
||||
state.phone = val
|
||||
},
|
||||
update_email(state, val) {
|
||||
state.email = val
|
||||
},
|
||||
update_hp(state, val) {
|
||||
state.hp = val
|
||||
},
|
||||
update_pj(state, val) {
|
||||
state.pj = val
|
||||
},
|
||||
update_dpj(state, val) {
|
||||
state.dpj = val
|
||||
},
|
||||
update_clinic(state, val) {
|
||||
state.clinic = val
|
||||
},
|
||||
update_marketing_confirm(state, val) {
|
||||
state.marketing_confirm = val
|
||||
},
|
||||
update_is_default(state, val) {
|
||||
state.is_default = 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_delete_addr(state, val) {
|
||||
state.dialog_confirmation_delete_addr = val
|
||||
},
|
||||
update_msg_confirmation_delete_addr(state, val) {
|
||||
state.msg_confirmation_delete_addr = val
|
||||
},
|
||||
update_addresses(state, val) {
|
||||
state.addresses = val
|
||||
},
|
||||
update_autocomplete_status(state,val){
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_address(state, val) {
|
||||
state.dialog_form_address = val
|
||||
},
|
||||
update_label_address(state, val) {
|
||||
state.label_address = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = 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
|
||||
},
|
||||
update_description_address(state, val) {
|
||||
state.description_address = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_patients(state, val) {
|
||||
state.total_patients = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_patient", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_patient", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_patients", data.records)
|
||||
context.commit("update_total_patients", data.total)
|
||||
var xdata = data.records[0]
|
||||
context.commit("update_selected_patient", xdata)
|
||||
var prm = {orderid:xdata['orderid']}
|
||||
context.dispatch("getdatapromises", prm)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async gettests(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.gettests(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_tests",data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getdatapromises(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdatapromises(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_tests",data.records['ok'])
|
||||
context.commit("update_details",data.records['notok'])
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async savenotesampling(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.savenotesampling(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_dialog_form_note",false)
|
||||
context.commit("update_tests",[])
|
||||
context.commit("update_details",[])
|
||||
context.dispatch("search",prm.search)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getrequirements(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getrequirements(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_requirements",data.records)
|
||||
context.commit("update_dialog_requirement",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async getdatanoterequirement(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdatanoterequirement(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_note_requirement",data.records)
|
||||
context.commit("update_dialog_note",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async savenewpromise(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.savenewpromise(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_tests",[])
|
||||
context.commit("update_details",[])
|
||||
context.dispatch("search",prm.search)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async receivesample(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(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
|
||||
}
|
||||
if(data.records.status === 'OK')
|
||||
prm.search.lastid = -1
|
||||
|
||||
context.dispatch("search",prm.search)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async addnewlabel(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.addnewlabel(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_action",false)
|
||||
/*let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if(data.records.status === 'OK')
|
||||
prm.search.lastid = -1*/
|
||||
console.log(prm)
|
||||
console.log('beofre')
|
||||
console.log(prm)
|
||||
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saverequirement(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saverequirement(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_requirement", false)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async newpatient(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.newpatient(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 dokter " + prm.M_patientName + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} 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 dokter " + prm.M_patientName + " sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_preffix",'')
|
||||
context.commit("update_patient_name",'')
|
||||
context.commit("update_suffix",'')
|
||||
context.commit("update_selected_sex",{})
|
||||
context.commit("update_selected_religion",{})
|
||||
context.commit("update_phone",'')
|
||||
context.commit("update_email",'')
|
||||
context.commit("update_hp",'')
|
||||
context.commit("update_pj",'N')
|
||||
context.commit("update_dpj",'N')
|
||||
context.commit("update_clinic",'N')
|
||||
context.commit("update_marketing_confirm",'N')
|
||||
context.commit("update_is_default",'N')
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getaddress(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_addresses",data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
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 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 search_staff(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.search_staff(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
|
||||
}
|
||||
if(data.records)
|
||||
context.commit("update_staff",resp.data.records)
|
||||
else{
|
||||
context.commit("update_staff",{id:0,code:'',name:'STAF TIDAK DITEMUKAN',code:'',userid:''})
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
search_patient(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
prm.token = one_token()
|
||||
context.commit("update_nolab",prm.search)
|
||||
var serach = prm.search
|
||||
prm.stationid = context.state.selected_station.id
|
||||
prm.statusid = context.state.selected_status.id
|
||||
prm.nolab = serach
|
||||
prm.searchx = serach
|
||||
prm.name = ''
|
||||
prm.lastid = -1
|
||||
window.key_enter = ''
|
||||
context.dispatch("search",prm)
|
||||
/*try {
|
||||
prm.token = one_token()
|
||||
context.commit("update_nolab",prm.search)
|
||||
prm.stationid = context.state.selected_station.id
|
||||
prm.statusid = context.state.selected_status.id
|
||||
|
||||
let resp= await api.search_patient(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
|
||||
}
|
||||
|
||||
var rst = data.records
|
||||
if(rst){
|
||||
console.log(rst.T_OrderHeaderID)
|
||||
var patients = context.state.patients
|
||||
var idx = _.findIndex(patients, function(o) { return o.T_OrderHeaderID == rst.T_OrderHeaderID })
|
||||
|
||||
if(idx !== -1){
|
||||
var pat = patients[idx]
|
||||
context.commit("update_selected_patient",pat)
|
||||
context.commit("update_last_id",idx)
|
||||
context.dispatch("getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: context.state.selected_station.id,
|
||||
statusid: context.state.selected_status.id
|
||||
})
|
||||
}else{
|
||||
var new_patients = []
|
||||
new_patients.push(rst)
|
||||
var pat = rst
|
||||
context.commit("update_nolab",pat.T_OrderHeaderLabNumber)
|
||||
|
||||
context.commit("update_patients",new_patients)
|
||||
context.commit("update_selected_patient",pat)
|
||||
context.commit("update_last_id",0)
|
||||
context.dispatch("getsampletypes",{
|
||||
orderid:pat.T_OrderHeaderID,
|
||||
stationid: context.state.selected_station.id,
|
||||
statusid: context.state.selected_status.id
|
||||
})
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('jalan jalan')
|
||||
var msg = "Jalan-jalan ke kota serang, <span class='mono' style='color:red;font-weight:bold'>"+prm.search+"</span> mungkin ada di sebrang"
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
|
||||
}
|
||||
} 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)
|
||||
}
|
||||
},
|
||||
async savenewaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.savenewaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_form_address",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data alamat dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async saveeditaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.saveeditaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_form_address",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Perubahan data alamat dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deleteaddress(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deleteaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_confirmation_delete_addr",false)
|
||||
context.commit("update_last_id", prm.M_patientAddressM_patientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data alamat "+prm.M_patientAddressNote+" dari dokter " + prm.M_patientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getsampletypes(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getsampletypes(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_sampletypes",data.records['sampletypes'])
|
||||
context.commit("update_information_bahan",data.records['information_bahan'])
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_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 doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(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_act",'-')
|
||||
context.commit("update_dialog_action",false)
|
||||
if(data.records['status'] === 'NOTCALL'){
|
||||
var msg = " Bagai pinang dibelah dua, pasiennya lagi dipanggil sebelah"
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
//prm.lastid = -1
|
||||
if(data.records['status'] === 'OK'){
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
one-ui/test_x_old/vuex/one-fo-promise/store.js
Normal file
27
one-ui/test_x_old/vuex/one-fo-promise/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import samplecall from "./modules/samplecall.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
samplecall: samplecall,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user