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,77 @@
<template>
<v-menu
v-model="menu2"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<v-text-field
slot="activator"
v-model="computedDateFormatted"
:label=init_label
hint="MM/DD/YYYY format"
persistent-hint
readonly
browser-autocomplete="off"
></v-text-field>
<v-date-picker v-model="init_date" no-title @input="menu2 = false" :max="init_max_date"></v-date-picker>
</v-menu>
</template>
<script>
module.exports = {
props : ['label', 'date', 'data', 'max_date'],
data () {
return {
init_date: this.date && this.date != "0000-00-00" ? this.date : null, //new Date().toISOString().substr(0, 10),
init_max_date: this.max_date ? this.max_date : '2999-09-09',
dateFormatted: this.formatDate(new Date().toISOString().substr(0, 10)),
menu1: false,
menu2: false,
init_label: this.label ? this.label : 'Date',
init_data: this.data ? this.data : ''
}
},
computed: {
computedDateFormatted () {
return this.formatDate(this.init_date)
}
},
watch: {
init_date (n, o) {
this.dateFormatted = this.formatDate(this.init_date)
this.$emit('change', {"old_date":o, "new_date":n, "data":this.init_data});
}
},
methods: {
formatDate (date) {
if (!date) { return null }
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
parseDate (date) {
if (!date) return null
const [month, day, year] = date.split('/')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
emitChange (n, o) {
console.log("old:"+o)
console.log("new:"+n)
}
}
}
</script>

View File

@@ -0,0 +1,188 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout >
<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-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>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components : {
},
mounted() {
this.$store.dispatch("priceref/search_company")
},
methods : {
isSelected(p) {
return false
},
search_mou() {
this.$store.dispatch("priceref/search_mou")
},
selectMe(doc) {
this.$store.commit('priceref/update_selected_mou', doc)
this.$store.dispatch('priceref/search_price')
}
},
computed: {
companies : {
get () {
return this.$store.state.priceref.companies
},
set (v) {
this.$store.commit('priceref/update_companies', v)
}
},
mous : {
get () {
return this.$store.state.priceref.mous
},
set (v) {
this.$store.commit('priceref/update_mous', v)
}
},
selected_company : {
get () {
return this.$store.state.priceref.selected_company
},
set (v) {
this.$store.commit('priceref/update_selected_company', v)
}
},
selected_mou : {
get () {
return this.$store.state.priceref.selected_mou
},
set (v) {
this.$store.commit('priceref/update_selected_mou', v)
}
},
query_mou : {
get () {
return this.$store.state.priceref.query_mou
},
set (v) {
this.$store.commit('priceref/update_query_mou', 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: "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.priceref.total_mous
}
};
}
}
</script>

View File

@@ -0,0 +1,261 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline" v-show="!state_edit">Tambah Data Harga Rujukan</span>
<span class="headline" v-show="state_edit">Ubah Data Harga Rujukan</span>
</v-card-title>
<v-card-text class="pt-0">
<v-container grid-list-md pa-0>
<v-layout row wrap>
<v-flex xs12 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_TestCode"></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="selected_px.T_TestName"></v-text-field>
</v-flex>
<!-- <v-flex xs6>&nbsp;</v-flex> -->
<v-flex xs12 sm12 md12>
<v-text-field v-model="new_price_amount" solo label="" hide-details required reverse suffix="Harga"></v-text-field>
</v-flex>
<v-flex xs6 pr-3>
<one-date-picker
label="Start Date"
:date="init_start_date"
@change="startDateChange"
v-if="refresh_date"
></one-date-picker>
</v-flex>
<v-flex xs6 pl-3>
<one-date-picker
label="End Date"
:date="init_end_date"
@change="endDateChange"
v-if="refresh_date"
></one-date-picker>
</v-flex>
<v-flex xs12 sm12 md12 pt-2 pb-2><v-divider></v-divider></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 = {
components : {
'one-date-picker': httpVueLoader('./oneDatePicker.vue')
},
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.priceref.edit_price
},
dialog : {
get () {
return this.$store.state.priceref.dialog_px_new
},
set (v) {
this.$store.commit('priceref/update_dialog_px_new', v)
}
},
pxs () {
return this.$store.state.priceref.pxs
},
selected_px : {
get () {
return this.$store.state.priceref.selected_px
},
set (v) {
this.$store.commit('priceref/update_selected_px', v)
}
},
query_px : {
get () {
return this.$store.state.priceref.query_px
},
set (v) {
this.$store.commit('priceref/update_query_px', v)
}
},
new_price : {
get () {
return this.$store.state.priceref.new_price
},
set (v) {
this.$store.commit('priceref/update_new_price', v)
}
},
new_price_amount : {
get () {
return this.$store.state.priceref.new_price.amount
},
set (v) {
let x = this.$store.state.priceref.new_price
x.amount = v
this.$store.commit('priceref/update_new_price', x)
}
},
is_loading () {
return false
},
btn_save_enabled () {
if (!this.$store.state.priceref.selected_px.T_TestID)
return false
return true
},
init_start_date () {
if (this.$store.state.priceref.edit_price)
return this.$store.state.priceref.selected_price.T_PriceRefStartDate
else
return ''
},
init_end_date () {
if (this.$store.state.priceref.edit_price)
return this.$store.state.priceref.selected_price.T_PriceRefEndDate
else
return null
},
refresh_date : {
get () {
return this.$store.state.priceref.refresh_date
},
set (v) {
this.$store.commit('priceref/update_refresh_date', v)
}
}
},
methods : {
thr_search: _.debounce( function () {
this.$store.dispatch("priceref/search_px")
}, 700),
save_price () {
let x = this.state_edit
if (x == true)
this.$store.dispatch('priceref/save_px', this.$store.state.priceref.selected_price.T_PriceRefID)
else
this.$store.dispatch('priceref/save_px')
},
startDateChange (prm) {
let x = this.$store.state.priceref.new_price
x.start_date = prm.new_date
this.$store.commit('priceref/update_new_price', x)
},
endDateChange (prm) {
let x = this.$store.state.priceref.new_price
x.end_date = prm.new_date
this.$store.commit('priceref/update_new_price', x)
}
},
watch : {
query_px(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.priceref.search_status == 1 ) return
console.log("5-val:"+val)
this.$store.commit("priceref/update_query_px", val)
this.thr_search()
},
others (v, o) {
console.log(v)
}
},
mounted () {
this.$store.dispatch('priceref/search_addon')
}
}
</script>

View File

@@ -0,0 +1,249 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout >
<!-- <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-text-field class="xs6 ma-1"
label=""
placeholder="Pencarian"
single-line
outline
v-model="query_price"
hide-details
></v-text-field>
<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"
:pagination.sync="pagination"
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestName }}</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_PriceRefAmount) }}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn icon @click="edit_price(props.item)" color="blue" dark class="ma-0"><v-icon>create</v-icon></v-btn>
<v-btn icon @click="del_price(props.item)" color="red" dark class="ma-0"><v-icon>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-flex>
</v-layout>
</v-card>
<one-md-price-ref-new-dialog></one-md-price-ref-new-dialog>
<one-dialog-confirm :data="selected_price" v-if="refresh_confirm" @confirm="confirm_delete"></one-dialog-confirm>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table.v-table tbody td,table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components : {
'one-md-price-ref-new-dialog': httpVueLoader('./oneMdPriceRefNewDialog.vue'),
'one-dialog-confirm': httpVueLoader('../../common/oneDialogConfirm.vue')
},
mounted() {
// this.$store.dispatch("priceref/search_company")
},
methods : {
one_money (p) {
return window.one_money(p)
},
isSelected(p) {
return false
},
search_price() {
this.$store.dispatch("priceref/search_price")
},
selectMe(doc) {
this.$store.commit('priceref/update_selected_price', doc)
},
add() {
this.$store.commit('priceref/update_refresh_date', false)
this.$store.commit('priceref/update_new_price', { amount: 0 })
this.$store.commit('priceref/update_selected_px', {})
this.$store.commit('priceref/update_edit_price', false)
this.$store.commit('priceref/update_dialog_px_new', true)
var x = this
setTimeout(function() {
x.$store.commit('priceref/update_refresh_date', true)
delete x
}, 100)
},
edit_price(data) {
this.$store.commit('priceref/update_refresh_date', false)
// this.$store.commit('priceref/update_others', {records:data.others, total:data.others.length})
this.$store.commit('priceref/update_new_price', {
amount: data.T_PriceRefAmount,
start_date: data.T_PriceRefStartDate,
end_date: data.T_PriceRefEndDate
})
this.$store.commit('priceref/update_selected_price', data)
this.$store.commit('priceref/update_selected_px', data.px)
this.$store.commit('priceref/update_edit_price', true)
this.$store.commit('priceref/update_dialog_px_new', true)
var x = this
setTimeout(function() {
x.$store.commit('priceref/update_refresh_date', true)
delete x
}, 100)
},
del_price(data) {
this.refresh_confirm = false
this.$store.commit('update_dialog_confirm', true)
var x = this
setTimeout(function() {
x.refresh_confirm = true
}, 100)
},
confirm_delete(data) {
this.$store.dispatch('priceref/del_price', data.data.T_PriceRefID)
}
},
computed: {
prices : {
get () {
return this.$store.state.priceref.prices
},
set (v) {
this.$store.commit('priceref/update_prices', v)
}
},
selected_price : {
get () {
return this.$store.state.priceref.selected_price
},
set (v) {
this.$store.commit('priceref/update_selected_price', v)
}
},
query_price : {
get () {
return this.$store.state.priceref.query_price
},
set (v) {
this.$store.commit('priceref/update_query_price', v)
}
},
isLoading () {
return false
},
btn_add_enabled () {
if (this.$store.state.priceref.selected_mou.M_MouID)
return true
return false
}
},
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: "ACTION",
align: "center",
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.priceref.total_price
},
refresh_confirm : false
};
}
}
</script>