Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,289 @@
const URL = "/one-api/v1/masterdata/";
export async function search_company(token, search) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_company', {
token:token,
search:search
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getjpagroups(token) {
try {
var resp = await axios.post(URL + 'priceeditadmin/getjpagroups', {
token:token
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_company_2(prm) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_company_2',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_single_company(token, id) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_single_company', {
token:token,
id:id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function copy_price(prm) {
try {
var resp = await axios.post(URL + 'priceeditadmin/copy_price',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_mou(token, company, query) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_mou', {
token:token,
company_id: company,
search: query
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_price(token, mou, query, page) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_price', {
token:token,
mou_id: mou,
search: query,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function del_price(token, id) {
try {
var resp = await axios.post(URL + 'priceeditadmin/del_price', {
token:token,
id: id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_px(token, query, mou_id, cito) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_px', {
token:token,
search: query,
cito: cito,
mou_id: mou_id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save_px(token, datax, datay) {
try {
var resp = await axios.post(URL + 'priceeditadmin/save_px', {
token:token,
data: datax,
data_others: datay
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_addon(token, query) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_addon', {
token:token,
search: query
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save_addon(token, name) {
try {
var resp = await axios.post(URL + 'priceeditadmin/save_addon', {
token:token,
name: name
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_price_packet(token, mou, query, page) {
try {
var resp = await axios.post(URL + 'priceeditadmin/search_price_packet', {
token:token,
mou_id: mou,
search: query,
page: page
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -0,0 +1,425 @@
<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.T_TestSasCode"></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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>

View File

@@ -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>

View File

@@ -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)}" @click="selectMe(props.item)">
<span style="color:brown">{{props.item.T_TestSasCode}}</span>
{{ props.item.T_TestName }}
<span v-if="props.item.T_PriceIsCito=='Y'" style="color:red">[cito]</span>
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @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)}" @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)}" @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)}" @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)}" @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)}" @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>

View File

@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs6 class="left" fill-height pa-1>
<one-md-price-mou-list></one-md-price-mou-list>
</v-flex>
<v-flex xs6 class="right" fill-height pa-1>
<one-md-price-px-list></one-md-price-px-list>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
<one-md-price-copy-dialog></one-md-price-copy-dialog>
</v-app>
</div>
<!-- Vendor -->
<script src="../../libs/vendor/moment.min.js"></script>
<script src="../../libs/vendor/numeral.min.js"></script>
<script src="../../libs/vendor/moment-locale-id.js"></script>
<script src="../../libs/vendor/lodash.js"></script>
<script src="../../libs/vendor/axios.min.js"></script>
<script src="../../libs/vendor/vue.js"></script>
<script src="../../libs/vendor/vuex.js"></script>
<script src="../../libs/vendor/vuetify.js"></script>
<script src="../../libs/vendor/httpVueLoader.js"></script>
<script src="../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-md-price-mou-list': httpVueLoader('./components/oneMdPriceMouList.vue'),
'one-md-price-px-list': httpVueLoader('./components/oneMdPricePxList.vue'),
'one-md-price-packet-list': httpVueLoader('./components/oneMdPricePacketList.vue'),
'one-md-price-copy-dialog': httpVueLoader('./components/oneMdPriceCopyDialog.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,487 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/price.js"
export default {
namespaced: true,
state: {
search_status: 0,
search_error_message: '',
companies: [],
selected_company: {},
total_company: 0,
query_company:'',
query_mou: '',
mous: [],
selected_mou: {},
total_mou: 0,
query_price: '',
prices: [],
selected_price: {},
total_price: 0,
total_price_page: 0,
curr_price_page: 1,
new_price: {amount:0, disc:0, discrp:0, sub_total:0, other:0, total:0, cito:'N'},
edit_price: false,
packets: [],
selected_packet: {},
total_packet: 0,
total_packet_page: 0,
curr_packet_page: 1,
query_px: '',
pxs: [],
selected_px: {},
total_px: 0,
query_addon: '',
addons: [],
selected_addon: {},
total_addon: 0,
new_addon_name: '',
// others: [{id:1, name:'Jasa Dokter', price:10000}, {id:2, name:'Lain - lain', price:5000}],
others: [],
selected_other: {},
total_other: 0,
dialog_px_new: false,
dialog_addon_new: false
},
mutations: {
update_search_error_message(state, patient) {
state.search_error_message = patient
},
// MOU
update_query_mou(state, q) {
state.query_mou = q
},
update_mous(state, d) {
state.mous = d.records
state.total_mou = d.total
},
update_selected_mou(state, d) {
state.selected_mou = d
},
// COMPANY
update_companies(state, d) {
state.companies = d.records
state.total_company = d.total
},
update_selected_company(state, d) {
state.selected_company = d
},
update_query_company(state, q) {
state.query_company = q
},
// PRICE
update_query_price(state, q) {
state.query_price = q
},
update_prices(state, d) {
state.prices = d.records
state.total_price = d.total
state.total_price_page = d.total_page
},
update_curr_price_page(state, data) {
state.curr_price_page = data
},
update_selected_price(state, d) {
state.selected_price = d
},
update_new_price(state, d) {
state.new_price = d
},
update_edit_price(state, d) {
state.edit_price = d
},
// PX
update_query_px(state, q) {
state.query_px = q
},
update_pxs(state, d) {
state.pxs = d.records
state.total_px = d.total
},
update_selected_px(state, d) {
state.selected_px = d
},
// ADDON
update_addons(state, d) {
state.addons = d.records
state.total_addon = d.total
},
update_selected_addon(state, d) {
state.selected_addon = d
},
// OTHER
update_others(state, d) {
state.others = d.records
state.total_other = d.total
},
update_selected_other(state, d) {
state.selected_other = d
},
add_other(state) {
let x = state.selected_addon
let y = state.others
y.push({id:x.T_AddonID, name:x.T_AddonName, price:0})
state.others = y
},
remove_other(state, item) {
// console.log('np')
// console.log(state.new_price)
let x = state.others
for (let i in x)
if (x[i].id == item.id)
{
x.splice(i, 1)
// x[i].disabled = true
let y = state.new_price
// console.log('y1')
// console.log(y)
y.other = Math.round(y.other) - Math.round(item.price)
y.total = Math.round(y.sub_total) + Math.round(y.other)
state.new_price = y
}
state.others = x
},
update_other_price(state, d) {
let x = state.others
x[d.idx].price = d.price
state.others = x
let y = state.new_price
y.other = 0
for (let i in state.others)
y.other = Math.round(y.other) + Math.round(state.others[i].price)
y.total = Math.round(y.sub_total) + Math.round(y.other)
state.new_price = y
},
update_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_dialog_px_new(state, val) {
state.dialog_px_new = val
},
update_dialog_addon_new(state, val) {
state.dialog_addon_new = val
},
update_new_addon_name(state, val) {
state.new_addon_name = val
},
// PACKET
update_packets(state, d) {
state.packets = d.records
state.total_packet = d.total
state.total_packet_page = d.total_page
},
update_curr_packet_page(state, data) {
state.curr_packet_page = data
},
update_selected_packet(state, d) {
state.selected_packet = d
}
},
actions: {
async search_company(context) {
try {
let resp = await api.search_company(one_token(), context.state.query_company)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_companies", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_mou(context) {
try {
let resp = await api.search_mou(one_token(), context.state.selected_company.M_CompanyID, context.state.query_mou)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_mous", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_price(context) {
try {
let resp = await api.search_price(one_token(), context.state.selected_mou.M_MouID, context.state.query_price, context.state.curr_price_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_prices", data)
context.dispatch("search_price_packet")
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async del_price(context, id) {
try {
let resp = await api.del_price(one_token(), id)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
context.dispatch('search_price')
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_px(context) {
try {
let mou_id = context.state.selected_mou.M_MouID;
let cito = context.state.new_price.cito
let resp = await api.search_px(one_token(), context.state.query_px,mou_id,cito)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_pxs", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async save_px(context, price_id) {
try {
let c = context.state.new_price
let data = {
test_id: context.state.selected_px.T_TestID,
mou_id: context.state.selected_mou.M_MouID,
price: c.amount,
disc: c.disc,
disc_rp: c.discrp,
other: c.other,
sub_total: c.sub_total,
total: c.total,
cito: c.cito
}
if (price_id) data.id = price_id
let resp = await api.save_px(one_token(), JSON.stringify(data), JSON.stringify(context.state.others))
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
context.dispatch("search_price")
context.commit("update_dialog_px_new", false)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_addon(context) {
try {
let resp = await api.search_addon(one_token(), context.state.query_adddon)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_addons", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async save_addon(context) {
try {
let resp = await api.save_addon(one_token(), context.state.new_addon_name)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
// let data = {
// records: resp.data.records,
// total: resp.data.total
// }
context.dispatch("search_addon")
context.commit('update_dialog_addon_new', false)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_single_company(context, id) {
try {
let resp = await api.search_single_company(one_token(), id)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_query_company", data.records[0].M_CompanyName)
context.commit("update_companies", data.records)
context.commit("update_selected_company", data.records[0])
context.commit('update_mous', {records:data.records[0].mou, total:1})
context.commit('update_selected_mou', data.records[0].mou[0])
context.commit('update_query_mou', data.records[0].mou[0].M_MouName)
context.dispatch('search_price')
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_price_packet(context) {
try {
let resp = await api.search_price_packet(one_token(), context.state.selected_mou.M_MouID, context.state.query_price, context.state.curr_packet_page)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_page: resp.data.total_page
}
context.commit("update_packets", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
}
}
}

View File

@@ -0,0 +1,241 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/price.js"
export default {
namespaced: true,
state: {
search_status: 0,
search_error_message: '',
query_company: '',
companies: [],
selected_company: {},
total_company: 0,
default_company: {},
query_mou: '',
mous: [],
selected_mou: null,
total_mou: 0,
default_mou: {},
dialog_copy: false,
target_disc: 0,
jpagroups:[],
selected_jpagroup:{},
selected_transaction:{},
open_dialog_info:false,
msg_info:'',
copyall:'N'
},
mutations: {
update_copyall(state, value){
state.copyall = value
},
update_open_dialog_info(state, value){
state.open_dialog_info = value
},
update_msg_info(state, value){
state.msg_info = value
},
update_selected_transaction(state, value){
state.selected_transaction = value
},
update_jpagroups(state, value) {
state.jpagroups = value
},
update_selected_jpagroup(state, value) {
state.selected_jpagroup = value
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
// MOU
update_query_mou(state, q) {
state.query_mou = q
},
update_mous(state, d) {
state.mous = d.records
state.total_mou = d.total
},
update_selected_mou(state, d) {
state.selected_mou = d
},
// COMPANY
update_query_company(state, q) {
state.query_company = q
},
update_companies(state, d) {
state.companies = d.records
state.total_company = d.total
},
update_selected_company(state, d) {
state.selected_company = d
// update mous
if (d) {
state.mous = d.mou
state.selected_mou = {}
state.total_mou = d.mou.length
} else {
state.mous = []
state.selected_mou = {}
state.total_mou = 0
}
},
update_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_dialog_copy(state, val) {
state.dialog_copy = val
},
update_target_disc(state, val) {
state.target_disc = val
}
},
actions: {
async search_company(context,prm) {
try {
prm.token = one_token()
prm.query = context.state.query_company
let resp = await api.search_company_2(prm)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_companies", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_mou(context) {
try {
let resp = await api.search_mou(one_token(), context.state.selected_company.M_CompanyID, context.state.query_mou)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_mous", data)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async search_price(context) {
try {
let resp = await api.search_price(one_token(), context.state.selected_mou.M_MouID, context.rootState.packet.selected_price.T_priceType, context.state.query_price, true)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_prices", data)
// Auto selected after save
if (context.state.auto_selected_price_id) {
for(let i in data.records)
if (data.records[i].T_priceID == context.state.auto_selected_price_id)
context.commit('update_selected_price', data.records[i])
}
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async save_copy(context,prm) {
try {
prm.company_target_id = context.rootState.price.selected_company.M_CompanyID
prm.target_id = context.rootState.price.selected_mou.M_MouID
prm.source_id = context.state.selected_mou.M_MouID
prm.token = one_token()
let resp = await api.copy_price(prm)
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
context.dispatch('price/search_price', null, {root:true})
context.commit('update_dialog_copy', false)
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
async getjpagroups(context) {
try {
let resp = await api.getjpagroups(one_token())
if (resp.status != "OK") {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_status", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_jpagroups", data.records)
context.commit("update_selected_jpagroup", data.records[0])
}
} catch (e) {
context.commit("update_search_status", 3)
context.commit("update_search_error_message", e.message)
}
},
}
}

View File

@@ -0,0 +1,29 @@
// State
// data ...
// Mutations
//
//
// Actions
import price from "./modules/price.js";
import price_copy from "./modules/price_copy.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
price: price,
price_copy: price_copy,
system: system
},
state: {
tab_selected: 'pasien-dokter'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});