Initial import

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

View File

@@ -0,0 +1,238 @@
const URL = "/one-api/v1/masterdata/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'ekspose/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 get_subgroups(prm) {
try {
var resp = await axios.post(URL + 'ekspose/get_subgroups', 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 get_subsubgroups(prm) {
try {
var resp = await axios.post(URL + 'ekspose/get_subsubgroups', 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 getinitdatas(token) {
try {
var resp = await axios.post(URL + 'ekspose/getinitdatas',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getracks(prm) {
try {
var resp = await axios.post(URL + 'ekspose/getracks',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 + 'ekspose/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 checkbarcode(prm) {
try {
var resp = await axios.post(URL + 'ekspose/checkbarcode',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 searchunit(token,prm) {
try {
var resp = await axios.post(URL + 'ekspose/searchunit ',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdataselected(prm) {
try {
var resp = await axios.post(URL + 'ekspose/getdataselected ',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 doaddtest(prm) {
try {
var resp = await axios.post(URL + 'ekspose/doaddtest ',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 checkcodeexist(prm) {
try {
var resp = await axios.post(URL + 'ekspose/checkcodeexist ',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 searchsample(token,prm) {
try {
var resp = await axios.post(URL + 'ekspose/searchsample ',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,100 @@
const URL = "/one-api/v1/masterdata/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'testsas/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 getalmaries(token) {
try {
var resp = await axios.post(URL + 'testsas/getalmaries',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getracks(prm) {
try {
var resp = await axios.post(URL + 'testsas/getracks',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 + 'testsas/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 checkbarcode(prm) {
try {
var resp = await axios.post(URL + 'testsas/checkbarcode',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,631 @@
<template>
<div>
<v-layout class="mb-2" column >
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> FORM TRANSAKSI SAMPLE STORAGE
<span v-if="xact === 'edit'"> &nbsp;[ <span style="color:#2196F3;font-weight: 900;">{{xnumbering}}</span> ]</span>
<v-flex text-md-right>
<v-btn v-if="xact === 'new'" @click="saveNewTransaction()" small color="info">Simpan</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-layout row>
<v-flex xs3 pa-1>
<v-text-field v-model="xdate" readonly="readonly" label="Tanggal Transaksi*"></v-text-field>
<p v-if="checkError('requiredate')" class="error pl-2 pr-2" style="color:#fff">Tanggal transaksi harus diisi dong</p>
</v-flex>
<v-flex xs2 pa-1>
<v-text-field v-model="xtime" readonly="readonly" label="Waktu Transaksi*"></v-text-field>
<p v-if="checkError('requiretime')" class="error pl-2 pr-2" style="color:#fff">Waktu transaksi harus diisi 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-flex>
</v-flex>
</v-card>
</v-layout>
<v-layout class="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 xs3 pa-1>
<v-text-field v-model="xalmariname" readonly="readonly" label="Lemari"></v-text-field>
</v-flex>
<v-flex xs3 pa-1>
<v-text-field v-model="xrackcode" readonly="readonly" label="Rak"></v-text-field>
</v-flex>
<v-flex xs1 pa-1>
<v-text-field v-model="xrow" readonly="readonly" label="Baris Ke"></v-text-field>
</v-flex>
<v-flex xs1 pa-1>
<v-text-field v-model="xcol" readonly="readonly" label="Kolom Ke"></v-text-field>
</v-flex>-->
<v-flex xs4 pa-1>
<v-text-field hide-details v-model="xbarcode" v-on:keyup.enter="addDetail()" label="Input Barcode"></v-text-field>
</v-flex>
</v-layout>
<v-layout 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-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon v-if="xact === 'new'" color="error" @click="deleteDetail(props.item)">delete</v-icon>
<v-icon v-if="xact === 'edit'" color="success" >check</v-icon>
</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.patientname }}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.barcode }}</td>
<td class="pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.almari.name }}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.rack.code }}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.row }} x {{ props.item.col }}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-layout>
<v-layout v-if="xact === 'new'" class="mb-2" column >
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> PILIH POSISI PENEMPATAN &nbsp;<v-icon style="font-weight:800">dialpad</v-icon>&nbsp;&nbsp;
<span style="font-weight:900; color:#2196f3" v-if="xopenalmari && !xopenrack">{{xselected_almari.name}}</span>
<span style="font-weight:900; color:#2196f3" v-if="!xopenalmari && xopenrack">{{xselected_almari.name}}</span> <v-icon v-if="!xopenalmari && xopenrack" style="font-weight:800">keyboard_arrow_right</v-icon> <span v-if="!xopenalmari && xopenrack" style="font-weight:700; color:#ff5722">{{xselected_rack.code}}</span>
<v-flex text-md-right>
<v-btn v-if="xopenalmari && !xopenrack" @click="backToAlmari()" small color="info">Kembali ke Lemari</v-btn>
<v-btn v-if="!xopenalmari && xopenrack" @click="backToRack()" small color="info">Kembali ke Rak</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row>
<v-flex xs12 align-center pa-2>
<v-layout align-center justify-center v-if="!xopenalmari && !xopenrack" row wrap>
<v-btn @click="openAlmari(almari)" v-for="almari in xalmaries" color="info" dark large>{{almari.code}}</v-btn>
</v-layout>
<v-layout align-center justify-center v-if="xopenalmari && !xopenrack" row wrap>
<v-btn @click="openRack(rack)" v-for="rack in xracks" color="info" dark>{{rack.code}}</v-btn>
</v-layout>
<v-layout align-center justify-center v-for="(rackcontent, index) in xrackcontents" v-if="!xopenalmari && xopenrack" row wrap>
<v-btn @click="setPosition(position,index)" v-for="position in rackcontent" fab dark :color="checkStatus(position)">
<v-icon v-if="position.status === 'N' && position.selected === 'N'">inbox</v-icon>
<v-icon v-if="position.status === 'N' && position.selected === 'Y'">move_to_inbox</v-icon>
<v-icon v-if="position.status === 'N' && position.selected === 'T'">archive</v-icon>
<v-icon v-if="position.status === 'Y' && position.selected === 'N'">report_problem</v-icon>
</v-btn>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-layout>
</div>
</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: () => ({
xbarcode:'',
xalmariname:'',
xrackcode:'',
xrow:0,
xcol:0,
rackrows:[],
rackcols:[],
headers: [
{
text: "",
align: "left",
sortable: false,
width: "8%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "PASIEN",
align: "left",
sortable: false,
width: "20%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "BARCODE",
align: "center",
sortable: false,
width: "15%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALMARI",
align: "left",
sortable: false,
width: "25%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "RAK",
align: "center",
sortable: false,
width: "15%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "POSISI",
align: "center",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
xact(){
return this.$store.state.samplestorage.act
},
xnumbering(){
return this.$store.state.form.transaction_number
},
xdate:{
get() {
return this.$store.state.form.transaction_date
},
set(val) {
this.$store.commit("form/update_transaction_date",val)
this.$store.commit("samplestorage/update_no_save",1)
}
},
xtime:{
get() {
return this.$store.state.form.transaction_time
},
set(val) {
this.$store.commit("form/update_transaction_time",val)
this.$store.commit("samplestorage/update_no_save",1)
}
},
xnote:{
get() {
return this.$store.state.form.transaction_note
},
set(val) {
this.$store.commit("form/update_transaction_note",val)
this.$store.commit("samplestorage/update_no_save",1)
}
},
isLoading() {
return this.$store.state.samplestorage.search_status == 1
},
xalmaries(){
return this.$store.state.form.almaries
},
xracks(){
return this.$store.state.form.racks
},
xselected_almari:{
get() {
return this.$store.state.form.selected_almari
},
set(val) {
this.$store.commit("form/update_selected_almari",val)
this.$store.dispatch("form/getracks",{
id:this.$store.state.form.selected_almari.id
})
}
},
xselected_rack:{
get() {
return this.$store.state.form.selected_rack
},
set(val) {
this.$store.commit("form/update_selected_rack",val)
}
},
details(){
return this.$store.state.form.details
},
xopenalmari(){
return this.$store.state.form.open_almari
},
xopenrack(){
return this.$store.state.form.open_rack
},
xrackcontents(){
return this.$store.state.form.rack_contents
},
},
methods : {
checkError(value){
var errors = this.$store.state.form.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
isSelected(p) {
return p.barcode == this.$store.state.form.selected_detail.barcode
},
selectMe(detail) {
this.$store.commit("form/update_selected_detail",detail)
},
addDetail(){
/*var arr = this.$store.state.form.details
let idx = _.findIndex(arr, { barcode : this.xbarcode})
if(idx === -1 ){
var detail = {
xid:0,
barcode:this.xbarcode,
almari:{},
rack:{},
rackid:0,
row:0,
col:0
}
arr.push(detail)
this.$store.commit("form/update_details",arr)
let idx = _.findIndex(arr, function(o) { return o.barcode == detail.barcode })
this.$store.commit("form/update_selected_detail",arr[idx])
this.xbarcode = ''
}*/
var barcode = this.xbarcode
this.xbarcode = ''
this.$store.dispatch("form/checkbarcode",{
barcode : barcode,
details : this.$store.state.form.details
})
},
deleteDetail(detail){
var selectedbarcode = this.$store.state.form.selected_detail.barcode
var arr = this.$store.state.form.details
let idx = _.findIndex(arr, function(o) { return o.barcode == detail.barcode })
//arr.splice(idx, 1)
var result = _.reject(arr, { barcode: detail.barcode })
this.$store.commit("form/update_details",result)
if(!_.isEmpty(this.xselected_rack)){
var rackcontents = this.$store.state.form.rack_contents
for (var i = 0; i < rackcontents.length; i++) {
var childs = rackcontents[i]
for (var x = 0; x < childs.length; x++) {
var arrinlist = this.$store.state.form.details
if(childs[x].row !== 0 & childs[x].col !== 0){
let idx = _.findIndex(arrinlist, { rackid: this.xselected_rack.id, row:childs[x].row, col: childs[x].col})
if(idx !== -1){
childs[x].selected = 'T'
}
else{
childs[x].selected = 'N'
}
}
}
}
this.$store.commit("form/update_rack_contents",rackcontents)
}
if(selectedbarcode === detail.barcode){
console.log('empty detail')
this.$store.commit("form/update_selected_detail",{})
if(!_.isEmpty(this.$store.state.form.details)){
var xnewdetail = this.$store.state.form.details[0]
this.selectMe(xnewdetail)
//this.$store.commit("form/update_selected_detail",xnewdetail)
}
}
},
saveNewTransaction(){
this.$store.commit("form/update_errors",[])
var errors = this.$store.state.form.errors
if(this.xdate === ''){
errors.push("requiredate")
}
if(this.xtime === ''){
errors.push("requiretime")
}
if(errors.length === 0){
if(this.$store.state.form.details.length > 0){
var details = this.$store.state.form.details
//console.log(details)
var xerrors = _.filter(details, function(o) { return o.row === 0 })
console.log(xerrors)
if(_.isEmpty(xerrors)){
var prm = {
date: this.$store.state.form.transaction_date,
time: this.$store.state.form.transaction_time,
note: this.$store.state.form.transaction_note,
details : this.$store.state.form.details
}
this.$store.dispatch("form/save",prm)
}
else{
var er_barcodes = ''
for (var i = 0; i < xerrors.length; i++) {
if(er_barcodes === ''){
er_barcodes = xerrors[i]['barcode']
}
else{
er_barcodes += " , "+xerrors[i]['barcode']
}
}
var msg = "<p>Barcode "+er_barcodes+" belum dipilih posisinya dong<p>"
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}
}
else{
var msg = "Belum ada sample yang dipilih dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}
}
},
openAlmari(almari){
/*var xseldel = this.$store.state.form.selected_detail
var zxdetails = this.$store.state.form.details
let zzidxsel = _.findIndex(zxdetails, function(o) { return o.barcode == xseldel.barcode })
if(!_.isEmpty(this.$store.state.form.selected_detail) && zzidxsel !== -1){*/
this.$store.commit("form/update_open_almari",true)
this.$store.commit("form/update_selected_almari",almari)
this.xalmariname = almari.name
this.$store.dispatch("form/getracks",{
id:this.$store.state.form.selected_almari.id
})
this.$store.commit("form/update_selected_rack",{})
/*var arr = this.$store.state.form.details
var nowbarcode = this.$store.state.form.selected_detail.barcode
let idx = _.findIndex(arr, function(o) { return o.barcode == nowbarcode })
console.log(idx)
arr[idx].almari = this.$store.state.form.selected_almari
arr[idx].rack = {}
arr[idx].rackid = 0
arr[idx].row = 0
arr[idx].col = 0
this.$store.commit("form/update_details",arr)*/
/*}
else{
var msg = "Belum memilih salah satu barcode dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}*/
},
openRack(rack){
/*var xseldel = this.$store.state.form.selected_detail
var zxdetails = this.$store.state.form.details
let zzidxsel = _.findIndex(zxdetails, function(o) { return o.barcode == xseldel.barcode })
if(!_.isEmpty(this.$store.state.form.selected_detail) && zzidxsel !== -1){*/
this.$store.commit("form/update_open_almari",false)
this.$store.commit("form/update_open_rack",true)
this.$store.commit("form/update_selected_rack",rack)
this.xrackcode = rack.code
/*var arr = this.$store.state.form.details
var nowbarcode = this.$store.state.form.selected_detail.barcode
let idx = _.findIndex(arr, function(o) { return o.barcode == nowbarcode })
arr[idx].almari = this.$store.state.form.selected_almari
arr[idx].rack = this.$store.state.form.selected_rack
arr[idx].rackid = this.$store.state.form.selected_rack.id
arr[idx].row = 0
arr[idx].col = 0
this.$store.commit("form/update_details",arr)*/
if(!_.isEmpty(this.xselected_rack)){
var rackcontents = rack.rackcontens
for (var i = 0; i < rackcontents.length; i++) {
var childs = rackcontents[i]
for (var x = 0; x < childs.length; x++) {
var arrinlist = this.$store.state.form.details
if(childs[x].row !== 0 & childs[x].col !== 0){
let idx = _.findIndex(arrinlist, { rackid: this.xselected_rack.id, row:childs[x].row, col: childs[x].col})
if(idx !== -1){
childs[x].selected = 'T'
}
else{
childs[x].selected = 'N'
}
}
}
}
this.$store.commit("form/update_rack_contents",rackcontents)
}
/*}
else{
var msg = "Belum memilih salah satu barcode dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}*/
},
setPosition(position,idx){
if(position.status !== 'Y'){
var xseldel = this.$store.state.form.selected_detail
var zxdetails = this.$store.state.form.details
let zzidxsel = _.findIndex(zxdetails, function(o) { return o.barcode == xseldel.barcode })
if(!_.isEmpty(this.$store.state.form.selected_detail) && zzidxsel !== -1){
var arr = this.$store.state.form.details
var existindex = _.findIndex(arr, { rackid : this.xselected_rack.id, row:position.row, col : position.col })
if(existindex === -1){
var nowbarcode = this.$store.state.form.selected_detail.barcode
let ixdx = _.findIndex(arr, function(o) { return o.barcode == nowbarcode })
arr[ixdx].almari = this.$store.state.form.selected_almari
arr[ixdx].rack = this.$store.state.form.selected_rack
arr[ixdx].rackid = this.$store.state.form.selected_rack.id
arr[ixdx].row = position.row
arr[ixdx].col = position.col
this.$store.commit("form/update_details",arr)
if(!_.isEmpty(this.xselected_rack)){
var rackcontents = this.$store.state.form.rack_contents
for (var i = 0; i < rackcontents.length; i++) {
var childs = rackcontents[i]
for (var x = 0; x < childs.length; x++) {
var arrinlist = this.$store.state.form.details
if(childs[x].row !== 0 & childs[x].col !== 0){
let idx = _.findIndex(arrinlist, { rackid: this.xselected_rack.id, row:childs[x].row, col: childs[x].col})
if(idx !== -1){
childs[x].selected = 'T'
}
else{
childs[x].selected = 'N'
}
}
}
}
this.$store.commit("form/update_rack_contents",rackcontents)
}
}
else{
var msg = "Cuman bisa diisi satu dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}
}
else{
var msg = "Belum memilih salah satu barcode dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}
}
else{
var msg = "Sudah ada isinya dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}
},
backToAlmari(){
/*var xseldel = this.$store.state.form.selected_detail
var zxdetails = this.$store.state.form.details
let zzidxsel = _.findIndex(zxdetails, function(o) { return o.barcode == xseldel.barcode })
if(!_.isEmpty(this.$store.state.form.selected_detail) && zzidxsel !== -1){*/
this.$store.commit("form/update_open_almari",false)
this.$store.commit("form/update_open_rack",false)
this.$store.commit("form/update_selected_rack",{})
this.$store.commit("form/update_selected_almari",{})
/*}
else{
var msg = "Belum memilih salah satu barcode dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}*/
},
backToRack(){
/*var xseldel = this.$store.state.form.selected_detail
var zxdetails = this.$store.state.form.details
let zzidxsel = _.findIndex(zxdetails, function(o) { return o.barcode == xseldel.barcode })
if(!_.isEmpty(this.$store.state.form.selected_detail) && zzidxsel !== -1){*/
this.$store.commit("form/update_open_almari",true)
this.$store.commit("form/update_open_rack",false)
this.$store.commit("form/update_selected_rack",{})
/*}
else{
var msg = "Belum memilih salah satu barcode dong "
this.$store.commit("samplestorage/update_msg_info",msg)
this.$store.commit("samplestorage/update_open_dialog_info",true)
}*/
},
checkStatus(value){
if(value.status === 'N' && value.selected === 'N'){
return 'info'
}else if(value.status === 'N' && value.selected === 'T'){
return 'warning'
}
else{
return 'error'
}
}
}
}
</script>

View File

@@ -0,0 +1,731 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogchooseprint" persistent max-width="20%">
<v-card>
<v-card-title class="headline white--text grey darken-1 pt-2 pb-2" primary-title style="color:white">
<h4>Pilih Format Laporan</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
<v-radio-group v-model="formatreport" row>
<v-radio color="grey" label="PDF" value="pdf"></v-radio>
<v-radio color="grey" label="EXCEL" value="xls"></v-radio>
</v-radio-group>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="black" flat @click="dialogchooseprint = false">
Tutup
</v-btn>
<v-btn color="grey" flat @click="doPrint()">
Cetak
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogaddtest" persistent max-width="30%">
<v-card>
<v-card-title class="headline teal darken-1 pt-2 pb-2" primary-title style="color:white">
<h4>Sisipkan</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
<v-text-field class="pr-1" v-model="codefrom" readonly label="Kode Nasional"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
<v-text-field class="pr-1" v-model="codetoward" label="Kode Struktur"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('lenghtcodetoward')" class="error pl-2 pr-2">Harus lebih dari 8 karakter</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('falseformat')" class="error pl-2 pr-2">Pelajari cara pembuatan kode</p>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="black" flat @click="dialogaddtest = false">
Tutup
</v-btn>
<v-btn color="error" flat @click="doAddTest()">
Sisipkan Sekarang
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialognew" persistent max-width="850px">
<v-card>
<v-card-title>
<span class="headline">Form Ekspose</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-layout row>
<v-flex xs6>
<v-text-field class="pr-1" v-model="xform.code" readonly label="Kode"></v-text-field>
</v-flex>
<v-flex xs6>
<v-text-field class="pr-1" v-model="xform.name" readonly label="Nama"></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-text-field class="pr-1" v-model="xform.expose" type="number" label="Eksposi*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requireexpose')" class="error pl-2 pr-2" style="color:#fff">Eksposi harus diisi</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requireexposedecimal')" class="error pl-2 pr-2"
style="color:#fff">Tanda desimal menggunakan tanda titik (.)</p>
</v-flex>
<v-flex xs12>
<v-text-field class="pr-1" v-model="xform.tegangan" type="number" label="Tegangan*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiretegangan')" class="error pl-2 pr-2" style="color:#fff">Tegangan harus diisi</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiretegangandecimal')" class="error pl-2 pr-2"
style="color:#fff">Tanda desimal menggunakan tanda titik (.)</p>
</v-flex>
<v-flex xs12>
<v-text-field class="pr-1" v-model="xform.arus" type="number" label="Arus*" @change="totalMas(xform.arus, xform.waktu)"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirearus')" class="error pl-2 pr-2" style="color:#fff">Arus harus diisi</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirearusdecimal')" class="error pl-2 pr-2"
style="color:#fff">Tanda desimal menggunakan tanda titik (.)</p>
</v-flex>
<v-flex xs12>
<v-text-field class="pr-1" v-model="xform.waktu" type="number" label="Waktu*" @change="totalMas(xform.arus, xform.waktu)"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirewaktu')" class="error pl-2 pr-2" style="color:#fff">Waktu harus diisi</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirewaktudecimal')" class="error pl-2 pr-2"
style="color:#fff">Tanda desimal menggunakan tanda titik (.)</p>
</v-flex>
<v-flex xs12>
<v-text-field class="pr-1" readonly v-model="xform.mas" type="number" label="mAs*"></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey darken-1" flat @click="dialognew = false">Tutup</v-btn>
<v-btn color="grey darken-1" flat @click="saveData()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<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-text-field class="xs6 pr-1" v-model="code" label="Kode" outline hide-details></v-text-field>
<v-text-field class="xs6 pr-1" v-model="name" label="Nama" outline hide-details></v-text-field>
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
<!-- <span @click="openprintformat" class="icon-medium-fill-base xs1 white--text grey darken-1 ml-1 icon-print"></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" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestCode }}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestName}}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_EksposiExpose}}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_EksposiKV}}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_EksposiMa}}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_EksposiS}}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_EksposiMaS}}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<span @click="openEdit(props.item)" class="icon-medium-fill-base-small xs1 white--text warning"><v-icon style="color:white!important" class="white-text">edit</v-icon></span>
</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>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
mounted() {
this.$store.dispatch("samplestorage/getinitdatas")
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
current_page: 1,
lastid: -1
})
},
methods: {
checkError(value) {
var errors = this.$store.state.samplestorage.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')}`
},
isSelected(p) {
return p.Nat_TestID == this.$store.state.samplestorage.selected_transaction.Nat_TestID
},
searchTransaction() {
this.$store.commit("samplestorage/update_current_page", 1)
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
current_page: this.curr_page,
lastid: -1
})
},
selectMe(trx) {
if (this.$store.state.samplestorage.no_save == 0) {
console.log(trx)
this.$store.commit("samplestorage/update_selected_transaction", trx)
this.$store.commit("samplestorage/update_act", 'edit')
this.$store.commit("form/update_transaction_number", trx.trx_number)
this.$store.commit("form/update_transaction_date", trx.xdate)
this.$store.commit("form/update_transaction_time", trx.xtime)
this.$store.commit("form/update_transaction_note", trx.trx_note)
this.$store.commit("form/update_details", trx.details)
var transactions = this.$store.state.samplestorage.transactions
var idx = _.findIndex(transactions, function (o) {
return o.Nat_TestID == trx.Nat_TestID
})
console.log(idx)
this.$store.commit("samplestorage/update_last_id", idx)
} else {
this.$store.commit("samplestorage/update_open_alert_confirmation", true)
}
},
closeAlertConfirmation() {
this.$store.commit("samplestorage/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("samplestorage/update_no_save", 0)
this.$store.commit("samplestorage/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("samplestorage/update_alert_success", val)
},
setNewTransaction() {
this.$store.commit("samplestorage/update_selected_transaction", {})
this.$store.commit("samplestorage/update_act", 'new')
this.$store.commit("form/update_transaction_number", "")
this.$store.commit("form/update_transaction_date", moment(new Date()).format('DD-MM-YYYY'))
this.$store.commit("form/update_transaction_time", moment(new Date()).format("hh:mm"))
this.$store.commit("form/update_transaction_note", '')
this.$store.commit("form/update_details", [])
},
closeDialogSuccess() {
let arrtrx = this.$store.state.samplestorage.transactions
var idx = _.findIndex(arrtrx, item => item.T_SampleStorageID === this.$store.state.samplestorage.last_id)
console.log(idx)
this.$store.commit("samplestorage/update_dialog_success", false)
},
closeDialogInfo() {
this.$store.commit("samplestorage/update_open_dialog_info", false)
},
changeBtnFlag(value, objectname) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xform[objectname] = newval
},
openform() {
this.$store.commit("samplestorage/update_errors", [])
this.$store.commit("samplestorage/update_act", 'new')
this.$store.commit("samplestorage/update_code_exist", 'N')
this.$store.commit("samplestorage/update_subgroups", [])
this.$store.commit("samplestorage/update_subsubgroups", [])
this.$store.commit("samplestorage/update_units", [])
this.$store.commit("samplestorage/update_samples", [])
var xform = {
code: '',
name: '',
expose: 0,
tegangan: 0,
arus: 0,
waktu: 0,
mah: 0
}
this.$store.commit("samplestorage/update_xform", xform)
this.dialognew = true
},
openEdit(value) {
this.$store.commit("samplestorage/update_errors", [])
this.$store.commit("samplestorage/update_act", 'edit')
this.$store.commit("samplestorage/update_code_exist", 'N')
this.$store.commit("samplestorage/update_subgroups", [])
this.$store.commit("samplestorage/update_subsubgroups", [])
this.$store.commit("samplestorage/update_units", [])
this.$store.commit("samplestorage/update_samples", [])
this.$store.dispatch("samplestorage/getdataselected", value)
this.xid = value.Nat_TestID
this.xeksposiid = value.eksposiid
},
openprintformat() {
this.formatreport = 'pdf'
this.dialogchooseprint = true
},
doPrint() {
console.log('doprint')
this.dialogchooseprint = false
this.printwidth = 1028
this.printtitle = ""
let user = one_user()
var d = new Date();
var n = d.getTime()
var rptname = 'test_nasional'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/nasional/masterdata/" + rptname + ".rptdesign&__format=" +
formatrpt + "&username=" + user.M_UserUsername + "&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
saveData() {
this.$store.commit("samplestorage/update_errors", [])
var errors = this.$store.state.samplestorage.errors
if (this.xform.expose === '') {
errors.push("requireexpose")
}
if (this.xform.tegangan === '') {
errors.push("requiretegangan")
}
if (this.xform.arus === '') {
errors.push("requirearus")
}
if (this.xform.waktu === '') {
errors.push("requirewaktu")
}
if (errors.length === 0) {
var searchprm = {
code: this.code,
name: this.name,
current_page: this.$store.state.samplestorage.current_page,
lastid: this.$store.state.samplestorage.last_id
}
var prm = this.$store.state.samplestorage.xform
prm.paramsearch = searchprm
prm.act = this.$store.state.samplestorage.act
prm.id = this.xid
prm.eksposiid = this.xeksposiid
this.$store.dispatch("samplestorage/save", prm)
}
},
thr_search_unit: _.debounce(function () {
this.$store.dispatch("samplestorage/searchunit", this.search_unit)
}, 2000),
thr_search_sample: _.debounce(function () {
this.$store.dispatch("samplestorage/searchsample", this.search_sample)
}, 2000),
totalMas(arus, waktu) {
this.xform.mas = arus * waktu
},
openAddTest(value) {
this.$store.commit("samplestorage/update_errors", [])
this.codefrom = value.Nat_TestCode
this.codetoward = this.$store.state.samplestoragesas.selected_transaction.T_TestSasCode
this.dialogaddtest = true
},
doAddTest() {
this.$store.commit("samplestorage/update_errors", [])
var errors = this.$store.state.samplestorage.errors
if (this.codetoward.length <= 8)
errors.push("lenghtcodetoward")
if (this.codetoward.length % 2 !== 0)
errors.push("falseformat")
console.log(errors)
if (errors.length === 0) {
this.dialogaddtest = false
var prm = {}
prm.codefrom = this.codefrom
prm.codetoward = this.codetoward
var searchprm = {
code: this.$store.state.samplestoragesas.xcode,
name: this.$store.state.samplestoragesas.xname,
current_page: this.$store.state.samplestoragesas.current_page,
lastid: -1
}
prm.paramsearch = searchprm
this.$store.dispatch("samplestorage/doaddtest", prm)
}
}
},
computed: {
flagsmcu() {
return this.$store.state.samplestorage.flagsmcu
},
dialognew: {
get() {
return this.$store.state.samplestorage.dialognew
},
set(val) {
this.$store.commit("samplestorage/update_dialognew", val)
}
},
code: {
get() {
return this.$store.state.samplestorage.code
},
set(val) {
this.$store.commit("samplestorage/update_code", val)
}
},
name: {
get() {
return this.$store.state.samplestorage.name
},
set(val) {
this.$store.commit("samplestorage/update_name", val)
}
},
dialogsuccess: {
get() {
return this.$store.state.samplestorage.dialog_success
},
set(val) {
this.$store.commit("samplestorage/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.samplestorage.msg_success
},
snackbar: {
get() {
return this.$store.state.samplestorage.alert_success
},
set(val) {
this.$store.commit("samplestorage/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.samplestorage.search_status == 1
},
xact() {
return this.$store.state.samplestorage.act
},
xdatestart: {
get() {
return this.$store.state.samplestorage.start_date
},
set(val) {
this.$store.commit("samplestorage/update_start_date", val)
}
},
xdateend: {
get() {
return this.$store.state.samplestorage.end_date
},
set(val) {
this.$store.commit("samplestorage/update_end_date", val)
}
},
filterComputedDateFormattedStart() {
return this.formatDate(this.xdatestart)
},
filterComputedDateFormattedEnd() {
return this.formatDate(this.xdateend)
},
xtransactions() {
console.log(this.$store.state.samplestorage.transactions)
return this.$store.state.samplestorage.transactions
},
openalertconfirmation: {
get() {
return this.$store.state.samplestorage.open_alert_confirmation
},
set(val) {
this.$store.commit("samplestorage/update_open_alert_confirmation", val)
}
},
opendialoginfo: {
get() {
return this.$store.state.samplestorage.open_dialog_info
},
set(val) {
this.$store.commit("samplestorage/update_open_dialog_info", false)
}
},
msginfo() {
return this.$store.state.samplestorage.msg_info
},
curr_page: {
get() {
return this.$store.state.samplestorage.current_page
},
set(val) {
this.$store.commit("samplestorage/update_current_page", val)
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.samplestorage.total_page
},
set(val) {
this.$store.commit("samplestorage/update_total_page", val)
}
},
xform: {
get() {
return this.$store.state.samplestorage.xform
},
set(val) {
this.$store.commit("samplestorage/update_xform", val)
}
},
groups: {
get() {
return this.$store.state.samplestorage.groups
},
set(val) {
this.$store.commit("samplestorage/update_groups", val)
}
},
subgroups: {
get() {
return this.$store.state.samplestorage.subgroups
},
set(val) {
this.$store.commit("samplestorage/update_subgroups", val)
}
},
subsubgroups: {
get() {
return this.$store.state.samplestorage.subsubgroups
},
set(val) {
this.$store.commit("samplestorage/update_subsubgroups", val)
}
},
types: {
get() {
return this.$store.state.samplestorage.types
},
set(val) {
this.$store.commit("samplestorage/update_types", val)
}
},
units: {
get() {
return this.$store.state.samplestorage.units
},
set(val) {
this.$store.commit("samplestorage/update_units", val)
}
},
nonlabs: {
get() {
return this.$store.state.samplestorage.nonlabs
},
set(val) {
this.$store.commit("samplestorage/update_nonlabs", val)
}
},
samples: {
get() {
return this.$store.state.samplestorage.samples
},
set(val) {
this.$store.commit("samplestorage/update_samples", val)
}
},
selected_group: {
get() {
return this.$store.state.samplestorage.xform.xgroup
},
set(val) {
this.xform.xgroup = val
this.$store.commit("samplestorage/update_xform", this.xform)
this.$store.dispatch("samplestorage/get_subgroups", val)
this.$store.dispatch("samplestorage/get_subsubgroups", val)
}
}
},
watch: {
search_unit(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.samplestorage.update_autocomplete_status == 1) return
this.thr_search_unit()
},
search_sample(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.samplestorage.update_autocomplete_status == 1) return
this.thr_search_sample()
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
menufilterdatestart: false,
menufilterdateend: false,
date: new Date().toISOString().substr(0, 10),
items: [],
dialogaddtest: false,
xid: 0,
xeksposiid: 0,
codefrom: '',
codetoward: '',
dialogchooseprint: false,
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
page: 1,
search_unit: '',
search_sample: '',
headers: [{
text: "KODE NASIONAL",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
width: "15%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "EKSPOSI",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "TEGANGAN (kV)",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ARUS (mA)",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "WAKTU (s)",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "mAs",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'T_SampleStorageDate',
totalItems: this.$store.state.samplestorage.total_transactions
}
};
}
}
</script>

View File

@@ -0,0 +1,811 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogdetail" persistent max-width="60%">
<v-card>
<v-card-title color="info" class="headline">
<h4>Info data pemeriksaan</h4>
</v-card-title>
<v-card-text>
<v-layout wrap>
<!--kiri-->
<v-flex xs6 pa-1>
<v-layout wrap>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Kode pemeriksaan</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono name">
<span style="color:#bd4147">{{detailsinfo.T_TestCode}}</span> /
<span style="color:#03a9f4">{{detailsinfo.T_TestSasCode}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Nama pemeriksaan</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestName}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Singkatan</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestShortName}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Singkatan untuk barcode</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestShortNameBarcode}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Sebagai orang tua</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsParent == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Dimasukkan dalam worklist</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsWorklist == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Mempunyai hasil</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsResult == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Satuan</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.Nat_UnitName}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Hasil dicetak dilaporan</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsPrintResult == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Hasil kuantitatif</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsQuantitative == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Delta check</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsDeltaCheck == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Trend analysis</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsTrendAnalysis == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Flag low</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span style="color:orange">{{detailsinfo.T_TestFlagLow}}</span>
<span v-if="detailsinfo.T_TestFlagLow === ''">Tidak ada</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span >Flag high</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span v-if="detailsinfo.T_TestFlagHigh !== ''" style="color:orange">{{detailsinfo.T_TestFlagHigh}}</span>
<span v-if="detailsinfo.T_TestFlagHigh === ''">Tidak ada</span>
</div>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
<!--kanan-->
<v-flex xs6 pa-1>
<v-layout wrap>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono default">
<span>Grup</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono name">
<span>{{detailsinfo.Nat_GroupName}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono name">
<span>Subgrup</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono name" >
<span>{{detailsinfo.Nat_SubGroupName}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono name">
<span>Jenis Sample</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono name">
<span>{{detailsinfo.Nat_SampleTypeName !== null ?detailsinfo.Nat_SampleTypeName:'-'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono name">
<span>Tipe hasil</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono name">
<span>{{detailsinfo.T_TestIsNonLab === ''?'LAB':detailsinfo.T_TestIsNonLab}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Anak dari pemeriksaan </span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestParentT_TestID !== '0' || detailsinfo.T_TestParentT_TestID !== 0 ?detailsinfo.parenttestname:'-'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Nama worklist </span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsWorklist === 'Y' ?detailsinfo.T_TestWorklistName:'-'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Bisa diberi harga</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsPrice === 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Dicetak dinota</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsPrintNota === 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Huruf dibuat tebal</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsBold == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Huruf dibuat miring</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestIsItalic == 'Y'?'Ya':'Tidak'}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-2 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Warna huruf</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestFontColor ===''?'black':detailsinfo.T_TestFontColor}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12 class="grey lighten-4 mt-2">
<v-layout wrap class="px-1 py-1">
<v-flex xs6 pl-2>
<div style="color:#a19a9b" class="mono">
<span>Ukuran huruf</span>
</div>
</v-flex>
<v-flex xs6 pr-2 class="text-xs-right">
<div class="mono">
<span>{{detailsinfo.T_TestFontSize}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="info" flat @click="dialogdetail = false">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog
v-model="dialogchooseprint"
persistent
max-width="20%"
>
<v-card>
<v-card-title
class="headline white--text grey darken-1 pt-2 pb-2"
primary-title
style="color:white"
>
<h4>Pilih Format Laporan</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
<v-radio-group v-model="formatreport" row>
<v-radio color="grey" label="PDF" value="pdf"></v-radio>
<v-radio color="grey" label="EXCEL" value="xls"></v-radio>
</v-radio-group>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="black"
flat
@click="dialogchooseprint = false"
>
Tutup
</v-btn>
<v-btn
color="grey"
flat
@click="doPrint()"
>
Cetak
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<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-text-field
class="xs6 pr-1"
v-model="xcode"
label="Kode"
outline
hide-details
></v-text-field>
<v-text-field
class="xs6 pr-1"
v-model="xname"
label="Nama"
outline
hide-details
></v-text-field>
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
<span @click="openprintformat" class="icon-medium-fill-base xs1 white--text grey darken-1 ml-1 icon-print"></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"
hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestCode }}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestSasCode }}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestName}}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<span @click="opendialogdetail(props.item)" class="icon-medium-fill-base-small xs1 white--text info"><v-icon style="color:white!important" class="white-text">visibility</v-icon></span>
</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>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components : {
'one-dialog-info':httpVueLoader('../../../common/oneDialogInfo.vue'),
'one-dialog-alert':httpVueLoader('../../../common/oneDialogAlert.vue'),
'one-dialog-print':httpVueLoader('../../../common/oneDialogPrintX.vue')
},
mounted() {
//this.$store.dispatch("form/getalmaries")
this.$store.dispatch("samplestoragesas/search",{
code:this.xcode,
name: this.xname,
current_page:1,
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.T_TestID == this.$store.state.samplestoragesas.selected_transaction.T_TestID
},
searchTransaction() {
this.$store.commit("samplestoragesas/update_current_page",1)
this.$store.dispatch("samplestoragesas/search",{
code:this.xcode,
name: this.xname,
current_page:this.curr_page,
lastid:-1
})
},
selectMe(trx) {
if(this.$store.state.samplestoragesas.no_save == 0 ){
console.log(trx)
this.$store.commit("samplestoragesas/update_selected_transaction",trx)
this.$store.commit("samplestoragesas/update_act",'edit')
}else{
this.$store.commit("samplestoragesas/update_open_alert_confirmation",true)
}
},
closeAlertConfirmation(){
this.$store.commit("samplestoragesas/update_open_alert_confirmation",false)
},
forgetAlertConfirmation(){
this.$store.commit("samplestoragesas/update_no_save",0)
this.$store.commit("samplestoragesas/update_open_alert_confirmation",false)
},
updateAlert_success(val){
this.$store.commit("samplestoragesas/update_alert_success",val)
},
setNewTransaction(){
this.$store.commit("samplestoragesas/update_selected_transaction",{})
this.$store.commit("samplestoragesas/update_act",'new')
this.$store.commit("form/update_transaction_number","")
this.$store.commit("form/update_transaction_date",moment(new Date()).format('DD-MM-YYYY'))
this.$store.commit("form/update_transaction_time",moment(new Date()).format("hh:mm"))
this.$store.commit("form/update_transaction_note",'')
this.$store.commit("form/update_details",[])
},
closeDialogSuccess(){
let arrtrx = this.$store.state.samplestoragesas.transactions
var idx = _.findIndex(arrtrx, item => item.T_samplestoragesasID === this.$store.state.samplestoragesas.last_id)
console.log(idx)
this.$store.dispatch("samplestoragesas/search",{
code:this.xcode,
name: this.xname,
current_page:1,
lastid: idx
})
this.$store.commit("samplestoragesas/update_dialog_success",false)
},
closeDialogInfo(){
this.$store.commit("samplestoragesas/update_open_dialog_info",false)
},
openprintformat(){
this.formatreport = 'pdf'
this.dialogchooseprint = true
},
doPrint(){
console.log('doprint')
this.dialogchooseprint = false
this.printwidth = 1028
this.printtitle = ""
let user = one_user()
var d = new Date();
var n = d.getTime()
var rptname = 'test_pramita'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/nasional/masterdata/"+rptname+".rptdesign&__format="+formatrpt+"&username="+user.M_UserUsername+"&tm="+n
this.openprint = true
},
closePrint(){
this.openprint = false
},
opendialogdetail(value){
this.detailsinfo = value
this.dialogdetail = true
}
},
computed: {
xcode: {
get() {
return this.$store.state.samplestoragesas.xcode
},
set(val) {
this.$store.commit("samplestoragesas/update_xcode",val)
}
},
xname: {
get() {
return this.$store.state.samplestoragesas.xname
},
set(val) {
this.$store.commit("samplestoragesas/update_xname",val)
}
},
dialogsuccess: {
get() {
return this.$store.state.samplestoragesas.dialog_success
},
set(val) {
this.$store.commit("samplestoragesas/update_dialog_success",val)
}
},
msgsuccess(){
return this.$store.state.samplestoragesas.msg_success
},
snackbar: {
get() {
return this.$store.state.samplestoragesas.alert_success
},
set(val) {
this.$store.commit("samplestoragesas/update_alert_success",val)
}
},
isLoading() {
return this.$store.state.samplestoragesas.search_status == 1
},
xdatestart : {
get() {
return this.$store.state.samplestoragesas.start_date
},
set(val) {
this.$store.commit("samplestoragesas/update_start_date",val)
}
},
xdateend : {
get() {
return this.$store.state.samplestoragesas.end_date
},
set(val) {
this.$store.commit("samplestoragesas/update_end_date",val)
}
},
filterComputedDateFormattedStart () {
return this.formatDate(this.xdatestart)
},
filterComputedDateFormattedEnd () {
return this.formatDate(this.xdateend)
},
xtransactions() {
console.log(this.$store.state.samplestoragesas.transactions)
return this.$store.state.samplestoragesas.transactions
},
openalertconfirmation: {
get() {
return this.$store.state.samplestoragesas.open_alert_confirmation
},
set(val) {
this.$store.commit("samplestoragesas/update_open_alert_confirmation",val)
}
},
opendialoginfo: {
get() {
return this.$store.state.samplestoragesas.open_dialog_info
},
set(val) {
this.$store.commit("samplestoragesas/update_open_dialog_info",false)
}
},
msginfo(){
return this.$store.state.samplestoragesas.msg_info
},
curr_page: {
get() {
return this.$store.state.samplestoragesas.current_page
},
set(val) {
this.$store.commit("samplestoragesas/update_current_page",val)
this.$store.dispatch("samplestoragesas/search",{
code:this.xcode,
name: this.xname,
current_page:val,
lastid:-1
})
}
},
xtotal_page: {
get() {
return this.$store.state.samplestoragesas.total_page
},
set(val) {
this.$store.commit("samplestoragesas/update_total_page",val)
}
},
},
data() {
return {
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
menufilterdatestart:false,
menufilterdateend:false,
date: new Date().toISOString().substr(0, 10),
items: [],
name: '',
dialogdetail:false,
detailsinfo:{},
dialogchooseprint:false,
openprint:false,
urlprint:'',
printtitle:'',
printwidth:600,
formatreport:'pdf',
page:1,
headers: [
{
text: "KODE NASIONAL",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "KODE STRUKTUR",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
width: "45%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
}
],
pagination:{
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'T_samplestoragesasDate',
totalItems: this.$store.state.samplestoragesas.total_transactions
}
};
}
}
</script>

View File

@@ -0,0 +1,397 @@
<template>
<v-layout v-if="xact !== 'new'" column >
<v-dialog v-model="dialogconfirmationdeleteaddr" 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>
{{msgconfirmationdeleteaddr}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogformaddress" persistent max-width="650">
<v-card>
<v-card-title>
<span class="headline">Form Alamat Dokter</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4 pa-1>
<v-autocomplete
label="Kota"
v-model="cityaddress"
:items="xcities"
:search-input.sync="search_city"
auto-select-first
no-filter
item-text="M_CityName"
return-object
:loading="isLoading"
no-data-text="Pilih Kota"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
label="Kecamatan*"
></v-select>
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
label="Kelurahan / Desa*"
></v-select>
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-textarea
box
label="Alamat Lengkap"
v-model="descriptionaddress"
></v-textarea>
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">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> ALAMAT DOKTER
<v-flex text-md-right>
<v-btn @click="createNewAddress()" 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="xaddresses"
:loading="isLoading"
hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressDescription}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_city:'',
oldlabel:'',
headers: [
{
text: "AKSI",
align: "center",
sortable: false,
value: "action",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "LABEL",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALAMAT",
align: "left",
sortable: false,
value: "lab",
width: "40%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
dialogconfirmationdeleteaddr:{
get() {
return this.$store.state.doctor.dialog_confirmation_delete_addr
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",val)
}
},
msgconfirmationdeleteaddr(){
return this.$store.state.doctor.msg_confirmation_delete_addr
},
xact() {
return this.$store.state.doctor.act
},
xactaddr() {
return this.$store.state.doctor.act_addr
},
dialogformaddress:{
get() {
return this.$store.state.doctor.dialog_form_address
},
set(val) {
this.$store.commit("doctor/update_dialog_form_address",val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xaddresses(p) {
return this.$store.state.doctor.addresses
},
xcities(){
return this.$store.state.doctor.cities
},
labeladdress:{
get() {
return this.$store.state.doctor.label_address
},
set(val) {
this.$store.commit("doctor/update_label_address",val)
}
},
cityaddress:{
get() {
return this.$store.state.doctor.city_address
},
set(val) {
this.$store.commit("doctor/update_city_address",val)
this.$store.dispatch("doctor/getdistrict",this.$store.state.doctor.city_address)
}
},
xdistricts(){
return this.$store.state.doctor.districts
},
districtaddress:{
get() {
return this.$store.state.doctor.district_address
},
set(val) {
this.$store.commit("doctor/update_district_address",val)
this.$store.dispatch("doctor/getkelurahan",this.$store.state.doctor.district_address)
}
},
xkelurahans(){
return this.$store.state.doctor.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.doctor.kelurahan_address
},
set(val) {
this.$store.commit("doctor/update_kelurahan_address",val)
}
},
descriptionaddress:{
get() {
return this.$store.state.doctor.description_address
},
set(val) {
this.$store.commit("doctor/update_description_address",val)
}
},
},
methods : {
createNewAddress(){
this.$store.commit("doctor/update_act_addr",'new')
this.search_city = ''
this.labeladdress = ''
this.$store.commit("doctor/update_cities",[])
this.cityaddress = {}
this.$store.commit("doctor/update_districts",[])
this.districtaddress = {}
this.$store.commit("doctor/update_kelurahans",[])
this.kelurahanaddress = {}
this.descriptionaddress = ''
this.$store.commit("doctor/update_dialog_form_address",true)
},
thr_search_city: _.debounce( function () {
this.$store.dispatch("doctor/searchcity",this.search_city)
},2000),
checkError(value){
var errors = this.$store.state.doctor.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
saveNewAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/savenewaddress",prm)
}
},
editAddress(value){
this.$store.commit("doctor/update_act_addr",'edit')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.labeladdress = value.M_DoctorAddressNote
this.oldlabel = value.M_DoctorAddressNote
this.$store.commit("doctor/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
this.$store.commit("doctor/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
this.$store.commit("doctor/update_kelurahans",[{M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
this.kelurahanaddress = {M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
this.descriptionaddress = value.M_DoctorAddressDescription
this.$store.commit("doctor/update_dialog_form_address",true)
},
saveEditAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
errors.push("readonlyutama")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/saveeditaddress",prm)
}
},
deleteAddress(value){
this.$store.commit("doctor/update_act_addr",'delete')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.$store.commit("doctor/update_errors",[])
this.oldlabel = value.M_DoctorAddressNote
var errors = this.$store.state.doctor.errors
if(value.M_DoctorAddressNote.toLowerCase() === 'utama'){
errors.push("deleteutama")
}
var msg = ''
if(errors.includes("deleteutama")){
msg = "Biarkan yang utama tetap ada"
}
else{
msg = "Yakin, akan menghapus data alamat dokter "+value.M_DoctorAddressNote+" ?"
}
this.$store.commit("doctor/update_msg_confirmation_delete_addr",msg)
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",true)
},
doDeleteAddr(){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.oldlabel
this.$store.dispatch("doctor/deleteaddress",prm)
}
},
watch: {
search_city(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.doctor.update_autocomplete_status == 1 ) return
this.thr_search_city()
}
}
}
</script>

View File

@@ -0,0 +1,91 @@
<!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 xs12 class="left" fill-height pa-1>
<one-sample-storage-list></one-sample-storage-list>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../libs/vendor/moment.min.js"></script>
<script src="../../libs/vendor/numeral.min.js"></script>
<script src="../../libs/vendor/moment-locale-id.js"></script>
<script src="../../libs/vendor/lodash.js"></script>
<script src="../../libs/vendor/axios.min.js"></script>
<script src="../../libs/vendor/vue.js"></script>
<script src="../../libs/vendor/vuex.js"></script>
<script src="../../libs/vendor/vuetify.js"></script>
<script src="../../libs/vendor/httpVueLoader.js"></script>
<script src="../../libs/one_global.js"></script>
<!-- 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/oneNavbarComponentNoMenu.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-sample-storage-list': httpVueLoader('./components/oneSampleStorageList.vue'),
'one-sample-storage-list-sas': httpVueLoader('./components/oneSampleStorageListSas.vue'),
'one-sample-storage-rack': httpVueLoader('./components/oneSampleStorageRack.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,198 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplestorage.js"
export default {
namespaced: true,
state: {
save_status: 0,
transaction_number:'',
transaction_date:moment(new Date()).format('DD-MM-YYYY'),
transaction_time:moment(new Date()).format("hh:mm"),
transaction_note:'',
details:[],
selected_detail:{},
almaries:[],
racks:[],
selected_almari:{},
selected_rack:{},
get_data_status:0,
open_almari:false,
open_rack:false,
rack_contents:[],
errors:[]
},
mutations: {
update_save_status(state, val) {
state.save_status = val
},
update_transaction_number(state, val) {
state.transaction_number = val
},
update_transaction_date(state, val) {
state.transaction_date = val
},
update_transaction_time(state, val) {
state.transaction_time = val
},
update_transaction_note(state, val) {
state.transaction_note = val
},
update_details(state, val) {
state.details = val
},
update_selected_detail(state, val) {
state.selected_detail = val
console.log(val)
},
update_almaries(state, val) {
state.almaries = val
},
update_racks(state, val) {
state.racks = val
},
update_selected_almari(state, val) {
state.selected_almari = val
},
update_selected_rack(state, val) {
state.selected_rack = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_open_almari(state, val) {
state.open_almari = val
},
update_open_rack(state, val) {
state.open_rack = val
},
update_rack_contents(state, val) {
state.rack_contents = val
},
update_errors(state, val) {
state.errors = val
},
},
actions: {
async getalmaries(context) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getalmaries(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_almaries",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getracks(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.getracks(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_racks",data.records)
}
} 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_transaction_date",moment(new Date()).format('DD-MM-YYYY'))
context.commit("update_transaction_time",moment(new Date()).format("hh:mm"))
context.commit("update_transaction_note","")
context.commit("update_selected_almari",{})
context.commit("update_racks",[])
context.commit("update_selected_rack",{})
context.commit("update_open_almari",false)
context.commit("update_open_rack",false)
context.commit("update_rack_contents",[])
context.commit("update_details",[])
context.commit("samplestorage/update_dialog_success", true,{root:true})
context.commit("samplestorage/update_last_id", resp.data.id,{root:true})
var msg = "Transaksi penyimpanan " + resp.data.numbering + " berhasil dong ..."
context.commit("samplestorage/update_msg_success", msg,{root:true})
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async checkbarcode(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.checkbarcode(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
if(data.records){
var arr = prm.details
let idx = _.findIndex(arr, { barcode : prm.barcode})
if(idx === -1 ){
var detail = {
xid:0,
barcode:prm.barcode,
almari:{},
rack:{},
rackid:0,
row:0,
col:0,
ordersampleid:data.records.T_OrderSampleID,
patientname:data.records.patientname
}
arr.push(detail)
context.commit("update_details",arr)
let idx = _.findIndex(arr, function(o) { return o.barcode == detail.barcode })
context.commit("update_selected_detail",arr[idx])
}else{
var msg = "sudah ada di list dong"
context.commit("samplestorage/update_msg_info",msg,{root:true})
context.commit("samplestorage/update_open_dialog_info",true,{root:true})
}
}
else{
var msg = "Barcode <span style='font-weight:900'>"+prm.barcode+"</span> tidak valid dong"
context.commit("samplestorage/update_msg_info",msg,{root:true})
context.commit("samplestorage/update_open_dialog_info",true,{root:true})
}
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
}
}

View File

@@ -0,0 +1,428 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplestorage.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:[],
selected_transaction: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
open_alert_confirmation:false,
alert_success: false,
msg_success: "",
dialog_success: false,
dialog_confirmation_delete: false,
msg_confirmation_delete: "",
autocomplete_status:0,
dialog_form_address: false,
errors:[],
open_dialog_info:false,
msg_info:'',
current_page:1,
total_page:1,
code:'',
name:'',
dialognew:false,
xform:{
code:'',
name:'',
expose: 0,
tegangan:0,
arus:0,
waktu:0,
mah:0
},
groups:[],
subgroups:[],
subsubgroups:[],
flagsmcu:[{id:'N',name:'Tidak ada'},{id:'G',name:'Dengan perhitungan abnormal'},{id:'A',name:'Sesuai hasil'},{id:'C',name:'Berdasarkan SUBSUBGROUP'},{id:'R',name:'Reaktif Tidak normal'},{id:'P',name:'Positif Tidak normal'}],
types:[],
units:[],
nonlabs:[],
samples:[],
autocomplete_status:0,
code_exist:'N'
},
mutations: {
update_code_exist(state, val) {
state.code_exist = val
},
update_samples(state, val) {
state.samples = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_units(state, val) {
state.units = val
},
update_types(state, val) {
state.types = val
},
update_subgroups(state, val) {
state.subgroups = val
},
update_subsubgroups(state, val) {
state.subsubgroups = val
},
update_groups(state, val) {
state.groups = val
},
update_xform(state, val) {
state.xform = val
},
update_dialognew(state, val) {
state.dialognew = val
},
update_code(state, val) {
state.code = val
},
update_name(state, val) {
state.name = val
},
update_total_page(state, val) {
state.total_page = val
},
update_current_page(state, val) {
state.current_page = val
},
update_x_addr_id(state, val) {
state.x_addr_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = 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_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
},
},
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_transactions", data.total)
context.commit("update_total_page", data.total)
context.commit("update_no_save", 0)
/*if(prm.lastid === -1){
context.commit("update_selected_transaction", data.records[0])
var doc = data.records[0]
}
else{
context.commit("update_selected_transaction", data.records[prm.lastid])
var doc = data.records[prm.lastid]
}*/
}
} catch (e) {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getinitdatas(context) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getinitdatas(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_groups",data.records.groups)
//context.commit("update_subgroups",data.records.subgroups)
context.commit("update_types",data.records.types)
context.commit("update_nonlabs",data.records.nonlabs)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getdataselected(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.getdataselected(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_xform",data.records.xform)
context.commit("update_subgroups",data.records.subgroups)
context.commit("update_subsubgroups",data.records.subsubgroups)
var units = []
units.push(data.records.xform.unit)
context.commit("update_units",units)
var samples = []
samples.push(data.records.xform.sample)
context.commit("update_samples",samples)
context.commit("update_dialognew",true)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async checkcodeexist(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.checkcodeexist(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_code_exist",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async get_subgroups(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.get_subgroups(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_subgroups",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async get_subsubgroups(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.get_subsubgroups(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_subsubgroups",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async searchunit(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchunit(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status",3)
} else {
context.commit("update_autocomplete_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_units",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async searchsample(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchsample(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status",3)
} else {
context.commit("update_autocomplete_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_samples",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_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)
var msg = "Data ekposi pemeriksaan " + prm.name + " berhasil dimasukkan dong ..."
context.commit("update_msg_success", msg)
context.commit("update_dialog_success", true)
context.commit("update_dialognew", false)
context.dispatch("search",prm.paramsearch)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async doaddtest(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.doaddtest(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
if(data.records === 0 || data.records === '0'){
var msg = "Data pemeriksaan berhasil disisipkan ..."
context.commit("update_msg_success", msg)
context.commit("update_dialog_success", true)
//context.commit("update_dialognew", false)
context.dispatch("samplestoragesas/search",prm.paramsearch,{root:true})
}
else{
var msg = "Sudah ada dong, pemeriksaan yang sama dikeluarga ini"
context.commit("update_msg_info", msg)
context.commit("update_open_dialog_info", true)
}
}
} catch(e) {
context.commit("update_save_status",3)
}
},
}
}

View File

@@ -0,0 +1,181 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplestoragesas.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:[],
selected_transaction: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
open_alert_confirmation:false,
alert_success: false,
msg_success: "",
dialog_success: false,
dialog_confirmation_delete: false,
msg_confirmation_delete: "",
autocomplete_status:0,
dialog_form_address: false,
errors:[],
open_dialog_info:false,
msg_info:'',
current_page:1,
total_page:1,
xcode:'',
xname:''
},
mutations: {
update_xcode(state, val) {
state.xcode = val
},
update_xname(state, val) {
state.xname = val
},
update_total_page(state, val) {
state.total_page = val
},
update_current_page(state, val) {
state.current_page = val
},
update_x_addr_id(state, val) {
state.x_addr_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = 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_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
},
},
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_transactions", data.total)
context.commit("update_total_page", data.total)
context.commit("update_no_save", 0)
/*if(prm.lastid === -1){
context.commit("update_selected_transaction", data.records[0])
var doc = data.records[0]
}
else{
context.commit("update_selected_transaction", data.records[prm.lastid])
var doc = data.records[prm.lastid]
}*/
}
} catch (e) {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
}
}
}

View File

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