Initial import
This commit is contained in:
@@ -0,0 +1,357 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
persistent
|
||||
:overlay="false"
|
||||
max-width="80%"
|
||||
transition="dialog-transition"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title primary-title color="orange">
|
||||
<h3 class="title">PENGGANDAAN HARGA</h3>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4>
|
||||
<v-layout mb-1 row>
|
||||
<v-subheader>TARGET</v-subheader>
|
||||
</v-layout>
|
||||
<v-layout pl-3 mb-4 row>
|
||||
<v-flex>
|
||||
<span class="mono" style="color:red;font-size:14px;">{{target_company.M_CompanyName}}</span>
|
||||
[ <span class="mono" style="font-size:14px;">{{target_mou.M_MouName}}</span> ]
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout mb-1 row>
|
||||
<v-subheader>SUMBER</v-subheader>
|
||||
</v-layout>
|
||||
<v-layout pl-3 mb-1 row>
|
||||
<v-flex>
|
||||
<v-autocomplete
|
||||
label="Kelompok Pelanggan"
|
||||
v-model="selected_company"
|
||||
:items="companies"
|
||||
:search-input.sync="query_company"
|
||||
outline
|
||||
auto-select-first
|
||||
no-filter
|
||||
return-object
|
||||
hide-details
|
||||
clearable
|
||||
item-text="M_CompanyName"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Kel. Pelanggan"
|
||||
>
|
||||
<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-layout>
|
||||
<v-layout pl-3 mb-2 row>
|
||||
<v-flex>
|
||||
<v-select class="xs12" :items="mous"
|
||||
outline
|
||||
hide-details
|
||||
item-text="M_MouName"
|
||||
item-value="M_MouID"
|
||||
return-object
|
||||
v-model="selected_mou"
|
||||
label="Agreement"></v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout pl-3 mb-2 row>
|
||||
<v-flex>
|
||||
<div>
|
||||
<v-btn block @click="changeBtnFlagCopyAll(copyall)" v-if="copyall === 'N'" color="error">
|
||||
<v-icon left>close</v-icon> Gandakan semua sekaligus </v-btn>
|
||||
<v-btn block @click="changeBtnFlagCopyAll(copyall)" v-if="copyall === 'Y'" color="success">
|
||||
<v-icon left>check</v-icon> Gandakan semua sekaligus</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs8 pl-3>
|
||||
<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 v-slot:headers="props">
|
||||
<tr>
|
||||
<th style="width:20px" class= "text-xs-left blue-grey white--text">
|
||||
<v-checkbox style="padding-top:0;margin-top:0"
|
||||
hide-details
|
||||
color="white"
|
||||
:disabled="copyall === 'Y'"
|
||||
:indeterminate="indeterminatex"
|
||||
@change="changeCbxAll(bar_chx_all)"
|
||||
v-model="bar_chx_all"
|
||||
></v-checkbox>
|
||||
</th>
|
||||
<th
|
||||
v-for="header in props.headers"
|
||||
:key="header.text"
|
||||
:class="header.class"
|
||||
:width="header.width"
|
||||
>
|
||||
{{ header.text }}
|
||||
</th>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:items="props">
|
||||
<td style="width:20px" class="text-xs-left">
|
||||
<v-checkbox style="padding-top:0;margin-top:0"
|
||||
color="blue-grey"
|
||||
hide-details
|
||||
:disabled="copyall === 'Y'"
|
||||
v-model="props.item.chex"
|
||||
@change="checkTop()"
|
||||
></v-checkbox>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.Nat_JPAGroupName }} ( <span style="color:red">{{fixedDiscount(props.item.Nat_JpaGroupMaxPxDisc)}} %</span> )</td>
|
||||
<td class="text-xs-left pa-2">
|
||||
<v-text-field
|
||||
label="DISKON (%)"
|
||||
single-line
|
||||
:disabled="copyall === 'Y'"
|
||||
hide-details
|
||||
v-model="props.item.discount"
|
||||
></v-text-field>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</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-btn color="primary" dark @click="save">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-md-price-copy-list': httpVueLoader('./oneMdPriceCopyList.vue'),
|
||||
|
||||
},
|
||||
mounted(){
|
||||
this.$store.dispatch("price_copy/getjpagroups")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
indeterminatex:false,
|
||||
bar_chx_all:false,
|
||||
isLoading:false,
|
||||
headers: [
|
||||
{
|
||||
text: "GROUP",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "65%",
|
||||
class: "pa-2 blue-grey text-xs-left white--text"
|
||||
},
|
||||
{
|
||||
text: "DISKON",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "pa-2 blue-grey text-xs-left white--text"
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
copyall : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.copyall
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_copyall', v)
|
||||
}
|
||||
},
|
||||
is_loading () {
|
||||
return false
|
||||
},
|
||||
dialog : {
|
||||
get() { return this.$store.state.price_copy.dialog_copy },
|
||||
set(v) { this.$store.commit('price_copy/update_dialog_copy', v) }
|
||||
},
|
||||
target_company () {
|
||||
return this.$store.state.price.selected_company
|
||||
},
|
||||
target_mou () {
|
||||
return this.$store.state.price.selected_mou
|
||||
},
|
||||
query_company : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.query_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_query_company', v)
|
||||
}
|
||||
},
|
||||
companies : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.companies
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_companies', v)
|
||||
}
|
||||
},
|
||||
selected_company : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.selected_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_selected_company', v)
|
||||
//console.log(this.$store.state.price_copy.selected_company)
|
||||
//this.$store.commit('price_copy/update_mous', this.$store.state.price_copy.selected_company.mou)
|
||||
this.$store.commit('price_copy/update_selected_mou', {})
|
||||
}
|
||||
},
|
||||
mous : {
|
||||
get () {
|
||||
return this.selected_company.mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_mous', v)
|
||||
}
|
||||
},
|
||||
selected_mou : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.selected_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_selected_mou', v)
|
||||
}
|
||||
},
|
||||
xtransactions(){
|
||||
return this.$store.state.price_copy.jpagroups
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
changeBtnFlagCopyAll(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.copyall = newval
|
||||
},
|
||||
fixedDiscount(value){
|
||||
return +(parseFloat(value)).toFixed(2)
|
||||
},
|
||||
save () {
|
||||
var go_action = true
|
||||
var errors = []
|
||||
var transactions = this.$store.state.price_copy.jpagroups
|
||||
if(this.copyall === 'N' && (_.isEmpty(this.selected_company) || !this.selected_company)){
|
||||
errors.push("Main petak umpet sama orang utan, jangan lupa isi kelompok pelanggan")
|
||||
go_action = false
|
||||
}
|
||||
|
||||
|
||||
if(this.copyall === 'N' && (_.isEmpty(this.selected_mou) || !this.selected_mou )){
|
||||
go_action = false
|
||||
errors.push("Gal gadot jadi wonder women, jangan lupa isi agreement")
|
||||
}
|
||||
|
||||
|
||||
if(this.copyall === 'N' && (_.isEmpty(this.$store.state.price_copy.selected_transaction) || !this.$store.state.price_copy.selected_transaction )){
|
||||
errors.push("Diet nasi makan kentang, salah satu group harus dicentang")
|
||||
go_action = false
|
||||
}
|
||||
|
||||
transactions.forEach(function(entry,index) {
|
||||
if(parseFloat(entry.discount) > parseFloat(entry.Nat_JpaGroupMaxPxDisc)){
|
||||
go_action = false
|
||||
errors.push("Diskon "+entry.Nat_JPAGroupName+" melebihi dari ketetapan maksimal")
|
||||
}
|
||||
})
|
||||
// console.log(errors)
|
||||
if(go_action){
|
||||
var prm = {trx:this.$store.state.price_copy.jpagroups}
|
||||
prm.copyall = this.$store.state.price_copy.copyall
|
||||
this.$store.dispatch('price_copy/save_copy',prm)
|
||||
}
|
||||
else{
|
||||
this.$store.commit("price_copy/update_msg_info",errors.join('</br></br>'))
|
||||
this.$store.commit("price_copy/update_open_dialog_info",true)
|
||||
console.log('open '+this.open_dialog_info)
|
||||
}
|
||||
|
||||
},
|
||||
thr_search: _.debounce( function () {
|
||||
var prm = this.$store.state.price.selected_company
|
||||
this.$store.dispatch("price_copy/search_company",prm)
|
||||
|
||||
}, 700),
|
||||
checkTop(){
|
||||
var barcodes = this.xtransactions
|
||||
var selected = _.filter(barcodes, function(o) { return o.chex; })
|
||||
this.bar_chx_all = false
|
||||
this.indeterminatex = false
|
||||
if(selected.length > 0 && barcodes.length === selected.length){
|
||||
this.bar_chx_all = true
|
||||
this.indeterminatex = false
|
||||
|
||||
}
|
||||
if(selected.length > 0 && barcodes.length > selected.length){
|
||||
this.bar_chx_all = false
|
||||
this.indeterminatex = true
|
||||
|
||||
}
|
||||
this.$store.commit("price_copy/update_selected_transaction",selected)
|
||||
|
||||
},
|
||||
changeCbxAll(value){
|
||||
var arr = this.xtransactions
|
||||
this.indeterminatex = false
|
||||
this.btn_hide = true
|
||||
arr.forEach((el)=>{el.chex = value})
|
||||
var selected = _.filter(arr, function(o) { return o.chex; })
|
||||
this.$store.commit("price_copy/update_selected_transaction",selected)
|
||||
|
||||
},
|
||||
},
|
||||
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.price.search_status == 1 ) return
|
||||
// console.log("5-val:"+val)
|
||||
this.$store.commit("price_copy/update_query_company", val)
|
||||
this.thr_search()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
|
||||
|
||||
|
||||
<v-layout row>
|
||||
<v-flex xs3>
|
||||
<h5>Target Agreement</h5>
|
||||
<v-divider class="mt-1 mb-1"></v-divider>
|
||||
<h4 class="title">{{target_company.M_CompanyName}} > {{target_mou.M_MouName}}</h4>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs3>
|
||||
<h5 class="caption">Sumber Agreement</h5>
|
||||
<v-divider class="mt-1 mb-1"></v-divider>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<v-autocomplete
|
||||
label="Kelompok Pelanggan"
|
||||
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 Kel. Pelanggan"
|
||||
>
|
||||
<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-flex xs3>
|
||||
<v-select class="xs12" :items="mous"
|
||||
item-text="M_MouName"
|
||||
item-value="M_MouID"
|
||||
return-object
|
||||
v-model="selected_mou"
|
||||
label="Agreement"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<div>
|
||||
<v-btn @click="changeBtnFlagCopyAll(copyall)" v-if="copyall === 'N'" small color="error">
|
||||
<v-icon left>close</v-icon> Gandakan semua sekaligus </v-btn>
|
||||
<v-btn @click="changeBtnFlagCopyAll(copyall)" v-if="copyall === 'Y'" small color="success">
|
||||
<v-icon left>check</v-icon> Gandakan semua sekaligus</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
<!-- <v-btn class="xs3 ma-1" color="info" @click="set" >Baru</v-btn> -->
|
||||
</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 : {
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch("price_copy/getjpagroups")
|
||||
},
|
||||
|
||||
methods : {
|
||||
changeBtnFlagCopyAll(value) {
|
||||
var newval = (value === 'Y') ? 'N' : 'Y'
|
||||
this.copyall = newval
|
||||
},
|
||||
search_price() {
|
||||
return
|
||||
},
|
||||
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("price_copy/search_company")
|
||||
|
||||
}, 700),
|
||||
|
||||
one_money (x) {
|
||||
return window.one_money(x)
|
||||
},
|
||||
|
||||
copy_me (p) {
|
||||
this.selectMe(p)
|
||||
this.$store.dispatch('price_copy/save_copy')
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
copyall : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.copyall
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_copyall', v)
|
||||
}
|
||||
},
|
||||
query_company : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.query_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_query_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
search_mou : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.search_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_search_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
companies : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.companies
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_companies', v)
|
||||
}
|
||||
},
|
||||
|
||||
mous : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.mous
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_mous', v)
|
||||
}
|
||||
},
|
||||
jpagroups : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.jpagroups
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_jpagroups', v)
|
||||
}
|
||||
},
|
||||
selected_jpagroup : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.selected_jpagroup
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_selected_jpagroup', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.selected_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_selected_company', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_mou : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.selected_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_selected_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_mou : {
|
||||
get () {
|
||||
return this.$store.state.price_copy.query_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price_copy/update_query_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading () {
|
||||
return false
|
||||
},
|
||||
|
||||
is_loading () {
|
||||
return false
|
||||
},
|
||||
|
||||
dialog_confirm () {
|
||||
return this.$store.state.dialog_confirm
|
||||
},
|
||||
|
||||
target_disc : {
|
||||
get () { return this.$store.state.price_copy.target_disc },
|
||||
set (v) { this.$store.commit('price_copy/update_target_disc', v)}
|
||||
},
|
||||
|
||||
target_company () {
|
||||
return this.$store.state.price.selected_company
|
||||
},
|
||||
|
||||
target_mou () {
|
||||
return this.$store.state.price.selected_mou
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
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.price.search_status == 1 ) return
|
||||
// console.log("5-val:"+val)
|
||||
this.$store.commit("price_copy/update_query_company", val)
|
||||
this.thr_search()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-text-field class="xs6 ma-1"
|
||||
label=""
|
||||
placeholder="Pencarian"
|
||||
single-line
|
||||
outline
|
||||
v-model="query_mou"
|
||||
hide-details
|
||||
@keyup.native="keySearch"
|
||||
></v-text-field>
|
||||
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
label="Kelompok Pelanggan"
|
||||
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 Kel. Pelanggan"
|
||||
hide-details
|
||||
outline
|
||||
class="ma-1"
|
||||
>
|
||||
<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-autocomplete
|
||||
class="xs6 ma-1" :items="companies"
|
||||
item-text="M_CompanyName"
|
||||
item-value="M_CompanyID"
|
||||
return-object
|
||||
v-model="selected_company"
|
||||
label="Company" outline hide-details
|
||||
@change="search_mou"></v-autocomplete> -->
|
||||
<!-- <v-select class="xs6 ma-1" :items="companies"
|
||||
item-text="M_CompanyName"
|
||||
item-value="M_CompanyID"
|
||||
return-object
|
||||
v-model="selected_company"
|
||||
label="Company" outline hide-details
|
||||
@change="search_mou"></v-select> -->
|
||||
</v-flex>
|
||||
<v-flex xs3 pr-0 pa-1>
|
||||
<v-btn color="success" class="ma-0 one-btn-icon" fill-height @click="search_mou">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-btn class="xs3 ma-1" color="success" @click="search_mou" >Search</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="mous"
|
||||
: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.M_MouName }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_MouStartDate }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_MouEndDate }}</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-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
|
||||
</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;
|
||||
}
|
||||
|
||||
.one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue')
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
this.$store.dispatch("price/search_company")
|
||||
this.$store.dispatch("price_copy/getjpagroups")
|
||||
|
||||
var url_string = window.location.href
|
||||
var url = new URL(url_string);
|
||||
var id = url.searchParams.get("id");
|
||||
if (id) {
|
||||
this.$store.dispatch('price/search_single_company', id)
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
|
||||
isSelected(p) {
|
||||
let x = this.$store.state.price.selected_mou
|
||||
for(let i in x)
|
||||
if (p.M_MouID == x.M_MouID)
|
||||
return true
|
||||
return false
|
||||
},
|
||||
|
||||
search_mou() {
|
||||
this.$store.dispatch("price/search_mou")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
this.$store.commit('price/update_selected_mou', doc)
|
||||
this.$store.dispatch('price/search_price')
|
||||
},
|
||||
|
||||
keySearch(e) {
|
||||
if (e.which == 13) {
|
||||
this.search_mou()
|
||||
}
|
||||
},
|
||||
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("price/search_company")
|
||||
|
||||
}, 700)
|
||||
},
|
||||
|
||||
computed: {
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.price_copy.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("price_copy/update_open_dialog_info",val)
|
||||
}
|
||||
},
|
||||
msginfo(){
|
||||
return this.$store.state.price_copy.msg_info
|
||||
},
|
||||
companies : {
|
||||
get () {
|
||||
return this.$store.state.price.companies
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_companies', v)
|
||||
}
|
||||
},
|
||||
|
||||
mous : {
|
||||
get () {
|
||||
return this.$store.state.price.mous
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_mous', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_company : {
|
||||
get () {
|
||||
return this.$store.state.price.selected_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_selected_company', v)
|
||||
this.$store.dispatch('price/search_mou')
|
||||
}
|
||||
},
|
||||
|
||||
selected_mou : {
|
||||
get () {
|
||||
return this.$store.state.price.selected_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_selected_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_mou : {
|
||||
get () {
|
||||
return this.$store.state.price.query_mou
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_query_mou', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading () {
|
||||
return false
|
||||
},
|
||||
|
||||
is_loading () {
|
||||
return false
|
||||
},
|
||||
|
||||
query_company : {
|
||||
get () {
|
||||
return this.$store.state.price.query_company
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_query_company', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "START DATE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "END DATE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'M_MouName',
|
||||
totalItems: this.$store.state.price.total_mous
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
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.price.search_status == 1 ) return
|
||||
// console.log("5-val:"+val)
|
||||
this.$store.commit("price/update_query_company", val)
|
||||
this.thr_search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,96 @@
|
||||
<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 Jasa Lain</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0">
|
||||
<v-container grid-list-md pa-0>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field
|
||||
label="Nama item"
|
||||
v-model="new_addon_name"
|
||||
required
|
||||
>
|
||||
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
<small>*indicates required field</small>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialog = false">Close</v-btn>
|
||||
<v-btn color="blue darken-1" :dark="btn_save_enabled" @click="save_addon" :disabled="!btn_save_enabled">Save</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.v-input__append-outer {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () {
|
||||
return this.$store.state.price.dialog_addon_new
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_dialog_addon_new', v)
|
||||
}
|
||||
},
|
||||
|
||||
new_addon_name : {
|
||||
get () {
|
||||
return this.$store.state.price.new_addon_name
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_new_addon_name', v)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
is_loading () {
|
||||
return false
|
||||
},
|
||||
|
||||
btn_save_enabled () {
|
||||
if (this.new_addon_name == '')
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
save_addon : function() {
|
||||
this.$store.dispatch('price/save_addon')
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
|
||||
},
|
||||
|
||||
mounted () {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,422 @@
|
||||
<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 Harga</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0">
|
||||
<v-container grid-list-md pa-0>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs10 pr-3>
|
||||
<v-autocomplete v-show="!state_edit" label="Nama Test" v-model="selected_px" :items="pxs" :search-input.sync="query_px" auto-select-first
|
||||
no-filter return-object clearable item-text="T_TestName" :loading="is_loading" no-data-text="Pilih Test"
|
||||
ref="ref_px">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-text="item.description"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
|
||||
<v-text-field v-show="state_edit" label="Nama Test" readonly v-model="sel_T_TestName"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2>
|
||||
<v-checkbox v-model="new_price_cito" label="Cito ?" :readonly="state_edit"></v-checkbox>
|
||||
</v-flex>
|
||||
<!-- <v-flex xs6> </v-flex> -->
|
||||
<v-flex xs12 sm12 md12>
|
||||
<v-text-field v-model="new_price_amount" v-on:keyup="update_new_price_amount" solo label="" hide-details required reverse
|
||||
suffix="Harga"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-flex xs6> </v-flex> -->
|
||||
<v-flex xs6 sm6 md6>
|
||||
<v-text-field v-model="new_price_disc" v-on:keyup="update_new_price_disc" label="" hide-details required reverse solo suffix="Diskon (%)"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-flex xs6> </v-flex> -->
|
||||
<v-flex xs6 sm6 md6>
|
||||
<v-text-field v-model="new_price_discrp" v-on:keyup="update_new_price_discrp" label="" hide-details required reverse solo
|
||||
suffix="Diskon (Rp)"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-flex xs6> </v-flex> -->
|
||||
<v-flex xs12 sm12 md12>
|
||||
<v-text-field v-model="new_price_subtotal" readonly label="" hide-details required reverse solo suffix="Sub Total"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm12 md12 pt-2 pb-2>
|
||||
<v-divider></v-divider>
|
||||
</v-flex>
|
||||
|
||||
<!--<v-flex xs6>
|
||||
<v-select
|
||||
:items="addons"
|
||||
label="Item Tambahan"
|
||||
item-text="T_AddonName"
|
||||
item-value="T_AddonID"
|
||||
v-model="selected_addon"
|
||||
return-object
|
||||
class="mt-0"
|
||||
>
|
||||
<template v-slot:append-outer>
|
||||
|
||||
<v-btn icon flat color="blue" @click="add_other" :disabled="!selected_addon.T_AddonID" class="btn-outer"><v-icon>arrow_forward</v-icon></v-btn>
|
||||
</template>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-btn fab small color="green" dark class="ml-0 btn-outer-2" @click="new_addon"><v-icon dark>add</v-icon></v-btn>
|
||||
|
||||
|
||||
</template>
|
||||
</v-select>
|
||||
|
||||
|
||||
</v-flex>-->
|
||||
|
||||
|
||||
<!--<v-flex xs1> </v-flex>
|
||||
<v-flex xs5 sm5 md5>
|
||||
<v-layout column>
|
||||
<v-flex v-for="(o, i) in others" v-bind:key="i">
|
||||
<v-text-field v-model="o.price" :disabled="other_disabled(o)" v-on:keyup="update_other_price(i, o.price)" label="" hide-details required reverse solo :suffix="o.name">
|
||||
<template v-slot:append-outer>
|
||||
|
||||
<v-btn icon color="red" @click="remove_other(o)" flat class="ml-0 btn-outer"><v-icon>clear</v-icon></v-btn>
|
||||
</template>
|
||||
|
||||
</v-text-field>
|
||||
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>-->
|
||||
|
||||
<v-flex xs12 sm12 md12>
|
||||
<v-text-field ref="ref_total" v-model="new_price_total" readonly label="" hide-details required reverse solo suffix="Total"></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
</v-container>
|
||||
<small>*indicates required field</small>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialog = false">Tutup</v-btn>
|
||||
<v-btn color="blue darken-1" :dark="btn_save_enabled" @click="save_price" :disabled="!btn_save_enabled">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.v-input__append-outer {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.btn-outer,
|
||||
.btn-outer-2 {
|
||||
margin-top: -6px;
|
||||
/* border-radius: 5% !important; */
|
||||
}
|
||||
|
||||
.btn-outer-2 {
|
||||
margin-top: -10px;
|
||||
margin-right: -5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
// new_price_amount: this.$store.state.price.new_price.amount,
|
||||
// new_price_disc: this.$store.state.price.new_price.disc,
|
||||
// new_price_discrp: this.$store.state.price.new_price.discrp
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
computed: {
|
||||
state_edit() {
|
||||
return this.$store.state.price.edit_price
|
||||
},
|
||||
sel_T_TestName() {
|
||||
if (this.selected_px) return this.selected_px.T_TestName
|
||||
return ''
|
||||
},
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.price.dialog_px_new
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_dialog_px_new', v)
|
||||
}
|
||||
},
|
||||
|
||||
pxs() {
|
||||
return this.$store.state.price.pxs
|
||||
},
|
||||
|
||||
selected_px: {
|
||||
get() {
|
||||
return this.$store.state.price.selected_px
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_selected_px', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_px: {
|
||||
get() {
|
||||
return this.$store.state.price.query_px
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_query_px', v)
|
||||
}
|
||||
},
|
||||
|
||||
new_price: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price
|
||||
},
|
||||
set(v) {
|
||||
|
||||
this.$store.commit('price/update_new_price', v)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_amount: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.amount
|
||||
},
|
||||
set(v) {
|
||||
let x = this.$store.state.price.new_price
|
||||
x.amount = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_disc: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.disc
|
||||
},
|
||||
set(v) {
|
||||
let x = this.$store.state.price.new_price
|
||||
x.disc = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_discrp: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.discrp
|
||||
},
|
||||
set(v) {
|
||||
let x = this.$store.state.price.new_price
|
||||
x.discrp = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
new_price_subtotal: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.sub_total
|
||||
},
|
||||
set(v) {
|
||||
let x = this.new_price
|
||||
x.sub_total = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_total: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.total
|
||||
},
|
||||
set(v) {
|
||||
let x = this.new_price
|
||||
x.total = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_other: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.other
|
||||
},
|
||||
set(v) {
|
||||
let x = this.new_price
|
||||
x.other = v
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
}
|
||||
},
|
||||
|
||||
new_price_cito: {
|
||||
get() {
|
||||
return this.$store.state.price.new_price.cito == 'Y' ? true : false
|
||||
},
|
||||
set(v) {
|
||||
let x = this.new_price
|
||||
x.cito = v == true ? 'Y' : 'N'
|
||||
this.$store.commit('price/update_new_price', x)
|
||||
console.log('cito', v)
|
||||
this.$store.commit("price/update_pxs", {
|
||||
records: [],
|
||||
total: 0
|
||||
})
|
||||
//reset pencarian
|
||||
this.$store.commit("price/update_query_px", "")
|
||||
this.thr_search()
|
||||
}
|
||||
},
|
||||
|
||||
addons() {
|
||||
return this.$store.state.price.addons
|
||||
},
|
||||
|
||||
selected_addon: {
|
||||
get() {
|
||||
return this.$store.state.price.selected_addon
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_selected_addon', v)
|
||||
}
|
||||
},
|
||||
|
||||
others: {
|
||||
get() {
|
||||
return this.$store.state.price.others
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_others', {
|
||||
records: v,
|
||||
total: v.length
|
||||
})
|
||||
}
|
||||
},
|
||||
// new_price_amount : {
|
||||
// get () {
|
||||
// return this.$store.state.price.new_price.amount
|
||||
// },
|
||||
// set (v) {
|
||||
// let x = this.new_price
|
||||
// x.amount = v
|
||||
// this.new_price = x
|
||||
// }
|
||||
// },
|
||||
|
||||
is_loading() {
|
||||
return false
|
||||
},
|
||||
|
||||
btn_save_enabled() {
|
||||
if (!this.$store.state.price.selected_px.T_TestID)
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("price/search_px")
|
||||
}, 300),
|
||||
|
||||
update_new_price_amount: _.debounce(function () {
|
||||
this.update_new_price('amount')
|
||||
}, 500),
|
||||
update_new_price_disc: _.debounce(function () {
|
||||
this.update_new_price('disc')
|
||||
}, 500),
|
||||
update_new_price_discrp: _.debounce(function () {
|
||||
this.update_new_price('discrp')
|
||||
}, 500),
|
||||
|
||||
update_new_price(type) {
|
||||
let x = this.new_price
|
||||
if (type == 'amount')
|
||||
x.amount = this.new_price_amount
|
||||
if (type == 'disc')
|
||||
x.disc = this.new_price_disc
|
||||
if (type == 'discrp')
|
||||
x.discrp = this.new_price_discrp
|
||||
|
||||
this.new_price = x
|
||||
this.new_price_subtotal = Math.round(this.new_price_amount * (100 - parseFloat(this.new_price_disc))) / 100 -
|
||||
Math.round(this.new_price_discrp)
|
||||
this.new_price_total = this.new_price_subtotal + Math.round(this.new_price_other)
|
||||
},
|
||||
|
||||
update_other_price(idx, price) {
|
||||
try {
|
||||
this.$store.commit('price/update_other_price', {
|
||||
idx: idx,
|
||||
price: price
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e.message())
|
||||
}
|
||||
},
|
||||
|
||||
add_other() {
|
||||
this.$store.commit('price/add_other')
|
||||
},
|
||||
|
||||
remove_other(item) {
|
||||
// this.$refs.ref_px.$el.focus()
|
||||
|
||||
|
||||
this.$store.commit('price/remove_other', item)
|
||||
},
|
||||
|
||||
other_disabled(item) {
|
||||
if (item.disabled)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
new_addon() {
|
||||
this.$store.commit('price/update_dialog_addon_new', true)
|
||||
},
|
||||
|
||||
save_price() {
|
||||
let x = this.state_edit
|
||||
if (x == true)
|
||||
this.$store.dispatch('price/save_px', this.$store.state.price.selected_price.T_PriceID)
|
||||
else
|
||||
this.$store.dispatch('price/save_px')
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
query_px(val, old) {
|
||||
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
if (val == old) return
|
||||
if (this.$store.state.price.search_status == 1) return
|
||||
this.$store.commit("price/update_query_px", val)
|
||||
this.thr_search()
|
||||
|
||||
},
|
||||
|
||||
others(v, o) {
|
||||
console.log(v)
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch('price/search_addon')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<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"
|
||||
hide-actions
|
||||
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_PacketName }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_PacketType == 'PN' ? 'Panel' : 'Profile' }}</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)">{{ one_money(props.item.discrp) }}</td>
|
||||
<td class="text-xs-right pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ Math.round(props.item.discrp * 10000 / props.item.T_PacketOriginalPrice) / 100 }}</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_PacketPrice) }}</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<v-pagination
|
||||
v-model="curr_packet_page"
|
||||
:length="total_packet_page"
|
||||
:total-visible="10"
|
||||
@input="change_page"
|
||||
></v-pagination>
|
||||
</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:60px;
|
||||
}
|
||||
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
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods : {
|
||||
one_money (p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
isSelected(p) {
|
||||
return false
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
this.$store.commit('price/update_selected_packet', doc)
|
||||
},
|
||||
|
||||
change_page(x) {
|
||||
this.curr_packet_page = x
|
||||
this.$store.dispatch('price/search_packet')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
packets : {
|
||||
get () {
|
||||
return this.$store.state.price.packets
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_packets', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_packet : {
|
||||
get () {
|
||||
return this.$store.state.price.selected_packet
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('price/update_selected_packet', v)
|
||||
}
|
||||
},
|
||||
|
||||
total_packet () {
|
||||
return this.$store.state.price.total_packet
|
||||
},
|
||||
|
||||
total_packet_page () {
|
||||
return this.$store.state.price.total_packet_page
|
||||
},
|
||||
|
||||
curr_packet_page : {
|
||||
get () { return this.$store.state.price.curr_packet_page },
|
||||
set (v) { this.$store.commit('price/update_curr_packet_page', v) }
|
||||
},
|
||||
|
||||
isLoading () {
|
||||
return false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TIPE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
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: "DISKON",
|
||||
align: "right",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "DISKON (%)",
|
||||
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"
|
||||
}
|
||||
],
|
||||
pagination:{
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_TestName',
|
||||
totalItems: this.$store.state.price.total_mous
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,334 @@
|
||||
<template>
|
||||
<v-layout class="mb-2" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<!-- <v-text-field class="xs6 ma-1"
|
||||
label=""
|
||||
placeholder="Pencarian"
|
||||
single-line
|
||||
outline
|
||||
v-model="query_mou"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
|
||||
<v-select class="xs6 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 xs12>
|
||||
<v-text-field class="ma-1" label="" placeholder="Pencarian" single-line outline v-model="query_price" hide-details @keyup.native="keySearch"></v-text-field>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs5 pr-0 pa-1>
|
||||
<v-btn color="success" class="ma-0 one-btn-icon" fill-height @click="search_price">
|
||||
<span class="icon-search"></span>
|
||||
</v-btn>
|
||||
<!-- <v-btn class="ma-0 one-btn-icon" color="orange"
|
||||
:disabled="!btn_add_enabled || prices.length > 0 || selected_mou.M_MouIsVerified == 'Y'"
|
||||
:dark="!!btn_add_enabled && prices.length == 0 && selected_mou.M_MouIsVerified != 'Y'" @click="copy">
|
||||
<span class="icon-import"></span>
|
||||
</v-btn> -->
|
||||
<v-btn color="primary" class="ma-0 one-btn-icon" fill-height @click="add">
|
||||
<span class="icon-add"></span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
|
||||
<!-- <v-btn class="xs3 ma-1" color="success" @click="search_price" dark>Cari</v-btn> -->
|
||||
<!-- <v-btn class="xs3 ma-1" color="primary" @click="add" :disabled="!btn_add_enabled" :dark="btn_add_enabled" >Tambah</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="prices" :loading="isLoading" hide-actions 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),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">
|
||||
<span style="color:brown">{{props.item.T_TestSasCode}}</span> {{ props.item.T_TestName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">{{ one_money(props.item.T_PriceAmount) }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">{{ total_disc(props.item) }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">{{ props.item.T_PriceDisc }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">{{ one_money(props.item.T_PriceOther) }}</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">{{ one_money(props.item.T_PriceTotal) }}</td>
|
||||
<td class="text-xs-center pa-0" v-bind:class="{'amber lighten-4':isSelected(props.item),'red lighten-4': props.item.T_PriceIsCito === 'Y'}" @click="selectMe(props.item)">
|
||||
<v-btn icon @click="edit_price(props.item)" color="blue" :dark="props.item.M_MouIsVerified != 'Y'" class="ma-0" small>
|
||||
<v-icon small>create</v-icon>
|
||||
</v-btn>
|
||||
<!-- <v-btn icon @click="del_price(props.item)" color="red" :dark="props.item.M_MouIsVerified != 'Y'" class="ma-0" small><v-icon small>clear</v-icon></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-pagination v-model="curr_price_page" :length="total_price_page" :total-visible="10" @input="change_page"></v-pagination>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-md-price-new-dialog></one-md-price-new-dialog>
|
||||
<one-md-price-new-addon-dialog></one-md-price-new-addon-dialog>
|
||||
</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;
|
||||
}
|
||||
|
||||
.one-btn-icon {
|
||||
font-size: 1.5em
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
let ts = "?ts=" + moment().format('YYMMDDDHHmmss')
|
||||
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-md-price-new-dialog': httpVueLoader('./oneMdPriceNewDialog.vue' + ts),
|
||||
'one-md-price-new-addon-dialog': httpVueLoader('./oneMdPriceNewAddonDialog.vue' + ts)
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch("price/search_company")
|
||||
},
|
||||
|
||||
methods: {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
isSelected(p) {
|
||||
return false
|
||||
},
|
||||
|
||||
search_price() {
|
||||
console.log("yiiihaaa")
|
||||
this.$store.dispatch("price/search_price")
|
||||
},
|
||||
|
||||
selectMe(doc) {
|
||||
//console.log("apem")
|
||||
this.$store.commit('price/update_selected_price', doc)
|
||||
//this.search_price()
|
||||
},
|
||||
|
||||
add() {
|
||||
this.$store.commit('price/update_new_price', {
|
||||
amount: 0,
|
||||
disc: 0,
|
||||
discrp: 0,
|
||||
other: 0,
|
||||
sub_total: 0,
|
||||
total: 0,
|
||||
cito: 'N'
|
||||
})
|
||||
this.$store.commit('price/update_others', {
|
||||
records: [],
|
||||
total: 0
|
||||
})
|
||||
this.$store.commit('price/update_selected_px', {})
|
||||
|
||||
this.$store.commit('price/update_edit_price', false)
|
||||
this.$store.commit('price/update_dialog_px_new', true)
|
||||
},
|
||||
|
||||
edit_price(data) {
|
||||
|
||||
this.$store.commit('price/update_others', {
|
||||
records: data.others,
|
||||
total: data.others.length
|
||||
})
|
||||
this.$store.commit('price/update_new_price', {
|
||||
amount: data.T_PriceAmount,
|
||||
disc: data.T_PriceDisc,
|
||||
discrp: data.T_PriceDiscRp,
|
||||
other: data.T_PriceOther,
|
||||
sub_total: data.T_PriceSubTotal,
|
||||
total: data.T_PriceTotal,
|
||||
cito: data.T_PriceIsCito
|
||||
})
|
||||
this.$store.commit('price/update_selected_px', data.px)
|
||||
this.$store.commit('price/update_edit_price', true)
|
||||
this.$store.commit('price/update_dialog_px_new', true)
|
||||
},
|
||||
|
||||
del_price(data) {
|
||||
this.$store.dispatch('price/del_price', data.T_PriceID)
|
||||
},
|
||||
|
||||
total_disc(data) {
|
||||
return this.one_money(data.T_PriceAmount - data.T_PriceSubTotal)
|
||||
},
|
||||
|
||||
change_page(x) {
|
||||
this.curr_price_page = x
|
||||
this.$store.dispatch('price/search_price')
|
||||
},
|
||||
|
||||
keySearch(e) {
|
||||
if (e.which == 13) {
|
||||
this.search_price()
|
||||
}
|
||||
},
|
||||
|
||||
copy() {
|
||||
this.$store.commit('price_copy/update_dialog_copy', true)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
prices: {
|
||||
get() {
|
||||
return this.$store.state.price.prices
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_prices', v)
|
||||
}
|
||||
},
|
||||
|
||||
selected_price: {
|
||||
get() {
|
||||
return this.$store.state.price.selected_price
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_selected_price', v)
|
||||
}
|
||||
},
|
||||
|
||||
total_price() {
|
||||
return this.$store.state.price.total_price
|
||||
},
|
||||
|
||||
total_price_page() {
|
||||
return this.$store.state.price.total_price_page
|
||||
},
|
||||
|
||||
curr_price_page: {
|
||||
get() {
|
||||
return this.$store.state.price.curr_price_page
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_curr_price_page', v)
|
||||
}
|
||||
},
|
||||
|
||||
query_price: {
|
||||
get() {
|
||||
return this.$store.state.price.query_price
|
||||
},
|
||||
set(v) {
|
||||
this.$store.commit('price/update_query_price', v)
|
||||
}
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return false
|
||||
},
|
||||
|
||||
btn_add_enabled() {
|
||||
if (this.$store.state.price.selected_mou.M_MouID)
|
||||
return true
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
selected_mou() {
|
||||
return this.$store.state.price.selected_mou
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "25%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARGA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "DISKON",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "DISKON(%)",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "LAIN - LAIN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TOTAL",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ACTION",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_TestName',
|
||||
totalItems: this.$store.state.price.total_mous
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user