Flatten nested repos
This commit is contained in:
56
test/vuex/cpone-receive-sample/api/receive.js
Normal file
56
test/vuex/cpone-receive-sample/api/receive.js
Normal file
@@ -0,0 +1,56 @@
|
||||
const URL = "/one-api/mockup/receivesample/receivesample/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + '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 getsample(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'getsample', 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 saveConfirm(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'saveConfirm', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-layout column>
|
||||
<v-dialog v-model="dialogconfirmation" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title dark class="headline error pt-2 pb-2" primary-title style="color: white">
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{ msgconfirmation }}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-right" flat
|
||||
@click="dialogconfirmation = false">Batal</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-left" flat @click="doSave()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- alert dialog error start -->
|
||||
<v-dialog v-model="dialogerror" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="error" class="headline">Error !</v-card-title>
|
||||
<v-card-text>
|
||||
{{ msgerror }}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogError">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- alert dialog error end -->
|
||||
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-layout align-center column>
|
||||
<v-toolbar dark color="primary">
|
||||
<v-toolbar-title class="white--text"
|
||||
>DAFTAR SAMPEL</v-toolbar-title
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
</v-toolbar>
|
||||
<v-card style="width: 100%" class="mb-2 pa-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="text-sm-right" pa-1>
|
||||
<v-btn v-if="xsamples.length > 0" :disabled="xsamples[0].ischoose == 'Y'" @click="opensaveConfirm()" color="primary">Konfirmasi</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
<v-card>
|
||||
<v-layout v-if="xsamples.length > 0" row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-layout xs12 row wrap>
|
||||
<v-flex xs4 v-for="(vst,idx) in xsamples" :key="vst.T_OrderSampleID" class="pr-2 pb-1">
|
||||
<v-layout row>
|
||||
<v-flex :class="vst.ischoose === 'Y' ? 'boxoutlinegreen' : 'boxoutline'" style="text-overflow:ellipsis;overflow:hidden;" xs11>
|
||||
<span>{{vst.typename_barcode}}</span>
|
||||
</v-flex>
|
||||
<v-flex :class="vst.ischoose === 'Y' ? 'boxoutlinegreen text-left' : 'boxoutline text-left'" style="padding-top:10px" pl-2 pb-2 pr-2 xs2>
|
||||
<v-layout row align-left justify-space-between>
|
||||
<v-icon v-if="vst.ischoose === 'N'" style="color:red">clear</v-icon>
|
||||
<v-icon v-if="vst.ischoose === 'Y'" style="color:green">check</v-icon>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
<!-- <one-dialog-print
|
||||
:title="printtitle"
|
||||
:width="printwidth"
|
||||
:height="500"
|
||||
:status="openprint"
|
||||
:urlprint="urlprint"
|
||||
@close-dialog-print="closePrint"
|
||||
></one-dialog-print> -->
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
.boxoutlinegreen {
|
||||
color: green;
|
||||
border: 1px solid green;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxoutlinegreen:hover {
|
||||
background: rgba(0, 0, 0, 0.07) !important;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.boxoutline {
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxoutline:hover {
|
||||
background: rgba(0, 0, 0, 0.07) !important;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
// "one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
opensaveConfirm() {
|
||||
var msg = "Yakin, akan terima sampel ?"
|
||||
this.$store.commit("receive/update_msg_confirmation", msg)
|
||||
this.$store.commit("receive/update_dialog_confirmation", true)
|
||||
},
|
||||
doSave() {
|
||||
var datasample = this.$store.state.receive.samples;
|
||||
if (datasample.length > 0) {
|
||||
var prm = {
|
||||
spkHomeServiceID: this.$store.state.receive.selected_transaction.SpkHomeServiceID,
|
||||
spkHomeServiceOrderID: this.$store.state.receive.selected_transaction.SpkHomeServiceOrderID,
|
||||
arrSample: datasample
|
||||
}
|
||||
this.$store.dispatch("receive/saveConfirm", prm)
|
||||
}
|
||||
},
|
||||
closeDialogError() {
|
||||
this.$store.commit("receive/update_dialog_error", false);
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
this.$store.dispatch("receive/getsample", {
|
||||
orderheaderID: this.$store.state.receive.selected_transaction.SpkHomeServiceOrderT_OrderHeaderID
|
||||
})
|
||||
this.$store.commit("receive/update_dialog_success",false)
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
xsamples() {
|
||||
return this.$store.state.receive.samples;
|
||||
},
|
||||
dialogconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.receive.dialog_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_dialog_confirmation", val)
|
||||
}
|
||||
},
|
||||
msgconfirmation() {
|
||||
return this.$store.state.receive.msg_confirmation
|
||||
},
|
||||
dialogerror: {
|
||||
get() {
|
||||
return this.$store.state.receive.dialog_error;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_dialog_error", val);
|
||||
},
|
||||
},
|
||||
msgerror() {
|
||||
return this.$store.state.receive.msg_error;
|
||||
},
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.receive.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.receive.msg_success
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
printtitle: "",
|
||||
printwidth: "80%",
|
||||
openprint: false,
|
||||
urlprint: "",
|
||||
searchhandoverHeaderCopy: "",
|
||||
selected_delivery: {},
|
||||
search_company: "",
|
||||
search_test: "",
|
||||
menuFormDateStart: false,
|
||||
menuFormDateEnd: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
dialogAct: "add",
|
||||
items: [],
|
||||
menuFormDateEnd: false,
|
||||
menuFormDateStart: false,
|
||||
errors: [],
|
||||
sheet: false,
|
||||
indeterminatex: false,
|
||||
checkednotall: false,
|
||||
bar_chx_all: false,
|
||||
selected_barcode: [],
|
||||
dialogtimeline: false,
|
||||
search_doctor: "",
|
||||
headers: [
|
||||
{
|
||||
text: "NOMOR",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 blue darken-2 white--text",
|
||||
},
|
||||
{
|
||||
text: "TGL. ORDER",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 blue darken-2 white--text",
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "pa-2 blue darken-2 white--text",
|
||||
},
|
||||
{
|
||||
text: "STAFF",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "20%",
|
||||
class: "pa-2 blue darken-2 white--text",
|
||||
},
|
||||
{
|
||||
text: "PENERIMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "20%",
|
||||
class: "pa-2 blue darken-2 white--text",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-toolbar dark color="primary">
|
||||
<v-toolbar-title class="white--text"
|
||||
>DAFTAR ORDER SPK</v-toolbar-title
|
||||
>
|
||||
</v-toolbar>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout align-center row>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-menu class="xs4 pl-2"
|
||||
v-model="menufilterdateend"
|
||||
: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="filterComputedDateFormattedEnd"
|
||||
label="Tanggal spk"
|
||||
outline
|
||||
readonly
|
||||
hide-details
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdate" no-title @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs6 pa-1>
|
||||
<v-text-field
|
||||
v-model="spk_search"
|
||||
label="Cari"
|
||||
outline
|
||||
placeholder="Ketikkan no spk atau no lab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex pa-1>
|
||||
<v-btn
|
||||
dark
|
||||
color="primary"
|
||||
style="min-width: 50px; height: 50px; margin: 0"
|
||||
@click="searchTransaction()"
|
||||
>
|
||||
<v-icon>search</v-icon>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card >
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xtransactions"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.SpkHomeServiceDate }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.SpkHomeServiceNumber }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_OrderHeaderLabNumber }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_PatientName }}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<v-pagination
|
||||
style="margin-top:10px;margin-bottom:10px"
|
||||
v-model="curr_page"
|
||||
:length="xtotal_page"
|
||||
|
||||
></v-pagination>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:40px;
|
||||
}
|
||||
.searchbox .v-btn {
|
||||
min-height:40px;
|
||||
}
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("receive/search",{
|
||||
date: this.xdate,
|
||||
search: this.spk_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
return p.SpkHomeServiceOrderID == this.$store.state.receive.selected_transaction.SpkHomeServiceOrderID
|
||||
},
|
||||
selectMe(data) {
|
||||
this.$store.commit("receive/update_selected_transaction", data)
|
||||
this.$store.dispatch("receive/getsample", {
|
||||
orderheaderID: data.SpkHomeServiceOrderT_OrderHeaderID
|
||||
})
|
||||
},
|
||||
searchTransaction() {
|
||||
this.$store.dispatch("receive/search", {
|
||||
date: this.xdate,
|
||||
search: this.spk_search,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.commit("receive/update_samples", [])
|
||||
},
|
||||
openDeleteAll(value){
|
||||
this.$store.commit("receive/update_selected_transaction", value)
|
||||
let msg = "Yakin, akan menghapus data spk nomor " + this.$store.state.receive.selected_transaction.SpkHomeServiceNumber + " ?"
|
||||
this.$store.commit("receive/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("receive/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
doDeleteData() {
|
||||
var prm = {}
|
||||
prm.spkHomeServiceId = this.$store.state.receive.selected_transaction.SpkHomeServiceID
|
||||
prm.number = this.$store.state.receive.selected_transaction.SpkHomeServiceNumber
|
||||
console.log(prm)
|
||||
this.$store.dispatch("form/deleteOrder",prm)
|
||||
},
|
||||
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')}`
|
||||
},
|
||||
editRowOrder(item) {
|
||||
// console.log('edit data', item)
|
||||
// this.$store.commit("service/update_act", 'edit')
|
||||
// this.$store.commit("service/update_no_save", 0)
|
||||
// this.$store.commit("form/update_trx_id", item.SpkHomeServiceID)
|
||||
// this.$store.commit("form/update_transaction_date", this.formatDate(item.SpkHomeServiceDate))
|
||||
// this.$store.commit("service/update_selected_transaction", item)
|
||||
// this.$store.commit("form/update_save_hide", true);
|
||||
// this.$store.dispatch("form/getorderbyid",{spkHomeServiceId: item.SpkHomeServiceID, current_page: 1})
|
||||
// this.$store.dispatch("form/getstaff", {spkHomeServiceId: item.SpkHomeServiceID })
|
||||
// this.$store.dispatch("form/getstaffbyid",{spkHomeServiceId: item.SpkHomeServiceID })
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("service/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("service/update_no_save",0)
|
||||
this.$store.commit("service/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("service/update_alert_success",val)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("service/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.receive.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_open_dialog_info", false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.receive.msg_info
|
||||
},
|
||||
xtransactions() {
|
||||
return this.$store.state.receive.transactions
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.receive.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_current_page",val)
|
||||
this.$store.dispatch("receive/search",{
|
||||
date: this.xdate,
|
||||
search: '',
|
||||
current_page: val,
|
||||
lastid:-1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.receive.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_total_page",val)
|
||||
}
|
||||
},
|
||||
spk_search : {
|
||||
get() {
|
||||
return this.$store.state.receive.spk_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_spk_search",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.receive.search_transaction == 1
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.receive.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.receive.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormattedEnd () {
|
||||
return this.formatDate(this.xdate)
|
||||
},
|
||||
xdate:{
|
||||
get() {
|
||||
return this.$store.state.receive.transaction_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receive/update_transaction_date",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
menufilterdateend:false,
|
||||
name: '',
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NOMOR SPK",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NOMOR LAB",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "40%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
97
test/vuex/cpone-receive-sample/index.php
Normal file
97
test/vuex/cpone-receive-sample/index.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<!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>CPOne</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp">
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs5 class="left" fill-height pa-1>
|
||||
<one-receive-sampleheader></one-receive-sampleheader>
|
||||
</v-flex>
|
||||
<v-flex xs7 class="right" fill-height pa-1>
|
||||
<one-receive-sampledetail></one-receive-sampledetail>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../../libs/one_global.js"></script>
|
||||
<!-- <script src="../../../libs/one_print_barcode.js"></script>
|
||||
<script src="../../../libs/one_print_robo.js"></script> -->
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
window.calculate_age = function(inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
var year = now.diff(dob, 'years')
|
||||
dob.add(year, 'years')
|
||||
var month = now.diff(dob, 'months')
|
||||
dob.add(month, 'months')
|
||||
var day = now.diff(dob, 'days')
|
||||
if (isNaN(year)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
|
||||
import {
|
||||
store
|
||||
} from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected: function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-receive-sampleheader': httpVueLoader('./components/oneReceiveSampleHedaer.vue'),
|
||||
'one-receive-sampledetail': httpVueLoader('./components/oneReceiveSampleDetail.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
190
test/vuex/cpone-receive-sample/modules/receive.js
Normal file
190
test/vuex/cpone-receive-sample/modules/receive.js
Normal file
@@ -0,0 +1,190 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/receive.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
search_transaction: 0,
|
||||
search_error_message: '',
|
||||
transactions:[],
|
||||
current_page:1,
|
||||
total_page: 0 ,
|
||||
no_save: 0,
|
||||
selected_transaction: {},
|
||||
search_status: 0,
|
||||
last_id:-1,
|
||||
spk_search:'',
|
||||
dialog_success: false,
|
||||
alert_success: false,
|
||||
open_alert_confirmation:false,
|
||||
dialog_confirmation: false,
|
||||
msg_confirmation: "",
|
||||
act:'new',
|
||||
transaction_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
msg_success: "",
|
||||
get_data: 0,
|
||||
samples: [],
|
||||
save_data: 0,
|
||||
dialog_error: false,
|
||||
msg_error:""
|
||||
},
|
||||
mutations: {
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_search_transaction(state, val) {
|
||||
state.search_transaction = val
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_transactions(state, data) {
|
||||
state.transactions = data
|
||||
},
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_no_save(state, val) {
|
||||
state.no_save = val
|
||||
},
|
||||
update_selected_transaction(state, val) {
|
||||
state.selected_transaction = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_spk_search(state, val) {
|
||||
state.spk_search = val
|
||||
},
|
||||
update_dialog_success(state, val) {
|
||||
state.dialog_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_open_alert_confirmation(state, val) {
|
||||
state.open_alert_confirmation = val
|
||||
},
|
||||
update_dialog_confirmation(state, val) {
|
||||
state.dialog_confirmation = val
|
||||
},
|
||||
update_msg_confirmation(state, val) {
|
||||
state.msg_confirmation = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_transaction_date(state, val) {
|
||||
state.transaction_date = val
|
||||
},
|
||||
update_get_data(state, val) {
|
||||
state.get_data = val
|
||||
},
|
||||
update_samples(state, val) {
|
||||
state.samples = val
|
||||
},
|
||||
update_save_data(state, val) {
|
||||
state.save_data = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_update_msg_error(state, val) {
|
||||
state.msg_error = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_transaction", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_transaction", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_transactions", data.records)
|
||||
context.commit("update_total_page", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log('search',e)
|
||||
}
|
||||
},
|
||||
async getsample(context, prm) {
|
||||
context.commit("update_get_data", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getsample(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_get_data", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_samples", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log('search',e)
|
||||
}
|
||||
},
|
||||
async saveConfirm(context, prm) {
|
||||
context.commit("update_save_data", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveConfirm(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_data", 3)
|
||||
context.commit("update_msg_error", resp.message)
|
||||
context.commit("update_dialog_error",true)
|
||||
} else {
|
||||
context.commit("update_save_data", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
var msg = "berhasil disimpan dong.."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_success", true)
|
||||
context.commit("update_dialog_confirmation", false)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_data", 3)
|
||||
context.commit("update_msg_error", e.message)
|
||||
console.log('search',e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
test/vuex/cpone-receive-sample/store.js
Normal file
27
test/vuex/cpone-receive-sample/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
import receive from "./modules/receive.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
receive: receive,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user