Flatten nested repos
This commit is contained in:
@@ -0,0 +1,599 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog v-model="dialogconfirmationdelete" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title
|
||||
dark
|
||||
class="headline error pt-2 pb-2"
|
||||
primary-title
|
||||
style="color:white"
|
||||
>
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationdelete}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteTrx()">Lakukan</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
|
||||
<v-btn v-if="xact !== 'new'" @click="printX()" small color="grey">Print</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
|
||||
|
||||
<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'"> [ <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-btn v-if="xact !== 'new'" @click="cancelTransaction()" small color="error">Pembatalan</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-flex xs5 pa-1>
|
||||
<v-text-field v-model="xrefnumber" label="Nomor Refferensi*"></v-text-field>
|
||||
<p v-if="checkError('requirereffnumber')" class="error pl-2 pr-2" style="color:#fff">Nomor referensi harus diisi dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-text-field v-model="xtransportername" label="Transporter*"></v-text-field>
|
||||
<p v-if="checkError('requiretransporter')" class="error pl-2 pr-2" style="color:#fff">Transporter 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-layout>
|
||||
</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> ITEM
|
||||
|
||||
<v-flex text-md-right>
|
||||
<!-- <v-btn @click="openDialogSearch()" v-if="xact === 'new'" small color="warning">Cari sample</v-btn>-->
|
||||
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<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-left pa-2" >{{ props.item.numbering }}</td>
|
||||
<td class="text-xs-center pa-2" >{{ props.item.sampleweight }}</td>
|
||||
<td class="text-xs-center pa-2" >{{ props.item.nonsampleweight }}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs4 class="text-xs-right pr-2" pa-1>
|
||||
<h3 class="font-weight-black">TOTAL SAMPLE</h3>
|
||||
</v-flex>
|
||||
<v-flex x1 class="text-xs-right pb-2" pa-1>
|
||||
<v-text-field
|
||||
style="text-align:center;font-size:18px;font-weight:bold;margin-top:0; width:70px"
|
||||
single-line
|
||||
hide-details
|
||||
outline
|
||||
readonly
|
||||
v-model="sampleweight"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs1 pa-1>
|
||||
<h3 class="font-weight-black">KG</h3>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="text-xs-right pr-2" pa-1>
|
||||
<h3 class="font-weight-black">TOTAL NON SAMPLE</h3>
|
||||
</v-flex>
|
||||
<v-flex x1 class="text-xs-right pb-2" pa-1>
|
||||
<v-text-field
|
||||
style="text-align:center;font-size:18px;font-weight:bold;margin-top:0; width:70px"
|
||||
single-line
|
||||
hide-details
|
||||
outline
|
||||
readonly
|
||||
v-model="nonsampleweight"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs1 pa-1>
|
||||
<h3 class="font-weight-black">KG</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="openprint=false"></one-dialog-print>
|
||||
</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;
|
||||
}
|
||||
.v-messages{
|
||||
min-height:0;
|
||||
margin:0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue')
|
||||
},
|
||||
data: () => ({
|
||||
openprint:false,
|
||||
urlprint:'',
|
||||
printtitle:'',
|
||||
printwidth:600,
|
||||
is_loading:false,
|
||||
xbarcode:'',
|
||||
search_dialog:'',
|
||||
search_nonsample_dialog:'',
|
||||
search_staff:'',
|
||||
xalmariname:'',
|
||||
xrackcode:'',
|
||||
xrow:0,
|
||||
xcol:0,
|
||||
rackrows:[],
|
||||
rackcols:[],
|
||||
vendor_name:'',
|
||||
vendor_address:'',
|
||||
item_new:'',
|
||||
headers: [
|
||||
{
|
||||
text: "NOMOR TRX",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "40%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "BERAT SAMPLE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "BERAT NON SAMPLE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
width: "30%",
|
||||
class: "pa-2 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
|
||||
},
|
||||
xstaffs(){
|
||||
return this.$store.state.form.staffs
|
||||
},
|
||||
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)
|
||||
}
|
||||
},
|
||||
xselected_staff:{
|
||||
get() {
|
||||
return this.$store.state.form.selected_staff
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_selected_staff",val)
|
||||
}
|
||||
},
|
||||
details(){
|
||||
return this.$store.state.form.details
|
||||
},
|
||||
detailnonsamples(){
|
||||
return this.$store.state.form.detailnonsamples
|
||||
},
|
||||
xsamples(){
|
||||
return this.$store.state.form.samples
|
||||
},
|
||||
xnonsamples(){
|
||||
return this.$store.state.form.nonsamples
|
||||
},
|
||||
xopenalmari(){
|
||||
return this.$store.state.form.open_almari
|
||||
},
|
||||
xopenrack(){
|
||||
return this.$store.state.form.open_rack
|
||||
},
|
||||
xrackcontents(){
|
||||
return this.$store.state.form.rack_contents
|
||||
},
|
||||
successadditem(){
|
||||
return this.$store.state.form.success_add_item
|
||||
},
|
||||
dialogsearchsample:{
|
||||
get() {
|
||||
return this.$store.state.form.dialog_search_sample
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_dialog_search_sample",val)
|
||||
}
|
||||
},
|
||||
dialogsearchnonsample:{
|
||||
get() {
|
||||
return this.$store.state.form.dialog_search_nonsample
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_dialog_search_nonsample",val)
|
||||
}
|
||||
},
|
||||
xrefnumber:{
|
||||
get() {
|
||||
return this.$store.state.form.reffnumber
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_reffnumber",val)
|
||||
}
|
||||
},
|
||||
xtransportername:{
|
||||
get() {
|
||||
return this.$store.state.form.porter
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_porter",val)
|
||||
}
|
||||
},
|
||||
dialogconfirmationdelete:{
|
||||
get() {
|
||||
return this.$store.state.samplestorage.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("samplestorage/update_dialog_confirmation_delete",val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdelete(){
|
||||
return this.$store.state.samplestorage.msg_confirmation_delete
|
||||
},
|
||||
sampleweight:{
|
||||
get() {
|
||||
return this.$store.state.form.sample_weight
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_sample_weight",val)
|
||||
}
|
||||
},
|
||||
nonsampleweight:{
|
||||
get() {
|
||||
return this.$store.state.form.nonsample_weight
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("form/update_nonsample_weight",val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
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_003"
|
||||
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
|
||||
},
|
||||
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)
|
||||
this.$store.commit("form/update_open_almari",false)
|
||||
this.$store.commit("form/update_open_rack",true)
|
||||
this.$store.commit("form/update_selected_almari",detail.almari)
|
||||
|
||||
this.xalmariname = detail.almari.name
|
||||
this.$store.commit("form/update_selected_rack",detail.rack)
|
||||
this.xrackcode = detail.rack.code
|
||||
|
||||
this.$store.dispatch("form/getrackcontent",{
|
||||
almariid:detail.almari.id,
|
||||
rackid:detail.rack.id,
|
||||
col:detail.col,
|
||||
row:detail.row
|
||||
})
|
||||
},
|
||||
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)
|
||||
}
|
||||
this.$store.commit("form/update_selected_almari",{})
|
||||
this.$store.commit("form/update_selected_rack",{})
|
||||
this.$store.commit("form/update_rack_contents",[])
|
||||
}
|
||||
|
||||
},
|
||||
deleteDetailNonSample(detail){
|
||||
var arr = this.$store.state.form.detailnonsamples
|
||||
|
||||
let idx = _.findIndex(arr, function(o) { return o.id == detail.id })
|
||||
var result = _.reject(arr, { id: detail.id })
|
||||
this.$store.commit("form/update_detailnonsamples",result)
|
||||
|
||||
},
|
||||
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(this.xrefnumber === ''){
|
||||
errors.push("requirereffnumber")
|
||||
}
|
||||
if(this.xtransportername === ''){
|
||||
errors.push("requiretransporter")
|
||||
}
|
||||
if(errors.length === 0){
|
||||
var prm = {
|
||||
date: this.$store.state.form.transaction_date,
|
||||
time: this.$store.state.form.transaction_time,
|
||||
reffnumber:this.xrefnumber,
|
||||
transportername:this.xtransportername,
|
||||
note: this.$store.state.form.transaction_note,
|
||||
details : this.$store.state.form.details
|
||||
}
|
||||
this.$store.dispatch("form/save",prm)
|
||||
}else{
|
||||
this.$store.commit("form/update_errors",errors)
|
||||
}
|
||||
},
|
||||
checkStatus(value){
|
||||
if(value.status === 'N' && value.selected === 'N'){
|
||||
return 'info'
|
||||
}else if(value.status === 'Y' && value.selected === 'T'){
|
||||
return 'warning'
|
||||
}
|
||||
else{
|
||||
return 'error'
|
||||
}
|
||||
},
|
||||
cancelTransaction(){
|
||||
var trx = this.$store.state.samplestorage.selected_transaction
|
||||
console.log(trx)
|
||||
let msg = "Yakin, akan membatalkan data transaksi "+trx.trx_number+" ?"
|
||||
this.$store.commit("samplestorage/update_msg_confirmation_delete",msg)
|
||||
this.$store.commit("samplestorage/update_dialog_confirmation_delete",true)
|
||||
},
|
||||
doDeleteTrx(){
|
||||
var trx = this.$store.state.samplestorage.selected_transaction
|
||||
this.$store.dispatch("samplestorage/deletetrx",trx)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_staff(val,old) {
|
||||
if (val == old ) return
|
||||
if (! val) return
|
||||
if (val.length < 1 ) return
|
||||
if (this.$store.state.form.update_autocomplete_status == 1 ) return
|
||||
this.thr_search_staff()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,409 @@
|
||||
<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"
|
||||
v-model="filterComputedDateFormattedStart"
|
||||
label="FIlter Tanggal Awal"
|
||||
outline
|
||||
readonly
|
||||
hide-details
|
||||
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="Filter Tanggal Akhir"
|
||||
outline
|
||||
readonly
|
||||
hide-details
|
||||
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_reffnumber}}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.trx_transporter}}</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/getitems")
|
||||
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_transaction_note",trx.trx_note)
|
||||
this.$store.commit("form/update_reffnumber",trx.trx_reffnumber)
|
||||
this.$store.commit("form/update_porter",trx.trx_transporter)
|
||||
this.$store.commit("form/update_details",trx.details)
|
||||
var dx = trx.details
|
||||
var sampleweigth = 0
|
||||
var nonsampleweight = 0
|
||||
for (var x = 0; x < dx.length; x++) {
|
||||
sampleweigth = sampleweigth + parseFloat(dx[x].sampleweight)
|
||||
nonsampleweight = nonsampleweight + parseFloat(dx[x].nonsampleweight)
|
||||
}
|
||||
this.$store.commit("form/update_sample_weight",sampleweigth)
|
||||
this.$store.commit("form/update_nonsample_weight",nonsampleweight)
|
||||
}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_nonsample_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_reffnumber",'')
|
||||
this.$store.commit("form/update_porter",'')
|
||||
this.$store.commit("form/update_details",[])
|
||||
this.$store.dispatch("form/getitems")
|
||||
|
||||
},
|
||||
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:-1
|
||||
})
|
||||
this.$store.commit("samplestorage/update_dialog_success",false)
|
||||
},
|
||||
closeDialogInfo(){
|
||||
this.$store.commit("samplestorage/update_open_dialog_info",false)
|
||||
|
||||
|
||||
},
|
||||
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_003.rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx
|
||||
console.log(this.urlprintnote)
|
||||
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: "NO REF",
|
||||
align: "CENTER",
|
||||
sortable: false,
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TRANSPORTER",
|
||||
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