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,707 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalert}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card class="scroll-container" style="/*max-height:645px;overflow: auto;*/">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>PERUSAHAAN</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormPerusahaan()" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :color="color" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{msgsnackbar}}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<div v-for="(vs,index) in vcompanys">
<v-layout pa-2 v-if="isSelected(vs)" row>
<v-flex xs12 @click="selectMe(vs)">
<v-layout row>
<v-flex class="boxsolid" xs10>
<v-tooltip right>
<template v-slot:activator="{ on }">
<span v-html="vs.description" v-on="on"></span>
</template>
<span>{{vs.name}}</span>
</v-tooltip>
</v-flex>
<v-flex class="boxsolid text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
<v-layout row align-center justify-space-between>
<v-icon style="color:#ffffff" @click="editPerusahaan(vs)">edit</v-icon>
<v-icon style="color:#ffffff" @click="deletePerusahaan(vs)">clear</v-icon>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout pa-2 v-if="!isSelected(vs)" row>
<v-flex xs12 @click="selectMe(vs)">
<v-layout row>
<v-flex class="boxoutline" xs10>
<v-tooltip right>
<template v-slot:activator="{ on }">
<span v-html="vs.description" v-on="on"></span>
</template>
<span>{{vs.name}}</span>
</v-tooltip>
</v-flex>
<v-flex class="boxoutline text-center" style="padding-top:10px" pl-1 pb-1 pr-1 xs2>
<v-layout row align-center justify-space-between>
<v-icon style="color:red" @click="editPerusahaan(vs)">edit</v-icon>
<v-icon style="color:red" @click="deletePerusahaan(vs)">clear</v-icon>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-divider></v-divider>
</div>
<v-layout row>
<v-flex class="text-xs-center" pt-3 xs12>
<p style="margin-bottom:2px;color: rgba(0,0,0,0.54);font-size:12px;">Menampilkan <span class="red--text">{{xtotalfiltercompanys}}</span> dari <span class="red--text">{{xtotalcompanys}}</span> total data</p>
<v-btn small v-if="xshowall === 'N'" flat @click="updateShowAll('Y')" color="primary" dark>Tampilkan Semua</v-btn>
<v-btn small v-if="xshowall === 'Y'" flat @click="updateShowAll('N')" color="primary" dark>Batasi data</v-btn>
</v-flex>
</v-layout>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogcompany" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Form Perusahaan</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formcompany" v-model="valid" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="companyname" label="Nama Perusahaan" :rules="nameRules" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-layout>
<v-flex xs7 pa-1>
<v-select item-text="M_CompanyTypeName" :disabled="readonlytypecompany" return-object :items="xcompanytypes" v-model="xcompanytype"
label="Tipe Perusahaan"></v-select>
</v-flex>
<v-flex xs5 pa-1>
<v-text-field :disabled="readonlytypecompanynew" v-model="companytypenew" label="Tipe Perusahaan Baru"></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-autocomplete label="Dokter" v-model="doctor" :items="xdoctors" :search-input.sync="search_doctor" auto-select-first no-filter
item-text="M_DoctorNames" return-object :loading="isLoading" no-data-text="Pilih Dokter">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_DoctorNames"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<v-autocomplete label="Kota" v-model="cityaddress" :items="xcities" :search-input.sync="search_city" auto-select-first no-filter
item-text="M_CityName" return-object :loading="isLoading" no-data-text="Pilih Kota">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
label="Kecamatan*"
></v-select>
</v-flex>
<v-flex xs12>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
label="Kelurahan / Desa*"
></v-select>
</v-flex>
<v-flex xs12>
<v-text-field v-model="companyaddress" label="Alamat Perusahaan" :rules="addressRules" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field v-model="companyphone" label="Telpon Perusahaan"></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field v-model="companyemail" label="Email Perusahaan"></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field v-model="companypic" label="PIC Perusahaan"></v-text-field>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="islabfrom" label="Rekanan Yang Merujuk?"></v-checkbox>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="islabto" label="Rekanan Tujuan ?"></v-checkbox>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormPerusahaan()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data: () => ({
color: "success",
valid: false,
companyname: '',
companytypenew: '',
companyaddress: '',
companyphone: '',
companyemail: '',
companypic: '',
companymindp: '',
search_city: '',
search_doctor: '',
nameRules: [
v => !!v || 'Nama Perusahaan harus diisi'
],
addressRules: [
v => !!v || 'Alamat Perusahaan harus diisi'
],
dialogdeletealert: false,
msgalert: "",
xid: 0,
xsearch: "",
islabfrom: "",
islabto: "",
isnewcompanytype: false,
readonlytypecompany: false,
readonlytypecompanynew: false
}),
mounted() {
this.$store.dispatch("company/lookup", {
search: this.xsearch,
all: this.xshowall
})
this.$store.dispatch("company/selectcompanytype")
},
computed: {
xact() {
return this.$store.state.company.act
},
xerrors() {
return this.$store.state.company.errors
},
xshowall() {
return this.$store.state.company.show_all
},
vcompanys() {
return this.$store.state.company.companys
},
xtotalcompanys() {
return this.$store.state.company.total_companys
},
xtotalfiltercompanys() {
return this.$store.state.company.total_filter_companys
},
dialogcompany() {
return this.$store.state.company.dialog_form_company
},
snackbar: {
get() {
return this.$store.state.company.alert_success
},
set(val) {
this.$store.commit("company/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.company.msg_success
},
lookupstatus() {
return this.$store.state.company.lookup_company
},
xcompanytypes() {
return this.$store.state.company.companytypes
},
xcompanytype: {
get() {
return this.$store.state.company.companytype
},
set(val) {
this.$store.commit("company/update_companytype", val)
}
},
isLoading() {
return this.$store.state.company.search_status == 1
},
xcities() {
return this.$store.state.company.cities
},
cityaddress: {
get() {
return this.$store.state.company.city_address
},
set(val) {
this.$store.commit("company/update_city_address", val)
this.$store.dispatch("company/getdistrict", this.$store.state.company.city_address)
}
},
xdoctors() {
return this.$store.state.company.doctors
},
doctor: {
get() {
return this.$store.state.company.doctor
},
set(val) {
this.$store.commit("company/update_doctor", val)
}
},
xdistricts(){
return this.$store.state.company.districts
},
districtaddress:{
get() {
return this.$store.state.company.district_address
},
set(val) {
this.$store.commit("company/update_district_address",val)
this.$store.dispatch("company/getkelurahan",this.$store.state.company.district_address)
}
},
xkelurahans(){
return this.$store.state.company.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.company.kelurahan_address
},
set(val) {
this.$store.commit("company/update_kelurahan_address",val)
}
}
},
methods: {
updateShowAll(val) {
this.$store.commit("company/update_show_all", val)
this.$store.dispatch("company/lookup", {
search: this.xsearch,
all: this.xshowall
})
},
isSelected(p) {
return p.id == this.$store.state.company.selected_company.id
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
selectMe(sc) {
this.$store.commit("company/update_selected_company", sc)
this.$store.dispatch("mou/lookup", {
id: this.$store.state.company.selected_company.id
})
},
updateDialogFormPerusahaan() {
this.$store.commit("company/update_dialog_form_company", false)
},
openFormPerusahaan() {
this.search_city = ''
this.$store.commit("company/update_cities", [])
this.cityaddress = {}
this.search_doctor = ''
this.$store.commit("company/update_doctors", [])
this.doctor = {}
this.$store.commit("company/update_districts",[])
this.districtaddress = {}
this.$store.commit("company/update_kelurahans",[])
this.kelurahanaddress = {}
this.companytypenew = ""
this.$refs.formcompany.reset()
this.$refs.formcompany.resetValidation()
this.$store.commit("company/update_act", 'new')
this.$store.commit("company/update_dialog_form_company", true)
},
thr_search_city: _.debounce(function () {
this.$store.dispatch("company/searchcity", this.search_city)
}, 2000),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("company/searchdoctor", this.search_doctor)
}, 2000),
saveFormPerusahaan() {
if (this.$refs.formcompany.validate()) {
var newcompanytype = this.companytypenew
if ((_.isEmpty(this.companytypenew))) {
this.$store.dispatch("company/save", {
name: this.companyname,
address: this.companyaddress,
city: this.cityaddress.M_CityID,
doctor: this.doctor.M_DoctorID,
district: this.districtaddress.M_DistrictID,
kelurahan : this.kelurahanaddress.M_KelurahanID,
phone: this.companyphone,
email: this.companyemail,
pic: this.companypic,
companytypenew: this.companytypenew,
companytype: this.xcompanytype.M_CompanyTypeID,
islabfrom: this.islabfrom === true ? "Y" : "N",
islabto: this.islabto === true ? "Y" : "N"
})
} else {
this.$store.dispatch("company/save", {
name: this.companyname,
address: this.companyaddress,
city: this.cityaddress.M_CityID,
doctor: this.doctor.M_DoctorID,
district: this.districtaddress.M_DistrictID,
kelurahan : this.kelurahanaddress.M_KelurahanID,
phone: this.companyphone,
email: this.companyemail,
pic: this.companypic,
companytypenew: this.companytypenew,
companytype: 0,
islabfrom: this.islabfrom === true ? "Y" : "N",
islabto: this.islabto === true ? "Y" : "N"
})
}
}
},
updateFormPerusahaan() {
if (this.$refs.formcompany.validate()) {
var newcompanytype = this.companytypenew
if (newcompanytype == "") {
this.$store.dispatch("company/update", {
id: this.xid,
name: this.companyname,
city: this.cityaddress.M_CityID,
doctor: this.doctor.M_DoctorID,
district: this.districtaddress.M_DistrictID,
kelurahan : this.kelurahanaddress.M_KelurahanID,
address: this.companyaddress,
phone: this.companyphone,
email: this.companyemail,
pic: this.companypic,
companytypenew: this.companytypenew,
companytype: this.xcompanytype.M_CompanyTypeID,
islabfrom: this.islabfrom === true ? "Y" : "N",
islabto: this.islabto === true ? "Y" : "N"
})
} else {
this.$store.dispatch("company/update", {
id: this.xid,
name: this.companyname,
city: this.cityaddress.M_CityID,
doctor: this.doctor.M_DoctorID,
district: this.districtaddress.M_DistrictID,
kelurahan: this.kelurahanaddress.M_KelurahanID,
address: this.companyaddress,
phone: this.companyphone,
email: this.companyemail,
pic: this.companypic,
companytypenew: this.companytypenew,
companytype: 0,
islabfrom: this.islabfrom === true ? "Y" : "N",
islabto: this.islabto === true ? "Y" : "N"
})
}
}
},
updateAlert_success(val) {
this.$store.commit("company/update_alert_success", val)
},
editPerusahaan(data) {
this.xid = data.id
this.companyname = data.name
this.$store.commit("company/update_cities", [{
M_CityID: data.M_CityID,
M_CityName: data.M_CityName
}])
this.cityaddress = {
M_CityID: data.M_CityID,
M_CityName: data.M_CityName
}
this.$store.commit("company/update_doctors", [{
M_DoctorID: data.M_DoctorID,
M_DoctorNames: data.M_DoctorNames
}])
this.doctor = {
M_DoctorID: data.M_DoctorID,
M_DoctorNames: data.M_DoctorNames
}
this.$store.commit("company/update_districts", [{
M_DistrictID: data.M_DistrictID,
M_DistrictName: data.M_DistrictName
}])
this.districtaddress = {
M_DistrictID: data.M_DistrictID,
M_DistrictName: data.M_DistrictName
}
this.$store.commit("company/update_kelurahans", [{
M_KelurahanID: data.M_KelurahanID,
M_KelurahanName: data.M_KelurahanName
}])
this.kelurahanaddress = {
M_KelurahanID: data.M_KelurahanID,
M_KelurahanName: data.M_KelurahanName
}
this.companyaddress = data.address
this.companyphone = data.phone
this.companyemail = data.email
this.companypic = data.pic
this.companytypenew = ""
this.islabfrom = data.islabfrom === 'N' ? false : true
this.islabto = data.islabto === 'N' ? false : true
this.$store.commit("company/update_act", 'edit')
this.$store.commit("company/update_dialog_form_company", true)
var companytypes = this.$store.state.company.companytypes
var idx_companytype = _.findIndex(companytypes, function (o) {
return o.M_CompanyTypeID == data.companytypeid
})
var companytype = companytypes[idx_companytype]
this.$store.commit("company/update_companytype", companytype)
},
deletePerusahaan(data) {
this.xid = data.id
var xdata = {
id: data.id,
name: data.name,
mous: 'xxx'
}
this.$store.commit("company/update_selected_company", xdata)
this.msgalert = "Yakin, mau hapus company " + data.name + " ?"
this.dialogdeletealert = true
},
changeNewCompanyType(value) {
this.readonlytypecompany = value === true ? true : false
this.readonlytypecompanynew = value === true ? false : true
},
newCompanyType() {
readonlytypecompany: true
readonlytypecompanynew: false
},
closeDeleteAlert() {
this.$store.dispatch("company/delete", {
companyid: this.$store.state.company.selected_company.id,
companyname: this.$store.state.company.selected_company.name
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("company/lookup", {
search: this.xsearch,
all: this.xshowall
})
}, 1000)
},
watch: {
xsearch(val, old) {
if (val !== old && this.lookupstatus !== 1) {
console.log(val)
this.xsearch = val
this.thr_search()
}
},
search_city(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.company.update_autocomplete_status == 1) return
this.thr_search_city()
},
search_doctor(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.company.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>

View File

@@ -0,0 +1,600 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>Agreement Perusahaan : {{xcompany.name}}</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormMou(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row wrap>
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
<table>
<tr>
<th width="10%" class="text-md-center pt-2 pb-2">NO.</th>
<th width="15%" class="text-md-center pt-2 pb-2">NAMA</th>
<th width="10%" class="text-md-center pt-2 pb-2">TGL MULAI</th>
<th width="10%" class="text-md-center pt-2 pb-2">TGL AKHIR</th>
<th width="10%" class="text-md-center pt-2 pb-2">DASAR</th>
<th width="10%" class="text-md-center pt-2 pb-2">KLASIFIKASI OMZET</th>
<th width="10%" class="text-md-center pt-2 pb-2">TIPE</th>
<th width="15%" class="text-md-center pt-2 pb-2">VERIFIKASI</th>
<th width="15%" class="text-md-center pt-2 pb-2">RILIS</th>
<th class="text-md-center pt-2 pb-2">AKSI</th>
</tr>
<tr v-if="mous.length > 0 " v-for="(mou,idx) in mous">
<td class="text-md-left pl-3">{{mou.number}}</td>
<td class="text-md-left pl-3">{{mou.name}}</td>
<td class="text-md-center">{{mou.startdate}}</td>
<td class="text-md-center">{{mou.enddate}}</td>
<td class="text-md-center">{{mou.basename}}</td>
<td class="text-md-center">{{mou.M_OmzetTypeName}}</td>
<td class="text-md-center">{{mou.M_MouTypeName}}</td>
<td class="text-md-center">{{mou.verify}}</td>
<td class="text-md-center">{{mou.released}}</td>
<td align="center" class="text-md-center">
<v-btn @click="editFormMou(mou)" depressed small color="primary">
<v-icon>edit</v-icon>
</v-btn>
<v-btn @click="deleteMou(mou)" depressed small color="error">
<v-icon>delete</v-icon>
</v-btn>
<v-btn v-if="mou.isverified == 'N'" @click="verifyMou(mou)" depressed small color="success">
<v-icon>check</v-icon>
</v-btn>
<v-btn v-if="mou.isverified == 'Y' && mou.isreleased == 'N'" @click="releaseMou(mou)" depressed small color="primary">
<v-icon>check</v-icon>
</v-btn>
</td>
</tr>
<tr v-if="mous.length === 0">
<td align="center" style="height:50px;text-align:center" colspan="11">Belum ada data</td>
</tr>
</table>
</v-flex>
</v-layout>
<template>
<v-dialog v-model="dialogdeletealertmou" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertmou}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertmou = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertMou()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<template>
<v-dialog v-model="dialogverifyalertmou" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Konfirmasi
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertmou}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogverifyalertmou = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeVerifyAlertMou()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<template>
<v-dialog v-model="dialogreleasealertmou" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Konfirmasi
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertmou}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogreleasealertmou = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeReleaseAlertMou()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogmou" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Form Agreement</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formcompanymou" v-model="validmou" lazy-validation>
<v-layout wrap>
<v-flex xs12>
PERUSAHAAN : {{xcompany.name}} <span> &nbsp;[ <span style="color:#2196F3;font-weight: 900;">{{number}} </span> &nbsp;]
</v-flex>
<v-flex xs12>
<v-text-field label="Nama" v-model="name"></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field label="No Ref" v-model="refnumber"></v-text-field>
</v-flex>
<v-flex xs12>
<v-layout>
<v-flex xs6 pa-1>
<v-menu ref="menustartdate" v-model="menustartdate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
offset-y full-width max-width="290px" min-width="290px">
<template v-slot:activator="{ on }">
<v-text-field v-model="startComputedDateFormatted" label="Tgl. Mulai" readonly v-on="on" @blur="date = deFormatedDate(startComputedDateFormatted)"></v-text-field>
</template>
<v-date-picker v-model="xstartdate" no-title @input="menustartdate = false"></v-date-picker>
</v-flex>
<v-flex xs6 pa-1>
<v-menu ref="menuenddate" v-model="menuenddate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
offset-y full-width max-width="290px" min-width="290px">
<template v-slot:activator="{ on }">
<v-text-field v-model="endComputedDateFormatted" label="Tgl. Selesai" readonly v-on="on" @blur="date = deFormatedDate(endComputedDateFormatted)"></v-text-field>
</template>
<v-date-picker v-model="xenddate" no-title @input="menuenddate = false"></v-date-picker>
</v-flex>
</v-layout>
<v-flex xs12>
<v-select item-text="basename" return-object :items="xbases" v-model="xbase" label="Dasar Agreement"></v-select>
</v-flex>
<v-flex xs12>
<v-select item-text="M_OmzetTypeName" return-object :items="xomzettypes" v-model="xomzettype" label="Klasifikasi Omset"></v-select>
</v-flex>
<v-flex xs12>
<v-select item-text="M_MouTypeName" return-object :items="xmoutypes" v-model="xmoutype" label="Tipe Agreement"></v-select>
</v-flex>
<v-flex xs12>
<v-layout>
<v-flex xs6 pa-1>
<v-checkbox v-model="isbill" label="Bill ?"></v-checkbox>
</v-flex>
<v-flex xs6 pa-1>
<v-text-field label="Min DP (Persen)" v-model="mindp"></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-layout>
<v-flex xs6 pa-1>
<v-checkbox v-model="isaging" label="Aging on Hold ?"></v-checkbox>
</v-flex>
<v-flex xs6 pa-1>
<v-text-field label="Keterangan Aging on Hold" v-model="agingnote"></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="isdefault" label="Default ?"></v-checkbox>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormMou()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormMou()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
background: white;
border: 0px;
}
th,
td {
border: 1px solid black;
border-collapse: collapse;
padding-top: 2px;
padding-bottom: 2px;
}
table>tr>td {
padding: 8px;
}
table>tr>td:first {
padding-left: 15px !important;
}
</style>
<script>
module.exports = {
components: {
'one-date-picker': httpVueLoader('../../common/oneDatePicker.vue')
},
data() {
return {
query: "",
items: [],
headers: [{
text: "NAME",
align: "Center",
sortable: false,
value: "lab",
width: "30%",
class: "blue lighten-4"
},
{
text: "STARTDATE",
align: "Center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-4"
},
{
text: "ENDDATE",
align: "Center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-4"
},
{
text: "ISBILL",
align: "Center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-4"
},
{
text: "Action",
align: "Center",
sortable: false,
value: "status",
width: "15%",
class: "blue lighten-4"
}
],
isLoading: false,
color: "success",
validmou: false,
xid: 0,
name: "",
number: "",
refnumber: "",
mindp: "",
agingnote: "",
startdate: "",
enddate: "",
isbill: "",
isdefault: "",
isaging: "",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertmou: false,
dialogverifyalertmou: false,
dialogreleasealertmou: false,
msgalertmou: ""
};
},
mounted() {
this.$store.dispatch("mou/selectbase")
this.$store.dispatch("mou/selectomzettype")
this.$store.dispatch("mou/selectmoutype")
},
computed: {
mous() {
return this.$store.state.mou.mous
},
xcompany() {
return this.$store.state.company.selected_company
},
dialogmou() {
return this.$store.state.mou.dialog_form_mou
},
xerrors() {
return this.$store.state.mou.errors
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.mou.startdate
},
set(val) {
this.$store.commit("mou/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.mou.enddate
},
set(val) {
this.$store.commit("mou/update_enddate", val)
}
},
xbases() {
return this.$store.state.mou.bases
},
xbase: {
get() {
return this.$store.state.mou.base
},
set(val) {
this.$store.commit("mou/update_base", val)
}
},
xomzettypes() {
return this.$store.state.mou.omzettypes
},
xomzettype: {
get() {
return this.$store.state.mou.omzettype
},
set(val) {
this.$store.commit("mou/update_omzettype", val)
}
},
xmoutypes() {
return this.$store.state.mou.moutypes
},
xmoutype: {
get() {
return this.$store.state.mou.moutype
},
set(val) {
this.$store.commit("mou/update_moutype", val)
}
}
},
methods: {
updateDialogFormMou() {
this.$store.commit("mou/update_dialog_form_mou", false)
},
openFormMou(val) {
this.xid = val
this.name = ''
this.number = ''
this.refnumber = ''
this.startdate = ''
this.enddate = ''
this.isbill = ''
this.isdefault = ''
this.isaging = ''
this.mindp = ''
this.agingnote = ''
this.$store.commit("mou/update_dialog_form_mou", true)
},
editFormMou(val) {
// this.$store.commit("mou/update_error_name", false)
this.xid = val.id
this.name = val.name
this.number = val.number
this.refnumber = val.refnumber
this.startdate = val.xstartdate
this.enddate = val.xenddate
this.isbill = val.isbill === 'N' ? false : true
this.isdefault = val.isdefault === 'N' ? false : true
this.isaging = val.isaging === 'N' ? false : true
this.mindp = val.mindp
this.agingnote = val.agingnote
var bases = this.$store.state.mou.bases
var idx_base = _.findIndex(bases, function (o) {
return o.baseid == val.baseid
})
var base = bases[idx_base]
this.$store.commit("mou/update_base", base)
var omzettypes = this.$store.state.mou.omzettypes
var idx_omzettype = _.findIndex(omzettypes, function (o) {
return o.M_OmzetTypeID == val.M_OmzetTypeID
})
var omzettype = omzettypes[idx_omzettype]
this.$store.commit("mou/update_omzettype", omzettype)
var moutypes = this.$store.state.mou.moutypes
var idx_moutype = _.findIndex(moutypes, function (o) {
return o.M_MouTypeID == val.M_MouTypeID
})
var moutype = moutypes[idx_moutype]
this.$store.commit("mou/update_moutype", moutype)
this.$store.commit("mou/update_dialog_form_mou", true)
this.$store.commit("mou/update_startdate", val.M_MouStartDate)
this.$store.commit("mou/update_enddate", val.M_MouEndDate)
},
saveFormMou() {
this.$store.dispatch("mou/save", {
xid: this.xid,
companyid: this.$store.state.company.selected_company.id,
companyname: this.$store.state.company.selected_company.name,
name: this.name,
startdate: this.xstartdate,
enddate: this.xenddate,
isbill: this.isbill === true ? "Y" : "N",
isdefault: this.isdefault === true ? "Y" : "N",
isaging: this.isaging === true ? "Y" : "N",
number: this.number,
refnumber: this.refnumber,
mindp: this.mindp,
agingnote: this.agingnote,
base: this.xbase.baseid,
omzettype: this.xomzettype.M_OmzetTypeID,
moutype: this.xmoutype.M_MouTypeID
})
},
set_date2(x) {
this.startdate = x.new_date
},
set_date3(x) {
this.enddate = x.new_date
},
formatDate(date) {
if (!date) return null
const [year, month, day] = date.split('-')
return `${day}-${month}-${year}`
},
deFormatedDate(date) {
if (!date) return null
const [day, month, year] = date.split('-')
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
},
updateAlert_success(val) {
this.$store.commit("company/update_alert_success", val)
},
deleteMou(data) {
this.xid = data.id
this.msgalertmou = "Yakin, mau hapus agreement ini?"
this.dialogdeletealertmou = true
},
closeDeleteAlertMou() {
this.$store.dispatch("mou/delete", {
xid: this.xid,
companyid: this.$store.state.company.selected_company.id,
companyname: this.$store.state.company.selected_company.name,
name: this.name
})
this.dialogdeletealertmou = false
},
verifyMou(data) {
this.xid = data.id
this.msgalertmou = "Apakah Anda yakin akan mem-verifikasi agreement ini?"
this.dialogverifyalertmou = true
},
closeVerifyAlertMou() {
this.$store.dispatch("mou/verify", {
xid: this.xid,
companyid: this.$store.state.company.selected_company.id,
companyname: this.$store.state.company.selected_company.name,
name: this.name
})
this.dialogverifyalertmou = false
},
releaseMou(data) {
this.xid = data.id
this.msgalertmou = "Apakah Anda yakin akan merilis agreement ini?"
this.dialogreleasealertmou = true
},
closeReleaseAlertMou() {
this.$store.dispatch("mou/release", {
xid: this.xid,
companyid: this.$store.state.company.selected_company.id,
companyname: this.$store.state.company.selected_company.name,
name: this.name
})
this.dialogreleasealertmou = false
}
}
}
</script>

View File

@@ -0,0 +1,294 @@
<template>
<v-layout >
<v-flex xs12 >
<v-card class="mb-2" color="white" >
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>Bahan : {{xbahan.name}}</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormSampletype(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row wrap>
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
<table>
<tr>
<th width="25%" class="text-md-center pt-2 pb-2">KODE</th>
<th width="35%" class="text-md-center pt-2 pb-2">NAMA</th>
<th width="15%" class="text-md-center pt-2 pb-2">SUFFIX</th>
<th class="text-md-center pt-2 pb-2">AKSI</th>
</tr>
<tr v-if="sampletypes.length > 0 " v-for="(sampletype,idx) in sampletypes">
<td class="text-md-left pl-3">{{sampletype.code}}</td>
<td class="text-md-center">{{sampletype.name}}</td>
<td class="text-md-center">{{sampletype.suffix}}</td>
<td align="center" class="text-md-center">
<v-btn @click="editFormSampletype(sampletype)" depressed small color="primary"><v-icon>edit</v-icon></v-btn>
<v-btn @click="deleteSampletype(sampletype)" depressed small color="error"><v-icon>delete</v-icon></v-btn>
</td>
</tr>
<tr v-if="sampletypes.length === 0"><td align="center" style="height:50px;text-align:center" colspan="8">Belum ada data</td> </tr>
</table>
</v-flex>
</v-layout>
<template>
<v-dialog
v-model="dialogdeletealertsampletype"
max-width="30%"
>
<v-card>
<v-card-title
class="headline grey lighten-2 pt-2 pb-2"
primary-title
>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertsampletype}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="primary"
flat
@click="dialogdeletealertsampletype = false"
>
Tutup
</v-btn>
<v-btn
color="primary"
flat
@click="closeDeleteAlertSampletype()"
>
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogsampletype" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Form Sampletype</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form
ref="formbahansampletype"
v-model="validsampletype"
lazy-validation
>
<v-layout wrap>
<v-flex xs12>
BAHAN : {{xbahan.name}}
</v-flex>
<v-flex xs12>
<v-text-field
label="Kode"
v-model="code"
></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field
label="Nama"
v-model="name"
></v-text-field>
</v-flex>
<v-flex xs12>
<v-text-field
label="Suffix"
v-model="suffix"
></v-text-field>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormSampletype()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormSampletype()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:60px;
}
.searchbox .v-btn {
min-height:60px;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
background:white;
border: 0px;
}
th, td {
border: 1px solid black;
border-collapse: collapse;
padding-top: 2px;
padding-bottom: 2px;
}
table>tr>td {
padding: 8px;
}
table>tr>td:first {
padding-left:15px!important;
}
</style>
<script>
module.exports = {
data() {
return {
query: "",
items: [],
headers: [
{
text: "KODE",
align: "Center",
sortable: false,
value: "mr",
width: "30%",
class: " blue lighten-4"
},
{
text: "NAME",
align: "Center",
sortable: false,
value: "lab",
width: "30%",
class: "blue lighten-4"
},
{
text: "SUFFIX",
align: "Center",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-4"
},
{
text: "Action",
align: "Center",
sortable: false,
value: "status",
width: "15%",
class: "blue lighten-4"
}
],
isLoading: false,
color:"success",
validsampletype:false,
xid:0,
code:"",
name:"",
suffix:"",
dialogdeletealertsampletype:false,
msgalertsampletype:""
};
},
computed: {
sampletypes() {
return this.$store.state.sampletype.sampletypes
},
xbahan(){
return this.$store.state.bahan.selected_bahan
},
dialogsampletype(){
return this.$store.state.sampletype.dialog_form_sampletype
},
xerrors() {
return this.$store.state.sampletype.errors
}
},
methods : {
updateDialogFormSampletype(){
this.$store.commit("sampletype/update_dialog_form_sampletype",false)
},
openFormSampletype(val){
this.xid = val
this.code = ''
this.name = ''
this.suffix = ''
this.$store.commit("sampletype/update_dialog_form_sampletype",true)
},
editFormSampletype(val){
this.$store.commit("sampletype/update_error_code",false)
this.$store.commit("sampletype/update_error_name",false)
this.xid = val.id
this.code = val.code
this.name = val.name
this.suffix = val.suffix
this.$store.commit("sampletype/update_dialog_form_sampletype",true)
},
saveFormSampletype(){
this.$store.dispatch("sampletype/save",{
xid:this.xid,
bahanid:this.$store.state.bahan.selected_bahan.id,
bahanname:this.$store.state.bahan.selected_bahan.name,
code:this.code,
name:this.name,
suffix:this.suffix
})
},
updateAlert_success(val){
this.$store.commit("bahan/update_alert_success",val)
},
deleteSampletype(data){
this.xid = data.id
this.msgalertsampletype = "Yakin, mau hapus sampletype ?"
this.dialogdeletealertsampletype = true
},
closeDeleteAlertSampletype(){
this.$store.dispatch("sampletype/delete",{
xid:this.xid,
bahanid:this.$store.state.bahan.selected_bahan.id,
bahanname:this.$store.state.bahan.selected_bahan.name,
name:this.name
})
this.dialogdeletealertsampletype = false
}
}
}
</script>