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,149 @@
const URL = "/one-api/v1/requpload_marketing/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'requpload/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 getstationstatus(token) {
try {
var resp = await axios.post(URL + 'requpload/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 getbranchs(token) {
try {
var resp = await axios.post(URL + 'requpload/getbranchs',{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 getmodules(token) {
try {
var resp = await axios.post(URL + 'requpload/getmodules',{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 getdatetimererun(prm) {
try {
var resp = await axios.post(URL + 'requpload/getdatetimererun',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 getmaxtimererun(token) {
try {
var resp = await axios.post(URL + 'requpload/getmaxtimererun',{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 save(prm) {
try {
var resp = await axios.post(URL + 'requpload/save',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function doaction(prm) {
try {
var resp = await axios.post(URL + 'requpload/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
};
}
}

View File

@@ -0,0 +1,910 @@
<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>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogreqrerun" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM PERMINTAAN UPLOAD ULANG</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formreqrerunreqrerun" v-model="validreqrerun" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-layout wrap>
<v-flex xs6>
<v-menu class="xs3 pr-2" v-model="menufilterdatestartform" :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 class="textinput ma-1" v-model="filterComputedDateFormattedStartForm" label="Tgl Mulai" outline readonly v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormattedStartForm)"></v-text-field>
</template>
<v-date-picker v-model="xstartdateform" no-title @input="menufilterdatestartform = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6>
<v-menu class="xs3 pr-2" v-model="menufilterdateedateform" :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 class="textinput ma-1" v-model="filterComputedDateFormattedEndForm" label="Tgl. Selesai" outline readonly v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormattedEndForm)"></v-text-field>
</template>
<v-date-picker v-model="xenddateform" no-title @input="menufilterdateedateform = false"></v-date-picker>
</v-menu>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 pa-2>
<span>Cabang</span>
</v-flex>
<v-flex xs12 pa-2>
<v-btn class="mt-1 mb-2" v-for="(vst,idx) in xorderbranchs" :key="vst.id" @click="changeBranch(idx)" small :color="vst.isbranch === 'N' ? 'yellow' : 'green'">{{vst.M_BranchName}}
</v-btn>
</v-flex>
<v-flex xs12 pa-2>
<span>Modul</span>
</v-flex>
<v-flex xs12 pa-2>
<v-tooltip top v-for="(vst,idx) in xordermodules" :key="vst.id">
<template v-slot:activator="{ on, attrs }">
<v-btn class="mt-1 mb-2" @click="changeModule(idx)" v-bind="attrs" v-on="on" small :color="vst.ismodule === 'N' ? 'yellow' : 'green'">{{vst.M_ReqUploadModuleCode}}
</v-btn>
</template>
<span>{{vst.M_ReqUploadModuleDesc}}</span>
</v-tooltip>
</v-flex>
<v-flex xs12 pa-2>
<v-textarea v-model="xnote" label="Alasan"></v-textarea>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormReRun()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormReRun()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
<v-card class="mb-2 pa-2 searchbox">
<v-layout>
<v-menu class="xs3 pr-2" v-model="menufilterdatestart" :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 class="mt-1" v-model="filterComputedDateFormattedStart" label="Tanggal" outline readonly v-on="on" @blur="date = deFormatedDate(filterComputedDateFormattedStart)"></v-text-field>
</template>
<v-date-picker v-model="xstartdate" no-title @input="menufilterdatestart = false"></v-date-picker>
</v-menu>
<v-select class="xs3 ma-1 mini-select" :items="filter_branch" item-text="name" return-object style="font-size:14px" v-model="selected_filter_branch"
label="Cabang" outline hide-details></v-select>
<v-select class="xs3 ma-1 mini-select" :items="filter_status" item-text="name" return-object style="font-size:14px" v-model="selected_filter_status"
label="Status" outline hide-details></v-select>
<span @click="setNewReqReRun" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
<!-- <span v-if="btn_hide === false" title="Kirim" @click="receive" class="icon-medium-fill-base xs1 white--text warning"><v-icon large dark>move_to_inbox</v-icon></span> -->
</v-layout>
</v-card>
<v-card>
<v-layout align-center row>
<v-flex xs12 pl-2 style="max-height:610px;overflow-y:scroll" pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="reqreruns" :loading="isLoading" hide-actions class="elevation-1">
<template v-slot:headers="props">
<tr>
<!-- <th class="text-xs-left blue-grey white--text">
<v-checkbox style="padding-top:0;margin-top:0" hide-details color="white" :indeterminate="indeterminatex" @change="changeCbxAll(bar_chx_all)"
v-model="bar_chx_all"></v-checkbox>
</th> -->
<th v-for="header in props.headers" :key="header.text" :class="header.class" :width="header.width">
{{ header.text }}
</th>
</tr>
</template>
<template v-slot:items="props">
<!-- <td style="width:5px" class="text-xs-left">
<v-checkbox style="padding-top:0;margin-top:0" color="blue-grey" hide-details v-model="props.item.chex" @change="checkTop()"></v-checkbox>
</td> -->
<td class="text-xs-left pa-2">{{ props.item.requploaddate}}</td>
<td class="text-xs-left pa-2">{{ props.item.branchname}}</td>
<td class="text-xs-left pa-2">{{ props.item.moduledesc}}</td>
<td class="text-xs-left pa-2">{{ props.item.Req_UploadHeaderNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.status}}</td>
<td class="text-xs-left pa-2">{{ props.item.pengulangan}}</td>
<td class="text-xs-left pa-2">{{ props.item.staffname}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</v-card>
<template>
<v-dialog v-model="dialog_alert_verif" max-width="600px">
<v-card>
<v-card-title class="headline red lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertverif}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="close_alert_verif()">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<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>
<one-dialog-print-verify :title="printtitleverify" :width="printwidthverify" :height="500" :status="openprintverify" :urlprint="urlprintverify"
@close-dialog-print="closePrintVerify"></one-dialog-print-verify>
</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'),
'one-x-check': httpVueLoader('../../../common/onexcheck.vue'),
'one-dialog-print-verify': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
mounted() {
this.$store.dispatch("reqrerun/search")
this.$store.dispatch("reqrerun/getmodules")
this.$store.dispatch("reqrerun/getbranchs")
this.$store.dispatch("reqrerun/getstationstatus", {
date: this.xstartdate,
branchid: 0,
statusid: 0,
lastid: -1,
current_page: 1
})
},
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')}`
},
formatDateSchedule(date) {
if (!date) return null
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
deFormatedDateSchedule(date) {
if (!date) return null
const [day, month, year] = date.split('-')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
isSelected(p) {
return p.T_BarcodeLabID == this.$store.state.reqrerun.selected_patient.T_BarcodeLabID
},
searchPatient() {
this.$store.dispatch("reqrerun/search", {
date: this.xstartdate,
branchid: this.selected_filter_branch.id,
statusid: this.selected_filter_status.id,
lastid: -1,
current_page: this.curr_page
})
},
selectMe(pat) {
if (this.$store.state.reqrerun.no_save == 0) {
var reqreruns = this.$store.state.reqrerun.reqreruns
this.$store.commit("reqrerun/update_selected_patient", pat)
var idx = _.findIndex(reqreruns, function (o) {
return o.T_BarcodeLabID == pat.T_BarcodeLabID
})
this.$store.commit("reqrerun/update_last_id", idx)
} else {
this.$store.commit("reqrerun/update_open_alert_confirmation", true)
}
},
close_alert_verif() {
this.$store.commit("reqrerun/update_dialog_alert_verif", false)
this.btn_hide = false
},
closeAlertConfirmation() {
this.$store.commit("reqrerun/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("reqrerun/update_no_save", 0)
this.$store.commit("reqrerun/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("reqrerun/update_alert_success", val)
},
setNewPatient() {
//this.$store.commit("reqrerun/update_selected_Patient",{})
},
opendialog_reqrerun(value) {
//console.log(value)
var trx = this.$store.state.reqrerun.reqreruns
var idx = _.findIndex(trx, function (o) {
return o.T_BarcodeLabBarcode == value.T_BarcodeLabBarcode
})
if (value.status === 'V' && value.requirement_status === 'Y') {
} else {
this.$store.commit("reqrerun/update_selected_patient", value)
trx[idx].requirement_status = 'N'
//console.log(trx[idx].requirements)
this.$store.commit("reqrerun/update_requirements", trx[idx].requirements)
this.$store.commit("reqrerun/update_dialog_reqrerun", true)
}
},
checkReq(val, idx) {
var xrequirements = this.requirements
if (xrequirements[idx].status === 'D') {
xrequirements[idx].chex = val
this.$store.commit("reqrerun/update_requirements", xrequirements)
}
},
updateDialogReRun() {
this.$store.commit("reqrerun/update_dialog_form_reqrerun", false)
},
updateDialogFormReRun() {
this.$store.commit("reqrerun/update_dialog_form_reqrerun", false)
},
setNewReqReRun(val) {
this.$store.dispatch("reqrerun/getmodules")
this.$store.dispatch("reqrerun/getbranchs")
this.xid = 0
this.xnote = ''
this.xtotalbranch = 0
this.xtotalmodule = 2
this.xstartdateform = moment(new Date()).format('YYYY-MM-DD')
this.xenddateform = moment(new Date()).format('YYYY-MM-DD')
this.$store.commit("reqrerun/update_dialog_form_reqrerun", true)
},
saveFormReRun() {
var go_action = true
var errors = []
if (this.xtotalbranch == 0) {
errors.push("Eits pilih dulu cabangnya")
go_action = false
}
if (this.xtotalmodule == 0) {
errors.push("Eits pilih dulu modulnya")
go_action = false
}
if (this.xnote === '') {
errors.push("Eits isi alasannya dooong")
go_action = false
}
if (go_action) {
this.$store.dispatch("reqrerun/save", {
startdate: this.xstartdateform,
enddateform : this.xenddateform,
branchs : this.xorderbranchs,
modules : this.xordermodules,
note: this.xnote
})
}else {
this.$store.commit("reqrerun/update_msg_info", errors.join('</br></br>'))
this.$store.commit("reqrerun/update_open_dialog_info", true)
console.log('open ' + this.open_dialog_info)
}
},
confirmRequirement(value) {
var branchs = this.$store.state.reqrerun.reqreruns
var idx = _.findIndex(branchs, function (o) {
return o.T_BarcodeLabID == value.T_BarcodeLabID
})
if (value.status === 'D') {
branchs[idx].requirement_status = 'Y'
this.$store.commit("reqrerun/update_reqreruns", branchs)
branchs[idx].requirements.forEach((el) => {
el.chex = "N"
})
}
},
verify(value) {
console.log(value)
var goaction = true
if (value.requirement_status === 'N') {
var req_check = _.filter(value.requirements, function (o) {
return o.chex === 'Y'
})
if (req_check.length === 0) {
goaction = false
}
}
if (value.status === 'D' && value.requirement_status !== 'X' && goaction) {
console.log("in verify")
this.$store.commit("reqrerun/update_act", 'verify')
this.$store.commit("reqrerun/update_selected_patient", value)
this.closeDialogAction()
} else {
//console.log('oeey')
if (value.status === 'D') {
this.$store.commit("reqrerun/update_msg_info",
"Mobil batmen ngeluarin api, ada requirement mohon dilengkapi")
this.$store.commit("reqrerun/update_open_dialog_info", true)
}
}
},
receive() {
this.$store.commit("reqrerun/update_act", 'receive')
this.closeDialogAction()
},
reject() {
this.$store.commit("reqrerun/update_act", 'reject')
this.closeDialogAction()
},
cancel() {
this.$store.commit("reqrerun/update_act", 'cancel')
this.closeDialogAction()
},
closeDialogAction() {
console.log("closedialogaction")
this.btn_hide = true
var act = this.$store.state.reqrerun.act
var trx = this.$store.state.reqrerun.selected_patient
var reqreruns = this.$store.state.reqrerun.reqreruns
this.$store.dispatch("reqrerun/doaction", {
act: act,
detail: trx,
reqreruns: reqreruns,
lastid: -1
})
},
closeDialogSuccess() {
let arrPatient = this.$store.state.reqrerun.reqreruns
var idx = _.findIndex(arrPatient, item => item.M_PatientID === this.$store.state.reqrerun.last_id)
var xcur_page = 1
// if(idx !== -1)
// xcur_page = this.$store.state.reqrerun.current_page
this.$store.dispatch("reqrerun/search", {
name: this.name,
date: this.xstartdate,
stationid: this.xselectedstation.id,
statusid: this.xselectedstatus.id,
// current_page:xcur_page,
lastid: idx
})
this.$store.commit("reqrerun/update_dialog_success", false)
},
closeDialogInfo() {
this.$store.commit("reqrerun/update_open_dialog_info", false)
},
checkTop() {
var barcodes = this.reqreruns
var selected = _.filter(barcodes, function (o) {
return o.chex;
})
this.bar_chx_all = false
this.indeterminatex = false
if (selected.length > 0) {
this.bar_chx_all = true
this.indeterminatex = false
}
if (selected.length > 0) {
this.bar_chx_all = false
this.indeterminatex = true
}
this.$store.commit("reqrerun/update_selected_patient", selected)
console.log(selected)
},
changeCbxAll(value) {
var arr = this.reqreruns
this.indeterminatex = false
arr.forEach((el) => {
el.chex = value
})
var selected = _.filter(arr, function (o) {
return o.chex;
})
this.$store.commit("reqrerun/update_selected_patient", selected)
},
changeFilter(e) {
if (e.key == 'Tab') {
////////this.searchPatient()
}
},
doPrintVerify(val) {
console.log('doprint')
this.printwidthverify = 1028
this.printtitleverify = ""
let user = one_user()
var id = val.reqrerunid
var d = new Date();
var n = d.getTime()
var rptname = 'price_reqrerun'
var formatrpt = this.formatreport
this.urlprintverify = "/birt/run?__report=report/one/rekap/" + rptname + ".rptdesign&__format=" +
formatrpt + "&PID=" + id + "&username=" + user.M_UserUsername + "&tm=" + n
this.openprintverify = true
},
closePrintVerify() {
this.openprintverify = false
},
changeBranch(idx) {
var arrOrders = this.$store.state.reqrerun.orderbranchs
arrOrders[idx].isbranch = arrOrders[idx].isbranch === 'N' ? 'Y' : 'N'
if(arrOrders[idx].isbranch === 'N'){
this.xtotalbranch = this.xtotalbranch - 1
}else{
this.xtotalbranch = this.xtotalbranch + 1
}
this.$store.commit("reqrerun/update_orderbranchs", arrOrders)
},
changeModule(idx) {
var arrOrders = this.$store.state.reqrerun.ordermodules
arrOrders[idx].ismodule = arrOrders[idx].ismodule === 'N' ? 'Y' : 'N'
if(arrOrders[idx].ismodule === 'N'){
this.xtotalmodule = this.xtotalmodule - 1
}else{
this.xtotalmodule = this.xtotalmodule + 1
}
this.$store.commit("reqrerun/update_ordermodules", arrOrders)
}
},
computed: {
xorderbranchs() {
xbranchs = this.$store.state.reqrerun.orderbranchs;
console.log('xbranchs', xbranchs)
return xbranchs
},
xordermodules() {
xmodules = this.$store.state.reqrerun.ordermodules;
console.log('xmodules', xmodules)
return xmodules
},
filterComputedDateFormattedStartForm() {
return this.formatDate(this.xstartdateform)
},
xstartdateform: {
get() {
return this.$store.state.reqrerun.startdateform
},
set(val) {
this.$store.commit("reqrerun/update_startdateform", val)
}
},
filterComputedDateFormattedEndForm() {
return this.formatDate(this.xenddateform)
},
xenddateform: {
get() {
return this.$store.state.reqrerun.enddateform
},
set(val) {
this.$store.commit("reqrerun/update_enddateform", val)
}
},
filter_branch() {
return this.$store.state.reqrerun.filter_branch
},
dialogreqrerun() {
return this.$store.state.reqrerun.dialog_form_reqrerun
},
selected_filter_branch: {
get() {
return this.$store.state.reqrerun.selected_filter_branch
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_selected_filter_branch", val)
this.searchPatient()
}
},
filter_staff() {
return this.$store.state.reqrerun.filter_staff
},
selected_filter_staff: {
get() {
return this.$store.state.reqrerun.selected_filter_staff
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_selected_filter_staff", val)
this.searchPatient()
}
},
filter_type() {
return this.$store.state.reqrerun.filter_type
},
selected_filter_type: {
get() {
return this.$store.state.reqrerun.selected_filter_type
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_selected_filter_type", val)
this.searchPatient()
}
},
filter_status() {
return this.$store.state.reqrerun.filter_status
},
selected_filter_status: {
get() {
return this.$store.state.reqrerun.selected_filter_status
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_selected_filter_status", val)
this.searchPatient()
}
},
timererun() {
return this.$store.state.reqrerun.timererun
},
selected_timererun: {
get() {
return this.$store.state.reqrerun.selected_timererun
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_selected_timererun", val)
}
},
maxtimererun: {
get() {
return this.$store.state.reqrerun.maxtimererun
},
set(val) {
//console.log("adsda")
this.$store.commit("reqrerun/update_maxtimererun", val)
}
},
filterComputedDateFormattedStart() {
return this.formatDate(this.xstartdate)
},
filterComputedDateFormattedSchedule() {
return this.formatDateSchedule(this.xscheduledate)
},
xstartdate: {
get() {
return this.$store.state.reqrerun.startdate
},
set(val) {
this.$store.commit("reqrerun/update_startdate", val)
console.log(val)
this.searchPatient()
}
},
bar_chx_all: {
get() {
return this.$store.state.reqrerun.bar_chx_all
},
set(val) {
this.$store.commit("reqrerun/update_bar_chx_all", val)
}
},
indeterminatex: {
get() {
return this.$store.state.reqrerun.indeterminatex
},
set(val) {
this.$store.commit("reqrerun/update_indeterminatex", val)
}
},
btn_hide: {
get() {
return this.$store.state.reqrerun.btn_hide
},
set(val) {
this.$store.commit("reqrerun/update_btn_hide", val)
}
},
dialogsuccess: {
get() {
return this.$store.state.reqrerun.dialog_success
},
set(val) {
this.$store.commit("reqrerun/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.reqrerun.msg_success
},
snackbar: {
get() {
return this.$store.state.reqrerun.alert_success
},
set(val) {
this.$store.commit("reqrerun/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.reqrerun.search_status == 1
},
xstations() {
return this.$store.state.reqrerun.stations
},
xselectedstation: {
get() {
return this.$store.state.reqrerun.selected_station
},
set(val) {
this.$store.commit("reqrerun/update_selected_station", val)
this.searchPatient()
}
},
xstatuses() {
return this.$store.state.reqrerun.statuses
},
xselectedstatus: {
get() {
return this.$store.state.reqrerun.selected_status
},
set(val) {
this.$store.commit("reqrerun/update_selected_status", val)
////////this.searchPatient()
}
},
reqreruns() {
return this.$store.state.reqrerun.reqreruns
},
openalertconfirmation: {
get() {
return this.$store.state.reqrerun.open_alert_confirmation
},
set(val) {
this.$store.commit("reqrerun/update_open_alert_confirmation", val)
}
},
curr_page: {
get() {
return this.$store.state.reqrerun.current_page
},
set(val) {
this.$store.commit("reqrerun/update_current_page", val)
this.$store.dispatch("reqrerun/search", {
date: this.xstartdate,
branchid: this.selected_filter_branch.id,
statusid: this.selected_filter_status.id,
lastid: 1,
current_page: val
})
}
},
xtotal_page: {
get() {
return this.$store.state.reqrerun.total_page
},
set(val) {
this.$store.commit("reqrerun/update_total_page", val)
}
},
opendialoginfo: {
get() {
return this.$store.state.reqrerun.open_dialog_info
},
set(val) {
this.$store.commit("reqrerun/update_open_dialog_info", false)
}
},
msginfo() {
return this.$store.state.reqrerun.msg_info
},
xdate: {
get() {
return this.$store.state.reqrerun.xdate
},
set(val) {
this.$store.commit("reqrerun/update_xdate", val)
}
},
xscheduledate: {
get() {
return this.$store.state.reqrerun.xscheduledate
},
set(val) {
this.$store.commit("reqrerun/update_xscheduledate", val)
this.$store.dispatch("reqrerun/getdatetimererun", {
date: val
})
}
},
xscheduletime: {
get() {
return this.$store.state.reqrerun.xscheduletime
},
set(val) {
this.$store.commit("reqrerun/update_xscheduletime", val)
}
},
nolab: {
get() {
return this.$store.state.reqrerun.nolab
},
set(val) {
this.$store.commit("reqrerun/update_nolab", val)
//////////this.searchPatient()
}
},
xtotalbranch: {
get() {
return this.$store.state.reqrerun.totalbranch
},
set(val) {
this.$store.commit("reqrerun/update_totalbranch", val)
//////////this.searchPatient()
}
},
xtotalmodule: {
get() {
return this.$store.state.reqrerun.totalmodule
},
set(val) {
this.$store.commit("reqrerun/update_totalmodule", val)
//////////this.searchPatient()
}
},
requirements: {
get() {
return this.$store.state.reqrerun.requirements
},
set(val) {
this.$store.commit("reqrerun/update_requirements", val)
}
},
dialog_alert_verif() {
return this.$store.state.reqrerun.dialog_alert_verif
},
msgalertverif() {
return this.$store.state.reqrerun.msgalertverif
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
on: false,
page: 1,
xcode: '',
openprintverify: false,
urlprintverify: '',
printtitleverify: '',
printwidthverify: 600,
formatreport: 'pdf',
xnote: "",
menufilterdatestart: false,
menufilterdateschedule: false,
menufilterdatestartform: false,
menufilterdateedateform: false,
validreqrerun: false,
headers: [{
text: "TANGGAL",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "CABANG",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "MODUL",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "ALASAN",
align: "left",
sortable: false,
value: "mr",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "STATUS",
align: "left",
sortable: false,
value: "lab",
width: "10%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "PENGULANGAN",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
},
{
text: "STAFF",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "text-xs-left pa-2 blue-grey white--text"
}
]
};
}
}
</script>

View File

@@ -0,0 +1,102 @@
<!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 class="pl-1 pr-1 pt-1 pb-1">
<v-layout wrap>
<v-flex xs12 class="left" pa-1>
<one-req-rerun-list></one-req-rerun-list>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../libs/vendor/moment.min.js"></script>
<script src="../../libs/vendor/numeral.min.js"></script>
<script src="../../libs/vendor/moment-locale-id.js"></script>
<script src="../../libs/vendor/lodash.js"></script>
<script src="../../libs/vendor/axios.min.js"></script>
<script src="../../libs/vendor/vue.js"></script>
<script src="../../libs/vendor/vuex.js"></script>
<script src="../../libs/vendor/vuetify.js"></script>
<script src="../../libs/vendor/httpVueLoader.js"></script>
<script src="../../libs/one_global.js"></script>
<script src="../../libs/vendor/socket.io.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`
}
var socketIoUrl = "http://" + window.location.host + ":9090/";
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
data : {
socket : io.connect(socketIoUrl,{forceNew:false})
},
el: '#app',
doctornted(){
},
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
computed: {
showtests(){
return this.$store.state.samplecall.showtests
}
},
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-req-rerun-list': httpVueLoader('./components/oneReqReRunMarketingList.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,938 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/reqrerun.js"
export default {
namespaced: true,
state: {
last_id: -1,
last_saved_id: -1,
x_addr_id: 0,
btn_hide: false,
act: 'edit',
act_addr: 'new',
act_search: false,
get_data_status: 0,
search_patient: 0,
search_status: 0,
search_error_message: '',
preffix: '',
patient_name: '',
suffix: '',
reqreruns: [],
selected_patient: [],
branchs: [],
selected_branch: {},
total_reqreruns: 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_reqrerun: false,
requirements: [],
selected_sample: {},
open_dialog_info: false,
msg_info: '',
name: '',
nolab: '',
information_bahan: [],
staff: {
id: 0,
code: '',
name: 'BELUM ADA STAF',
code: '',
userid: ''
},
bar_chx_all: false,
indeterminatex: false,
filter_branch: [],
selected_filter_branch: {},
filter_staff: [],
selected_filter_staff: {},
filter_type: [],
selected_filter_type: {},
filter_status: [],
selected_filter_status: {
id: 'N',
name: 'Pending'
},
timererun: [],
selected_timererun: {},
maxtimererun: {},
dialog_alert_verif: false,
xdate: moment(new Date()).format('YYYY-MM-DD'),
xscheduledate: moment(new Date()).format('YYYY-MM-DD'),
startdate: moment(new Date()).format('YYYY-MM-DD'),
xscheduletime: '21:00',
msgalertverif: '',
dialog_form_reqrerun: false,
startdateform: moment(new Date()).format('YYYY-MM-DD'),
enddateform: moment(new Date()).format('YYYY-MM-DD'),
orderbranchs: [],
deleted_orderbranchs: [],
ordermodules: [],
deleted_ordermodules: [],
totalbranch: 0,
totalmodule: 2
},
mutations: {
update_totalbranch(state, data) {
state.totalbranch = data
},
update_totalmodule(state, data) {
state.totalmodule = data
},
update_orderbranchs(state, data) {
state.orderbranchs = data
},
update_deleted_orderbranchs(state, data) {
state.deleted_orderbranchs = data
},
update_ordermodules(state, data) {
state.ordermodules = data
},
update_deleted_ordermodules(state, data) {
state.deleted_ordermodules = data
},
update_startdateform(state, val) {
state.startdateform = val
},
update_enddateform(state, val) {
state.enddateform = val
},
update_startdate(state, val) {
state.startdate = val
},
update_dialog_form_reqrerun(state, val) {
state.dialog_form_reqrerun = val
},
update_xdate(state, val) {
state.xdate = val
},
update_xscheduledate(state, val) {
state.xscheduledate = val
},
update_xscheduletime(state, val) {
state.xscheduletime = val
},
update_dialog_alert_verif(state, val) {
state.dialog_alert_verif = val
},
update_msgalertverif(state, val) {
state.msgalertverif = val
},
update_filter_branch(state, val) {
state.filter_branch = val
},
update_selected_filter_branch(state, val) {
console.log(val)
state.selected_filter_branch = val
},
update_filter_staff(state, val) {
state.filter_staff = val
},
update_selected_filter_staff(state, val) {
console.log(val)
state.selected_filter_staff = val
},
update_filter_type(state, val) {
state.filter_type = val
},
update_selected_filter_type(state, val) {
console.log(val)
state.selected_filter_type = val
},
update_filter_status(state, val) {
state.filter_status = val
},
update_selected_filter_status(state, val) {
console.log(val)
state.selected_filter_status = val
},
update_timererun(state, val) {
state.timererun = val
},
update_selected_timererun(state, val) {
console.log(val)
state.selected_timererun = val
},
update_maxtimererun(state, val) {
console.log(val)
state.maxtimererun = val
},
update_act_search(state, val) {
state.act_search = val
},
update_bar_chx_all(state, val) {
state.bar_chx_all = val
},
update_indeterminatex(state, val) {
state.indeterminatex = val
},
update_btn_hide(state, val) {
state.btn_hide = 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_reqrerun(state, val) {
state.dialog_reqrerun = 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_reqreruns(state, data) {
state.reqreruns = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_branchs(state, data) {
state.branchs = data
},
update_selected_branch(state, val) {
state.selected_branch = 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_reqreruns(state, val) {
state.total_reqreruns = val
},
update_dialog_action(state, val) {
state.dialog_action = val
},
update_msg_action(state, val) {
state.msg_action = val
}
},
actions: {
async search(context) {
context.commit("update_search_patient", 1)
try {
var prm = {
date: context.state.startdate,
branchid: context.state.filter_branch.M_BranchID,
statusid: context.state.selected_filter_status.id,
lastid: -1,
current_page: context.state.current_page
}
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_selected_patient", [])
context.commit("update_bar_chx_all", false)
context.commit("update_indeterminatex", false)
context.commit("update_reqreruns", data.records)
context.commit("update_total_reqreruns", data.total)
if (data.records.length > 0 && context.state.act_search) {
context.commit("update_bar_chx_all", true)
context.commit("update_indeterminatex", false)
var reqreruns = data.records
reqreruns.forEach((el) => {
el.chex = true
})
context.commit("update_reqreruns", reqreruns)
context.commit("update_act_search", false)
context.commit("update_selected_patient", reqreruns)
}
//context.commit("update_total_page", data.total)
context.commit("update_no_save", 0)
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getstationstatus(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getstationstatus(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_filter_branch", data.records.branchs)
context.commit("update_selected_filter_branch", data.records.branchs[0])
context.commit("update_filter_status", data.records.statuss)
context.commit("update_selected_filter_status", data.records.statuss[0])
//prm.stationid = data.records.stations[0].id
//prm.statusid = data.records.statuses[0].id
prm.date = prm.date
prm.branchid = data.records.branchs[0].id
prm.statusid = data.records.statuss[0].id
prm.current_page = 1
//prm.branchid = -1
/*if(data.records.branchs.length > 0){
var idx_branchid = _.findIndex(data.records.branchs, function(o) { return o.id === prm.branchid })
console.log(idx_branchid)
if(idx_branchid === -1){
prm.branchid = data.records.branchs[0].id
context.commit("update_selected_filter_branch",data.records.branchs[0])
}
else
context.commit("update_selected_filter_branch",data.records.branchs[idx_branchid])
}
*/
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getdatetimererun(context, prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.getdatetimererun(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_timererun", data.records.datetimereruns)
context.commit("update_selected_timererun", data.records.datetimereruns[0])
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getmaxtimererun(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getmaxtimererun(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_maxtimererun", data.records.datetimereruns[0])
}
} 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_reqrerun", true)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
context.commit("update_dialog_success", true)
var msg = "Data permintaan upload sudah tersimpang dong ..."
context.commit("update_msg_success", msg)
context.commit("update_dialog_form_reqrerun", false)
context.dispatch("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)
prm.search.lastid = -1
context.dispatch("search", prm.search)
}
} 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_reqrerun", 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 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 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 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)
}
},
/*async search_patient(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
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
}
//context.rootState.px.req_status
var rst = data.records
if(rst){
console.log(rst)
context.commit("update_nolab",prm.search)
context.commit("update_reqreruns",rst)
context.commit("update_bar_chx_all",true)
context.commit("update_indeterminatex",false)
context.commit("update_selected_patient",rst)
}
else{
var msg = "Naik angkot ketemu si marni, <span class='mono' style='color:red;font-weight:bold'>"+prm.search+"</span> maaf sample-nya belum sampai di sini"
context.commit("update_msg_info",msg)
context.commit("update_open_dialog_info",true)
}
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},*/
search_patient(context, prm) {
context.commit("update_get_data_status", 1)
context.commit("update_act_search", true)
//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.lastid = -1
window.key_enter = ''
console.log(prm)
context.dispatch("search", prm)
},
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 getbranchs(context) {
context.commit("update_save_status", 1)
try {
let resp = await api.getbranchs(one_token())
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_orderbranchs", data.records['branchs'])
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async getmodules(context) {
context.commit("update_save_status", 1)
try {
let resp = await api.getmodules(one_token())
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_ordermodules", data.records['ordermodules'])
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async gettypes(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.gettypes(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_types", data.records['types'])
}
} catch (e) {
context.commit("update_save_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)
var msg = resp.message
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
// var note = str.replace('\\n)\\n\"}"', '')
var note = 'Error Send Data'
console.log(note)
context.commit("update_msgalertverif", note)
context.commit("update_dialog_alert_verif", true)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_act", '-')
context.commit("update_btn_hide", false)
context.dispatch("search")
}
} catch (e) {
context.commit("update_save_status", 3)
}
}
}
}

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import reqrerun from "./modules/reqrerun.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
reqrerun:reqrerun,
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)
}
}
});