Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,231 @@
const URL = "/one-api/v1/preorder/home-service/";
export async function titsexreg(token) {
try {
var resp = await axios.post(URL + 'order/titsexreg',{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 searchcity(token,prm) {
try {
var resp = await axios.post(URL + 'order/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 + 'order/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 + 'order/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 savenewpatient(prm) {
try {
var resp = await axios.post(URL + 'order/savenewpatient',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(token,prm) {
try {
var resp = await axios.post(URL + 'order/getaddress',{token:token,id:prm.M_PatientID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdoctoraddress(token,prm) {
try {
var resp = await axios.post(URL + 'order/getdoctoraddress',{token:token,id:prm.M_DoctorID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchpatient(token,prm) {
try {
var resp = await axios.post(URL + 'order/searchpatient',{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 searchtest(token,prm) {
try {
var resp = await axios.post(URL + 'order/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 searchdoctor(token,prm) {
try {
var resp = await axios.post(URL + 'order/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 saveorder(prm) {
try {
var resp = await axios.post(URL + 'order/saveorder',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 updateorder(prm) {
try {
var resp = await axios.post(URL + 'order/updateorder',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
};
}
}

View File

@@ -0,0 +1,96 @@
const URL = "/one-api/v1/preorder/home-service/";
export async function search(fdate,fstatus,ftype,token) {
try {
var resp = await axios.post(URL + 'order/search',{fdate:fdate,fstatus:fstatus,ftype:ftype,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_staff(fdate,fstatus,token) {
try {
var resp = await axios.post(URL + 'order/lookup_staff',{fdate:fdate,fstatus:fstatus,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 doconfirm(prm) {
try {
var resp = await axios.post(URL + 'order/do_confirm',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 doorderlab(prm) {
try {
var resp = await axios.post(URL + 'order/do_orderlab',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 docancel(prm) {
try {
var resp = await axios.post(URL + 'order/do_cancel',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
};
}
}

View File

@@ -0,0 +1,20 @@
const URL = "/one-api/v1/preorder/home-service/";
export async function lookup() {
try {
var resp = await axios.post(URL + 'status/lookup');
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,21 @@
const URL = "/one-api/v1/preorder/home-service/";
export async function lookup() {
try {
var resp = await axios.post(URL + 'type/lookup');
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
console.log(data)
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,658 @@
<template>
<div>
<v-layout>
<v-flex xs12>
<v-card style="height:100px" class="mb-2" color="white">
<v-card-text>
<v-layout>
<v-flex pa-2 xs8>
<v-layout>
<v-flex
xs3 pr-2
>
<!--<v-text-field
label="Tanggal Transaksi"
v-model="xdate"
outline
@change="updateDate(xdate)"
></v-text-field>-->
<v-menu
v-model="menufilterdate"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="filterComputedDateFormatted"
label="Tanggal Transaksi"
outline
readonly
v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormatted)"
></v-text-field>
</template>
<v-date-picker v-model="xdate" no-title @input="menufilterdate = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 pl-2>
<v-select
item-text="name"
return-object
:items="statuses"
v-model="xstatus"
label="Status" outline hide-details
></v-select>
</v-flex>
<v-flex xs3 pl-2>
<v-select
item-text="name"
return-object
:items="types"
v-model="xtype"
label="Tipe" outline hide-details
></v-select>
</v-flex>
<v-flex xs3 pl-4>
<v-btn
color="secondary"
outline
large
@click="filterOrder()"
>
Filter
</v-btn>
</v-flex>
</v-layout>
</v-flex>
<v-flex class="text-xs-right" pt-2 xs4>
<v-btn
color="warning"
depressed
style="display:none"
>
Unduh Data
</v-btn>
<v-btn
color="info"
depressed
@click="openForm(true)"
>
Baru
</v-btn>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-layout row wrap>
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
<div class="rTable">
<div class="rTableHeading">
<div style="width:10%;" class="rTableHead">JAM</div>
<div style="width:10%" class="rTableHead">TIPE</div>
<div style="width:16%" class="rTableHead">PASIEN</div>
<div style="width:22%" class="rTableHead">ALAMAT</div>
<div style="width:12%" class="rTableHead">TELEPON</div>
<div style="width:10%" class="rTableHead">STATUS</div>
<div class="rTableHead">AKSI</div>
</div>
</div>
<div v-if="xorders.length === 0" class="rTable pt-2">
<div class="rTableRow">
<div style="width:100%;text-align:center" class="rTableCell">Belum ada data</div>
</div>
</div>
<div v-if="xorders.length > 0" v-for="(vo,idx) in xorders" :key="vo.PreOrder_HeaderID">
<div class="rTable">
<div class="rTableGroup">
<div class="rTableRow">
<div style="width:10%" class="rTableCell rfirstCell">{{vo.PreOrder_HeaderTime}}</div>
<div style="width:10%" class="rTableCell">{{vo.M_PreOrderTypeName}}</div>
<div style="width:16%" class="rTableCell">{{vo.M_PatientName}}</div>
<div style="width:22%" class="rTableCell">{{vo.M_PatientAddressDescription}}</div>
<div style="width:12%" class="rTableCell">{{vo.PreOrder_HeaderPhone}}</div>
<div style="width:10%" class="rTableCell">
<v-btn v-bind:class="vo.M_PreOrderStatusColor">{{vo.M_PreOrderStatusName}}</v-btn>
</div>
<div class="rTableCell">
<v-chip style="cursor:pointer" v-if="vo.PreOrder_HeaderM_PreOrderStatusID === '1'" @click="actCancel(vo)" label color="error" text-color="white">
<v-icon left>cancel</v-icon> batal
</v-chip>
<v-chip style="cursor:no-drop" v-if="vo.PreOrder_HeaderM_PreOrderStatusID !== '1'" label color="gray" text-color="white">
<v-icon left>cancel</v-icon> batal
</v-chip>
<v-chip style="cursor:pointer" v-if="vo.PreOrder_HeaderM_PreOrderStatusID === '1' || vo.PreOrder_HeaderM_PreOrderStatusID === '2' && vo.PreOrder_HeaderDownloadedMobile === 'N' || vo.PreOrder_HeaderDownloadedMobile === 'U' && vo.PreOrder_HeaderM_PreOrderStatusID < 3" @click="openFormEdit(vo)" label color="warning" text-color="white">
<v-icon left>edit</v-icon> edit
</v-chip>
<v-chip style="cursor:pointer" v-if=" ( vo.PreOrder_HeaderM_PreOrderStatusID === '2' && vo.PreOrder_HeaderDownloadedMobile === 'Y' ) || vo.PreOrder_HeaderM_PreOrderStatusID > 2" label color="gray" text-color="white">
<v-icon left>edit</v-icon> edit
</v-chip>
<v-icon style="cursor:pointer;padding-top:12px;float:right" class="text-sm-right" @click="showDetail(idx)" color="blue darken-2">more_vert</v-icon>
</div>
</div>
</div>
<transition name="fade">
<div v-if="vo.show_detail === 'Y'" style="width:100%;border:1px solid black" class="caption">
<v-layout v-if="vo.deliveries.length > 0" row mb-2 wrap>
<v-flex v-for="(vd,didx) in vo.deliveries" :key="vd.PreOrder_DeliveryID" xs4>
<v-layout row wrap>
<v-flex xs4 class="label-delivery font-weight-bold">
{{vd.M_DeliveryName}}
</v-flex>
<v-flex xs8 class="text-delivery text-xs-right">
{{vd.PreOrder_DeliveryDestination}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout row>
<table>
<tr>
<th class="text-md-center pt-2 pb-2"> NO. </th>
<th class="text-md-center pt-2 pb-2">PEMERIKSAAN</th>
<th class="text-md-center pt-2 pb-2">BRUTO</th>
<th class="text-md-center pt-2 pb-2">DISKON</th>
<th class="text-md-center pt-2 pb-2">TOTAL</th>
</tr>
<tr v-for="(vt,tidx) in vo.tests" :key="vt.PreOrder_TestID">
<td class="text-md-center"> {{tidx+1}} </td>
<td class="text-md-left pl-3">{{vt.PreOrder_TestT_TestName}}</td>
<td class="text-md-right pr-2">{{doubletorp(vt.PreOrder_TestPrice)}}</td>
<td class="text-md-right pr-2">{{vt.PreOrder_TestDisc}}%</td>
<td class="text-md-right pr-2">{{doubletorp(vt.PreOrder_TestTotal)}}</td>
</tr>
<!--<tfoot>
<tr>
<th style="background:#03a9f43d" colspan="3" class="text-md-right pr-2 pt-1 pb-1">SUB TOTAL</th>
<th style="background:#03a9f43d" class="text-md-right pr-2 pt-2 pb-2" colspan="2">300.000</th>
</tr>
<tr>
<th colspan="3" class="text-md-right pr-2 pt-1 pb-1">DISKON PEMBULATAN</th>
<th class="text-md-right pr-2 pt-1 pb-1" colspan="2">0</th>
</tr>
<tr>
<th style="background:#03a9f43d" colspan="3" class="text-md-right pr-2 pt-2 pb-2">TOTAL</th>
<th style="background:#03a9f43d" class="text-md-right pr-2 pt-1 pb-1" colspan="2">300.000</th>
</tr>
</tfoot>-->
</table>
</v-layout>
</div>
</transition>
</div>
</div>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
<template>
<v-dialog
v-model="xdialogwarningdelete"
max-width="30%"
>
<v-card>
<v-card-title
class="headline red darken-1 pt-2 pb-2"
primary-title
>
<h4 style="color:#FFEBEE">Peringatan !</h4>
</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 v-html="xmsgwarningdelete" xs12>
</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="error"
flat
@click="doCancel()"
>
OK, Batalkan !
</v-btn>
<v-btn
color="primary"
flat
@click="xdialogwarningdelete = false"
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</div>
</template>
<style scoped>
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
.bounce-enter-active {
animation: bounce-in .5s;
}
.bounce-leave-active {
animation: bounce-in .5s reverse;
}
@keyframes bounce-in {
0% {
transform: scale(0);
}
25% {
transform: scale(.50);
}
50% {
transform: scale(.75);
}
75% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
.rTable {
display: table;
width: 100%;
border-spacing: 0 .2em;
}
.rTableGroup {
display: table-row-group;
}
.rTableRow {
display: table-row;
font-size: 14px;
}
.rTableHeading {
display: table-header-group;
background-color: #fffff;
}
.rTableCell {
display: table-cell;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
line-height: 2;
border: 1px solid #2196f3;
background-color: #fffff;
border-spacing: 5px;
}
.rTableHead {
display: table-cell;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-bottom: 0px;
background-color: #fffff;
}
.rTableHeading {
display: table-header-group;
text-transform: uppercase;
font-weight: 500;
}
.rTableFoot {
display: table-footer-group;
font-weight: bold;
background-color: #ddd;
}
.rTableBody {
display: table-row-group;
}
.rfirstCell {
border-left: 10px solid #2196f3;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.caption {
border: 1px solid grey;
caption-side: bottom;
display: table-caption;
text-align: center;
padding: 5px
}
.mini-input .v-input {
margin-top: 0px;
}
.mini-input .v-input,
.mini-input .v-input--selection-controls,
.mini-input .v-input__slot {
margin-top: 0px;
margin-bottom: 0px;
margin-left: 3px;
}
.mini-input .v-messages {
min-height: 0px;
}
.text-fajrihm {
padding: 3px 20px 3px 0;
text-align: left;
font-size: 13px;
font-family: open sans, tahoma, sans-serif;
}
.label-delivery {
font-size: 11px;
padding: 3px 10px 3px 0;
font-family: open sans, tahoma, sans-serif;
}
.text-delivery {
font-size: 12px;
padding: 3px 10px 3px 0;
font-family: open sans, tahoma, sans-serif;
}
.nota {
font-size: 2em;
font-weight: bold;
text-align: left;
}
.total {
min-height: 76px;
}
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;
}
.mini-input .v-input{
margin-top: 0px;
}
.mini-input .v-input, .mini-input .v-input--selection-controls,.mini-input .v-input__slot{
margin-top: 0px;
margin-bottom:0px;
margin-left:3px;
}
.mini-input .v-messages{
min-height:0px;
}
.border-bottom-dashed{
border-bottom : 1px dashed rgba(0,0,0,.12);
}
.v-breadcrumbs__item{
color:#fff!important;
}
</style>
<script>
module.exports = {
data() {
return {
xxx:0,
xdialogwarningdelete:false,
xmsgwarningdelete:'',
menufilterdate:false,
date: new Date().toISOString().substr(0, 10)
}
},
mounted() {
this.$store.dispatch("status/lookup")
this.$store.dispatch("type/lookup")
this.$store.dispatch("form/titsexreg")
console.log(this.$store.state.type.selected_type)
var prm = {fdate:this.xdate,fstatus:this.$store.state.status.selected_status.id,ftype:this.$store.state.type.selected_type.id}
this.$store.dispatch("order/search",prm)
this.$store.dispatch("order/lookup_staff",prm)
},
computed: {
statuses(){
return this.$store.state.status.statuses
},
xstatus : {
get() {
return this.$store.state.status.selected_status
},
set(val) {
this.$store.commit("status/update_selected_status",val)
}
},
types(){
return this.$store.state.type.types
},
xtype : {
get() {
return this.$store.state.type.selected_type
},
set(val) {
this.$store.commit("type/update_selected_type",val)
}
},
xdate : {
get() {
return this.$store.state.order.fdate
},
set(val) {
this.$store.commit("order/update_fdate",val)
}
},
filterComputedDateFormatted () {
return this.formatDate(this.xdate)
},
xorders(){
return this.$store.state.order.orders
}
},
methods: {
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')}`
},
filterOrder(){
var prm = {fdate:this.xdate,fstatus:this.$store.state.status.selected_status.id,ftype:this.$store.state.type.selected_type.id}
this.$store.dispatch("order/search",prm)
this.$store.dispatch("order/lookup_staff",prm)
},
doubletorp(val){
return one_money(val)
},
showDetail(idx){
var arrOrders = this.$store.state.order.orders
arrOrders[idx].show_detail = arrOrders[idx].show_detail === 'Y' ? 'N':'Y'
this.$store.commit("order/update_orders_commit",arrOrders)
},
openForm(val){
this.$store.commit("form/update_step",'order')
this.$store.commit("form/update_btn_order",'hide')
this.$store.commit("form/update_supplies_trx_id",0)
this.$store.commit("form/update_status_now",{id:0,name:''})
this.$store.commit("form/update_form_act",'new')
this.$store.commit("form/update_disabled_register",false)
this.$store.commit("form/update_ordertype",{})
this.$store.commit("form/update_orderdate","")
this.$store.commit("form/update_ordertime",{})
this.$store.commit("form/update_orderphone","")
this.$store.commit("form/update_ordernote","")
this.$store.commit("form/update_orderpatient",{})
this.$store.commit("form/update_orderadress",{})
this.$store.commit("form/update_orderautotest",{})
this.$store.commit("form/update_ordertests",[])
this.$store.commit("form/update_orderstaff",{})
this.$store.commit("form/update_orderpatients",[])
this.$store.commit("form/update_orderadresss",[])
this.$store.commit("form/update_orderdeliverytype",{})
this.$store.commit("form/update_orderpatientdeliveryaddress",{})
this.$store.commit("form/update_orderdoctor",{})
this.$store.commit("form/update_doctoradresss",[])
this.$store.commit("form/update_doctoradress",{})
this.$store.commit("form/update_dialog_form",val)
},
openFormEdit(val){
this.$store.commit("form/update_step",'order')
this.$store.commit("form/update_supplies_trx_id",val.supplies_trx_id)
this.$store.commit("form/update_patient_dob",val.M_PatientDOB)
this.$store.commit("form/update_disabled_register",true)
this.$store.commit("form/update_form_act",'edit')
this.$store.commit("form/update_btn_confirm",'hide')
this.$store.commit("form/update_deleted_ordertests",[])
this.$store.commit("form/update_orderid",val.PreOrder_HeaderID)
this.$store.commit("form/update_status_now",{id:val.M_PreOrderStatusID,name:val.M_PreOrderStatusName})
this.$store.commit("form/update_ordernote",val.PreOrder_HeaderNote)
var types = this.$store.state.form.ordertypes
var idx_type = _.findIndex(types, function(o) { return o.M_PreOrderTypeID == val.PreOrder_HeaderM_PreOrderTypeID })
var type = types[idx_type]
this.$store.commit("form/update_ordertype",type)
this.$store.commit("form/update_orderdate",val.PreOrder_HeaderDate)
this.$store.commit("form/update_orderphone",val.PreOrder_HeaderPhone)
this.$store.commit("form/update_orderpatients",[{M_PatientID:val.M_PatientID,M_PatientName:val.M_PatientName,M_PatientNoReg:val.M_PatientNoReg}])
this.$store.commit("form/update_orderpatient",{M_PatientID:val.M_PatientID,M_PatientName:val.M_PatientName,M_PatientNoReg:val.M_PatientNoReg})
var addresses = val.address
var idx_addrs = _.findIndex(addresses, function(o) { return o.M_PatientAddressID == val.M_PatientAddressID })
var address = addresses[idx_addrs]
this.$store.commit("form/update_orderadresss",addresses)
this.$store.commit("form/update_orderadress",address)
this.$store.commit("form/update_ordertests",val.tests)
var staffs = this.$store.state.form.staffs
if(val.M_StaffID){
var idx_staff = _.findIndex(staffs, function(o) { return o.M_StaffID == val.M_StaffID })
}
var staff = staffs[idx_staff]
this.$store.commit("form/update_orderstaff",staff)
var xtimes = this.$store.state.form.ordertimes
//console.log(xtimes)
if(val.PreOrder_HeaderTime){
console.log(val.PreOrder_HeaderTime)
var idx_time = _.findIndex(xtimes, function(o) { return o.M_SamplingTimeTime === val.PreOrder_HeaderTime })
//console.log(idx_time)
}
var xtime = xtimes[idx_time]
//console.log(xtime)
this.$store.commit("form/update_ordertime",xtime)
var deliverytipes = this.$store.state.form.orderdeliverytipes
if(val.deliveries.length > 0){
var idx_deliverytype = _.findIndex(deliverytipes, function(o) { return parseInt(o.M_DeliveryM_DeliveryTypeID) == parseInt(val.deliveries[0].PreOrder_DeliveryM_DeliveryTypeID) })
this.$store.commit("form/update_orderdeliverytype",deliverytipes[idx_deliverytype])
if(parseInt(val.deliveries[0].M_DeliveryID) === 2){
var delivery_idx_addrs = _.findIndex(addresses, { M_PatientAddressM_KelurahanID: val.deliveries[0].PreOrder_DeliveryM_KelurahanID, M_PatientAddressDescription: val.deliveries[0].PreOrder_DeliveryM_DeliveryTypeID })
var patient_delivery_address = addresses[idx_addrs]
this.$store.commit("form/update_orderpatientdeliveryaddress",patient_delivery_address)
this.$store.commit("form/update_orderdeliveryaddress",val.deliveries[0].PreOrder_DeliveryDestination)
}else{
this.$store.commit("form/update_orderdeliveryaddress",val.deliveries[0].PreOrder_DeliveryDestination)
if(parseInt(val.deliveries[0].M_DeliveryID) === 1){
this.$store.commit("form/update_orderdeliveryaddress","")
}
}
}
this.$store.commit("form/update_orderdoctors",[{M_DoctorID:val.M_DoctorID,M_DoctorName:val.M_DoctorName}])
this.$store.commit("form/update_orderdoctor",{M_DoctorID:val.M_DoctorID,M_DoctorName:val.M_DoctorName})
var doctoraddresses = val.doctoraddress
this.$store.commit("form/update_doctoradresss",doctoraddresses)
var idx_doctor_addrs = _.findIndex(doctoraddresses, function(o) { return o.M_DoctorAddressID == val.PreOrder_HeaderM_DoctorAddressID })
if(idx_doctor_addrs !== -1){
var doctoraddress = doctoraddresses[idx_doctor_addrs]
this.$store.commit("form/update_doctoradress",doctoraddress)
}
this.$store.commit("form/update_btn_order",'hide')
if(val.PreOrder_HeaderDownloadedMobile === 'U'){
this.$store.commit("form/update_btn_order",'show')
}
this.$store.commit("form/update_dialog_form",true)
},
actCancel(val){
this.$store.commit("form/update_orderid",val.PreOrder_HeaderID)
this.xdialogwarningdelete = true
this.xmsgwarningdelete = '<p>Yakin, mau membatalkan order '+val.PreOrder_HeaderNumbering+' ?</p>'
},
doCancel(){
this.xdialogwarningdelete = false
var params = {
orderid:this.$store.state.form.orderid,
fdate:this.$store.state.order.fdate,
fstatus:this.$store.state.status.selected_status.id,
ftype:this.$store.state.type.selected_type.id
}
this.$store.dispatch("order/docancel",params)
}
}
}
</script>

View File

@@ -0,0 +1,76 @@
<template>
<div>
<v-layout v-for="staff in xstaffs">
<v-flex xs12 mb-2 >
<v-card
color="white"
>
<v-card-title style="padding: 7px;" class="title text-sm-center">
<v-btn block depressed color="info">{{staff.M_StaffName}}</v-btn>
</v-card-title>
<v-divider color="#2196f3"></v-divider>
<v-card-text style="padding:10px" class="white text--primary">
<v-layout row>
<v-flex xs6>
<div class="subheading font-weight-bold text-sm-left pl-1">jam</div>
</v-flex>
<v-flex xs6>
<div class="subheading font-weight-bold text-sm-right">area</div>
</v-flex>
</v-layout>
<v-layout row>
<v-flex mt-1 mb-2 xs6>
<v-btn v-for="time in staff.times"
color="error"
dark
depressed
small
class="btn-time"
>
{{time.xtime}}
</v-btn>
</v-flex>
<v-flex mt-1 xs6 class="text-sm-right">
<v-btn v-for="area in staff.areas"
color="info"
dark
outline
small
class="btn-time"
>
{{area.xarea}}
</v-btn>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</div>
</template>
<style scoped>
.btn-time{
margin: 3px 1px!important;
min-width: 50px!important;
}
</style>
<script>
module.exports = {
data() {
return {
}
},
computed: {
xstaffs(){
return this.$store.state.order.staffs
}
},
methods : {
}
}
</script>

View File

@@ -0,0 +1,78 @@
<!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/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 xs10 class="right" fill-height pa-1>
<!-- komponen kanan -->
<one-home-service-listing></one-home-service-listing>
</v-flex>
<v-flex xs2 class="left" fill-height pa-1>
<!-- komponen kiri -->
<one-home-service-summary></one-home-service-summary>
<one-home-service-form></one-home-service-form>
</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-home-service-listing' : httpVueLoader('./components/oneHomeServiceListing.vue'),
'one-home-service-summary' : httpVueLoader('./components/oneHomeServiceSummary.vue'),
'one-home-service-form' : httpVueLoader('./components/oneHomeServiceForm.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,620 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/form.js"
export default {
namespaced: true,
state: {
form_act:'new',
step:'order',
btn_confirm:'hide',
btn_order:'hide',
do_btn_order:'hide',
disabled_register:false,
status_now:{id:1,code:'NEW'},
get_data_status:0,
get_data_error_message:'',
save_status:0,
save_error_message:'',
autocomplete_status:0,
dialog_form:false,
dialog_ordernumber:false,
msg_ordernumber:'',
title_ordernumber:'',
titles:[],
title:{},
patientname:'',
dob:'',
hp:'',
email:'',
phone:'',
sexs:[],
sex:{},
religions:[],
religion:{},
cities:[],
new_cities:[],
city:{},
new_city:{},
districts:[],
new_districts:[],
new_district:[],
district:{},
kelurahans:[],
new_kelurahans:[],
kelurahan:{},
new_kelurahan:{},
address:'',
new_address:'',
orderid:0,
orderpatients:[],
orderpatient:{},
orderadresss:[],
orderadress:{},
doctoradresss:[],
doctoradress:{},
ordertypes:[],
ordertype:{},
orderdate:moment(new Date()).format('YYYY-MM-DD'),
mindate:moment().subtract(1, 'days').toISOString(),
ordertimes:[],
ordertime:{},
orderphone:'',
orderautotests:[],
orderautotest:{},
ordertests:[],
deleted_ordertests:[],
staffs:[],
orderstaff:{},
orderdeliverytipes:[],
orderdeliverytype:{},
orderdeliveryaddress:'',
orderpatientdeliveryaddress:{},
orderdoctors:[],
orderdoctor:{},
patient_dob:'',
ordernote:'',
supplies_trx_id:0
},
mutations: {
update_step(state,val){
state.step = val
},
update_status_now(state,val){
state.status_now = val
},
update_disabled_register(state,val){
state.disabled_register = val
},
update_btn_confirm(state,val){
state.btn_confirm = val
},
update_do_btn_order(state,val){
state.do_btn_order = val
},
update_btn_order(state,val){
state.btn_order = val
},
update_form_act(state,val){
state.form_act = val
},
update_autocomplete_status(state,val){
state.autocomplete_status = val
},
update_search_city(state,val){
state.search_city = val
},
update_get_data_status(state,val){
state.get_data_status = val
},
update_save_status(state,val){
state.save_status = val
},
update_get_data_error_message(state,val){
state.get_data_error_message = val
},
update_save_error_message(state,val){
state.save_error_message = val
},
update_dialog_form(state,val) {
state.dialog_form = val
},
update_dialog_ordernumber(state,val) {
state.dialog_ordernumber = val
},
update_msg_ordernumber(state,val) {
state.msg_ordernumber = val
},
update_title_ordernumber(state,val) {
state.title_ordernumber = val
},
update_titles(state,data){
state.titles = data
},
update_title(state,val){
state.title = val
},
update_patientname(state,val){
state.patientname = val
},
update_dob(state,val){
state.dob = val
},
update_hp(state,val){
state.hp = val
},
update_phone(state,val){
state.phone = val
},
update_email(state,val){
state.email = val
},
update_sexs(state,data){
state.sexs = data
},
update_sex(state,val){
state.sex = val
},
update_religions(state,data){
state.religions = data
},
update_religion(state,val){
state.religion = val
},
update_cities(state,data){
state.cities = data
},
update_new_cities(state,data){
state.new_cities = data
},
update_city(state,val){
state.city = val
},
update_new_city(state,val){
state.new_city = val
},
update_districts(state,data){
state.districts = data
},
update_new_districts(state,data){
state.new_districts = data
},
update_district(state,val){
state.district = val
},
update_new_district(state,val){
state.new_district = val
},
update_kelurahans(state,data){
state.kelurahans = data
},
update_new_kelurahans(state,data){
state.new_kelurahans = data
},
update_kelurahan(state,val){
state.kelurahan = val
},
update_new_kelurahan(state,val){
state.new_kelurahan = val
},
update_address(state,val){
state.address = val
},
update_new_address(state,val){
state.new_address = val
},
update_orderid(state,val){
state.orderid = val
},
update_ordernote(state,val){
state.ordernote = val
},
update_orderpatients(state,data){
state.orderpatients = data
},
update_orderpatient(state,val){
state.orderpatient = val
},
update_orderadresss(state,data){
state.orderadresss = data
},
update_orderadress(state,data){
state.orderadress = data
},
update_doctoradresss(state,data){
state.doctoradresss = data
},
update_doctoradress(state,data){
state.doctoradress = data
},
update_ordertypes(state,data){
state.ordertypes = data
},
update_ordertype(state,val){
state.ordertype = val
},
update_orderdate(state,val){
state.orderdate = val
},
update_ordertimes(state,data){
state.ordertimes = data
},
update_ordertime(state,val){
state.ordertime = val
//console.log(state.ordertime)
},
update_orderphone(state,val){
state.orderphone = val
},
update_orderautotests(state,data){
state.orderautotests = data
},
update_orderautotest(state,val){
state.orderautotest = val
},
update_ordertests(state,data){
state.ordertests = data
},
update_deleted_ordertests(state,data){
state.deleted_ordertests = data
},
update_staffs(state,data){
state.staffs = data
},
update_orderstaff(state,val){
state.orderstaff = val
},
update_orderdeliverytipes(state,data){
state.orderdeliverytipes = data
},
update_orderdeliverytype(state,val){
state.orderdeliverytype = val
},
update_orderdeliveryaddress(state,val){
state.orderdeliveryaddress = val
},
update_orderpatientdeliveryaddress(state,val){
state.orderpatientdeliveryaddress = val
},
update_orderdoctors(state,data){
state.orderdoctors = data
},
update_orderdoctor(state,val){
state.orderdoctor = val
},
update_patient_dob(state,val){
state.patient_dob = val
},
update_supplies_trx_id(state,val){
state.supplies_trx_id = val
},
},
actions: {
async titsexreg(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.titsexreg(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_titles", resp.data.records.titles)
context.commit("update_sexs", resp.data.records.sexs)
context.commit("update_religions", resp.data.records.religions)
context.commit("update_ordertypes", resp.data.records.ordertypes)
context.commit("update_staffs", resp.data.records.staffs)
context.commit("update_orderdeliverytipes", resp.data.records.deliverytipes)
context.commit("update_ordertimes", resp.data.records.times)
}
} 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 searchnewcity(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_new_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 getnewdistrict(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_new_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)
}
},
async getnewkelurahan(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_new_kelurahans",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async savenewpatient(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.savenewpatient(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
}
console.log(data.records[0])
context.commit("update_title",{})
context.commit("update_sex",{})
context.commit("update_religion",{})
context.commit("update_cities",[])
context.commit("update_city",{})
context.commit("update_districts",[])
context.commit("update_district",{})
context.commit("update_kelurahans",[])
context.commit("update_kelurahan",{})
context.commit("update_patientname","")
context.commit("update_dob","")
context.commit("update_hp","")
context.commit("update_phone","")
context.commit("update_email","")
context.commit("update_address","")
context.commit("update_orderpatients",data.records)
context.commit("update_orderpatient",data.records[0])
context.dispatch("getaddress",data.records[0])
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async getaddress(context,prm) {
context.commit("update_save_status",1)
try {
let resp= await api.getaddress(one_token(),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_orderadresss",resp.data.records)
context.commit("update_orderadress",resp.data.records[0])
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async getdoctoraddress(context,prm) {
context.commit("update_save_status",1)
try {
let resp= await api.getdoctoraddress(one_token(),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_doctoradresss",resp.data.records)
context.commit("update_doctoradress",resp.data.records[0])
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async searchpatient(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchpatient(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_orderpatients",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_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
}
context.commit("update_orderautotests",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_orderdoctors",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async saveorder(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.saveorder(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
}
let msg = "Order dengan nomor "+data.records[0].numberx+" berhasil dibuat"
context.commit("update_dialog_form",false)
context.commit("update_msg_ordernumber",msg)
context.commit("update_title_ordernumber",'Berhasil !')
context.commit("update_dialog_ordernumber",true)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async updateorder(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.updateorder(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(prm.act === 'update'){
let msg = 'Perubahan order '+data.records[0].numberx+' telah tersimpan'
context.commit("update_dialog_form",false)
context.commit("update_title_ordernumber",'Berhasil !')
context.commit("update_msg_ordernumber",msg)
context.commit("update_dialog_ordernumber",true)
//var prm = {fdate:prm.fdate,fstatus:prm.fstatus,ftype:prm.ftype}
}else{
let msg = "Order dengan nomor "+data.records.numberx+" berhasil dibuat"
context.commit("update_title_ordernumber",'Berhasil !')
context.commit("update_msg_ordernumber",msg)
context.commit("update_dialog_ordernumber",true)
}
}
} catch(e) {
context.commit("update_save_status",3)
}
}
}
}

View File

@@ -0,0 +1,46 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
//import * as api from "../api/schedulepromise.js"
export default {
namespaced: true,
state: {
home_services: [],
listing_status: 0,
listing_error_message: ''
},
mutations: {
update_home_service(state, data) {
state.home_services = data
},
update_listing_status(state, val) {
state.listing_status = val
},
update_listing_error_message(state, val) {
state.listing_error_message = val
}
},
actions: {
async lookup(context, prm) {
context.commit("update_listing_status", 1)
try {
let resp = await api.lookup(prm.id)
if (resp.status != "OK") {
context.commit("update_listing_status", 3)
context.commit("update_listing_error_message", resp.message)
} else {
context.commit("update_listing_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("home_services", data.records)
}
} catch (e) {
context.commit("update_listing_status", 3)
context.commit("update_listing_error_message", resp.message)
}
}
}
}

View File

@@ -0,0 +1,213 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/order.js"
export default {
namespaced: true,
state: {
orders: [],
total_order:0,
selected_order:{},
listing_status: 0,
listing_error_message: '',
fdate:moment(new Date()).format('YYYY-MM-DD'),
search_order:0,
save_status:0,
search_error_message:'',
lookup_staff:0,
lookup_staff_error_message:'',
staffs:[],
disabled_button :false
},
mutations: {
update_disabled_button(state, data) {
state.disabled_button = data
},
update_home_service(state, data) {
state.home_services = data
},
update_listing_status(state, val) {
state.listing_status = val
},
update_listing_error_message(state, val) {
state.listing_error_message = val
},
update_fdate(state,val){
state.fdate = val
console.log(state.fdate)
},
update_search_order(state,val){
state.search_order = val
},
update_search_error_message(state,val){
state.search_error_message = val
},
update_orders(state,data){
state.orders = data.records
state.total_order = data.total
},
update_save_status(state,val){
state.save_status = val
},
update_orders_commit(state,data){
state.orders = data
},
update_lookup_staff(state,val){
state.lookup_staff = val
},
update_lookup_staff_error_message(state,val){
state.lookup_staff_error_message = val
},
update_staffs(state,data){
state.staffs = data
}
},
actions: {
async search(context, prm) {
context.commit("update_search_order", 1)
try {
let resp = await api.search(prm.fdate, prm.fstatus, prm.ftype, one_token())
if (resp.status != "OK") {
context.commit("update_search_order", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_order", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_orders", data)
//context.commit("update_selected_order", data.records[0])
}
} catch (e) {
context.commit("update_search_order", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async lookup_staff(context, prm) {
context.commit("update_lookup_staff", 1)
try {
let resp = await api.lookup_staff(prm.fdate, prm.fstatus,one_token())
if (resp.status != "OK") {
context.commit("update_lookup_staff", 3)
context.commit("update_lookup_staff_error_message", resp.message)
} else {
context.commit("update_lookup_staff", 2)
context.commit("update_lookup_staff_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_staffs", data.records)
//context.commit("update_selected_order", data.records[0])
}
} catch (e) {
context.commit("update_lookup_staff", 3)
context.commit("update_lookup_staff_error_message", e.message)
console.log(e)
}
},
async doconfirm(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.doconfirm(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
var prm = {fdate:prm.fdate,fstatus:prm.fstatus,ftype:prm.ftype}
//console.log(prm)
//context.commit("px/update_moucompany", data.records[0], { root: true })
context.commit("form/update_ordertype",{},{ root: true })
context.commit("form/update_orderdate","",{ root: true })
context.commit("form/update_orderphone","",{ root: true })
context.commit("form/update_orderpatient",{},{ root: true })
context.commit("form/update_orderadress",{},{ root: true })
context.commit("form/update_orderautotest",{},{ root: true })
context.commit("form/update_ordertests",[],{ root: true })
context.commit("form/update_orderstaff",{},{ root: true })
context.commit("form/update_orderpatients",[],{ root: true })
context.commit("form/update_orderadresss",[],{ root: true })
context.commit("form/update_orderdeliverytype",{},{ root: true })
context.commit("form/update_orderpatientdeliveryaddress",{},{ root: true })
context.commit("form/update_btn_confirm",'hide',{ root: true })
context.dispatch("search",prm)
context.dispatch("lookup_staff",prm)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async doorderlab(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.doorderlab(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
}
let msg = "Order dengan nomor "+data.records.numberx+" berhasil dibuat"
// var prm = {fdate:prm.fdate,fstatus:prm.fstatus,ftype:prm.ftype}
//console.log(prm)
// context.commit("form/update_dialog_form",false,{ root: true })
context.commit("form/update_title_ordernumber",'Berhasil !',{ root: true })
context.commit("form/update_msg_ordernumber",msg,{ root: true })
context.commit("form/update_dialog_ordernumber",true,{ root: true })
//context.commit("px/update_moucompany", data.records[0], { root: true })
/*context.commit("form/update_ordertype",{},{ root: true })
context.commit("form/update_orderdate","",{ root: true })
context.commit("form/update_orderphone","",{ root: true })
context.commit("form/update_orderpatient",{},{ root: true })
context.commit("form/update_orderadress",{},{ root: true })
context.commit("form/update_orderautotest",{},{ root: true })
context.commit("form/update_ordertests",[],{ root: true })
context.commit("form/update_orderstaff",{},{ root: true })
context.commit("form/update_orderpatients",[],{ root: true })
context.commit("form/update_orderadresss",[],{ root: true })
context.commit("form/update_orderdeliverytype",{},{ root: true })
context.commit("form/update_orderpatientdeliveryaddress",{},{ root: true })
context.commit("form/update_btn_confirm",'hide',{ root: true })
context.commit("form/update_do_btn_order",'hide',{ root: true })*/
//context.dispatch("search",prm)
//context.dispatch("lookup_staff",prm)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async docancel(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.docancel(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
var prm = {fdate:prm.fdate,fstatus:prm.fstatus,ftype:prm.ftype}
console.log(prm)
context.dispatch("search",prm)
context.dispatch("lookup_staff",prm)
}
} catch(e) {
context.commit("update_save_status",3)
}
}
}
}

View File

@@ -0,0 +1,53 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/status.js"
export default {
namespaced: true,
state: {
lookup_status:0,
lookup_error_message:'',
statuses: [],
total_status: 0,
selected_status: {"id":1,"name":"NEW","color":"secondary"}
},
mutations: {
update_lookup_error_message(state,status) {
state.search_error_message = status
},
update_lookup_status(state,status) {
state.search_status = status
},
update_statuses(state,data) {
state.statuses= data.records
state.total_status= data.total
},
update_selected_status(state,val) {
state.selected_status=val
}
},
actions: {
async lookup(context) {
context.commit("update_lookup_status",1)
try {
let resp= await api.lookup()
if (resp.status != "OK") {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_status",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_statuses",data)
}
} catch(e) {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,55 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/type.js"
export default {
namespaced: true,
state: {
lookup_type:0,
lookup_error_message:'',
types: [],
total_type: 0,
selected_type: {"id":1,"name":"Telepon"}
},
mutations: {
update_lookup_error_message(state,type) {
state.search_error_message = type
},
update_lookup_type(state,type) {
state.search_type = type
},
update_types(state,data) {
state.types= data.records
//console.log(state.types)
state.total_type= data.total
},
update_selected_type(state,val) {
state.selected_type=val
}
},
actions: {
async lookup(context) {
context.commit("update_lookup_type",1)
try {
let resp= await api.lookup()
if (resp.status != "OK") {
context.commit("update_lookup_type",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_type",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
//console.log(data)
context.commit("update_types",data)
}
} catch(e) {
context.commit("update_lookup_type",3)
context.commit("update_lookup_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,29 @@
// State
// data ...
// Mutations
//
//
// Actions
import order from "./modules/order.js";
import status from "./modules/status.js";
import type from "./modules/type.js";
import form from "./modules/form.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
order: order,
status:status,
form:form,
type:type,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});