Flatten nested repos
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout >
|
||||
<v-menu class="xs6 pr-2"
|
||||
v-model="menufilterdatestart"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
hide-details
|
||||
v-model="filterComputedDateFormattedStart"
|
||||
label="Tanggal Awal"
|
||||
outline
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
|
||||
</v-menu>
|
||||
|
||||
<v-menu class="xs6 pl-2"
|
||||
v-model="menufilterdateend"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px"
|
||||
min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
class="mt-1"
|
||||
v-model="filterComputedDateFormattedEnd"
|
||||
label="Tanggal Akhir"
|
||||
outline
|
||||
hide-details
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xdateend" no-title @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
|
||||
<span @click="setNewTransaction" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card >
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xtransactions"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_number }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_datetime}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_staffname}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_note}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-icon @click="printOut(props.item)" style="cursor: pointer">description</v-icon>
|
||||
</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="700" :status="openprintout" :urlprint="urlprintnote" @close-dialog-print="openprintout = false"></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("samplestorage/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
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.id == this.$store.state.samplestorage.selected_transaction.id
|
||||
},
|
||||
searchTransaction() {
|
||||
this.$store.dispatch("samplestorage/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
current_page:1,
|
||||
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_sample_weight",trx.trx_sampleweight)
|
||||
this.$store.commit("form/update_staffs",[{M_StaffID:trx.trx_staffid,M_StaffName:trx.trx_staffname}])
|
||||
this.$store.commit("form/update_selected_staff",{M_StaffID:trx.trx_staffid,M_StaffName:trx.trx_staffname})
|
||||
this.$store.commit("form/update_transaction_note",trx.trx_note)
|
||||
this.$store.commit("form/update_detailnonsamples",trx.detailnonsamples)
|
||||
this.$store.commit("form/update_details",trx.details)
|
||||
}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_sample_weight",0)
|
||||
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_selected_vendor",{})
|
||||
this.$store.commit("form/update_picname",'')
|
||||
this.$store.commit("form/update_details",[])
|
||||
this.$store.commit("form/update_detailnonsamples",[])
|
||||
this.$store.commit("form/update_selected_almari",{})
|
||||
this.$store.commit("form/update_selected_rack",{})
|
||||
this.$store.commit("form/update_rack_contents",[])
|
||||
this.$store.commit("form/update_staffs",[])
|
||||
this.$store.commit("form/update_selected_staff",{})
|
||||
},
|
||||
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.dispatch("samplestorage/search",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
current_page:1,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("samplestorage/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("samplestorage/update_open_dialog_info",false)
|
||||
|
||||
|
||||
},
|
||||
printX(){
|
||||
var idx = this.$store.state.samplestorage.selected_transaction.id
|
||||
this.printwidth = 1028
|
||||
this.printtitle = ""
|
||||
let user = one_user()
|
||||
var d = new Date();
|
||||
var n = d.getTime()
|
||||
|
||||
var rptname = "rpt_storage_002"
|
||||
var xurl = "/birt/run?__report=report/one/rekap/"+rptname+".rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx+'&tm='+n
|
||||
|
||||
this.urlprint = xurl
|
||||
this.openprint = true
|
||||
},
|
||||
printOut(val){
|
||||
this.printwidth = 800
|
||||
this.printtitle = ""
|
||||
let idx = val.id
|
||||
let user = one_user()
|
||||
this.urlprintnote = "/birt/run?__report=report/one/rekap/rpt_storage_002.rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx
|
||||
|
||||
this.openprintout = true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
openprintout: {
|
||||
get() {
|
||||
return this.$store.state.samplestorage.open_print_out
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplestorage/update_open_print_out",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
|
||||
},
|
||||
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",{
|
||||
startdate:this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
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)
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
menufilterdatestart:false,
|
||||
menufilterdateend:false,
|
||||
urlprintnote:'',
|
||||
printtitle:'',
|
||||
printwidth:600,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
items: [],
|
||||
name: '',
|
||||
page:1,
|
||||
headers: [
|
||||
{
|
||||
text: "NO. TRANSAKSI",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL DAN JAM",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "STAF",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "CATATAN",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PRINT",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_SampleStorageDate',
|
||||
totalItems: this.$store.state.samplestorage.total_transactions
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user