Initial import
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
persistent
|
||||
:overlay="false"
|
||||
max-width="640px"
|
||||
transition="dialog-transition"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title primary-title color="orange">
|
||||
DUPLIKASI PAKET
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<one-md-packet-copy-list></one-md-packet-copy-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat dark @click="dialog=!dialog">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-md-packet-copy-list': httpVueLoader('./oneMdPacketCopyList.vue')
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get() { return this.$store.state.packet_copy.dialog_copy },
|
||||
set(v) { this.$store.commit('packet_copy/update_dialog_copy', v) }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout >
|
||||
<v-text-field class="xs4 ma-1"
|
||||
label=""
|
||||
placeholder="Pencarian"
|
||||
single-line
|
||||
outline
|
||||
v-model="query_mou"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
|
||||
<!-- <v-select class="xs4 ma-1" :items="companies"
|
||||
item-text="M_CompanyName"
|
||||
item-value="M_CompanyID"
|
||||
return-object
|
||||
v-model="selected_company"
|
||||
label="Company" outline hide-details></v-select> -->
|
||||
|
||||
<v-flex pt-1 pb-1 pl-2 pr-1 xs4>
|
||||
<v-autocomplete
|
||||
label="Perusahaan"
|
||||
v-model="selected_company"
|
||||
:items="companies"
|
||||
:search-input.sync="query_company"
|
||||
|
||||
auto-select-first
|
||||
no-filter
|
||||
return-object
|
||||
clearable
|
||||
item-text="M_CompanyName"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Company"
|
||||
hide-details
|
||||
outline
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
<!-- <v-list-tile-sub-title v-text="'aaa'"></v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-select class="xs4 ma-1" :items="mous"
|
||||
item-text="M_MouName"
|
||||
item-value="M_MouID"
|
||||
return-object
|
||||
v-model="selected_mou"
|
||||
label="MOU" outline hide-details></v-select>
|
||||
|
||||
<v-btn class="xs3 ma-1 one-btn-icon" color="success" @click="search_packet" >
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<!-- <v-btn class="xs3 ma-1" color="info" @click="set" >Baru</v-btn> -->
|
||||
</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="packets"
|
||||
item-key="T_PacketID"
|
||||
:loading="isLoading"
|
||||
:pagination.sync="pagination"
|
||||
|
||||
:expand="expand"
|
||||
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)">{{ props.item.T_PacketType == "PR" ? "Profile" : "Panel" }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props)">{{ props.item.T_PacketName }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props)">{{ one_money(props.item.T_PacketOriginalPrice) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props)"><strong>{{ one_money(props.item.T_PacketPrice) }}</strong></td>
|
||||
<td class="text-xs-center pa-0" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props)">
|
||||
<v-btn color="orange" dark small @click="copy_me(props)">Copy</v-btn>
|
||||
</td>
|
||||
<!-- <td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status}}</td> -->
|
||||
</template>
|
||||
|
||||
<template v-slot:expand="props">
|
||||
<v-card flat class="amber lighten-4">
|
||||
<v-card-text>{{ props.item.pxs }}</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination
|
||||
|
||||
:length="15"
|
||||
:total-visible="7"
|
||||
></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-confirm :data="selected_packet.T_PacketID" v-if="dialog_confirm" ></one-dialog-confirm>
|
||||
</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;
|
||||
}
|
||||
|
||||
.searchbox .one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-confirm': httpVueLoader('../../common/oneDialogConfirm.vue')
|
||||
},
|
||||
|
||||
mounted() {
|
||||
},
|
||||
|
||||
methods : {
|
||||
isSelected(p) {
|
||||
let x = this.$store.state.packet_copy.selected_packet
|
||||
if (!x)
|
||||
return false
|
||||
|
||||
if (x.T_PacketID == p.T_PacketID)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
search_packet() {
|
||||
this.$store.dispatch("packet_copy/search_packet")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
this.$store.commit('packet_copy/update_selected_packet', doc.item)
|
||||
doc.expanded = !doc.expanded
|
||||
// this.$store.dispatch('px/search_px')
|
||||
},
|
||||
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("packet_copy/search_company")
|
||||
|
||||
}, 700),
|
||||
|
||||
one_money (x) {
|
||||
return window.one_money(x)
|
||||
},
|
||||
|
||||
copy_me (p) {
|
||||
this.selectMe(p)
|
||||
this.$store.dispatch('packet_copy/save_copy')
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
query_company : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.query_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_query_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
search_mou : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.search_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_search_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
companies : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.companies
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_companies', v)
|
||||
}
|
||||
},
|
||||
|
||||
mous : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.mous
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_mous', v)
|
||||
}
|
||||
},
|
||||
|
||||
packets : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.packets
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_packets', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.selected_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_selected_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_mou : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.selected_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_selected_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_packet() {
|
||||
return this.$store.state.packet_copy.selected_packet
|
||||
},
|
||||
|
||||
query_mou : {
|
||||
get () {
|
||||
return this.$store.state.packet_copy.query_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('packet_copy/update_query_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading () {
|
||||
return false
|
||||
},
|
||||
|
||||
is_loading () {
|
||||
return false
|
||||
},
|
||||
|
||||
dialog_confirm () {
|
||||
return this.$store.state.dialog_confirm
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "TIPE PAKET",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA PAKET",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "35%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA NORMAL",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA PAKET",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_PacketName',
|
||||
totalItems: this.$store.state.packet_copy.total_packet
|
||||
},
|
||||
|
||||
expand : false
|
||||
};
|
||||
},
|
||||
|
||||
watch : {
|
||||
query_company(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
// console.log("1-val:"+val)
|
||||
if (val == old ) return
|
||||
// console.log("2-val:"+val)
|
||||
// if (! val) return
|
||||
// console.log("3-val:"+val)
|
||||
// if (val.length < 1 ) return
|
||||
// console.log("4-val:"+val)
|
||||
if (this.$store.state.packet.search_status == 1 ) return
|
||||
// console.log("5-val:"+val)
|
||||
this.$store.commit("packet_copy/update_query_company", val)
|
||||
this.thr_search()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
380
one-ui/agreement/one-md-packet-v4/components/oneMdPacketList.vue
Normal file
380
one-ui/agreement/one-md-packet-v4/components/oneMdPacketList.vue
Normal file
@@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout>
|
||||
<v-text-field class="xs4 ma-1" label="" placeholder="Pencarian" single-line outline v-model="query_packet" hide-details :height="height"></v-text-field>
|
||||
|
||||
<!-- <v-select class="xs4 ma-1" :items="companies"
|
||||
item-text="M_CompanyName"
|
||||
item-value="M_CompanyID"
|
||||
return-object
|
||||
v-model="selected_company"
|
||||
label="Company" outline hide-details></v-select> -->
|
||||
|
||||
<v-flex pt-1 pb-1 pl-2 pr-1 xs4>
|
||||
<v-autocomplete label="Perusahaan" v-model="selected_company" :items="companies" :search-input.sync="query_company" auto-select-first
|
||||
no-filter return-object clearable item-text="M_CompanyName" :loading="is_loading" no-data-text="Pilih Company"
|
||||
hide-details outline :height="height">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
<!-- <v-list-tile-sub-title v-text="'aaa'"></v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-select class="xs4 ma-1" :items="mous" item-text="M_MouName" item-value="M_MouID" return-object v-model="selected_mou"
|
||||
label="Agreement" outline hide-details :height="height"></v-select>
|
||||
|
||||
<v-btn class="xs3 ma-1 one-btn-icon" color="success" @click="search_packet">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<v-btn class="xs3 ma-1 one-btn-icon" color="primary" :disabled="!selected_mou || selected_mou.M_MouIsReleased == 'Y' || selected_mou.M_MouIsVerified == 'Y'"
|
||||
@click="new_packet">
|
||||
<span class="icon-add"></span>
|
||||
</v-btn>
|
||||
<!-- <v-btn class="xs3 ma-1" color="info" @click="set" >Baru</v-btn> -->
|
||||
</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="packets" :loading="isLoading" :pagination.sync="pagination" 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_PacketType == "PR" ? "Profile" : "Panel" }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PacketName }}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PacketIsNota }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketOriginalBruto) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketOriginalPrice) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)"><strong>{{ one_money(props.item.T_PacketPrice) }}</strong></td>
|
||||
<td class="text-xs-center pa-0" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-btn color="red" :disabled="selected_mou.M_MouIsReleased == 'Y' || selected_mou.M_MouIsVerified == 'Y'" :dark="selected_mou.M_MouIsReleased != 'Y' && selected_mou.M_MouIsVerified != 'Y'"
|
||||
class="one-btn-icon ma-0" small @click="del_packet(props.item)"><span class="icon-del"></span></v-btn>
|
||||
<v-btn color="blue" :disabled="selected_mou.M_MouIsReleased == 'Y' || selected_mou.M_MouIsVerified == 'Y'" :dark="selected_mou.M_MouIsReleased != 'Y' && selected_mou.M_MouIsVerified != 'Y'"
|
||||
class="one-btn-icon ma-0" small @click="edit_packet(props.item)"><span class="icon-edit"></span></v-btn>
|
||||
</td>
|
||||
<!-- <td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status}}</td> -->
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-confirm :data="selected_packet.T_PacketID" v-if="dialog_confirm" @confirm="del_me" :text="'Anda Yakin mau menghapus PAKET : ' + selected_packet.T_PacketName + ' ?'"></one-dialog-confirm>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:50px;
|
||||
} */
|
||||
|
||||
/* .v-autocomplete.v-text-field--enclosed:not(.v-text-field--solo):not(.v-text-field--single-line) .v-select__slot>input {
|
||||
margin-top: 14px;
|
||||
} */
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.searchbox .one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
|
||||
/* Overwrite */
|
||||
|
||||
.v-text-field--box>.v-input__control>.v-input__slot,
|
||||
.v-text-field--full-width>.v-input__control>.v-input__slot,
|
||||
.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
align-items: stretch;
|
||||
min-height: 50px
|
||||
}
|
||||
|
||||
.v-text-field--box .v-label,
|
||||
.v-text-field--full-width .v-label,
|
||||
.v-text-field--outline .v-label {
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.v-text-field.v-text-field--enclosed .v-input__append-inner {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.v-select.v-text-field--enclosed:not(.v-text-field--single-line) .v-select__selections {
|
||||
padding-top: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-confirm': httpVueLoader('../../../common/oneDialogConfirm.vue')
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch('packet/search_default_mou')
|
||||
},
|
||||
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
let x = this.$store.state.packet.selected_packet
|
||||
if (!x)
|
||||
return false
|
||||
|
||||
if (x.T_PacketID == p.T_PacketID)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
search_packet() {
|
||||
this.$store.dispatch("packet/search_packet")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
this.$store.commit('packet/update_selected_packet', doc)
|
||||
this.$store.dispatch('px/search_px')
|
||||
},
|
||||
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("packet/search_company")
|
||||
|
||||
}, 700),
|
||||
|
||||
new_packet() {
|
||||
this.$store.commit('packet_new/update_state_edit', false)
|
||||
this.$store.commit('packet_new/update_dialog_packet', true)
|
||||
},
|
||||
|
||||
edit_packet(x) {
|
||||
this.$store.commit('packet/update_selected_packet', x)
|
||||
this.$store.commit('packet_new/update_state_edit', true)
|
||||
this.$store.commit('packet_new/update_dialog_packet', true)
|
||||
},
|
||||
|
||||
one_money(x) {
|
||||
return window.one_money(x)
|
||||
},
|
||||
|
||||
del_packet(x) {
|
||||
this.$store.commit('packet/update_selected_packet', x)
|
||||
this.$store.commit('update_dialog_confirm', true)
|
||||
},
|
||||
|
||||
del_me(x) {
|
||||
this.$store.dispatch('packet/del_packet', x.data)
|
||||
this.$store.commit('update_dialog_confirm', false)
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
query_company: {
|
||||
get() {
|
||||
return this.$store.state.packet.query_company
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_query_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
search_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet.search_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_search_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
companies: {
|
||||
get() {
|
||||
return this.$store.state.packet.companies
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_packets', v)
|
||||
}
|
||||
},
|
||||
|
||||
mous: {
|
||||
get() {
|
||||
return this.$store.state.packet.mous
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_mous', v)
|
||||
}
|
||||
},
|
||||
|
||||
packets: {
|
||||
get() {
|
||||
return this.$store.state.packet.packets
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_packets', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.packet.selected_company
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_selected_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet.selected_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_selected_mou', v)
|
||||
this.$store.commit('test/update_mou_id', v.M_MouID)
|
||||
}
|
||||
},
|
||||
|
||||
selected_packet() {
|
||||
return this.$store.state.packet.selected_packet
|
||||
},
|
||||
|
||||
query_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet.query_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_query_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return false
|
||||
},
|
||||
|
||||
is_loading() {
|
||||
return false
|
||||
},
|
||||
|
||||
dialog_confirm() {
|
||||
return this.$store.state.dialog_confirm
|
||||
},
|
||||
|
||||
query_packet: {
|
||||
get() {
|
||||
return this.$store.state.packet.query_packet
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet/update_query_packet', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [{
|
||||
text: "TIPE PAKET",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA PAKET",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "35%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "CETAK NOTA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA BRUTO",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA NORMAL",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA PAKET",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_PacketName',
|
||||
totalItems: this.$store.state.packet.total_packet
|
||||
},
|
||||
|
||||
height: 50
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
query_company(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
// console.log("1-val:"+val)
|
||||
if (val == old) return
|
||||
// console.log("2-val:"+val)
|
||||
// if (! val) return
|
||||
// console.log("3-val:"+val)
|
||||
// if (val.length < 1 ) return
|
||||
// console.log("4-val:"+val)
|
||||
if (this.$store.state.packet.search_status == 1) return
|
||||
// console.log("5-val:"+val)
|
||||
this.$store.commit("packet/update_query_company", val)
|
||||
this.thr_search()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
260
one-ui/agreement/one-md-packet-v4/components/oneMdPacketNew.vue
Normal file
260
one-ui/agreement/one-md-packet-v4/components/oneMdPacketNew.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialog" persistent max-width="600px">
|
||||
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Tambah Data Paket</span>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field label="Nama Paket" v-model="packet_name"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pa-1>
|
||||
<v-select :items="types" v-model="packet_type" label="Tipe" item-value="code" item-text="label" :disabled="state_edit"></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-3 pa-1>
|
||||
<v-select :items="is_notas" v-model="packet_is_nota" label="Cetak Nota" item-value="code" item-text="label"></v-select>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-1>
|
||||
|
||||
<v-autocomplete label="Perusahaan" v-model="selected_company" :items="companies" :search-input.sync="query_company" auto-select-first
|
||||
no-filter return-object clearable item-text="M_CompanyName" :loading="is_loading" no-data-text="Pilih Company"
|
||||
hide-details v-show="!state_edit">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
<!-- <v-list-tile-sub-title v-text="'aaa'"></v-list-tile-sub-title> -->
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
|
||||
<v-text-field label="Perusahaan" v-model="curr_company_name" disabled v-show="state_edit"></v-text-field>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pt-3 pa-1>
|
||||
<v-select :items="mous" item-text="M_MouName" item-value="M_MouID" return-object v-model="selected_mou" label="MOU" hide-details
|
||||
v-show="!state_edit">
|
||||
</v-select>
|
||||
|
||||
<v-text-field label="MOU" v-model="curr_mou_name" disabled v-show="state_edit"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="red" dark flat @click="dialog=false">Tutup</v-btn>
|
||||
<v-btn color="primary" :disabled="in_saving" dark @click="save">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
packet_name: "",
|
||||
packet_type: "",
|
||||
packet_is_nota: "N",
|
||||
types: [{
|
||||
"code": "PR",
|
||||
"label": "Profile"
|
||||
}, {
|
||||
"code": "PN",
|
||||
"label": "Panel"
|
||||
}],
|
||||
is_notas: [{
|
||||
"code": "Y",
|
||||
"label": "Ya"
|
||||
}, {
|
||||
"code": "N",
|
||||
"label": "Tidak"
|
||||
}],
|
||||
is_loading: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.dialog_packet
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_dialog_packet', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_company: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.query_company
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_query_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
search_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.search_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_search_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
companies: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.companies
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_companies', v)
|
||||
}
|
||||
},
|
||||
|
||||
mous: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.mous
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_mous', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.selected_company
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_selected_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.selected_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_selected_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_mou: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.query_mou
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('packet_new/update_query_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
state_edit() {
|
||||
return this.$store.state.packet_new.state_edit
|
||||
},
|
||||
|
||||
curr_mou_name() {
|
||||
if (this.$store.state.packet.selected_mou)
|
||||
return this.$store.state.packet.selected_mou.M_MouName
|
||||
return ""
|
||||
},
|
||||
|
||||
curr_company_name() {
|
||||
if (this.$store.state.packet.selected_company)
|
||||
return this.$store.state.packet.selected_company.M_CompanyName
|
||||
return ""
|
||||
},
|
||||
in_saving: {
|
||||
get() {
|
||||
return this.$store.state.packet_new.in_saving
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("packet_new/update_in_saving", val)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
query_company(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
console.log("1-val:" + val)
|
||||
if (val == old) return
|
||||
console.log("2-val:" + val)
|
||||
// if (! val) return
|
||||
console.log("3-val:" + val)
|
||||
// if (val.length < 1 ) return
|
||||
console.log("4-val:" + val)
|
||||
if (this.$store.state.packet_new.search_status == 1) return
|
||||
console.log("5-val:" + val)
|
||||
this.$store.commit("packet_new/update_query_company", val)
|
||||
this.thr_search()
|
||||
},
|
||||
|
||||
dialog(val, old) {
|
||||
if (val && !old) {
|
||||
let sc = this.$store.state.packet.selected_company
|
||||
let sm = this.$store.state.packet.selected_mou
|
||||
this.packet_name = ""
|
||||
this.packet_type = ""
|
||||
this.query_company = ""
|
||||
// this.selected_company = {}
|
||||
this.selected_company = sc
|
||||
this.$store.commit('packet_new/update_companies', {
|
||||
records: [sc],
|
||||
total: 1
|
||||
})
|
||||
this.$store.commit('packet_new/update_selected_mou', sm)
|
||||
}
|
||||
|
||||
let se = this.$store.state.packet_new.state_edit
|
||||
if (se) {
|
||||
let sp = this.$store.state.packet.selected_packet
|
||||
this.packet_name = sp.T_PacketName
|
||||
this.packet_is_nota = sp.T_PacketIsNota
|
||||
this.packet_type = sp.T_PacketType
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("packet_new/search_company")
|
||||
|
||||
}, 700),
|
||||
|
||||
async save() {
|
||||
if (this.in_saving) return;
|
||||
this.in_saving = true;
|
||||
let se = this.$store.state.packet_new.state_edit
|
||||
if (!se) {
|
||||
this.$store.dispatch('packet_new/save', {
|
||||
packet_name: this.packet_name,
|
||||
packet_type: this.packet_type,
|
||||
packet_is_nota: this.packet_is_nota,
|
||||
packet_company: this.$store.state.packet_new.selected_company.M_CompanyID,
|
||||
packet_mou: this.$store.state.packet_new.selected_mou.M_MouID
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch('packet_new/save', {
|
||||
packet_name: this.packet_name,
|
||||
packet_is_nota: this.packet_is_nota,
|
||||
packet_id: this.$store.state.packet.selected_packet.T_PacketID,
|
||||
edit: true
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,460 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 v-if="state_add">
|
||||
<h3 class="title">{{ packet_name }} ({{ packet_type }})</h3>
|
||||
|
||||
<v-layout row wrap pt-2>
|
||||
<v-flex xs5 class="text-xs-right pr-2">
|
||||
<v-text-field label="HARGA PAKET" hide-details v-model="packet_price" class="text-xs-right" reverse v-show="packet_type_code == 'PN'"></v-text-field>
|
||||
|
||||
<v-text-field label="HARGA PAKET" hide-details :value="one_money(packet_price)" readonly class="text-xs-right" reverse v-show="packet_type_code == 'PR'"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs5 class="text-xs-right">
|
||||
<v-text-field label="TOTAL HARGA" hide-details :value="one_money(total_price)" readonly class="text-xs-right" reverse></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-flex xs12 pt-2 pl-0>
|
||||
<v-btn color="red" dark @click="cancel" class="mt-0 mb-0 ml-0">Batal</v-btn>
|
||||
<v-btn color="success" dark @click="save" class="ma-0">Simpan</v-btn>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
|
||||
<v-flex v-bind:class="state_add? 'xs6':'xs8'" class="searchbox">
|
||||
<v-layout row wrap>
|
||||
<v-text-field class="xs2 ma-1" label="" placeholder="Pencarian" single-line outline v-model="query_px" hide-details></v-text-field>
|
||||
<v-btn class="xs2 ma-1 one-btn-icon v-btn--search" color="success" @click="search_px" :disabled="!btn_enabled" :dark="btn_enabled">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<v-btn class="xs2 ma-1 one-btn-icon v-btn--search" color="orange" @click="imports" :disabled="!btn_enabled || selected_mou.M_MouIsReleased == 'Y' || selected_mou.M_MouIsVerified == 'Y'"
|
||||
:dark="btn_enabled && selected_mou.M_MouIsReleased != 'Y' && selected_mou.M_MouIsVerified != 'Y'"
|
||||
v-show="!state_add">
|
||||
<span class="icon-import"></span>
|
||||
</v-btn>
|
||||
<v-btn class="xs2 ma-1 one-btn-icon v-btn--search" color="primary" @click="add" :disabled="!btn_enabled || selected_mou.M_MouIsReleased == 'Y' || selected_mou.M_MouIsVerified == 'Y'"
|
||||
:dark="btn_enabled && selected_mou.M_MouIsReleased != 'Y' && selected_mou.M_MouIsVerified != 'Y'"
|
||||
v-show="!state_add">
|
||||
<span class="icon-edit"></span>
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
<!-- <v-layout row wrap>
|
||||
<v-btn color="success" @click="imports">Impor ...</v-btn>
|
||||
</v-layout> -->
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-flex xs2 pl-3 v-show="!state_add">
|
||||
<v-text-field label="Harga Bruto" :value="selected_packet?one_money(selected_packet.T_PacketOriginalBruto):0" reverse readonly
|
||||
hide-details></v-text-field>
|
||||
</v-flex> -->
|
||||
<v-flex xs2 pl-3 v-show="!state_add">
|
||||
<v-text-field label="Harga Normal" :value="selected_packet?one_money(selected_packet.T_PacketOriginalPrice):0" reverse readonly
|
||||
hide-details></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-4 v-show="!state_add">
|
||||
<v-text-field label="Harga Paket" :value="selected_packet?one_money(selected_packet.T_PacketPrice):0" reverse readonly hide-details></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-btn class="xs3 ma-1" color="info" @click="set" >Baru</v-btn> -->
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
|
||||
<!-- <v-card>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<one-md-packet-px-new></one-md-packet-px-new>
|
||||
</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 :headers="headers" :items="pxs" :loading="isLoading" :pagination.sync="pagination" 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_TestCode }}</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-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketDetailPriceAmount) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketDetailPriceDisc) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketDetailPriceDiscRp) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PacketDetailPrice) }}</td>
|
||||
<td class="text-xs-center pa-0" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-btn color="red" dark class="one-btn-icon" small ma-0 @click="remove(props.item)" v-show="state_add">«</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:60px;
|
||||
} */
|
||||
|
||||
.searchbox .v-btn--search {
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
|
||||
/* Overwrite */
|
||||
|
||||
.v-text-field--box>.v-input__control>.v-input__slot,
|
||||
.v-text-field--full-width>.v-input__control>.v-input__slot,
|
||||
.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
align-items: stretch;
|
||||
min-height: 50px
|
||||
}
|
||||
|
||||
.v-text-field--box .v-label,
|
||||
.v-text-field--full-width .v-label,
|
||||
.v-text-field--outline .v-label {
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.v-text-field.v-text-field--enclosed .v-input__append-inner {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
// 'one-md-price-new-dialog': httpVueLoader('./oneMdPriceNewDialog.vue'),
|
||||
// 'one-md-price-new-addon-dialog': httpVueLoader('./oneMdPriceNewAddonDialog.vue')
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
isSelected(p) {
|
||||
return false
|
||||
},
|
||||
|
||||
search_px() {
|
||||
this.$store.dispatch("px/search_px")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
// this.$store.commit('price/update_selected_price', doc)
|
||||
},
|
||||
|
||||
add() {
|
||||
this.$store.commit('test/update_state_add', true)
|
||||
this.$store.dispatch('test/search_test')
|
||||
|
||||
// copy price
|
||||
let x = this.$store.state.packet.selected_packet.T_PacketPrice
|
||||
let y = this.$store.state.packet.selected_packet.T_PacketOriginalPrice
|
||||
this.$store.commit('px/update_estimate_total_price', y)
|
||||
this.$store.commit('px/update_packet_price', x)
|
||||
|
||||
// update nat tests
|
||||
// refresh nat_tests
|
||||
let nt = []
|
||||
let pxs = this.$store.state.px.pxs
|
||||
for (let i in pxs) {
|
||||
for (let j in pxs[i].nat_tests) {
|
||||
nt.push(pxs[i].nat_tests[j])
|
||||
}
|
||||
}
|
||||
this.$store.commit('px/update_nat_tests', nt)
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.$store.dispatch('px/search_px')
|
||||
this.$store.commit('test/update_state_add', false)
|
||||
return
|
||||
|
||||
let y = this.$store.state.px.pxs
|
||||
let z = this.$store.state.px.total_px
|
||||
|
||||
for (let i in y) {
|
||||
if (y[i].T_PacketDetailID == 0) {
|
||||
y.splice(i, 1)
|
||||
z--
|
||||
}
|
||||
}
|
||||
|
||||
this.$store.commit('px/update_pxs', {
|
||||
records: y,
|
||||
total: z
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
save() {
|
||||
let x = this.$store.state.packet.selected_packet
|
||||
x.T_PacketPrice = this.packet_price
|
||||
x.T_PacketOriginalPrice = this.total_price
|
||||
|
||||
this.$store.commit('packet/update_selected_packet', x)
|
||||
this.$store.dispatch('px/save_px')
|
||||
this.$store.dispatch('packet/search_packet')
|
||||
},
|
||||
|
||||
remove(x) {
|
||||
// go to state add
|
||||
let z = this.$store.state.test.state_add
|
||||
if (!z) {
|
||||
let y = this.$store.state.packet.selected_packet.T_PacketPrice
|
||||
this.$store.commit('px/update_estimate_total_price', y)
|
||||
this.$store.commit('test/update_state_add', true)
|
||||
}
|
||||
|
||||
// add to test
|
||||
let te = this.$store.state.test.exclude
|
||||
let ti = this.$store.state.test.include
|
||||
let td = te.indexOf(x.T_TestID)
|
||||
if (td > -1)
|
||||
te.splice(td, 1)
|
||||
else
|
||||
ti.push(x.T_TestID)
|
||||
this.$store.commit('test/update_exclude', te)
|
||||
this.$store.commit('test/update_include', ti)
|
||||
|
||||
// search test
|
||||
this.$store.dispatch('test/search_test')
|
||||
|
||||
let pxs = this.pxs
|
||||
let price = 0
|
||||
let total = pxs.length
|
||||
let total_price = parseFloat(this.$store.state.px.estimate_total_price)
|
||||
for (let i in pxs) {
|
||||
if (pxs[i].T_TestID == x.T_TestID) {
|
||||
price = parseFloat(pxs[i].T_PacketDetailPrice)
|
||||
pxs.splice(i, 1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
total_price -= price
|
||||
if (total_price < 0) total_price = 0
|
||||
this.pxs = {
|
||||
total: total - 1,
|
||||
records: pxs
|
||||
}
|
||||
this.$store.commit('px/update_estimate_total_price', total_price)
|
||||
|
||||
if (this.packet_type_code == "PR")
|
||||
this.$store.commit('px/update_packet_price', total_price)
|
||||
|
||||
// refresh nat_tests
|
||||
let nt = []
|
||||
for (let i in pxs) {
|
||||
for (let j in pxs[i].nat_tests) {
|
||||
nt.push(pxs[i].nat_tests[j])
|
||||
}
|
||||
}
|
||||
this.$store.commit('px/update_nat_tests', nt)
|
||||
},
|
||||
|
||||
imports() {
|
||||
this.$store.commit('packet_copy/update_dialog_copy', true)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pxs: {
|
||||
get() {
|
||||
return this.$store.state.px.pxs
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('px/update_pxs', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_px: {
|
||||
get() {
|
||||
return this.$store.state.px.selected_px
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('px/update_selected_px', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_px: {
|
||||
get() {
|
||||
return this.$store.state.px.query_px
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('px/update_query_px', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return false
|
||||
},
|
||||
|
||||
btn_add_enabled() {
|
||||
// if (this.$store.state.price.selected_mou.M_MouID)
|
||||
return true
|
||||
|
||||
// return false
|
||||
},
|
||||
|
||||
packet_name() {
|
||||
if (this.$store.state.packet.selected_packet)
|
||||
return this.$store.state.packet.selected_packet.T_PacketName
|
||||
|
||||
return ""
|
||||
},
|
||||
|
||||
packet_type() {
|
||||
if (!this.$store.state.packet.selected_packet)
|
||||
return ""
|
||||
|
||||
if (this.$store.state.packet.selected_packet.T_PacketType == "PR")
|
||||
return "Profile"
|
||||
|
||||
return "Panel"
|
||||
},
|
||||
|
||||
packet_type_code() {
|
||||
if (!this.$store.state.packet.selected_packet)
|
||||
return ""
|
||||
|
||||
return this.$store.state.packet.selected_packet.T_PacketType
|
||||
},
|
||||
|
||||
state_add() {
|
||||
return this.$store.state.test.state_add
|
||||
},
|
||||
|
||||
btn_enabled() {
|
||||
if (this.$store.state.packet.selected_mou &&
|
||||
this.$store.state.packet.selected_packet)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
total_price: {
|
||||
get() {
|
||||
return this.$store.state.px.estimate_total_price
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('px/update_estimate_total_price', v)
|
||||
}
|
||||
},
|
||||
|
||||
packet_price: {
|
||||
get() {
|
||||
return this.$store.state.px.packet_price
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('px/update_packet_price', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_packet() {
|
||||
return this.$store.state.packet.selected_packet
|
||||
},
|
||||
|
||||
selected_mou() {
|
||||
return this.$store.state.packet.selected_mou
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [{
|
||||
text: "KODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "35%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "BRUTO",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "Disc %",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "Disc Rp",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_TestName',
|
||||
totalItems: this.$store.state.px.total_px
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox" color="grey">
|
||||
<v-layout row wrap class="pa-2 mb-3">
|
||||
<h3 class="title white--text">Tambah / Ubah Detail Paket</h3>
|
||||
</v-layout>
|
||||
<v-layout>
|
||||
<v-text-field class="xs4 ma-1" label="" placeholder="Pencarian" single-line outline v-model="query_test" hide-details dark></v-text-field>
|
||||
|
||||
<v-flex pt-1 pb-1 pl-2 pr-1 xs4>
|
||||
<v-text-field label="Perusahaan & MOU" v-model="company_name" readonly outline hide-details dark></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-btn class="xs2 ma-1 one-btn-icon" color="success" @click="search_test">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
|
||||
</v-layout>
|
||||
|
||||
|
||||
</v-card>
|
||||
|
||||
<v-card color="grey">
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="tests" :loading="isLoading" :pagination.sync="pagination" 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_TestCode }}</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-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PriceAmount}}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PriceDisc}}</td>
|
||||
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PriceDiscRp}}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ one_money(props.item.T_PriceTotal) }}</td>
|
||||
<td class="text-xs-right pt-0 pb-0 pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-btn color="success" small class="one-btn-icon ma-0" @click="addMe(props.item)">»</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .searchbox .v-input.v-text-field .v-input__slot{
|
||||
min-height:60px;
|
||||
} */
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
|
||||
/* Overwrite */
|
||||
|
||||
.v-text-field--box>.v-input__control>.v-input__slot,
|
||||
.v-text-field--full-width>.v-input__control>.v-input__slot,
|
||||
.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
align-items: stretch;
|
||||
min-height: 50px
|
||||
}
|
||||
|
||||
.v-text-field--box .v-label,
|
||||
.v-text-field--full-width .v-label,
|
||||
.v-text-field--outline .v-label {
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.v-text-field.v-text-field--enclosed .v-input__append-inner {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.v-select.v-text-field--enclosed:not(.v-text-field--single-line) .v-select__selections {
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.v-text-field--outline input {
|
||||
margin-top: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
return false
|
||||
},
|
||||
|
||||
search_test() {
|
||||
this.$store.dispatch("test/search_test")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
this.$store.commit('test/update_selected_test', doc)
|
||||
|
||||
},
|
||||
|
||||
cancel() {
|
||||
return
|
||||
},
|
||||
|
||||
one_money(x) {
|
||||
return window.one_money(x)
|
||||
},
|
||||
|
||||
addMe(x) {
|
||||
let y = this.$store.state.px.pxs
|
||||
let z = this.$store.state.px.total_px
|
||||
let nt = this.$store.state.px.nat_tests
|
||||
|
||||
let nt_found = false
|
||||
if (nt.length > 0) {
|
||||
for (let i in x.nat_tests) {
|
||||
if (nt.indexOf(x.nat_tests[i]) > -1)
|
||||
nt_found = true
|
||||
}
|
||||
|
||||
if (nt_found) {
|
||||
alert('Pemeriksaan tersebut sudah ada !')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
x.T_PacketDetailID = 0
|
||||
x.T_PacketDetailPriceAmount = x.T_PriceAmount
|
||||
x.T_PacketDetailPriceDisc = x.T_PriceDisc
|
||||
x.T_PacketDetailPriceDiscRp = x.T_PriceDiscRp
|
||||
x.T_PacketDetailPriceSubTotal = x.T_PriceSubTotal
|
||||
x.T_PacketDetailPrice = x.T_PriceTotal
|
||||
y.push(x)
|
||||
z++
|
||||
|
||||
this.$store.commit('px/update_pxs', {
|
||||
records: y,
|
||||
total: z
|
||||
})
|
||||
|
||||
// update nat tests
|
||||
for (let i in x.nat_tests) {
|
||||
nt.push(x.nat_tests[i])
|
||||
}
|
||||
this.$store.commit('px/update_nat_tests', nt)
|
||||
|
||||
// add price
|
||||
let m = this.$store.state.px.estimate_total_price
|
||||
m = parseFloat(m) + parseFloat(x.T_PriceTotal)
|
||||
if (m < 0) m = 0
|
||||
this.$store.commit('px/update_estimate_total_price', m)
|
||||
|
||||
let packet_type = this.$store.state.packet.selected_packet.T_PacketType
|
||||
if (packet_type == "PR")
|
||||
this.$store.commit('px/update_packet_price', m)
|
||||
|
||||
// remove from test
|
||||
let te = this.$store.state.test.exclude
|
||||
let ti = this.$store.state.test.include
|
||||
let td = ti.indexOf(x.T_TestID)
|
||||
if (td > -1)
|
||||
ti.splice(td, 1)
|
||||
else
|
||||
te.push(x.T_TestID)
|
||||
|
||||
this.$store.commit('test/update_exclude', te)
|
||||
this.$store.commit('test/update_include', ti)
|
||||
this.$store.dispatch('test/search_test')
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
query_test: {
|
||||
get() {
|
||||
return this.$store.state.test.query_test
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('test/update_query_test', v)
|
||||
}
|
||||
},
|
||||
|
||||
company_name() {
|
||||
let x = this.$store.state.packet.selected_packet.T_PacketType
|
||||
// if (x == "PR") {
|
||||
// if (this.$store.state.packet.selected_company)
|
||||
return this.$store.state.packet.selected_company.M_CompanyName +
|
||||
" » " + this.mou_name
|
||||
// } else {
|
||||
// if (this.$store.state.packet.default_company)
|
||||
// return this.$store.state.packet.default_company.M_CompanyName +
|
||||
// " » " + this.mou_name
|
||||
// }
|
||||
|
||||
return ""
|
||||
},
|
||||
|
||||
mou_name() {
|
||||
let x = this.$store.state.packet.selected_packet.T_PacketType
|
||||
// if (x == "PR") {
|
||||
if (this.$store.state.packet.selected_mou)
|
||||
return this.$store.state.packet.selected_mou.M_MouName
|
||||
// } else {
|
||||
// if (this.$store.state.packet.default_mou)
|
||||
// return this.$store.state.packet.default_mou.M_MouName
|
||||
// }
|
||||
|
||||
return ""
|
||||
},
|
||||
|
||||
tests: {
|
||||
get() {
|
||||
return this.$store.state.test.tests
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('test/update_tests', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return false
|
||||
},
|
||||
|
||||
is_loading() {
|
||||
return false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [{
|
||||
text: "KODE TEST",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA TEST",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "Bruto",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "Disc %",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "Disc Rp",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_TestName',
|
||||
totalItems: this.$store.state.test.total_test
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user