Flatten nested repos
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
const URL = "/one-api/mockup/receivereference/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/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 getcompanycouriers(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/getcompanycouriers', 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 + 'delivery/doaction', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdoctoraddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/getdoctoraddress', 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 getordersamples(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/getordersamples', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/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 deletetrx(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/deletetrx', 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,498 @@
|
||||
<template>
|
||||
<v-layout class="mb-2" column>
|
||||
<v-dialog v-model="dialogconfirmationdelete" 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>
|
||||
{{msgconfirmationdelete}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteTrx()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="xdialogaction" persistent max-width="350">
|
||||
<v-card>
|
||||
<v-card-title color="warning" class="headline">Konfirmasi</v-card-title>
|
||||
<v-card-text v-html="xmsgaction">
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary darken-1" flat @click="closeDialogAction()">Ya</v-btn>
|
||||
<v-btn color="error darken-1" flat @click="xdialogaction = false">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-layout row>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-subheader red--text text--lighten-1> FORM SURAT JALAN
|
||||
<span v-if="xact !== 'new'"> [ <span style="color:#2196F3;font-weight: 900;">{{xnumbering}}</span> ]</span>
|
||||
<span v-if="xact !== 'new' && currStatus === 'CREATED'">
|
||||
<v-btn small @click="releaseToCourier()" color="warning">RILIS SURAT JALAN</v-btn>
|
||||
</span>
|
||||
<!--
|
||||
<span v-if="xact !== 'new' && currStatus === 'RELEASEC'">
|
||||
<v-btn small @click="receiveCompany()" color="info">DITERIMA LAB PERUJUK</v-btn>
|
||||
</span>
|
||||
<span v-if="xact !== 'new' && currStatus === 'RCVDOC'">
|
||||
<v-btn small @click="receiveFromCourier()" color="primary">TERIMA DARI KURIR</v-btn>
|
||||
</span>
|
||||
<span v-if="xact !== 'new' && currStatus === 'PARTDONE'">
|
||||
<v-btn small @click="forceClose()" color="success">TUTUP TRANSAKSI MANUAL</v-btn>
|
||||
</span>
|
||||
-->
|
||||
<v-flex text-md-right>
|
||||
<v-btn v-if="xact !== 'new' && currStatus === 'CREATED'" @click="deleteTrx()" small color="error">Hapus</v-btn>
|
||||
<v-btn v-if="( xact !== 'new' && currStatus === 'CREATED') || xact === 'new'" @click="saveTrx()" small color="primary">Simpan</v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout class="pb-2" row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs2 pa-1>
|
||||
<v-text-field label="Tanggal Transaksi*" placeholder="dd-mm-yyyy" mask="##-##-####" v-model="xtrxdate" :disabled="xact === 'edit' && currStatus !== 'CREATED'"></v-text-field>
|
||||
|
||||
</v-flex>
|
||||
<v-flex pa-1 xs4>
|
||||
<v-select :search-input.sync="searchCompany" item-text="name" return-object :items="xcompanys" v-model="xselectedcompany" :disabled="xact === 'edit'" label="Kelompok Pelanggan*" autocomplete></v-select>
|
||||
<p v-if="checkError('requirecompany')" class="error pl-2 pr-2" style="color:#fff">Kelompok Pelanggan dipilih dulu dong</p>
|
||||
</v-flex>
|
||||
<v-flex pa-1 xs4>
|
||||
<v-select :search-input.sync="searchCourier" item-text="name" return-object :disabled="xact === 'edit' && currStatus !== 'CREATED'" :items="xcouriers" v-model="xselectedcourier"
|
||||
label="Kurir" autocomplete></v-select>
|
||||
<p v-if="checkError('requirecourier')" class="error pl-2 pr-2" style="color:#fff">Yang ngirim siapa dong ?</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-textarea filled outline label="Catatan" v-model="xnote" rows="3"></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-layout class="pt-2 mb-2" column>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> DETAIL TRANSAKSI</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout v-if="xact === 'new'" row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-data-table :headers="headers" :items="details" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2">{{ props.item.labnumberref }}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.patient_fullname }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.samplename }}</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div>
|
||||
<v-btn @click="changeActive(props.item)" v-if="props.item.active === 'N'" small color="error">
|
||||
<v-icon left>close</v-icon> Belum dipilih</v-btn>
|
||||
<v-btn @click="changeActive(props.item)" v-if="props.item.active === 'Y'" flat small color="success">
|
||||
<v-icon left>check</v-icon> Sudah terpilih</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="xact !== 'new'" row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-data-table :headers="headerreceive" :items="details" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2">{{ props.item.labnumberref }}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.patient_fullname }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.samplename }}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table,
|
||||
td,
|
||||
th {
|
||||
border: 1px solid #ddd;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 8px;
|
||||
padding-right: 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;
|
||||
}
|
||||
|
||||
input.fhm-input {
|
||||
border: 1px solid black;
|
||||
border-radius: 2px;
|
||||
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
padding: 2px 4px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
margin: 0 0 1px 0;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
menutrxdate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
isLoading: false,
|
||||
searchCompany: '',
|
||||
searchCourier: '',
|
||||
headers: [{
|
||||
text: "NOLAB REFERENSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PASIEN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "SAMPLE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
headerreceive: [{
|
||||
text: "NOLAB REFERENSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PASIEN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "SAMPLE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
}),
|
||||
computed: {
|
||||
xact: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.act
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_act", val)
|
||||
}
|
||||
},
|
||||
xnumbering() {
|
||||
if (this.$store.state.receivereferencedelivery.selected_transaction)
|
||||
return this.$store.state.receivereferencedelivery.selected_transaction.trx_numbering
|
||||
else
|
||||
return '-'
|
||||
},
|
||||
currStatus() {
|
||||
if (this.$store.state.receivereferencedelivery.selected_transaction)
|
||||
return this.$store.state.receivereferencedelivery.selected_transaction.status
|
||||
else
|
||||
return 'NONE'
|
||||
},
|
||||
xselectedtransaction() {
|
||||
return this.$store.state.receivereferencedelivery.selected_transaction
|
||||
},
|
||||
xtrxdate: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.trx_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_trx_date", val)
|
||||
}
|
||||
},
|
||||
dialogconfirmationdelete: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_confirmation_delete", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdelete() {
|
||||
return this.$store.state.receivereferencedelivery.msg_confirmation_delete
|
||||
},
|
||||
filterComputedDateFormattedTrx() {
|
||||
return this.formatDate(this.xtrxdate)
|
||||
},
|
||||
xselectedcompany: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.selected_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_selected_company", val)
|
||||
this.$store.dispatch("receivereferencedelivery/getordersamples", {
|
||||
companyid: val.id
|
||||
})
|
||||
}
|
||||
},
|
||||
xcompanys() {
|
||||
return this.$store.state.receivereferencedelivery.companys
|
||||
},
|
||||
xselectedcourier: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.selected_courier
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_selected_courier", val)
|
||||
|
||||
}
|
||||
},
|
||||
xcouriers() {
|
||||
return this.$store.state.receivereferencedelivery.couriers
|
||||
},
|
||||
xnote: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.trx_note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_trx_note", val)
|
||||
}
|
||||
},
|
||||
details() {
|
||||
return this.$store.state.receivereferencedelivery.details
|
||||
},
|
||||
xdialogaction: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.dialog_action
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_action", val)
|
||||
}
|
||||
},
|
||||
xmsgaction: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.msg_action
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_msg_action", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.receivereferencedelivery.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
saveTrx() {
|
||||
this.$store.commit("receivereferencedelivery/update_errors", [])
|
||||
var errors = this.$store.state.receivereferencedelivery.errors
|
||||
if (_.isEmpty(this.xselectedcompany)) {
|
||||
errors.push("requirecompany")
|
||||
}
|
||||
if (_.isEmpty(this.xselectedcourier)) {
|
||||
errors.push("requirecourier")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
if (this.$store.state.receivereferencedelivery.details.length > 0) {
|
||||
var details = this.$store.state.receivereferencedelivery.details
|
||||
var prm = {}
|
||||
console.log(this.xact)
|
||||
if (this.xact === 'new')
|
||||
prm.trx_id = 0
|
||||
else
|
||||
prm.trx_id = this.$store.state.receivereferencedelivery.selected_transaction.trx_id
|
||||
|
||||
console.log(prm.trx_id)
|
||||
prm.details = details
|
||||
prm.trx_date = moment(this.xtrxdate, 'DDMMYYYY', true)
|
||||
prm.trx_note = this.xnote
|
||||
prm.company = this.xselectedcompany
|
||||
prm.courier = this.xselectedcourier
|
||||
prm.startdate = this.$store.state.receivereferencedelivery.start_date
|
||||
prm.enddate = this.$store.state.receivereferencedelivery.end_date
|
||||
prm.search = this.$store.state.receivereferencedelivery.name_lab
|
||||
prm.lastid = -1
|
||||
this.$store.dispatch("receivereferencedelivery/save", prm)
|
||||
} else {
|
||||
var msg = "Belum ada sample yang dipilih dong "
|
||||
this.$store.commit("receivereferencedelivery/update_msg_info", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_open_dialog_info", true)
|
||||
}
|
||||
}
|
||||
},
|
||||
changeFlagImage(value) {
|
||||
console.log('changeFlagImage')
|
||||
if (this.xact === 'new' || (this.xact !== 'new' && this.currStatus === 'CREATED')) {
|
||||
let arr = this.$store.state.receivereferencedelivery.details
|
||||
var idx = _.findIndex(arr, item => item.orderid === value.orderid && item.sampleid === value.sampleid)
|
||||
arr[idx].flag_image = value.flag_image === 'N' ? 'Y' : 'N'
|
||||
this.$store.commit("receivereferencedelivery/update_details", arr)
|
||||
}
|
||||
},
|
||||
changeActive(value) {
|
||||
console.log('changeActive')
|
||||
if (this.xact === 'new' || (this.xact !== 'new' && this.currStatus === 'CREATED')) {
|
||||
let arr = this.$store.state.receivereferencedelivery.details
|
||||
var idx = _.findIndex(arr, item => item.rpatientid === value.rpatientid && item.sampleid === value.sampleid)
|
||||
arr[idx].active = value.active === 'N' ? 'Y' : 'N'
|
||||
this.$store.commit("receivereferencedelivery/update_details", arr)
|
||||
}
|
||||
},
|
||||
changeFlagImageReceive(value) {
|
||||
console.log('changeFlagImageReceive')
|
||||
if (this.xact !== 'new' && this.currStatus !== 'DONE') {
|
||||
let arr = this.$store.state.receivereferencedelivery.details
|
||||
var idx = _.findIndex(arr, item => item.orderid === value.orderid && item.sampleid === value.sampleid)
|
||||
arr[idx].flag_image_receive = value.flag_image_receive === 'N' ? 'Y' : 'N'
|
||||
this.$store.commit("receivereferencedelivery/update_details", arr)
|
||||
}
|
||||
},
|
||||
changeFlagResultReceive(value) {
|
||||
console.log('changeFlagResultReceive')
|
||||
if (this.xact !== 'new' && this.currStatus !== 'DONE') {
|
||||
let arr = this.$store.state.receivereferencedelivery.details
|
||||
var idx = _.findIndex(arr, item => item.T_ReceiveReferenceDeliveryDetailT_ReceiveReferencePatientID === value.T_ReceiveReferenceDeliveryDetailT_ReceiveReferencePatientID && item.sampleid === value.sampleid)
|
||||
arr[idx].active = value.active === 'N' ? 'Y' : 'N'
|
||||
this.$store.commit("receivereferencedelivery/update_details", arr)
|
||||
}
|
||||
},
|
||||
deleteTrx() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
console.log(trx)
|
||||
let msg = "Yakin, akan menghapus data transaksi " + trx.trx_numbering + " ?"
|
||||
this.$store.commit("receivereferencedelivery/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
doDeleteTrx() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
this.$store.dispatch("receivereferencedelivery/deletetrx", trx)
|
||||
},
|
||||
releaseToCourier() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
var msg = "Anda yakin akan menyerahkan dokumen transaksi " + trx.trx_numbering + " ke kurir ? "
|
||||
this.$store.commit("receivereferencedelivery/update_msg_action", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_act", 'RELEASEC')
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_action", true)
|
||||
},
|
||||
receiveCompany() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
var msg = "Dokumen transaksi " + trx.trx_numbering + " telah diterima lab perujuk ? "
|
||||
this.$store.commit("receivereferencedelivery/update_msg_action", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_act", 'RCVLAB')
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_action", true)
|
||||
},
|
||||
receiveFromCourier() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
var msg = "Dokumen transaksi " + trx.trx_numbering + " diterima dari kurir ? "
|
||||
this.$store.commit("receivereferencedelivery/update_msg_action", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_act", 'DONE')
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_action", true)
|
||||
},
|
||||
forceClose() {
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
var msg = "Dokumen transaksi " + trx.trx_numbering + " ditutup ? "
|
||||
this.$store.commit("receivereferencedelivery/update_msg_action", msg)
|
||||
this.$store.commit("receivereferencedelivery/update_act", 'FORCEDONE')
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_action", true)
|
||||
},
|
||||
closeDialogAction() {
|
||||
var act = this.$store.state.receivereferencedelivery.act
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
let arrtrx = this.$store.state.receivereferencedelivery.transactions
|
||||
var idx = _.findIndex(arrtrx, item => item.trx_id === trx.trx_id)
|
||||
var prm = {}
|
||||
prm.act = act
|
||||
prm.trx = trx
|
||||
prm.startdate = this.$store.state.receivereferencedelivery.start_date
|
||||
prm.enddate = this.$store.state.receivereferencedelivery.end_date
|
||||
prm.search = this.$store.state.receivereferencedelivery.name_lab
|
||||
prm.stationid = this.$store.state.receivereferencedelivery.selected_station.id
|
||||
prm.lastid = idx
|
||||
prm.details = this.$store.state.receivereferencedelivery.details
|
||||
prm.trx_note = this.xnote
|
||||
this.$store.dispatch("receivereferencedelivery/doaction", prm)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,392 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout >
|
||||
<v-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="Filter Tanggal Awal"
|
||||
outline
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
|
||||
</v-menu>
|
||||
|
||||
<v-menu class="xs3 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
|
||||
class="mt-1"
|
||||
v-model="filterComputedDateFormattedEnd"
|
||||
label="Filter Tanggal Akhir"
|
||||
outline
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdateend" no-title @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
<v-text-field class="xs4 ma-1"
|
||||
label="Nomor Transaksi"
|
||||
placeholder="Cari ..."
|
||||
outline
|
||||
v-model="xnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
<v-select class="xs3 ma-1 mini-select" :items="xstations"
|
||||
item-text="name"
|
||||
return-object
|
||||
v-model="xselectedstation"
|
||||
label="Status" outline hide-details></v-select>
|
||||
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
|
||||
<span @click="setNewTransaction" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
|
||||
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card >
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xtransactions"
|
||||
:loading="isLoading"
|
||||
:pagination.sync="pagination"
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_numbering }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_date_ina}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.company_fullname}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.courier_name}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status_name}}</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
:length="15"
|
||||
:total-visible="7"
|
||||
></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<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:60px;
|
||||
}
|
||||
.searchbox .v-btn {
|
||||
min-height:60px;
|
||||
}
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("receivereferencedelivery/getcompanycouriers",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
lastid:-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')}`
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.trx_id == this.$store.state.receivereferencedelivery.selected_transaction.trx_id
|
||||
},
|
||||
searchTransaction() {
|
||||
this.$store.dispatch("receivereferencedelivery/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
lastid:-1
|
||||
})
|
||||
},
|
||||
selectMe(trx) {
|
||||
if(this.$store.state.receivereferencedelivery.no_save == 0 ){
|
||||
//console.log(trx)
|
||||
this.$store.commit("receivereferencedelivery/update_selected_transaction",trx)
|
||||
this.$store.commit("receivereferencedelivery/update_act",'edit')
|
||||
this.$store.commit("receivereferencedelivery/update_trx_note",trx.trx_note)
|
||||
this.$store.commit("receivereferencedelivery/update_trx_date",trx.trx_date_ina)
|
||||
if(trx.company_fulname !== null){
|
||||
this.$store.commit("receivereferencedelivery/update_selected_company",{id:trx.T_ReceiveReferenceDeliveryM_CompanyID,name:trx.company_fullname})
|
||||
this.$store.commit("receivereferencedelivery/update_selected_courier",{id:trx.T_ReceiveReferenceDeliveryM_StaffID,name:trx.courier_name})
|
||||
}
|
||||
else{
|
||||
this.$store.commit("receivereferencedelivery/update_selected_company",{})
|
||||
}
|
||||
|
||||
|
||||
if(trx.details.length > 0 ){
|
||||
this.$store.commit("receivereferencedelivery/update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
this.$store.commit("receivereferencedelivery/update_details", [])
|
||||
}
|
||||
|
||||
}else{
|
||||
this.$store.commit("receivereferencedelivery/update_open_alert_confirmation",true)
|
||||
}
|
||||
},
|
||||
closeAlertConfirmation(){
|
||||
this.$store.commit("receivereferencedelivery/update_open_alert_confirmation",false)
|
||||
},
|
||||
forgetAlertConfirmation(){
|
||||
this.$store.commit("receivereferencedelivery/update_no_save",0)
|
||||
this.$store.commit("receivereferencedelivery/update_open_alert_confirmation",false)
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("receivereferencedelivery/update_alert_success",val)
|
||||
},
|
||||
setNewTransaction(){
|
||||
this.$store.commit("receivereferencedelivery/update_selected_transaction",{})
|
||||
this.$store.commit("receivereferencedelivery/update_details",[])
|
||||
this.$store.commit("receivereferencedelivery/update_selected_detail",{})
|
||||
this.$store.commit("receivereferencedelivery/update_selected_company",{})
|
||||
this.$store.commit("receivereferencedelivery/update_selected_courier",{})
|
||||
this.$store.commit("receivereferencedelivery/update_trx_date",moment(new Date()).format('DDMMYYYY'))
|
||||
this.$store.commit("receivereferencedelivery/update_trx_note",'')
|
||||
this.$store.commit("receivereferencedelivery/update_act",'new')
|
||||
},
|
||||
closeDialogSuccess(){
|
||||
let arrtrx = this.$store.state.receivereferencedelivery.transactions
|
||||
var idx = _.findIndex(arrtrx, item => item.So_WalkLetterCourierID === this.$store.state.receivereferencedelivery.last_id)
|
||||
//console.log(idx)
|
||||
this.$store.dispatch("receivereferencedelivery/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search:this.xnamelab,
|
||||
stationid:this.xselectedstation.id,
|
||||
lastid:idx
|
||||
})
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("receivereferencedelivery/update_open_dialog_info",false)
|
||||
var trxs = this.$store.state.receivereferencedelivery.transactions
|
||||
var trx = this.$store.state.receivereferencedelivery.selected_transaction
|
||||
var idx = _.findIndex(trxs, item => item.T_OrderHeaderID === trx.T_OrderHeaderID && item.T_SampleTypeID === trx.T_SampleTypeID)
|
||||
this.$store.dispatch("receivereferencedelivery/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
stationid:this.xselectedstation.id,
|
||||
lastid:idx
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_dialog_success",val)
|
||||
}
|
||||
},
|
||||
msgsuccess(){
|
||||
return this.$store.state.receivereferencedelivery.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_alert_success",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.receivereferencedelivery.search_status == 1
|
||||
},
|
||||
xdatestart : {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.start_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_start_date",val)
|
||||
}
|
||||
},
|
||||
xdateend : {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_end_date",val)
|
||||
}
|
||||
},
|
||||
xnamelab : {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.name_lab
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_name_lab",val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormattedStart () {
|
||||
return this.formatDate(this.xdatestart)
|
||||
},
|
||||
filterComputedDateFormattedEnd () {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
xstations() {
|
||||
return this.$store.state.receivereferencedelivery.stations
|
||||
},
|
||||
xselectedstation: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.selected_station
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_selected_station",val)
|
||||
}
|
||||
},
|
||||
xtransactions() {
|
||||
//console.log(this.$store.state.receivereferencedelivery.transactions)
|
||||
return this.$store.state.receivereferencedelivery.transactions
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_open_alert_confirmation",val)
|
||||
}
|
||||
},
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.receivereferencedelivery.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereferencedelivery/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.receivereferencedelivery.msg_info
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
menufilterdatestart:false,
|
||||
menufilterdateend:false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
items: [],
|
||||
name: '',
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NOMOR",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PERUSAHAAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "KURIR",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_ReceiveReferenceDeliveryNumber DESC',
|
||||
totalItems: this.$store.state.receivereferencedelivery.total_transactions
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,542 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column>
|
||||
<v-dialog v-model="dialogconfirmationdeletepat" 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>
|
||||
{{msgconfirmationdeletepat}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeletePat()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeletepat = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogconfirmationsend" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title dark class="headline success pt-2 pb-2" primary-title style="color:white">
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationsend}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="success darken-1 text-sm-left" flat @click="doOrderPatient()">Kirim</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationsend = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformpatient" persistent max-width="650">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Pasien</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="xnoref" label="Nomor Referensi"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="namapasien" label="Nama Pasien*"></v-text-field>
|
||||
<p v-if="checkError('requirenamapasien')" class="error pl-2 pr-2" style="color:#fff">Nama pasien diisi dulu dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="xdob" label="Tanggal Lahir*" hint="format : DD-MM-YYYY , contoh : 22-06-1988"></v-text-field>
|
||||
<p v-if="checkError('requirexdob')" class="error pl-2 pr-2" style="color:#fff">Tanggal lahir harus diisi dulu dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="m_sexname" return-object :items="xsexes" v-model="xsex" label="Jenis Kelamin*"></v-select>
|
||||
<p v-if="checkError('requirexsex')" class="error pl-2 pr-2" style="color:#fff">Pilih jenis kelamin dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs8 pa-1>
|
||||
<v-autocomplete label="Pemeriksaan" v-model="xorderautotest" :items="xorderautotests" :search-input.sync="search_test" auto-select-first
|
||||
no-filter item-text="T_TestName" return-object no-data-text="Cari Pemeriksaan" outline small>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs-4 class="text-md-right">
|
||||
<v-btn @click="addTest()" color="blue en-3">Pilih Pemeriksaan</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pt-2 pb-1>
|
||||
<table style="
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
border: 0px;
|
||||
" class="px">
|
||||
<tr>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" width="5%" class="text-md-center pt-2 pb-2">#
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" class="text-md-center pt-2 pb-2">PEMERIKSAAN
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" class="text-md-center pt-2 pb-2">BRUTO
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" class="text-md-center pt-2 pb-2">DISKON
|
||||
</td>
|
||||
<td style=" border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" class="text-md-center pt-2 pb-2">DISKON RP
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;" class="text-md-center pt-2 pb-2">TOTAL
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="xordertests.length > 0" class="mini-input" v-for="(vpx,idx) in xordertests">
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;
|
||||
text-align:center;
|
||||
vertical-align:center;" align="center">
|
||||
<span v-if="vpx.editable == 'N'">{{idx + 1}}</span>
|
||||
<v-icon v-else-if="vpx.editable == 'Y'" color="#c75c3a" @click="deleteDataPx(idx)">delete</v-icon>
|
||||
</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-left pl-3">{{vpx.T_TestName}}</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-right pr-2">{{convertMoney(vpx.T_PriceAmount)}}</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-right pr-2">{{convertMoney(vpx.T_PriceDisc)}}</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-right pr-2">{{convertMoney(vpx.T_PriceDiscRp)}}</td>
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" class="text-md-right pr-2">{{convertMoney(vpx.total)}}</td>
|
||||
</tr>
|
||||
<tr v-if="xordertests.length === 0" class="mini-input">
|
||||
<td style="border: 1px solid #fff;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding: 8px;" align="center" colspan="6">Belum ada data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformpatient = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactpat === 'new'" color="blue darken-1" flat @click="saveNewPatient()">Simpan</v-btn>
|
||||
<v-btn v-if="xactpat === 'edit'" color="blue darken-1" flat @click="saveEditPatient()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> DAFTAR PASIEN
|
||||
<v-flex text-md-right>
|
||||
<v-btn v-if="xactsend === 'N'" @click="sendOrderPatient()" small color="success">Kirim Permintaan</v-btn>
|
||||
<v-btn v-if="xactsend === 'N'" @click="createNewPatient()" small color="info">Baru</v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-data-table :headers="headers" :items="xpatients" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
|
||||
<td class="text-xs-left pa-2">{{ props.item.T_ReceiveReferencePatientName}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.T_ReceiveReferencePatientNoRef}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_SexName}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.T_ReceiveReferencePatientDOB}}</td>
|
||||
<td class="text-xs-left pa-2">
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs8 v-for="(p, i) in props.item.tesx" v-bind:key="i" pb-1 pr-1>
|
||||
<v-card :color="p.status == 'N' ? 'grey' : p.status == 'P' ? 'yellow' : 'green'" class="black--text">
|
||||
<v-card-title primary-title class="pl-3 pr-3 pt-1 pb-0 text-xs-center subheading">
|
||||
{{ p.testname }}
|
||||
</v-card-title>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon v-if="xactsend === 'N'" class="ml-3" color="primary" @click="editPatient(props.item)">edit</v-icon>
|
||||
<v-icon v-if="xactsend === 'N'" color="error" @click="deletePatient(props.item)">delete</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
Keterangan :
|
||||
<v-btn @click="" small color="grey"></v-btn> Baru
|
||||
<v-btn @click="" small color="yellow"></v-btn> Proses
|
||||
<v-btn @click="" small color="green"></v-btn> Selesai
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
oldlabel: '',
|
||||
search_test: '',
|
||||
headers: [
|
||||
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO. REFERENSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "5%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "JENIS KELAMIN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "5%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TGL. LAHIR",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeletepat: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.dialog_confirmation_delete_pat
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_dialog_confirmation_delete_pat", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdeletepat() {
|
||||
return this.$store.state.receivereference.msg_confirmation_delete_pat
|
||||
},
|
||||
dialogconfirmationsend: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.dialog_confirmation_send
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_dialog_confirmation_send", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationsend() {
|
||||
return this.$store.state.receivereference.msg_confirmation_send
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.receivereference.act
|
||||
},
|
||||
xactpat() {
|
||||
return this.$store.state.receivereference.act_pat
|
||||
},
|
||||
xactsend(){
|
||||
return this.$store.state.receivereference.act_send
|
||||
},
|
||||
dialogformpatient: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.dialog_form_patient
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_dialog_form_patient", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.receivereference.search_status == 1
|
||||
},
|
||||
xpatients(p) {
|
||||
return this.$store.state.receivereference.patients
|
||||
},
|
||||
xnoref: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.noref
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_noref", val)
|
||||
}
|
||||
},
|
||||
namapasien: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.namapasien
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_nama_pasien", val)
|
||||
}
|
||||
},
|
||||
xdob: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.dob
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_dob", val)
|
||||
}
|
||||
},
|
||||
xsexes() {
|
||||
return this.$store.state.receivereference.sexes
|
||||
},
|
||||
xsex: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.selected_sex
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_selected_sex", val)
|
||||
}
|
||||
},
|
||||
xorderautotests() {
|
||||
return this.$store.state.receivereference.orderautotests
|
||||
},
|
||||
xorderautotest: {
|
||||
get() {
|
||||
return this.$store.state.receivereference.orderautotest
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("receivereference/update_orderautotest", val)
|
||||
}
|
||||
},
|
||||
xordertests() {
|
||||
return this.$store.state.receivereference.ordertests
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createNewPatient() {
|
||||
this.$store.commit("receivereference/update_act_pat", 'new')
|
||||
this.xnoref = ''
|
||||
this.namapasien = ''
|
||||
this.$store.commit("receivereference/update_selected_sex", [])
|
||||
this.xdob = ''
|
||||
this.$store.commit("receivereference/update_ordertests", [])
|
||||
this.$store.commit("receivereference/update_dialog_form_patient", true)
|
||||
},
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.receivereference.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveNewPatient() {
|
||||
this.$store.commit("receivereference/update_errors", [])
|
||||
var errors = this.$store.state.receivereference.errors
|
||||
if (this.namapasien === '') {
|
||||
errors.push("requirenamapasien")
|
||||
}
|
||||
if (this.xdob === '') {
|
||||
errors.push("requirexdob")
|
||||
}
|
||||
if (_.isEmpty(this.xsex)) {
|
||||
errors.push("requirexsex")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
var prm = {}
|
||||
prm.T_ReceiveReferencePatientT_ReceiveReferenceHeaderID = this.$store.state.receivereference.selected_receivereference
|
||||
.T_ReceiveReferenceHeaderID
|
||||
prm.M_CompanyName = this.$store.state.receivereference.selected_receivereference.M_CompanyName
|
||||
prm.T_ReceiveReferencePatientNoRef = this.xnoref
|
||||
prm.T_ReceiveReferencePatientName = this.namapasien
|
||||
prm.T_ReceiveReferencePatientDOB = this.xdob
|
||||
prm.T_ReceiveReferencePatientM_SexID = this.$store.state.receivereference.selected_sex.M_SexID
|
||||
prm.ordertests = this.xordertests
|
||||
this.$store.dispatch("receivereference/savenewpatient", prm)
|
||||
}
|
||||
},
|
||||
editPatient(value) {
|
||||
this.$store.commit("receivereference/update_act_pat", 'edit')
|
||||
this.$store.commit("receivereference/update_x_pat_id", value.T_ReceiveReferencePatientID)
|
||||
this.xnoref = value.T_ReceiveReferencePatientNoRef
|
||||
this.namapasien = value.T_ReceiveReferencePatientName
|
||||
this.$store.commit("receivereference/update_selected_sex", {
|
||||
M_SexID: value.T_ReceiveReferencePatientM_SexID,
|
||||
m_sexname: value.M_SexName
|
||||
})
|
||||
this.xdob = value.T_ReceiveReferencePatientDOB
|
||||
this.$store.commit("receivereference/update_ordertests", value.tests)
|
||||
this.$store.commit("receivereference/update_dialog_form_patient", true)
|
||||
},
|
||||
saveEditPatient() {
|
||||
this.$store.commit("receivereference/update_errors", [])
|
||||
var errors = this.$store.state.receivereference.errors
|
||||
if (this.namapasien === '') {
|
||||
errors.push("requirenamapasien")
|
||||
}
|
||||
if (this.xdob === '') {
|
||||
errors.push("requirexdob")
|
||||
}
|
||||
if (_.isEmpty(this.xsex)) {
|
||||
errors.push("requirexsex")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
var prm = {}
|
||||
prm.T_ReceiveReferencePatientID = this.$store.state.receivereference.x_pat_id
|
||||
prm.T_ReceiveReferencePatientT_ReceiveReferenceHeaderID = this.$store.state.receivereference.selected_receivereference
|
||||
.T_ReceiveReferenceHeaderID
|
||||
prm.M_CompanyName = this.$store.state.receivereference.selected_receivereference.M_CompanyName
|
||||
prm.T_ReceiveReferencePatientNoRef = this.xnoref
|
||||
prm.T_ReceiveReferencePatientName = this.namapasien
|
||||
prm.T_ReceiveReferencePatientDOB = this.xdob
|
||||
prm.T_ReceiveReferencePatientM_SexID = this.$store.state.receivereference.selected_sex.M_SexID
|
||||
prm.ordertests = this.xordertests
|
||||
prm.deleted_ordertests = this.$store.state.receivereference.deleted_ordertests
|
||||
this.$store.dispatch("receivereference/saveeditpatient", prm)
|
||||
}
|
||||
},
|
||||
thr_search_test: _.debounce(function () {
|
||||
this.$store.dispatch("receivereference/searchtest", {
|
||||
tes: this.search_test,
|
||||
mouid: this.$store.state.receivereference.selected_receivereference.T_ReceiveReferenceHeaderM_MouID
|
||||
})
|
||||
}, 2000),
|
||||
deletePatient(value) {
|
||||
this.$store.commit("receivereference/update_act_pat", 'delete')
|
||||
this.$store.commit("receivereference/update_x_pat_id", value.T_ReceiveReferencePatientID)
|
||||
this.$store.commit("receivereference/update_errors", [])
|
||||
var errors = this.$store.state.receivereference.errors
|
||||
var msg = ''
|
||||
msg = "Yakin, akan menghapus data pasien " + value.T_ReceiveReferencePatientName + " ?"
|
||||
this.$store.commit("receivereference/update_msg_confirmation_delete_pat", msg)
|
||||
this.$store.commit("receivereference/update_dialog_confirmation_delete_pat", true)
|
||||
},
|
||||
doDeletePat() {
|
||||
var prm = {}
|
||||
prm.T_ReceiveReferencePatientT_ReceiveReferenceHeaderID = this.$store.state.receivereference.selected_receivereference
|
||||
.T_ReceiveReferenceHeaderID
|
||||
prm.T_ReceiveReferencePatientID = this.$store.state.receivereference.x_pat_id
|
||||
prm.T_ReceiveReferencePatientName = this.namapasien
|
||||
prm.M_CompanyName = this.$store.state.receivereference.selected_receivereference.M_CompanyName
|
||||
this.$store.dispatch("receivereference/deletepatient", prm)
|
||||
},
|
||||
sendOrderPatient(value) {
|
||||
let msg = "Yakin, akan mengirim permintaan nomor " + this.$store.state.receivereference.selected_receivereference.T_ReceiveReferenceHeaderNumber + " ?"
|
||||
this.$store.commit("receivereference/update_msg_confirmation_send", msg)
|
||||
this.$store.commit("receivereference/update_dialog_confirmation_send", true)
|
||||
},
|
||||
doOrderPatient() {
|
||||
var prm = {}
|
||||
prm.T_ReceiveReferenceHeaderID = this.$store.state.receivereference.selected_receivereference
|
||||
.T_ReceiveReferenceHeaderID
|
||||
prm.T_ReceiveReferenceHeaderNumber = this.$store.state.receivereference.selected_receivereference
|
||||
.T_ReceiveReferenceHeaderNumber
|
||||
this.$store.dispatch("receivereference/sendorder", prm)
|
||||
},
|
||||
convertMoney(money) {
|
||||
return one_money(money)
|
||||
},
|
||||
addTest() {
|
||||
var oldArr = this.$store.state.receivereference.ordertests
|
||||
oldArr.push(this.$store.state.receivereference.orderautotest)
|
||||
this.searchtest = ''
|
||||
this.$store.commit("receivereference/update_orderautotests", [])
|
||||
this.$store.commit("receivereference/update_orderautotest", {})
|
||||
},
|
||||
deleteDataPx(idx) {
|
||||
var inx = parseInt(idx);
|
||||
var xrow = this.$store.state.receivereference.ordertests[inx]
|
||||
if (parseInt(xrow.xid) !== 0) {
|
||||
var xdeltest = this.$store.state.receivereference.deleted_ordertests
|
||||
xdeltest.push(xrow)
|
||||
this.$store.commit("receivereference/update_deleted_ordertests", xdeltest)
|
||||
}
|
||||
var oldArr = this.$store.state.receivereference.ordertests
|
||||
oldArr.splice(inx, 1)
|
||||
this.$store.commit("receivereference/update_ordertests", oldArr)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_city(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.receivereference.update_autocomplete_status == 1) return
|
||||
this.thr_search_city()
|
||||
},
|
||||
search_test(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.receivereference.update_autocomplete_status == 1) return
|
||||
this.thr_search_test()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
test/vuex/one-receive-reference-delivery/index.php
Normal file
93
test/vuex/one-receive-reference-delivery/index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<one-receivereference-delivery-list></one-receivereference-delivery-list>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<one-receivereference-delivery-form></one-receivereference-delivery-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">
|
||||
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-receivereference-delivery-list': httpVueLoader('./components/oneReceiveReferenceDeliveryList.vue'),
|
||||
'one-receivereference-delivery-form': httpVueLoader('./components/oneReceiveReferenceDeliveryDetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,462 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/receivereferencedelivery.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id:-1,
|
||||
last_saved_id:-1,
|
||||
x_addr_id:0,
|
||||
act:'new',
|
||||
act_addr:'new',
|
||||
get_data_status:0,
|
||||
search_trx: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
start_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
total_transaction: 0,
|
||||
transactions:[],
|
||||
details:[],
|
||||
selected_detai:{},
|
||||
stations:[{id:"CREATED",name:"BARU"},{id:"RELEASEC",name:"RILIS SURAT JALAN"}],
|
||||
selected_station:{id:"CREATED",name:"BARU"},
|
||||
selected_transaction: {},
|
||||
save_status: 0,
|
||||
name_lab:'',
|
||||
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: "",
|
||||
autocomplete_status:0,
|
||||
dialog_form_address: false,
|
||||
errors:[],
|
||||
open_dialog_info:false,
|
||||
msg_info:'',
|
||||
dialog_action:false,
|
||||
msg_action:'',
|
||||
current_status:null,
|
||||
uploaded_files:[],
|
||||
uploaded_error:null,
|
||||
photos:[],
|
||||
selected_photo:{},
|
||||
dialog_image:false,
|
||||
image:'',
|
||||
companys:[],
|
||||
selected_company:{},
|
||||
company_address:[],
|
||||
selected_company_address:{},
|
||||
trx_date:moment(new Date()).format('DD-MM-YYYY'),
|
||||
couriers:[],
|
||||
selected_courier:{},
|
||||
trx_note:''
|
||||
},
|
||||
mutations: {
|
||||
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_start_date(state, val) {
|
||||
state.start_date = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_name_lab(state, val) {
|
||||
state.name_lab = val
|
||||
},
|
||||
update_stations(state, val) {
|
||||
state.stations = val
|
||||
},
|
||||
update_selected_station(state, val) {
|
||||
state.selected_station = 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_transaction(state, val) {
|
||||
state.search_transaction = val
|
||||
},
|
||||
update_transactions(state, data) {
|
||||
state.transactions = data
|
||||
},
|
||||
update_selected_transaction(state, val) {
|
||||
state.selected_transaction = val
|
||||
},
|
||||
update_details(state, data) {
|
||||
state.details = data
|
||||
},
|
||||
update_selected_detail(state, val) {
|
||||
state.selected_detail = 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_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_transactions(state, val) {
|
||||
state.total_transactions = val
|
||||
},
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_dialog_action(state, val) {
|
||||
state.dialog_action = val
|
||||
},
|
||||
update_msg_action(state, val) {
|
||||
state.msg_action = val
|
||||
},
|
||||
update_current_status(state, val) {
|
||||
state.current_status = val
|
||||
},
|
||||
update_uploaded_files(state, val) {
|
||||
state.uploaded_files = val
|
||||
},
|
||||
update_uploaded_error(state, val) {
|
||||
state.uploaded_error = val
|
||||
},
|
||||
update_photos(state, val) {
|
||||
state.photos = val
|
||||
},
|
||||
update_selected_photo(state, val) {
|
||||
state.selected_photo = val
|
||||
},
|
||||
update_dialog_image(state, val) {
|
||||
state.dialog_image = val
|
||||
},
|
||||
update_image(state, val) {
|
||||
state.image = val
|
||||
},
|
||||
update_companys(state, val) {
|
||||
state.companys = val
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_company_address(state, val) {
|
||||
state.company_address = val
|
||||
},
|
||||
update_selected_company_address(state, val) {
|
||||
state.selected_company_address = val
|
||||
},
|
||||
update_trx_date(state, val) {
|
||||
state.trx_date = val
|
||||
},
|
||||
update_couriers(state, val) {
|
||||
state.couriers = val
|
||||
},
|
||||
update_selected_courier(state, val) {
|
||||
state.selected_courier = val
|
||||
},
|
||||
update_trx_note(state, val) {
|
||||
state.trx_note = 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
|
||||
}
|
||||
|
||||
var trx = []
|
||||
if(data.records.length > 0){
|
||||
context.commit("update_transactions", resp.data.records)
|
||||
if(prm.lastid === -1){
|
||||
trx = resp.data.records[0]
|
||||
}
|
||||
else{
|
||||
trx = resp.data.records[prm.lastid]
|
||||
}
|
||||
context.commit("update_selected_transaction", trx)
|
||||
context.commit("update_trx_note",trx.trx_note)
|
||||
context.commit("update_trx_date",trx.trx_date_ina)
|
||||
if(!_.isEmpty(trx.details)){
|
||||
context.commit("update_details", trx.details)
|
||||
}
|
||||
else{
|
||||
context.commit("update_details", [])
|
||||
}
|
||||
|
||||
if(trx.company_fulname !== null){
|
||||
context.commit("update_selected_company",{id:trx.T_ReceiveReferenceDeliveryM_CompanyID,name:trx.company_fullname})
|
||||
context.commit("update_selected_courier",{id:trx.T_ReceiveReferenceDeliveryM_StaffID,name:trx.courier_name})
|
||||
}
|
||||
else{
|
||||
context.commit("update_selected_company",{})
|
||||
}
|
||||
}
|
||||
else{
|
||||
context.commit("update_transactions", [])
|
||||
context.commit("update_selected_transaction", {status:'NONE',numbering:'-'})
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_trx_date",moment(new Date()).format('DD-MM-YYYY'))
|
||||
context.commit("update_details", [])
|
||||
context.commit("update_selected_company",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
}
|
||||
|
||||
context.commit("update_total_transactions", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
context.commit("update_act",'edit')
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_transaction", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getcompanycouriers(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getcompanycouriers(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_companys",data.records['companys'])
|
||||
context.commit("update_couriers",data.records['couriers'])
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async upload(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
|
||||
let resp= await api.upload(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,
|
||||
error:resp.data.errors.error
|
||||
}
|
||||
context.commit("update_uploaded_files",data.records)
|
||||
|
||||
var msg = "Photo telah berhasil diupload"
|
||||
if(data.error){
|
||||
msg = data.error
|
||||
context.commit("update_current_status",'STATUS_FAILED')
|
||||
}
|
||||
else{
|
||||
context.commit("update_current_status",'STATUS_SUCCESS')
|
||||
}
|
||||
|
||||
context.commit("update_msg_info",msg)
|
||||
context.commit("update_open_dialog_info",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_get_data_status",3)
|
||||
}
|
||||
},
|
||||
async doaction(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.doaction(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_dialog_action",false)
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletephoto(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletephoto(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_act",'-')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_selected_photo",{})
|
||||
context.dispatch("search",prm)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getcompanyaddress(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getcompanyaddress(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_company_address",data.records)
|
||||
context.commit("update_selected_company_address",{})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async getordersamples(context,prm) {
|
||||
context.commit("update_get_data_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getordersamples(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_details",data.records)
|
||||
context.commit("update_selected_detail",{})
|
||||
}
|
||||
} 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_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_company",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_success", true)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
var msg = "Transaksi penyimpanan " + resp.data.numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
async deletetrx(context,prm) {
|
||||
context.commit("update_save_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.deletetrx(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status",3)
|
||||
} else {
|
||||
context.commit("update_save_status",2)
|
||||
context.commit("update_selected_transaction",{})
|
||||
context.commit("update_details",[])
|
||||
context.commit("update_selected_detail",{})
|
||||
context.commit("update_selected_company",{})
|
||||
context.commit("update_selected_company_address",{})
|
||||
context.commit("update_selected_courier",{})
|
||||
context.commit("update_trx_date",moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_trx_note",'')
|
||||
context.commit("update_act",'new')
|
||||
context.commit("update_dialog_confirmation_delete",false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Transaksi hapus " + prm.trx_numbering + " berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_save_status",3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
27
test/vuex/one-receive-reference-delivery/store.js
Normal file
27
test/vuex/one-receive-reference-delivery/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import receivereferencedelivery from "./modules/receivereferencedelivery.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
receivereferencedelivery: receivereferencedelivery,
|
||||
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