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,397 @@
<template>
<v-layout v-if="xact !== 'new'" column >
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
<v-card>
<v-card-title
dark
class="headline error pt-2 pb-2"
primary-title
style="color:white"
>
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdeleteaddr}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogformaddress" persistent max-width="650">
<v-card>
<v-card-title>
<span class="headline">Form Alamat Dokter</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4 pa-1>
<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>
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
label="Kecamatan*"
></v-select>
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
label="Kelurahan / Desa*"
></v-select>
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-textarea
box
label="Alamat Lengkap"
v-model="descriptionaddress"
></v-textarea>
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> ALAMAT DOKTER
<v-flex text-md-right>
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-data-table
:headers="headers"
:items="xaddresses"
:loading="isLoading"
hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressDescription}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_city:'',
oldlabel:'',
headers: [
{
text: "AKSI",
align: "center",
sortable: false,
value: "action",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "LABEL",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALAMAT",
align: "left",
sortable: false,
value: "lab",
width: "40%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
dialogconfirmationdeleteaddr:{
get() {
return this.$store.state.doctor.dialog_confirmation_delete_addr
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",val)
}
},
msgconfirmationdeleteaddr(){
return this.$store.state.doctor.msg_confirmation_delete_addr
},
xact() {
return this.$store.state.doctor.act
},
xactaddr() {
return this.$store.state.doctor.act_addr
},
dialogformaddress:{
get() {
return this.$store.state.doctor.dialog_form_address
},
set(val) {
this.$store.commit("doctor/update_dialog_form_address",val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xaddresses(p) {
return this.$store.state.doctor.addresses
},
xcities(){
return this.$store.state.doctor.cities
},
labeladdress:{
get() {
return this.$store.state.doctor.label_address
},
set(val) {
this.$store.commit("doctor/update_label_address",val)
}
},
cityaddress:{
get() {
return this.$store.state.doctor.city_address
},
set(val) {
this.$store.commit("doctor/update_city_address",val)
this.$store.dispatch("doctor/getdistrict",this.$store.state.doctor.city_address)
}
},
xdistricts(){
return this.$store.state.doctor.districts
},
districtaddress:{
get() {
return this.$store.state.doctor.district_address
},
set(val) {
this.$store.commit("doctor/update_district_address",val)
this.$store.dispatch("doctor/getkelurahan",this.$store.state.doctor.district_address)
}
},
xkelurahans(){
return this.$store.state.doctor.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.doctor.kelurahan_address
},
set(val) {
this.$store.commit("doctor/update_kelurahan_address",val)
}
},
descriptionaddress:{
get() {
return this.$store.state.doctor.description_address
},
set(val) {
this.$store.commit("doctor/update_description_address",val)
}
},
},
methods : {
createNewAddress(){
this.$store.commit("doctor/update_act_addr",'new')
this.search_city = ''
this.labeladdress = ''
this.$store.commit("doctor/update_cities",[])
this.cityaddress = {}
this.$store.commit("doctor/update_districts",[])
this.districtaddress = {}
this.$store.commit("doctor/update_kelurahans",[])
this.kelurahanaddress = {}
this.descriptionaddress = ''
this.$store.commit("doctor/update_dialog_form_address",true)
},
thr_search_city: _.debounce( function () {
this.$store.dispatch("doctor/searchcity",this.search_city)
},2000),
checkError(value){
var errors = this.$store.state.doctor.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
saveNewAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/savenewaddress",prm)
}
},
editAddress(value){
this.$store.commit("doctor/update_act_addr",'edit')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.labeladdress = value.M_DoctorAddressNote
this.oldlabel = value.M_DoctorAddressNote
this.$store.commit("doctor/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
this.$store.commit("doctor/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
this.$store.commit("doctor/update_kelurahans",[{M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
this.kelurahanaddress = {M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
this.descriptionaddress = value.M_DoctorAddressDescription
this.$store.commit("doctor/update_dialog_form_address",true)
},
saveEditAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
errors.push("readonlyutama")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/saveeditaddress",prm)
}
},
deleteAddress(value){
this.$store.commit("doctor/update_act_addr",'delete')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.$store.commit("doctor/update_errors",[])
this.oldlabel = value.M_DoctorAddressNote
var errors = this.$store.state.doctor.errors
if(value.M_DoctorAddressNote.toLowerCase() === 'utama'){
errors.push("deleteutama")
}
var msg = ''
if(errors.includes("deleteutama")){
msg = "Biarkan yang utama tetap ada"
}
else{
msg = "Yakin, akan menghapus data alamat dokter "+value.M_DoctorAddressNote+" ?"
}
this.$store.commit("doctor/update_msg_confirmation_delete_addr",msg)
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",true)
},
doDeleteAddr(){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.oldlabel
this.$store.dispatch("doctor/deleteaddress",prm)
}
},
watch: {
search_city(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.doctor.update_autocomplete_status == 1 ) return
this.thr_search_city()
}
}
}
</script>

View File

@@ -0,0 +1,460 @@
<template>
<v-layout class="mb-2" column >
<v-dialog v-model="dialogconfirmationdelete" persistent max-width="290">
<v-card>
<v-card-title
dark
class="headline error pt-2 pb-2"
primary-title
style="color:white"
>
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdelete}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteData()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2">
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> TUGAS DADAKAN
<v-flex text-md-right>
<v-btn v-if="xact === 'edit'" @click="deleteData()" small color="error">Hapus</v-btn>
<v-btn v-if="xact === 'new'" @click="saveData()" small color="primary">Simpan</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-layout row>
<v-flex xs4 pa-1>
<v-menu class="pr-2"
v-model="menufilterdatestart"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
class="mt-1"
v-model="filterComputedDateFormattedStart"
label="Tanggal*"
hide-details
v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
></v-text-field>
</template>
<v-date-picker v-model="xtransactiondate" no-title @input="menufilterdatestart = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs2 pa-1>
<v-text-field placeholder="hh:mm" hide-details v-model="xtime" label="Jam*"></v-text-field>
</v-flex>
<v-flex xs6 pa-1>
<v-text-field v-model="xtasklabel" label="Label Tugas*"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<p v-if="checkError('requiredate')" class="error pl-2 pr-2" style="color:#fff">Format penulisan "dd-mm-yyyy", contoh : 22-06-1988</p>
<p v-if="checkError('requiretime')" class="error pl-2 pr-2" style="color:#fff">Format penulisan "hh:mm", contoh : 17:50</p>
<p v-if="checkError('requirelabel')" class="error pl-2 pr-2" style="color:#fff">Label diisi dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12 mb-2>
<v-select
hide-details
item-text="name"
return-object
outline
:items="xcouriers"
v-model="xselected_courier"
class="mini-select"
label="Kurir*"
></v-select>
<p v-if="checkError('requirecourier')" class="error pl-2 pr-2" style="color:#fff">Kurirnya dong, dipilih</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-textarea
filled
outline
hide-details
label="Deskripsi Tugas"
v-model="xnote"
rows="3"
></v-textarea>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1>DETAIL ALAMAT</v-subheader>
<v-divider></v-divider>
<v-layout class="mt-2" row wrap>
<v-flex xs12>
<v-layout row>
<v-flex xs12 pa-1>
<v-select class="mini-select ma-1" :items="xdistricts"
item-text="name"
return-object
v-model="xselecteddistrict"
label="Kecamatan*" placeholder="Pilih salah satu" outline hide-details></v-select>
</v-flex>
</v-layout>
<v-layout row>
<v-flex x12 pa-1>
<v-select class="mini-select ma-1" :items="xkelurahans"
item-text="name"
return-object
v-model="xselectedkelurahan"
placeholder="Pilih salah satu"
label="Kelurahan*" outline hide-details></v-select>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<p v-if="checkError('requiredistrict')" class="error pl-2 pr-2" style="color:#fff">Kecamatan dipilih dong</p>
<p v-if="checkError('requirekelurahan')" class="error pl-2 pr-2" style="color:#fff">Kelurahan dipilih dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12 pt-1 pl-2 pr-2 pb-2>
<v-textarea
filled
outline
hide-details
label="Catatan / Alamat lengkap"
v-model="xaddressnote"
rows="3"
></v-textarea>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<style scoped>
table, td, th {
border: 1px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 8px;
padding-right: 5px;
}
.mini-input .v-input{
margin-top: 0px;
}
.mini-input .v-input, .mini-input .v-input--selection-controls,.mini-input .v-input__slot{
margin-top: 0px;
margin-bottom:0px;
margin-left:3px;
}
.mini-input .v-messages{
min-height:0px;
}
input.fhm-input{
border: 1px solid black;
border-radius: 2px;
-webkit-box-shadow:
inset 0 0 2px rgba(0,0,0,0.1),
0 0 4px rgba(0,0,0,0.1);
-moz-box-shadow:
inset 0 0 2px rgba(0,0,0,0.1),
0 0 4px rgba(0,0,0,0.1);
box-shadow:
inset 0 0 2px rgba(0,0,0,0.1),
0 0 4px rgba(0,0,0,0.1);
padding: 2px 4px;
background: rgba(255,255,255,0.5);
margin: 0 0 1px 0;
width:30px;
text-align:center;
}
</style>
<script>
module.exports = {
data: () => ({
menufilterdatestart:false,
date:''
}),
computed: {
dialogconfirmationdelete:{
get() {
return this.$store.state.doctor.dialog_confirmation_delete
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete",val)
}
},
msgconfirmationdelete(){
return this.$store.state.doctor.msg_confirmation_delete
},
xact() {
return this.$store.state.doctor.act
},
detail() {
return this.$store.state.doctor.selected_doctor
},
xnote:{
get() {
return this.$store.state.doctor.task_note
},
set(val) {
this.$store.commit("doctor/update_task_note",val)
this.$store.commit("doctor/update_no_save",1)
}
},
xaddressnote:{
get() {
return this.$store.state.doctor.address_note
},
set(val) {
this.$store.commit("doctor/update_address_note",val)
this.$store.commit("doctor/update_no_save",1)
}
},
xcouriers(){
return this.$store.state.doctor.couriers
},
xselected_courier:{
get() {
return this.$store.state.doctor.selected_courier
},
set(val) {
this.$store.commit("doctor/update_selected_courier",val)
this.$store.commit("doctor/update_no_save",1)
}
},
xtransactiondate : {
get() {
return this.$store.state.doctor.transaction_date
},
set(val) {
this.$store.commit("doctor/update_transaction_date",val)
}
},
xtime:{
get() {
return this.$store.state.doctor.transaction_time
},
set(val) {
this.$store.commit("doctor/update_transaction_time",val)
}
},
xtasklabel:{
get() {
return this.$store.state.doctor.task_label
},
set(val) {
var xval = val.toUpperCase()
this.$store.commit("doctor/update_task_label",xval)
}
},
filterComputedDateFormattedStart () {
return this.formatDate(this.xtransactiondate)
},
xcities() {
return this.$store.state.doctor.cities_form
},
xselectedcity: {
get() {
return this.$store.state.doctor.selected_city_form
},
set(val) {
this.$store.commit("doctor/update_selected_city_form",val)
}
},
xdistricts() {
return this.$store.state.doctor.districts_form
},
xselecteddistrict: {
get() {
return this.$store.state.doctor.selected_district_form
},
set(val) {
this.$store.commit("doctor/update_selected_district_form",val)
this.$store.dispatch("doctor/getkelurahanform",{id:val.id})
}
},
xkelurahans() {
return this.$store.state.doctor.kelurahans_form
},
xselectedkelurahan: {
get() {
return this.$store.state.doctor.selected_kelurahan_form
},
set(val) {
this.$store.commit("doctor/update_selected_kelurahan_form",val)
}
},
},
methods : {
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')}`
},
checkError(value){
var errors = this.$store.state.doctor.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
changeBtnFlagPJ(value){
var newval = (value === 'Y')?'N':'Y'
this.xpj = newval
},
changeBtnFlagDefaultPJ(value){
var newval = (value === 'Y')?'N':'Y'
this.xdpj = newval
},
changeBtnFlagDefault(value){
var newval = (value === 'Y')?'N':'Y'
this.xdefault = newval
},
changeBtnFlagClinic(value){
var newval = (value === 'Y')?'N':'Y'
this.xclinic = newval
},
changeBtnFlagMarketing(value){
var newval = (value === 'Y')?'N':'Y'
this.xmarketingconfirm = newval
},
saveData(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.xtasklabel === ''){
errors.push("requirelabel")
}
var DateX = moment(this.xtransactiondate, 'YYYY-MM-DD', true)
var isValidDateX = DateX.isValid()
if(!isValidDateX){
errors.push("requiredate")
}
var TimeX = moment(this.xtime, 'hh:mm', true)
var isValidTimeX = TimeX.isValid()
if(!isValidTimeX){
errors.push("requiretime")
}
if(_.isEmpty(this.xselecteddistrict, true)){
errors.push("requiredistrict")
}
if(_.isEmpty(this.xselectedkelurahan, true)){
errors.push("requirekelurahan")
}
if(errors.length === 0){
var prm = {}
prm.xdate = this.xtransactiondate
prm.courier = this.$store.state.doctor.selected_courier
prm.xtime = this.xtime
prm.xlabel = this.xtasklabel
prm.xnote = this.xnote
prm.kelurahan = this.$store.state.doctor.selected_kelurahan_form
prm.status = this.$store.state.doctor.selected_status.value
prm.current_page = 1
prm.lastid = -1
prm.filter_city = this.$store.state.doctor.selected_city
prm.filter_district = this.$store.state.doctor.selected_district
prm.filter_kelurahan = this.$store.state.doctor.selected_kelurahan
console.log(this.xtransactiondate)
console.log(prm)
this.$store.dispatch("doctor/savenewtask",prm)
}
},
saveNewDoctor(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.xdoctorname === ''){
errors.push("requirename")
}
if(_.isEmpty(this.xsex)){
errors.push("requiresex")
}
if(_.isEmpty(this.xreligion)){
errors.push("requirereligion")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorID = 0
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorM_SexID = this.$store.state.doctor.selected_sex.M_SexID
prm.M_DoctorM_ReligionID = this.$store.state.doctor.selected_religion.M_ReligionID
prm.M_DoctorEmail = this.xemail
prm.M_DoctorHP = this.xhp
prm.M_DoctorPhone = this.xphone
prm.M_DoctorIsMarketingConfirm = this.xmarketingconfirm
prm.M_DoctorIsPJ = this.xpj
prm.M_DoctorIsDefaultPJ = this.xdpj
prm.M_DoctorIsClinic = this.xclinic
prm.M_DoctorIsDefault = this.xdefault
this.$store.dispatch("doctor/newdoctor",prm)
}
},
deleteData(){
let msg = "Yakin, akan menghapus data dokter "+this.xdoctorname+" ?"
this.$store.commit("doctor/update_msg_confirmation_delete",msg)
this.$store.commit("doctor/update_dialog_confirmation_delete",true)
},
doDeleteData(){
var prm = {}
prm.M_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
this.$store.dispatch("doctor/delete",prm)
}
}
}
</script>

View File

@@ -0,0 +1,486 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogsuccess" persistent max-width="290">
<v-card>
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
<v-card-text>
{{msgsuccess}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogcourier" persistent max-width="450">
<v-card class="align-center justify-center">
<v-card-title primary-title dark color="warning" class="warning white--text headline">GANTI KURIR</v-card-title>
<v-card-text>
<v-select
hide-details
item-text="name"
return-object
outline
:items="xcouriers"
v-model="xselected_courier_change"
class="mini-select"
label="Kurir"
></v-select>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="doChangeCourier()">Simpan</v-btn>
<v-btn color="red darken-1" flat @click="dialogcourier = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2 pa-2 searchbox">
<v-layout >
<v-menu class="xs2 pr-2"
v-model="menufilterdatestart"
:close-on-content-click="false"
:nudge-right="40"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
class="mt-1"
v-model="filterComputedDateFormattedStart"
label="Tanggal Kerja"
outline
disabled
hide-details
v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
></v-text-field>
</template>
<v-date-picker v-model="xdate" no-title @input="menufilterdatestart = false"></v-date-picker>
</v-menu>
<v-select class="xs2 mini-select ma-1" :items="xcities"
item-text="name"
return-object
readonly="readonly"
v-model="xselectedcity"
label="Kota" outline hide-details></v-select>
<v-select class="xs2 mini-select ma-1" :items="xdistricts"
item-text="name"
return-object
v-model="xselecteddistrict"
label="Kecamatan" placeholder="Semua" outline hide-details></v-select>
<v-select class="xs2 mini-select ma-1" :items="xkelurahans"
item-text="name"
return-object
v-model="xselectedkelurahan"
placeholder="Semua"
label="Kelurahan" outline hide-details></v-select>
<v-select class="xs2 mini-select ma-1" :items="xstatuses"
item-text="label"
return-object
v-model="xselectedstatus"
label="Status" outline hide-details></v-select>
<span @click="searchDoctor" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
<span @click="setNewDoctor" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
</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="doctors"
: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.xtype_name }}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.xnumber}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.courier_name}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.districts}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.kelurahans}}</td>
<td class="text-xs-center align-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon large color="error" style="vertical-align:middle" v-if="props.item.status === 'N'">assignment_late</v-icon>
<v-icon large color="success" style="vertical-align:middle" v-if="props.item.status === 'Y'">assignment_turned_in</v-icon>
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-btn @click="approveIt(props.item)" v-if="props.item.status === 'N'" style="min-width:45px;height:35px;margin:0px" dark color="success" small><v-icon>check</v-icon></v-btn>
<v-btn @click="openDialogChangeCourier(props.item)" style="min-width:45px;height:35px;margin:0px" dark color="warning" small><v-icon>person</v-icon></v-btn>
</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination
style="margin-top:10px;margin-bottom:10px"
v-model="curr_page"
:length="xtotal_page"
></v-pagination>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
</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-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("doctor/getinitdata")
this.$store.dispatch("doctor/getcourier")
},
methods : {
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')}`
},
isSelected(p) {
return p.xid == this.$store.state.doctor.selected_doctor.xid
},
searchDoctor() {
this.$store.dispatch("doctor/search",{
xdate:this.xdate,
city:this.xselectedcity,
district:this.xselecteddistrict,
kelurahan:this.xselectedkelurahan,
status:this.xselectedstatus.value,
current_page:1,
lastid:-1
})
},
selectMe(doc) {
/*if(this.$store.state.doctor.no_save == 0 ){
this.$store.commit("doctor/update_selected_doctor",doc)
}else{
this.$store.commit("doctor/update_open_alert_confirmation",true)
}*/
this.$store.commit("doctor/update_selected_doctor",doc)
},
closeAlertConfirmation(){
this.$store.commit("doctor/update_open_alert_confirmation",false)
},
forgetAlertConfirmation(){
this.$store.commit("doctor/update_no_save",0)
this.$store.commit("doctor/update_open_alert_confirmation",false)
},
updateAlert_success(val){
this.$store.commit("doctor/update_alert_success",val)
},
setNewDoctor(){
this.$store.commit("doctor/update_selected_doctor",{})
this.$store.commit("doctor/update_preffix",'')
this.$store.commit("doctor/update_doctor_name",'')
this.$store.commit("doctor/update_suffix",'')
this.$store.commit("doctor/update_selected_sex",{})
this.$store.commit("doctor/update_selected_religion",{})
this.$store.commit("doctor/update_phone",'')
this.$store.commit("doctor/update_email",'')
this.$store.commit("doctor/update_hp",'')
this.$store.commit("doctor/update_pj",'N')
this.$store.commit("doctor/update_dpj",'N')
this.$store.commit("doctor/update_clinic",'N')
this.$store.commit("doctor/update_marketing_confirm",'N')
this.$store.commit("doctor/update_is_default",'N')
this.$store.commit("doctor/update_addresses",[])
this.$store.commit("doctor/update_act",'new')
},
closeDialogSuccess(){
let arrdoctor = this.$store.state.doctor.doctors
var idx = _.findIndex(arrdoctor, item => item.M_DoctorID === this.$store.state.doctor.last_id)
this.$store.dispatch("doctor/search",{
name:this.name,
status: this.xselectedstatus.value,
lastid: idx
})
this.$store.commit("doctor/update_dialog_success",false)
},
approveIt(value){
value.xdate = this.xdate
value.city = this.xselectedcity
value.district = this.xselecteddistrict
value.kelurahan = this.xselectedkelurahan
value.status = this.xselectedstatus.value
value.current_page = 1
value.lastid = -1
this.$store.dispatch("doctor/approve",value)
},
openDialogChangeCourier(value){
this.dialogcourier = true
this.xselected_courier_change = {id:value.courier_id,name:value.courier_name}
},
doChangeCourier(){
prm = this.$store.state.doctor.selected_doctor
prm.courier_change = this.xselected_courier_change
prm.xdate = this.xdate
prm.city = this.xselectedcity
prm.district = this.xselecteddistrict
prm.kelurahan = this.xselectedkelurahan
prm.status = this.xselectedstatus.value
prm.current_page = 1
prm.lastid = -1
this.$store.dispatch("doctor/dochangecourier",prm)
}
},
computed: {
dialogcourier:{
get() {
return this.$store.state.doctor.dialog_courier
},
set(val) {
this.$store.commit("doctor/update_dialog_courier",val)
this.$store.commit("doctor/update_no_save",1)
}
},
xcouriers(){
return this.$store.state.doctor.couriers
},
xselected_courier_change:{
get() {
return this.$store.state.doctor.selected_courier_change
},
set(val) {
this.$store.commit("doctor/update_selected_courier_change",val)
this.$store.commit("doctor/update_no_save",1)
}
},
xdate : {
get() {
return this.$store.state.doctor.xdate
},
set(val) {
this.$store.commit("doctor/update_xdate",val)
}
},
filterComputedDateFormattedStart () {
return this.formatDate(this.xdate)
},
dialogsuccess: {
get() {
return this.$store.state.doctor.dialog_success
},
set(val) {
this.$store.commit("doctor/update_dialog_success",val)
}
},
msgsuccess(){
return this.$store.state.doctor.msg_success
},
snackbar: {
get() {
return this.$store.state.doctor.alert_success
},
set(val) {
this.$store.commit("doctor/update_alert_success",val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xstatuses() {
return this.$store.state.doctor.statuses
},
xselectedstatus: {
get() {
return this.$store.state.doctor.selected_status
},
set(val) {
this.$store.commit("doctor/update_selected_status",val)
}
},
doctors() {
return this.$store.state.doctor.doctors
},
openalertconfirmation: {
get() {
return this.$store.state.doctor.open_alert_confirmation
},
set(val) {
this.$store.commit("doctor/update_open_alert_confirmation",val)
}
},
xcities() {
return this.$store.state.doctor.cities
},
xselectedcity: {
get() {
return this.$store.state.doctor.selected_city
},
set(val) {
this.$store.commit("doctor/update_selected_city",val)
}
},
xdistricts() {
return this.$store.state.doctor.districts
},
xselecteddistrict: {
get() {
return this.$store.state.doctor.selected_district
},
set(val) {
this.$store.commit("doctor/update_selected_district",val)
this.$store.dispatch("doctor/getkelurahan",{id:val.id})
}
},
xkelurahans() {
return this.$store.state.doctor.kelurahans
},
xselectedkelurahan: {
get() {
return this.$store.state.doctor.selected_kelurahan
},
set(val) {
this.$store.commit("doctor/update_selected_kelurahan",val)
}
},
totaldoctor() {
return this.$store.state.doctor.total_doctor
},
curr_page: {
get() {
return this.$store.state.doctor.current_page
},
set(val) {
this.$store.commit("doctor/update_current_page",val)
this.$store.dispatch("doctor/search",{
name:this.name,
status: this.xselectedstatus.value,
current_page:val,
lastid:-1
})
}
},
xtotal_page: {
get() {
return this.$store.state.doctor.total_doctor
},
set(val) {
this.$store.commit("doctor/update_total_doctor",val)
}
},
xdate: {
get() {
return this.$store.state.doctor.xdate
},
set(val) {
this.$store.commit("doctor/update_xdate",val)
}
},
},
data() {
return {
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
name: '',
page:1,
menufilterdatestart:false,
total_pages:5,
headers: [
{
text: "TUGAS",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO. TRANSAKSI",
align: "center",
sortable: false,
value: "lab",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KURIR",
align: "left",
sortable: false,
value: "name",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KECAMATAN",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KELURAHAN",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "STATUS",
align: "center",
sortable: false,
value: "status",
width: "8%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination:{
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'M_DoctorName',
totalItems: this.$store.state.doctor.total_doctor
}
};
}
}
</script>