Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,809 @@
<template>
<div>
<v-layout class="mb-2" column>
<v-dialog v-model="dialogconfirmationdelete" persistent max-width="290">
<v-card>
<v-card-title dark class="headline error pt-2 pb-2" primary-title style="color:white">
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdelete}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteData()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> DETAIL PEMERIKSAAN
</v-subheader>
<v-divider></v-divider>
<v-layout wrap>
<v-flex xs12 pa-2>
<v-layout row>
<v-flex xs6 pa-1>
<v-text-field class="pr-1" v-model="xcode" label="Kode*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecode')" class="error pl-2 pr-2" style="color:#fff">Kode harus diisi ya</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecodeexist')" class="error pl-2 pr-2" style="color:#fff">Sudah dipake dong</p>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirecodedigit')" class="error pl-2 pr-2" style="color:#fff">Kode harus 8 karakter</p>
</v-flex>
<v-flex xs6 pa-1>
<v-text-field class="pr-1" v-model="xtestname" label="Nama*"></v-text-field>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requirename')" class="error pl-2 pr-2" style="color:#fff">Kalo gak ada namanya, bingung dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xshortname" label="Singkatan"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xnamebarcode" label="Kode bar" hint="Kode yang ditampilkan pada kode bar"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field class="pr-1" v-model="xworklistname" label="Nama worklist"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6 pa-1>
<v-select item-text="Nat_GroupName" return-object :items="xgroups" v-model="xgroup" label="Grup"></v-select>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiregrup')" class="error pl-2 pr-2" style="color:#fff">Masukin grup dong</p>
</v-flex>
<v-flex xs6 pa-1>
<v-select item-text="Nat_SubGroupName" return-object :items="xsubgroups" v-model="xsubgroup" label="Sub Grup"></v-select>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiresubgrup')" class="error pl-2 pr-2" style="color:#fff">Subgrup-nya jangan lupa</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6 pa-1>
<v-select readonly class="pr-1" item-text="Nat_TestTypeName" return-object :items="xtypes" v-model="xtype" label="Tipe"></v-select>
</v-flex>
<v-flex xs6 pa-1>
<v-select class="pr-1" item-text="T_TestIsNonLab" return-object :items="xnonlabs" v-model="xnonlab" label="Tipe hasil"></v-select>
</v-flex>
</v-layout>
<v-layout row>
<v-flex v-bind:class="{ 'x6': xisresult === 'N','x3': xisresult === 'Y' && xflagquantitative === 'N','xs2': xisresult === 'Y' && xflagquantitative === 'Y'}">
<v-text-field class="pr-1" v-model="xfontsize" label="Ukuran huruf"></v-text-field>
</v-flex>
<v-flex v-bind:class="{ 'x6': xisresult === 'N','x3': xisresult === 'Y' && xflagquantitative === 'N','xs2': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-text-field class="pr-1" v-model="xfontcolor" label="Warna huruf"></v-text-field>
</v-flex>
<v-flex xs1 v-if="xisresult === 'Y' && xflagquantitative === 'Y'">
<v-text-field readonly class="pr-1" v-model="xflaglow" label="Low"></v-text-field>
</v-flex>
<v-flex xs1 v-if="xisresult === 'Y' && xflagquantitative === 'Y'">
<v-text-field readonly class="pr-1" v-model="xflaghigh" label="High"></v-text-field>
</v-flex>
<!--<v-flex v-bind:class="{ 'x4': xisresult === 'N','x3': xisresult === 'Y' }">
<v-text-field
class="pr-1"
v-model="xflaggluc"
label="Flag gluc"
hide-details
></v-text-field>
</v-flex>-->
<v-flex v-if="xisresult === 'Y'" v-bind:class="{ 'xs4': xisresult === 'Y' && xflagquantitative === 'N','xs3': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-autocomplete class="pr-1" label="Tipe Bahan" v-model="sampletypeaddress" :items="xsampletypees" :search-input.sync="search_sample"
auto-select-first no-filter item-text="T_SampleTypeName" return-object no-data-text="Pilih jenis sample">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_SampleTypeName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p style="margin-top: -14px;margin-right:2px;color:#fff" v-if="checkError('requiresample')" class="error pl-2 pr-2" style="color:#fff">Ada hasil, ada sample dong</p>
</v-flex>
<v-flex v-if="xisresult === 'Y'" v-bind:class="{ 'xs4': xisresult === 'Y' && xflagquantitative === 'N','xs3': xisresult === 'Y' && xflagquantitative === 'Y' }">
<v-text-field class="pr-1" v-model="xunit" label="Satuan"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6>
<div>
<v-btn v-if="xflagbold === 'N'" small color="error">
<v-icon left>close</v-icon> Huruf dibuat tebal</v-btn>
<v-btn v-if="xflagbold === 'Y'" small color="success">
<v-icon left>check</v-icon> Huruf dibuat tebal</v-btn>
</div>
<div>
<v-btn v-if="xflagitalic === 'N'" small color="error">
<v-icon left>close</v-icon> Huruf dibuat miring</v-btn>
<v-btn v-if="xflagitalic === 'Y'" small color="success">
<v-icon left>check</v-icon> Huruf dibuat miring</v-btn>
</div>
<div>
<v-btn v-if="xisprice === 'N'" small color="error">
<v-icon left>close</v-icon> Bisa diberi harga</v-btn>
<v-btn v-if="xisprice === 'Y'" small color="success">
<v-icon left>check</v-icon> Bisa diberi harga</v-btn>
</div>
<div>
<v-btn v-if="xprintnote === 'N' && xisprice === 'Y'" small color="error">
<v-icon left>close</v-icon> Dicetak dinota</v-btn>
<v-btn v-if="xprintnote === 'Y' && xisprice === 'Y'" small color="success">
<v-icon left>check</v-icon> Dicetak dinota</v-btn>
</div>
</v-flex>
<v-flex xs6 class="text-sm-right align-right">
<div>
<v-btn v-if="xisresult === 'N'" small color="error">
<v-icon left>close</v-icon> Ada hasil</v-btn>
<v-btn v-if="xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Ada hasil</v-btn>
</div>
<div>
<v-btn v-if="xflagquantitative === 'N' && xisresult === 'Y'"
small color="error">
<v-icon left>close</v-icon> Hasil Kuantitatif</v-btn>
<v-btn v-if="xflagquantitative === 'Y' && xisresult === 'Y'"
small color="success">
<v-icon left>check</v-icon> Hasil Kuantitatif</v-btn>
</div>
<div>
<v-btn v-if="xdeltacheck === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Delta check</v-btn>
<v-btn v-if="xdeltacheck === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Delta check</v-btn>
</div>
<div>
<v-btn v-if="xtrendanalysis === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Trend Analysis</v-btn>
<v-btn v-if="xtrendanalysis === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Trend Analysis</v-btn>
</div>
<div>
<v-btn v-if="xprintresult === 'N' && xisresult === 'Y'" small color="error">
<v-icon left>close</v-icon> Dicetak dihasil</v-btn>
<v-btn v-if="xprintresult === 'Y' && xisresult === 'Y'" small color="success">
<v-icon left>check</v-icon> Dicetak dihasil</v-btn>
</div>
<div>
<v-btn v-if="xisworklist === 'N'" small color="error">
<v-icon left>close</v-icon> Masuk worklist</v-btn>
<v-btn v-if="xisworklist === 'Y'" small color="success">
<v-icon left>check</v-icon> Masuk worklist</v-btn>
</div>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
<template>
<v-dialog v-model="dialogerrormsg" max-width="30%">
<v-card>
<v-card-title class="headline red en-1 pt-2 pb-2" primary-title>
<h4 style="color:#FFEBEE">Peringatan !</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 v-html="errormsg" xs12>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="dialogerrormsg = false">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</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: () => ({
dialogerrormsg: false,
errormsg: '',
search_sample: '',
startdate: '',
enddate: '',
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10)
}),
computed: {
dialogconfirmationdelete: {
get() {
return this.$store.state.test.dialog_confirmation_delete
},
set(val) {
this.$store.commit("test/update_dialog_confirmation_delete", val)
}
},
msgconfirmationdelete() {
return this.$store.state.test.msg_confirmation_delete
},
isLoading() {
return this.$store.state.test.search_status == 1
},
xact() {
return this.$store.state.test.act
},
detail() {
return this.$store.state.test.selected_test
},
xgroups() {
return this.$store.state.test.groups
},
xgroup: {
get() {
return this.$store.state.test.selected_group
},
set(val) {
this.$store.commit("test/update_selected_group", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtypes() {
return this.$store.state.test.types
},
xtype: {
get() {
return this.$store.state.test.selected_type
},
set(val) {
this.$store.commit("test/update_selected_type", val)
this.$store.commit("test/update_no_save", 1)
}
},
xnonlabs() {
return this.$store.state.test.nonlabs
},
xnonlab: {
get() {
return this.$store.state.test.selected_nonlab
},
set(val) {
this.$store.commit("test/update_selected_nonlab", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtestname: {
get() {
return this.$store.state.test.test_name
},
set(val) {
this.$store.commit("test/update_test_name", val)
this.$store.commit("test/update_no_save", 1)
}
},
xnamebarcode: {
get() {
return this.$store.state.test.namebarcode
},
set(val) {
this.$store.commit("test/update_namebarcode", val)
this.$store.commit("test/update_no_save", 1)
}
},
xdob: {
get() {
return this.$store.state.test.dob
},
set(val) {
this.$store.commit("test/update_dob", val)
this.$store.commit("test/update_no_save", 1)
}
},
xsubgroups() {
return this.$store.state.test.subgroups
},
xsubgroup: {
get() {
return this.$store.state.test.selected_subgroup
},
set(val) {
this.$store.commit("test/update_selected_subgroup", val)
this.$store.commit("test/update_no_save", 1)
}
},
xreligions() {
return this.$store.state.test.religions
},
xreligion: {
get() {
return this.$store.state.test.selected_religion
},
set(val) {
this.$store.commit("test/update_selected_religion", val)
this.$store.commit("test/update_no_save", 1)
}
},
xcode: {
get() {
return this.$store.state.test.code
},
set(val) {
this.$store.commit("test/update_code", val)
this.$store.dispatch("test/check_exist_code", {trx:this.$store.state.test.selected_test,newcode:val})
this.$store.commit("test/update_no_save", 1)
}
},
xshortname: {
get() {
return this.$store.state.test.shortname
},
set(val) {
this.$store.commit("test/update_shortname", val)
this.$store.commit("test/update_no_save", 1)
}
},
xunit: {
get() {
return this.$store.state.test.unit
},
set(val) {
this.$store.commit("test/update_unit", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflaglow: {
get() {
return this.$store.state.test.flaglow
},
set(val) {
this.$store.commit("test/update_flaglow", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflaghigh: {
get() {
return this.$store.state.test.flaghigh
},
set(val) {
this.$store.commit("test/update_flaghigh", val)
this.$store.commit("test/update_no_save", 1)
}
},
xaddress: {
get() {
return this.$store.state.test.address
},
set(val) {
this.$store.commit("test/update_address", val)
this.$store.commit("test/update_no_save", 1)
}
},
xsamples() {
return this.$store.state.test.samples
},
xsample: {
get() {
return this.$store.state.test.sample
},
set(val) {
this.$store.commit("test/update_sample", val)
}
},
xsampletypees() {
return this.$store.state.test.sampletypees
},
sampletypeaddress: {
get() {
return this.$store.state.test.sampletype_address
},
set(val) {
this.$store.commit("test/update_sampletype_address", val)
}
},
xpositions() {
return this.$store.state.test.positions
},
xposition: {
get() {
return this.$store.state.test.selected_position
},
set(val) {
this.$store.commit("test/update_selected_position", val)
this.$store.commit("test/update_no_save", 1)
}
},
xworklistname: {
get() {
return this.$store.state.test.worklistname
},
set(val) {
this.$store.commit("test/update_worklistname", val)
this.$store.commit("test/update_no_save", 1)
}
},
xfontsize: {
get() {
return this.$store.state.test.fontsize
},
set(val) {
this.$store.commit("test/update_fontsize", val)
this.$store.commit("test/update_no_save", 1)
}
},
xfontcolor: {
get() {
return this.$store.state.test.fontcolor
},
set(val) {
this.$store.commit("test/update_fontcolor", val)
this.$store.commit("test/update_no_save", 1)
}
},
xmaxdiscount: {
get() {
return this.$store.state.test.maxdiscount
},
set(val) {
this.$store.commit("test/update_maxdiscount", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagbold: {
get() {
return this.$store.state.test.flagbold
},
set(val) {
this.$store.commit("test/update_flagbold", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagitalic: {
get() {
return this.$store.state.test.flagitalic
},
set(val) {
this.$store.commit("test/update_flagitalic", val)
this.$store.commit("test/update_no_save", 1)
}
},
xflagquantitative: {
get() {
return this.$store.state.test.flagquantitative
},
set(val) {
this.$store.commit("test/update_flagquantitative", val)
this.$store.commit("test/update_no_save", 1)
}
},
xdeltacheck: {
get() {
return this.$store.state.test.deltacheck
},
set(val) {
this.$store.commit("test/update_deltacheck", val)
this.$store.commit("test/update_no_save", 1)
}
},
xtrendanalysis: {
get() {
return this.$store.state.test.trendanalysis
},
set(val) {
this.$store.commit("test/update_trendanalysis", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisresult: {
get() {
return this.$store.state.test.isresult
},
set(val) {
this.$store.commit("test/update_isresult", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisprice: {
get() {
return this.$store.state.test.isprice
},
set(val) {
this.$store.commit("test/update_isprice", val)
this.$store.commit("test/update_no_save", 1)
}
},
xprintresult: {
get() {
return this.$store.state.test.printresult
},
set(val) {
this.$store.commit("test/update_printresult", val)
this.$store.commit("test/update_no_save", 1)
}
},
xprintnote: {
get() {
return this.$store.state.test.printnote
},
set(val) {
this.$store.commit("test/update_printnote", val)
this.$store.commit("test/update_no_save", 1)
}
},
xisworklist: {
get() {
return this.$store.state.test.isworklist
},
set(val) {
this.$store.commit("test/update_isworklist", val)
this.$store.commit("test/update_no_save", 1)
}
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.test.startdate
},
set(val) {
this.$store.commit("test/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.test.enddate
},
set(val) {
this.$store.commit("test/update_enddate", val)
}
},
},
methods: {
changeBtnFlagBold(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagbold = newval
},
changeBtnFlagItalic(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagitalic = newval
},
changeBtnFlagQuantitative(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xflagquantitative = newval
},
changeBtnFlagDeltacheck(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdeltacheck = newval
},
changeBtnFlagTrendanalysis(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xtrendanalysis = newval
},
changeBtnFlagIsprice(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisprice = newval
},
changeBtnFlagIsresult(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisresult = newval
},
changeBtnFlagPrintresult(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xprintresult = newval
},
changeBtnFlagPrintnote(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xprintnote = newval
},
changeBtnFlagIsworklist(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xisworklist = newval
},
checkError(value) {
var errors = this.$store.state.test.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveData() {
var prm = {}
prm.T_TestID = this.$store.state.test.selected_test.T_TestID
prm.T_TestNat_GroupID = this.$store.state.test.selected_group.Nat_GroupID
prm.T_TestName = this.xtestname
prm.T_TestNat_SubgroupID = this.$store.state.test.selected_subgroup.Nat_SubGroupID
prm.T_TestShortName = this.xshortname
prm.T_TestSasCode = this.xcode
prm.T_TestShortNameBarcode = this.xnamebarcode
prm.T_TestT_SampleTypeID = this.sampletypeaddress.T_SampleTypeID
prm.T_TestWorklistName = this.xworklistname
prm.T_TestFontSize = this.xfontsize
prm.T_TestFontColor = this.xfontcolor
prm.T_TestMaxDiscount = this.xmaxdiscount
prm.T_TestIsNonLab = this.$store.state.test.selected_nonlab.T_TestIsNonLabID
prm.T_TestIsBold = this.xflagbold
prm.T_TestIsItalic = this.xflagitalic
prm.T_TestIsQuantitative = this.xflagquantitative
prm.T_TestIsDeltaCheck = this.xdeltacheck
prm.T_TestIsTrendAnalysis = this.xtrendanalysis
prm.T_TestIsResult = this.xisresult
prm.T_TestIsPrice = this.xisprice
prm.T_TestIsPrintResult = this.xprintresult
prm.T_TestIsPrintNota = this.xprintnote
prm.T_TestIsWorklist = this.xisworklist
this.$store.dispatch("test/save", prm)
},
saveNewTest() {
var error_count = 0
var error_msg = ''
if (_.isEmpty(this.xgroup)) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Cabang</kbd> : Ayo, pilih salah satu cabang</p>"
}
if (this.xtestname === "") {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Nama Karyawan</kbd> : Diisi dong nama karyawannya</p>"
}
if (_.isEmpty(this.xsubgroup)) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Jenis Kelamin</kbd> : Ayo, pilih salah satu jenis kelamin</p>"
}
if (this.xdob === "") {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Tanggal Lahir</kbd> : Diisi dong tanggal lahirnya</p>"
}
var aDOB = moment(this.xdob, 'DD-MM-YYYY', true)
var isValidDOB = aDOB.isValid()
if (!isValidDOB) {
error_count++
error_msg +=
"<p><kbd class='text-uppercase'>Tanggal Lahir</kbd> : Diisi sesuai format dong (DD-MM-YYYY, contoh : 22-06-1988)</p>"
}
if (error_count > 0) {
this.errormsg = error_msg
this.dialogerrormsg = true
} else {
var prm = {}
prm.T_TestID = 0
prm.T_TestNat_GroupID = this.$store.state.test.selected_group.Nat_GroupID
prm.T_TestName = this.xtestname
prm.T_TestDOB = this.xdob
prm.T_TestNat_SubgroupID = this.$store.state.test.selected_subgroup.Nat_SubGroupID
prm.T_TestM_ReligionID = this.$store.state.test.selected_religion.M_ReligionID
prm.T_TestShortName = this.xshortname
prm.T_TestCode = this.xcode
prm.T_TestAddress = this.xaddress
prm.T_TestShortNameBarcode = this.xnamebarcode
prm.T_TestM_CityID = this.cityaddress.M_CityID
prm.T_TestT_SampleTypeID = this.sampletypeaddress.T_SampleTypeID
prm.T_TestM_PositionID = this.$store.state.test.selected_position.M_PositionID
prm.T_TestStartDate = this.xstartdate
prm.T_TestEndDate = this.xenddate
prm.T_TestWorklistName = this.xworklistname
prm.T_TestFontSize = this.xfontsize
prm.T_TestFontColor = this.xfontcolor
prm.T_TestMaxDiscount = this.xmaxdiscount
prm.T_TestIsBold = this.xisbold
this.$store.dispatch("test/newtest", prm)
}
},
thr_search_sample: _.debounce(function () {
this.$store.dispatch("test/searchsample", this.search_sample)
}, 2000),
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')}`
},
deleteData() {
let msg = "Yakin, akan menghapus data pasien " + this.xtestname + " ?"
this.$store.commit("test/update_msg_confirmation_delete", msg)
this.$store.commit("test/update_dialog_confirmation_delete", true)
},
doDeleteData() {
var prm = {}
prm.T_TestID = this.$store.state.test.selected_test.T_TestID
prm.T_TestName = this.xtestname
this.$store.dispatch("test/delete", prm)
}
},
watch: {
search_sample(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.test.update_autocomplete_status == 1) return
this.thr_search_sample()
}
}
}
</script>

View File

@@ -0,0 +1,402 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogsuccess" persistent max-width="290">
<v-card>
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
<v-card-text>
{{msgsuccess}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2 pa-2 searchbox">
<v-layout align-center row>
<v-flex xs3>
<v-text-field class=" ma-1" label="" placeholder="Kode" single-line outline v-model="scode" @keyup.enter="searchTest" hide-details></v-text-field>
</v-flex>
<v-flex xs3>
<v-text-field class=" ma-1" label="" placeholder="Nama" single-line outline v-model="name" @keyup.enter="searchTest" hide-details></v-text-field>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-btn @click="checkAll('Y')" dark color="green">Centang Semua</v-btn>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-btn @click="checkAll('N')" dark color="red">Un-Centang Semua</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table hide-actions :headers="headers" :items="tests" :loading="isLoading" class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestSasCode}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestTypeName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_GroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_SubGroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_SubSubGroupName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn dark style="min-width:10px" v-if="props.item.status === 'N'" small @click="changeStatus(props.item)" color="error"><v-icon dark left>close</v-icon></v-btn>
<v-btn dark style="min-width:10px" v-if="props.item.status === 'Y'" small @click="changeStatus(props.item)" color="green"><v-icon dark right>check</v-icon></v-btn>
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn dark style="min-width:10px" v-if="props.item.isfavorite === 'N'" small @click="changeFavorite(props.item)" color="error"><v-icon dark left>close</v-icon></v-btn>
<v-btn dark style="min-width:10px" v-if="props.item.isfavorite === 'Y'" small @click="changeFavorite(props.item)" color="green"><v-icon dark right>check</v-icon></v-btn>
</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>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("test/getsexreg")
this.$store.dispatch("test/search", {
current_page:this.curr_page,
name: this.name,
scode: this.scode,
lastid: -1
})
},
methods: {
checkAll(value){
let arrtest = this.$store.state.test.tests
arrtest.forEach((entry,i) => {
arrtest[i].status = value
})
this.$store.dispatch("test/checkedhs", {
test:arrtest
})
},
changeStatus(item){
item.status = item.status === 'N' ? 'Y':'N'
this.$store.dispatch("test/checkedhs", {
test:[item]
})
},
changeFavorite(item){
item.isfavorite = item.isfavorite === 'N' ? 'Y':'N'
this.$store.dispatch("test/checkedfavorite", {
test:[item]
})
},
isSelected(p) {
return p.T_TestID == this.$store.state.test.selected_test.T_TestID
},
searchTest() {
this.$store.dispatch("test/search", {
current_page:this.curr_page,
name: this.name,
scode: this.scode,
lastid: -1
})
},
selectMe(sta) {
if (this.$store.state.test.no_save == 0) {
this.$store.commit("test/update_selected_test", sta)
this.$store.commit("test/update_selected_group", {
Nat_GroupID: sta.T_TestNat_GroupID,
Nat_GroupName: sta.Nat_GroupName
})
this.$store.commit("test/update_selected_type", {
Nat_TestTypeID: sta.Nat_TestNat_TestTypeID,
Nat_TestTypeName: sta.Nat_TestTypeName
})
this.$store.commit("test/update_selected_nonlab", {
T_TestIsNonLabID: sta.T_TestIsNonLabID,
T_TestIsNonLab: sta.T_TestIsNonLabs
})
this.$store.commit("test/update_test_name", sta.T_TestName)
this.$store.commit("test/update_selected_subgroup", {
Nat_SubGroupID: sta.T_TestNat_SubgroupID,
Nat_SubGroupName: sta.Nat_SubGroupName
})
this.$store.commit("test/update_sampletypees", [{
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
}])
this.$store.commit("test/update_sampletype_address", {
T_SampleTypeID: sta.T_TestT_SampleTypeID,
T_SampleTypeName: sta.T_SampleTypeName
})
this.$store.commit("test/update_code", sta.T_TestSasCode)
this.$store.commit("test/update_shortname", sta.T_TestShortName)
this.$store.commit("test/update_unit", sta.Nat_UnitName)
this.$store.commit("test/update_flaglow", sta.Nat_TestFlagLow)
this.$store.commit("test/update_flaghigh", sta.Nat_TestFlagHigh)
this.$store.commit("test/update_namebarcode", sta.T_TestShortNameBarcode)
this.$store.commit("test/update_worklistname", sta.T_TestWorklistName)
this.$store.commit("test/update_fontsize", sta.T_TestFontSize)
this.$store.commit("test/update_fontcolor", sta.T_TestFontColor)
this.$store.commit("test/update_maxdiscount", sta.T_TestMaxDiscount)
this.$store.commit("test/update_flagbold", sta.T_TestIsBold)
this.$store.commit("test/update_flagitalic", sta.T_TestIsItalic)
this.$store.commit("test/update_flagquantitative", sta.T_TestIsQuantitative)
this.$store.commit("test/update_deltacheck", sta.T_TestIsDeltaCheck)
this.$store.commit("test/update_trendanalysis", sta.T_TestIsTrendAnalysis)
this.$store.commit("test/update_isresult", sta.T_TestIsResult)
this.$store.commit("test/update_isprice", sta.T_TestIsPrice)
this.$store.commit("test/update_printresult", sta.T_TestIsPrintResult)
this.$store.commit("test/update_printnote", sta.T_TestIsPrintNota)
this.$store.commit("test/update_isworklist", sta.T_TestIsWorklist)
this.$store.commit("test/update_act", 'edit')
} else {
this.$store.commit("test/update_open_alert_confirmation", true)
}
},
closeAlertConfirmation() {
this.$store.commit("test/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("test/update_no_save", 0)
this.$store.commit("test/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("test/update_alert_success", val)
},
setNewTest() {
this.$store.commit("test/update_selected_test", {})
this.$store.commit("test/update_selected_group", {})
this.$store.commit("test/update_test_name", '')
this.$store.commit("test/update_dob", '')
this.$store.commit("test/update_selected_subgroup", {})
this.$store.commit("test/update_address", '')
this.$store.commit("test/update_city_address", {})
this.$store.commit("test/update_sample", {})
this.$store.commit("test/update_code", '')
this.$store.commit("test/update_shortname", '')
this.$store.commit("test/update_unit", '')
this.$store.commit("test/update_selected_religion", {})
this.$store.commit("test/update_startdate", '')
this.$store.commit("test/update_enddate", '')
this.$store.commit("test/update_selected_position", {})
this.$store.commit("test/update_namebarcode", '')
this.$store.commit("test/update_worklistname", '')
this.$store.commit("test/update_fontsize", '')
this.$store.commit("test/update_fontcolor", '')
this.$store.commit("test/update_maxdiscount", '')
this.$store.commit("test/update_act", 'new')
},
closeDialogSuccess() {
let arrtest = this.$store.state.test.tests
var idx = _.findIndex(arrtest, item => item.T_TestID === this.$store.state.test.last_id)
console.log(idx)
this.$store.dispatch("test/search", {
name: this.name,
scode: this.scode,
lastid: idx
})
this.$store.commit("test/update_dialog_success", false)
}
},
computed: {
dialogsuccess: {
get() {
return this.$store.state.test.dialog_success
},
set(val) {
this.$store.commit("test/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.test.msg_success
},
snackbar: {
get() {
return this.$store.state.test.alert_success
},
set(val) {
this.$store.commit("test/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.test.search_status == 1
},
xstatuses() {
return this.$store.state.test.statuses
},
xselectedstatus: {
get() {
return this.$store.state.test.selected_status
},
set(val) {
this.$store.commit("test/update_selected_status", val)
}
},
tests() {
return this.$store.state.test.tests
},
openalertconfirmation: {
get() {
return this.$store.state.test.open_alert_confirmation
},
set(val) {
this.$store.commit("test/update_open_alert_confirmation", val)
}
},
curr_page: {
get() {
return this.$store.state.test.current_page
},
set(val) {
this.$store.commit("test/update_current_page",val)
this.$store.dispatch("test/search",{
current_page:val,
name: this.name,
scode: this.scode,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.test.total_tests
},
set(val) {
this.$store.commit("test/update_total_tests",val)
}
},
name: {
get() {
return this.$store.state.test.name
},
set(val) {
this.$store.commit("test/update_name",val)
}
},
scode: {
get() {
return this.$store.state.test.scode
},
set(val) {
this.$store.commit("test/update_scode",val)
}
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
page: 1,
headers: [{
text: "KODE",
align: "center",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "center",
sortable: false,
value: "lab",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "TIPE",
align: "center",
sortable: false,
value: "name",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "GRUP",
align: "center",
sortable: false,
value: "name",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SUB GRUP",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "SUB SUB GRUP",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "MASUK HS",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "FAVORIT",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'T_TestID',
totalItems: this.$store.state.test.total_tests
}
};
}
}
</script>