Files
FE_CPONE/test/vuex/one-sniper-tools/components/oneFoSupervisorDialogDelivery.vue
2026-04-27 10:13:31 +07:00

228 lines
8.6 KiB
Vue

<template>
<v-layout row justify-center>
<v-dialog v-model="deliverydialog" persistent max-width="30%">
<v-card>
<v-card-title
dark
class="success pt-2 pb-2 white--text"
>
<h4 class="subheader">Pengiriman Hasil</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout v-if="lookup_delivery === 1" mt-1 row >
<v-flex xs12>
<v-progress-linear :indeterminate="true"></v-progress-linear>
</v-flex>
</v-layout>
<v-layout v-if="lookup_delivery !== 1" mt-1 row wrap >
<v-flex class="row" ma-1 xs11 v-for="(delivery,idx) in vdeliveryother">
<v-layout align-center row>
<v-flex xs2>
<v-btn v-if="delivery.chex === 'N'" @click="changeBoxRight(delivery,idx)" dark style="min-width:20px" small color="grey darken-1"><v-icon small>close</v-icon></v-btn>
<v-btn v-if="delivery.chex === 'Y'" @click="changeBoxRight(delivery,idx)" depressed style="min-width:20px" small color="teal lighten-4"><v-icon color="teal" small>check</v-icon></v-btn>
</v-flex>
<v-flex mb-1 pl-2 xs10>
<p :class="getColorFont(delivery)"
class="mb-0 font-weight-black"
style="font-size:11px">
{{delivery.label.toUpperCase()}}
</p>
<div v-if="delivery.destination !== ''"
class="body-2 mb-1 mono caption"
v-html="delivery.destination">
</div>
<v-textarea
v-if="delivery.chex === 'Y'"
v-model="delivery.note"
rows="1"
auto-grow
single-line
style="color:#800000;font-weight:500"
placeholder="Catatan"
hide-details
class="body-2 mb-1 mt-0 pt-0"
></v-textarea>
</v-flex>
</v-layout>
</v-flex >
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn v-if="vstatussave !== 1" @click="saveDeliveryAdditionOther()" color="primary" dark>Simpan</v-btn>
<v-btn
flat
@click="deliverydialog = false"
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<style scoped>
::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: #F5F5F5;
}
::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
}
::-webkit-scrollbar-thumb
{
background-color: #0ae;
background-image: -webkit-gradient(linear, 0 0, 0 100%,
color-stop(.5, rgba(255, 255, 255, .2)),
color-stop(.5, transparent), to(transparent));
}
</style>
<script>
module.exports = {
data () {
return {
printwidth:600
}
},
computed: {
lookup_delivery:{
get() {
return this.$store.state.delivery.lookup_delivery
},
set(val) {
this.$store.commit("delivery/update_lookup_delivery",val)
}
},
vmsgsave(){
return this.$store.state.delivery.save_message
},
vstatussave(){
return this.$store.state.delivery.save_status
},
vstatusdone(){
return this.$store.state.delivery.status_done
},
vdeliveryregister(){
return this.$store.state.delivery.delivery_register
},
vdeliveryverification(){
return this.$store.state.delivery.delivery_verification
},
vdeliveryother(){
return this.$store.state.delivery.delivery_other
},
deliverydialog:{
get() {
return this.$store.state.delivery.delivery_dialog
},
set(val) {
this.$store.commit("delivery/update_delivery_dialog",val)
}
},
savestatus(){
return this.$store.state.delivery.save_status
}
},
methods : {
reHTMLAddress(entry){
var rtn = ''
if(entry){
var perpart = entry.split("^")
rtn += "<p class='mb-0' style='font-size:12px'>"+perpart[0]+"</p>"
if(perpart[1])
rtn += "<p class='mb-0' style='font-size:12px'>"+perpart[1]+"</p>"
}
return rtn
},
changeBoxRight(value,idx){
var oldArr = this.$store.state.delivery.delivery_other
oldArr[idx].chex = value.chex === 'N'?'Y':'N'
this.$store.commit("delivery/update_delivery_other",oldArr)
},
getColorFont(value,type){
var xcolor = 'black--text'
if(value.chex === 'Y'){
xcolor = 'teal--text'
}
return xcolor
},
doSave(){
let prm = {
'orderid':this.$store.state.patient.selected_patient.orderid,
'delivery':this.$store.state.delivery.delivery
}
this.$store.dispatch("delivery/save",prm)
},
closeDialogBarcode(){
if(this.savestatus !== 2){
this.$store.commit("delivery/update_delivery_dialog",false)
}
else{
let arrpatient = this.$store.state.patient.patients
var idx = _.findIndex(arrpatient, item => item.idx === this.$store.state.patient.selected_patient.idx)
console.log(idx)
this.$store.dispatch("patient/search",{
search: this.$store.state.patient.search,
status: this.$store.state.patient.selected_status.value,
lastidx:idx
})
this.$store.commit("delivery/update_delivery_dialog",false)
}
},
checkstatus(delivery){
if(delivery.id > 0 && delivery.chex === 'N'){
return 'Tidak Aktif'
}
else if(delivery.id > 0 && delivery.chex === 'Y'){
return 'Aktif'
}
else if((delivery.id === 0 || delivery.id === '0') && delivery.chex === 'Y'){
return 'Tambahan dari verification'
}
},
updateDeliveryVerification(value,idx){
var oldArr = this.$store.state.delivery.delivery_verification
oldArr[idx].chex = value
this.$store.commit("delivery/update_delivery_verification",oldArr)
},
updateDeliveryOther(value,idx){
var oldArr = this.$store.state.delivery.delivery_other
oldArr[idx].chex = value
this.$store.commit("delivery/update_delivery_other",oldArr)
},
saveDeliveryAdditionVerification(){
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
delver:this.$store.state.delivery.delivery_verification
}
this.$store.dispatch("delivery/savedeliveryadditionalverification",prm)
},
saveDeliveryAdditionOther(){
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
delot:this.$store.state.delivery.delivery_other
}
this.$store.dispatch("delivery/savedeliveryadditionalother",prm)
}
}
}
</script>