Initial import
This commit is contained in:
102
one-ui/masterdata/one-md-summary-fisik/api/fisikdetail.js
Normal file
102
one-ui/masterdata/one-md-summary-fisik/api/fisikdetail.js
Normal file
@@ -0,0 +1,102 @@
|
||||
const URL = "/one-api/mockup/masterdata/one-md-summary-fisik/";
|
||||
|
||||
export async function searchdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/searchdetail", 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 searchtemplatecode(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/searchtemplatecode", {
|
||||
token: token,
|
||||
search: 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 addnewdetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/addnewdetail", 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 updatedetail(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/updatedetail", 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 deletedetail(token, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/deletedetail", {
|
||||
id: id,
|
||||
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,
|
||||
};
|
||||
}
|
||||
}
|
||||
123
one-ui/masterdata/one-md-summary-fisik/api/fisikheader.js
Normal file
123
one-ui/masterdata/one-md-summary-fisik/api/fisikheader.js
Normal file
@@ -0,0 +1,123 @@
|
||||
const URL = "/one-api/mockup/masterdata/one-md-summary-fisik/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/search", 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 searchkelainan(token, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/searchkelainan", {
|
||||
token: token,
|
||||
search: 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 getfitness(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/getfitness", {
|
||||
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 save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/addnewsummaryfisik", 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 update(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/updatesummaryfisik", 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 xdelete(token, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "summaryfisik/deletesummaryfisik", {
|
||||
id: id,
|
||||
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,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,610 @@
|
||||
<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="deleteSummaryDetail()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="xdialogsummarydetail" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">FORM SUMMARY FISIK DETAIL</span></v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formvalidatedetail" v-model="validdetail" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete label="Template Kode*" :items="xtemplatecode"
|
||||
v-model="vtemplatecode" :search-input.sync="search_item_templatecode" auto-select-first
|
||||
no-filter item-text="templatecodename" return-object no-data-text="Pilih Template Kode"
|
||||
small
|
||||
:error="errtemplatecode != ''"
|
||||
:error-messages="errtemplatecode"
|
||||
>
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.templatecodename"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select
|
||||
v-model="selected_detailtype"
|
||||
:items="xdetailtype"
|
||||
:error="errSelectType != ''"
|
||||
:error-messages="errSelectType"
|
||||
item-text="name"
|
||||
label="Tipe"
|
||||
return-object
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12 v-if="selected_detailtype.id == 'V'">
|
||||
<v-text-field
|
||||
label="Value"
|
||||
v-model="xvalue"
|
||||
outline
|
||||
:error="errValue != ''"
|
||||
:error-messages="errValue"
|
||||
></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="closeFormSummaryFisikDetail()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormSummaryFisikDetail()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormSummaryFisik()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>SUMMARY FISIK DETAIL</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormSummaryFisikDetail(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :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" label="Summary fisik detail" placeholder="Cari ..." />
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div>
|
||||
|
||||
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xsummaryfisikdetail" :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.FisikTemplateCodeLabel}}
|
||||
<p style="color:#800000" class="mb-0 font-weight-bold caption">{{ props.item.Mcu_FisikSummaryDetailCode}}</p>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.Mcu_FisikSummaryDetailType}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.Mcu_FisikSummaryDetailValue}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-icon small class="ml-3" color="primary" @click="openEditDetail(props.item)">edit</v-icon>
|
||||
<v-icon small class="ml-3" color="error" @click="openDeleteDetail(props.item)">clear</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-divider></v-divider>
|
||||
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</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.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.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() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
validdetail: false,
|
||||
xid: 0,
|
||||
search_instrument: '',
|
||||
items: [],
|
||||
xname: '',
|
||||
xcode: '',
|
||||
errtemplatecode: '',
|
||||
errValue: '',
|
||||
errSelectType: '',
|
||||
name: '',
|
||||
isdefault: false,
|
||||
scode: '',
|
||||
search_doctor: '',
|
||||
search_testheader: '',
|
||||
search_template: '',
|
||||
page: 1,
|
||||
search_item_templatecode: "",
|
||||
xvalue: "",
|
||||
headers: [{
|
||||
text: "CODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TYPE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "VALUE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
// pagination: {
|
||||
// descending: true,
|
||||
// page: 1,
|
||||
// rowsPerPage: 100,
|
||||
// sortBy: 'id DESC',
|
||||
// totalItems: this.$store.state.kelainangroup.total_filter_kelainangroups
|
||||
// }
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
xdetailtype() {
|
||||
return this.$store.state.fisikdetail.detailtype
|
||||
},
|
||||
selected_detailtype: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.selected_detailtype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_selected_detailtype", val)
|
||||
}
|
||||
},
|
||||
xsummaryfisikdetail() {
|
||||
return this.$store.state.fisikdetail.summaryfisikdetail
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.fisikdetail.search_status == 1
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.x_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_x_search", val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_current_page", val)
|
||||
this.$store.dispatch("fisikdetail/searchdetail", {
|
||||
fifiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID,
|
||||
search: this.xsearch,
|
||||
current_page: val,
|
||||
last_id: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.total_summaryfisikdetails
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_total_summaryfisikdetails", val)
|
||||
}
|
||||
},
|
||||
xtemplatecode() {
|
||||
return this.$store.state.fisikdetail.templatecodes
|
||||
},
|
||||
vtemplatecode: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.selected_templatecode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_selected_templatecode", val)
|
||||
}
|
||||
},
|
||||
xdialogsummarydetail() {
|
||||
return this.$store.state.fisikdetail.dialog_form_summary_detail
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.fisikdetail.act
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.fisikdetail.errors
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.fisikdetail.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikdetail/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.fisikdetail.msg_success
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
return p.Mcu_FisikSummaryDetailID == this.$store.state.fisikdetail.selected_summaryfisikdetail.Mcu_FisikSummaryDetailID
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("fisikdetail/update_selected_summaryfisikdetail", sc)
|
||||
|
||||
},
|
||||
closeFormSummaryFisikDetail() {
|
||||
this.$store.commit("fisikdetail/update_dialog_form_summary_detail", false)
|
||||
this.$store.commit("fisikdetail/update_errors", [])
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("fisikdetail/searchdetail", {
|
||||
fifiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID,
|
||||
search: this.xsearch,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}, 200),
|
||||
thr_search_templatecode: _.debounce(function () {
|
||||
this.$store.dispatch("fisikdetail/searchtemplatecode", this.search_item_templatecode)
|
||||
}, 2000),
|
||||
resetForm() {
|
||||
this.vtemplatecode = {}
|
||||
this.templatecodes = []
|
||||
this.selected_detailtype = {}
|
||||
this.detailtype = []
|
||||
this.errtemplatecode = ''
|
||||
this.errSelectType = ''
|
||||
this.errValue = ''
|
||||
this.xvalue = ''
|
||||
},
|
||||
openFormSummaryFisikDetail(val) {
|
||||
this.xid = val
|
||||
this.resetForm()
|
||||
this.$store.commit("fisikdetail/update_act", 'new')
|
||||
this.$store.commit("fisikdetail/update_dialog_form_summary_detail", true)
|
||||
},
|
||||
saveFormSummaryFisikDetail() {
|
||||
this.loading_save = true;
|
||||
this.errtemplatecode = "";
|
||||
if (_.isEmpty(this.vtemplatecode)) {
|
||||
this.errtemplatecode = "Anda belum memilih template code";
|
||||
}
|
||||
this.errSelectType = "";
|
||||
if (_.isEmpty(this.selected_detailtype)) {
|
||||
this.errSelectType = "Anda belum memilih type";
|
||||
}
|
||||
|
||||
this.errValue = ""
|
||||
if (this.selected_detailtype.id == "V") {
|
||||
if (this.xvalue == "") {
|
||||
this.errValue = "Anda lupa mengisi value";
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
this.errtemplatecode == "" &&
|
||||
this.errSelectType == "" &&
|
||||
this.errValue == ""
|
||||
) {
|
||||
let prm = {
|
||||
fisiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID == undefined ? 0 : this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID,
|
||||
code: this.vtemplatecode.FisikTemplateCodeName,
|
||||
type: this.selected_detailtype.id,
|
||||
value: this.xvalue,
|
||||
name: this.vtemplatecode.FisikTemplateCodeLabel,
|
||||
search: this.xsearch
|
||||
}
|
||||
this.$store.dispatch("fisikdetail/addnewdetail", prm);
|
||||
} else {
|
||||
this.loading_save = false
|
||||
}
|
||||
|
||||
},
|
||||
openEditDetail(data) {
|
||||
this.$store.commit("fisikdetail/update_act", 'edit')
|
||||
this.$store.commit("fisikdetail/update_dialog_form_summary_detail", true)
|
||||
this.xid = data.Mcu_FisikSummaryDetailID
|
||||
this.$store.commit("fisikdetail/update_templatecodes",[{
|
||||
FisikTemplateCodeID: data.FisikTemplateCodeID,
|
||||
FisikTemplateCodeName: data.FisikTemplateCodeName,
|
||||
FisikTemplateCodeLabel: data.FisikTemplateCodeLabel,
|
||||
templatecodename: data.templatecodename
|
||||
}])
|
||||
this.$store.commit("fisikdetail/update_selected_templatecode", {
|
||||
FisikTemplateCodeID: data.FisikTemplateCodeID,
|
||||
FisikTemplateCodeName: data.FisikTemplateCodeName,
|
||||
FisikTemplateCodeLabel: data.FisikTemplateCodeLabel,
|
||||
templatecodename: data.templatecodename
|
||||
})
|
||||
|
||||
let typedetail = ""
|
||||
if (data.Mcu_FisikSummaryDetailType == "C") {
|
||||
typedetail = "Centang"
|
||||
} else if (data.Mcu_FisikSummaryDetailType == "V") {
|
||||
typedetail = "Value"
|
||||
} else if (data.Mcu_FisikSummaryDetailType == "VK") {
|
||||
typedetail = "Value Nama Kelainan"
|
||||
}
|
||||
this.$store.commit("fisikdetail/update_selected_detailtype", {
|
||||
id: data.Mcu_FisikSummaryDetailType,
|
||||
name: typedetail
|
||||
})
|
||||
this.xvalue = data.Mcu_FisikSummaryDetailValue
|
||||
},
|
||||
updateFormSummaryFisik() {
|
||||
this.loading_save = true;
|
||||
this.errtemplatecode = "";
|
||||
if (_.isEmpty(this.vtemplatecode)) {
|
||||
this.errtemplatecode = "Anda belum memilih template code";
|
||||
}
|
||||
this.errSelectType = "";
|
||||
if (_.isEmpty(this.selected_detailtype)) {
|
||||
this.errSelectType = "Anda belum memilih type";
|
||||
}
|
||||
|
||||
this.errValue = ""
|
||||
if (this.selected_detailtype.id == "V") {
|
||||
if (this.xvalue == "") {
|
||||
this.errValue = "Anda lupa mengisi value";
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
this.errtemplatecode == "" &&
|
||||
this.errSelectType == "" &&
|
||||
this.errValue == ""
|
||||
) {
|
||||
let prm = {
|
||||
id: this.$store.state.fisikdetail.selected_summaryfisikdetail.Mcu_FisikSummaryDetailID,
|
||||
fisiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID == undefined ? 0 : this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID,
|
||||
code: this.vtemplatecode.FisikTemplateCodeName,
|
||||
type: this.selected_detailtype.id,
|
||||
value: this.xvalue,
|
||||
name: this.vtemplatecode.FisikTemplateCodeLabel,
|
||||
search: this.xsearch
|
||||
}
|
||||
this.$store.dispatch("fisikdetail/updatedetail", prm);
|
||||
} else {
|
||||
this.loading_save = false
|
||||
}
|
||||
},
|
||||
openDeleteDetail(data) {
|
||||
this.xid = data.Mcu_FisikSummaryDetailID
|
||||
this.msgalert = "Yakin, mau hapus summary fisik detail kode " + "[" + data.Mcu_FisikSummaryDetailCode + "]" + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
deleteSummaryDetail() {
|
||||
this.$store.dispatch("fisikdetail/deletedetail", {
|
||||
search: this.xsearch,
|
||||
name: this.$store.state.fisikdetail.selected_summaryfisikdetail.Mcu_FisikSummaryDetailCode,
|
||||
id: this.$store.state.fisikdetail.selected_summaryfisikdetail.Mcu_FisikSummaryDetailID,
|
||||
fisiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID == undefined ? 0 : this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
},
|
||||
search_item_templatecode(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
|
||||
if (val.length < 1) {
|
||||
this.$store.dispatch("fisikdetail/searchtemplatecode", this.search_item_templatecode)
|
||||
return this.thr_search_templatecode()
|
||||
}
|
||||
|
||||
if (val.length > 2) {
|
||||
this.$store.dispatch("fisikdetail/searchtemplatecode", this.search_item_templatecode)
|
||||
return this.thr_search_templatecode()
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,600 @@
|
||||
<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="deleteSummaryFisik()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="xdialogsummary" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">FORM SUMMARY FISIK</span></v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formvalidate" v-model="valid" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete label="Kelainan*" :items="xdatakelainans"
|
||||
v-model="vdatakelainan" :search-input.sync="search_item_datakelainan" auto-select-first
|
||||
no-filter item-text="Mcu_KelainanName" return-object no-data-text="Pilih Nama Kelainan"
|
||||
small
|
||||
:rules="kelainanRules">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.Mcu_KelainanName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="fitnessname" return-object :items="xfitness" :rules="fitnessRules" v-model="selected_fitness" label="Fitness*"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-radio-group v-model="formtype">
|
||||
<template v-slot:label>
|
||||
<div>Summary fisik type</div>
|
||||
</template>
|
||||
<v-layout row>
|
||||
<v-flex xs6 wrap>
|
||||
<v-radio value="AND">
|
||||
<template v-slot:label>
|
||||
<div>AND</div>
|
||||
</template>
|
||||
</v-radio>
|
||||
</v-flex>
|
||||
<v-flex xs6 wrap>
|
||||
<v-radio value="OR">
|
||||
<template v-slot:label>
|
||||
<div>OR</div>
|
||||
</template>
|
||||
</v-radio>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-radio-group>
|
||||
</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="closeFormSummaryFisik()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormSummaryFisik()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormSummaryFisik()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>SUMMARY FISIK</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="openFormSummaryFisik(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :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" label="Summary fisik" placeholder="Cari ..." />
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div>
|
||||
|
||||
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xsummaryfisik" :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.Mcu_KelainanName}}
|
||||
<p style="color:#800000" class="mb-0 font-weight-bold caption">{{ props.item.Mcu_KelainanClasification}}</p>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.fitnessname}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.Mcu_FisikSummaryType}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
<v-icon small class="ml-3" color="primary" @click="editSummaryFisik(props.item)">edit</v-icon>
|
||||
<v-icon small class="ml-3" color="error" @click="openDeleteSummaryFisik(props.item)">clear</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-divider></v-divider>
|
||||
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</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.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.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() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
valid: false,
|
||||
xid: 0,
|
||||
search_instrument: '',
|
||||
items: [],
|
||||
xname: '',
|
||||
xcode: '',
|
||||
kelainanRules: [
|
||||
v => !!v || 'Kelainan harus dipilih'
|
||||
],
|
||||
fitnessRules: [
|
||||
v => !!v || 'Fitness harus dipilih'
|
||||
],
|
||||
name: '',
|
||||
isdefault: false,
|
||||
scode: '',
|
||||
search_doctor: '',
|
||||
search_testheader: '',
|
||||
search_template: '',
|
||||
page: 1,
|
||||
search_item_datakelainan: "",
|
||||
headers: [{
|
||||
text: "kELAINAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "FITNESS KATEGORI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TYPE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
// pagination: {
|
||||
// descending: true,
|
||||
// page: 1,
|
||||
// rowsPerPage: 100,
|
||||
// sortBy: 'id DESC',
|
||||
// totalItems: this.$store.state.kelainangroup.total_filter_kelainangroups
|
||||
// }
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("fisikheader/search", {
|
||||
search: this.xsearch,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
this.$store.dispatch("fisikheader/getfitness")
|
||||
this.$store.dispatch("fisikdetail/searchdetail", {
|
||||
fifiksummaryId: 0,
|
||||
search: this.$store.state.fisikdetail.x_search,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
xsummaryfisik() {
|
||||
return this.$store.state.fisikheader.summaryfisik
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.fisikheader.search_status == 1
|
||||
},
|
||||
selected_summaryfisik: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.selected_summaryfisik
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("summaryfiisk/update_selected_summaryfisik", val)
|
||||
}
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.x_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_x_search", val)
|
||||
}
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_current_page", val)
|
||||
this.$store.dispatch("fisikheader/search", {
|
||||
search: this.xsearch,
|
||||
current_page: val,
|
||||
last_id: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.total_summaryfisiks
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_total_summaryfisiks", val)
|
||||
}
|
||||
},
|
||||
xdatakelainans() {
|
||||
return this.$store.state.fisikheader.datakelainans
|
||||
},
|
||||
vdatakelainan: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.selected_datakelainan
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_selected_datakelainan", val)
|
||||
}
|
||||
},
|
||||
xdialogsummary() {
|
||||
return this.$store.state.fisikheader.dialog_form_summary
|
||||
},
|
||||
xerrors() {
|
||||
return this.$store.state.fisikheader.errors
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.fisikheader.act
|
||||
},
|
||||
xfitness() {
|
||||
return this.$store.state.fisikheader.fitness
|
||||
},
|
||||
selected_fitness: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.selected_fitness
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_selected_fitness", val)
|
||||
}
|
||||
},
|
||||
formtype: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.formtype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_formtype", val)
|
||||
}
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.fisikheader.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("fisikheader/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.fisikheader.msg_success
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
return p.Mcu_FisikSummaryID == this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("fisikheader/update_selected_summaryfisik", sc)
|
||||
let alldata = this.$store.state.fisikheader.summaryfisik
|
||||
let idx = _.findIndex(alldata, item => item.Mcu_FisikSummaryID == sc.Mcu_FisikSummaryID)
|
||||
this.$store.state.fisikheader.last_id = idx
|
||||
this.$store.state.fisikdetail.current_page = 1
|
||||
this.$store.dispatch("fisikdetail/searchdetail", {
|
||||
fifiksummaryId: this.$store.state.fisikheader.selected_summaryfisik.Mcu_FisikSummaryID,
|
||||
search: this.$store.state.fisikdetail.x_search,
|
||||
current_page: this.$store.state.fisikdetail.current_page,
|
||||
last_id: -1
|
||||
})
|
||||
|
||||
},
|
||||
closeFormSummaryFisik() {
|
||||
this.$store.commit("fisikheader/update_dialog_form_summary", false)
|
||||
this.$store.commit("fisikheader/update_errors",[])
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("fisikheader/search", {
|
||||
search: this.xsearch,
|
||||
current_page: this.curr_page,
|
||||
last_id: -1
|
||||
})
|
||||
}, 1000),
|
||||
thr_search_datakelainan: _.debounce(function () {
|
||||
this.$store.dispatch("fisikheader/searchkelainan", this.search_item_datakelainan)
|
||||
}, 2000),
|
||||
openFormSummaryFisik(val) {
|
||||
this.xid = val
|
||||
this.formtype = 'AND'
|
||||
// this.$refs.formvalidate.reset()
|
||||
// this.$refs.formvalidate.resetValidation()
|
||||
this.$store.commit("fisikheader/update_datakelainans",[])
|
||||
this.$store.commit("fisikheader/update_selected_datakelainan",{})
|
||||
// this.$store.commit("fisikheader/update_fitness",[])
|
||||
this.$store.commit("fisikheader/update_selected_fitness",{})
|
||||
this.$store.commit("fisikheader/update_act", 'new')
|
||||
this.$store.commit("fisikheader/update_dialog_form_summary", true)
|
||||
},
|
||||
saveFormSummaryFisik() {
|
||||
if (this.$refs.formvalidate.validate()) {
|
||||
this.$store.dispatch("fisikheader/save", {
|
||||
xid: this.xid,
|
||||
kelainanId: this.vdatakelainan.Mcu_KelainanID,
|
||||
fitnessId: this.selected_fitness.Mcu_FitnessCategoryID,
|
||||
type: this.formtype,
|
||||
kelainanname: this.vdatakelainan.Mcu_KelainanName,
|
||||
fitnessname: this.selected_fitness.fitnessname,
|
||||
search: this.xsearch
|
||||
})
|
||||
}
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("fisikheader/update_alert_success", val)
|
||||
},
|
||||
editSummaryFisik(data) {
|
||||
this.xid = data.Mcu_FisikSummaryID
|
||||
this.formtype = data.Mcu_FisikSummaryType
|
||||
this.$store.commit("fisikheader/update_datakelainans",[{
|
||||
Mcu_KelainanID: data.Mcu_KelainanID,
|
||||
Mcu_KelainanName: data.Mcu_KelainanName
|
||||
}])
|
||||
this.$store.commit("fisikheader/update_selected_datakelainan", {
|
||||
Mcu_KelainanID: data.Mcu_KelainanID,
|
||||
Mcu_KelainanName: data.Mcu_KelainanName
|
||||
})
|
||||
this.$store.commit("fisikheader/update_fitness",[{
|
||||
Mcu_FitnessCategoryID: data.Mcu_FitnessCategoryID,
|
||||
fitnessname: data.fitnessname
|
||||
}])
|
||||
this.$store.commit("fisikheader/update_selected_fitness", {
|
||||
Mcu_FitnessCategoryID: data.Mcu_FitnessCategoryID,
|
||||
fitnessname: data.fitnessname
|
||||
})
|
||||
this.$store.commit("fisikheader/update_errors",[])
|
||||
this.$store.commit("fisikheader/update_act", 'edit')
|
||||
this.$store.commit("fisikheader/update_dialog_form_summary", true)
|
||||
this.$store.dispatch("fisikheader/getfitness")
|
||||
},
|
||||
updateFormSummaryFisik() {
|
||||
if (this.$refs.formvalidate.validate()) {
|
||||
this.$store.dispatch("fisikheader/update", {
|
||||
xid: this.xid,
|
||||
search: this.xsearch,
|
||||
kelainanname: this.vdatakelainan.Mcu_KelainanName,
|
||||
fitnessname: this.selected_fitness.fitnessname,
|
||||
kelainanId: this.vdatakelainan.Mcu_KelainanID,
|
||||
fitnessId: this.selected_fitness.Mcu_FitnessCategoryID,
|
||||
type: this.formtype,
|
||||
})
|
||||
}
|
||||
},
|
||||
openDeleteSummaryFisik(data) {
|
||||
this.xid = data.Mcu_FisikSummaryID
|
||||
var xdata = {
|
||||
Mcu_KelainanID: data.Mcu_KelainanID,
|
||||
Mcu_KelainanName: data.Mcu_KelainanName,
|
||||
Mcu_KelainanClasification: data.Mcu_KelainanClasification
|
||||
}
|
||||
this.$store.commit("fisikheader/update_selected_datakelainan", xdata)
|
||||
this.msgalert = "Yakin, mau hapus summary fisik kelainan " + data.Mcu_KelainanName + ", fitness " + data.fitnessname + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
deleteSummaryFisik() {
|
||||
this.$store.dispatch("fisikheader/delete", {
|
||||
search: this.xsearch,
|
||||
kelainanname: this.vdatakelainan.Mcu_KelainanName,
|
||||
id: this.xid
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
},
|
||||
search_item_datakelainan(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
|
||||
if (val.length < 1) {
|
||||
this.$store.dispatch("fisikheader/searchkelainan", this.search_item_datakelainan)
|
||||
return this.thr_search_datakelainan()
|
||||
}
|
||||
|
||||
if (val.length > 2) {
|
||||
this.$store.dispatch("fisikheader/searchkelainan", this.search_item_datakelainan)
|
||||
return this.thr_search_datakelainan()
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
78
one-ui/masterdata/one-md-summary-fisik/index.php
Normal file
78
one-ui/masterdata/one-md-summary-fisik/index.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<!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 class="blue lighten-5">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-fisikheader-list></one-md-fisikheader-list>
|
||||
</v-flex>
|
||||
<v-flex xs8 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-md-fisikdetail-list></one-md-fisikdetail-list>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</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">
|
||||
import {
|
||||
store
|
||||
} from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
// window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponentNoMenu.vue'),
|
||||
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
|
||||
'one-md-fisikheader-list': httpVueLoader('./components/oneMdFisikHeader.vue'),
|
||||
'one-md-fisikdetail-list': httpVueLoader('./components/oneMdFisikDetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
243
one-ui/masterdata/one-md-summary-fisik/modules/fisikdetail.js
Normal file
243
one-ui/masterdata/one-md-summary-fisik/modules/fisikdetail.js
Normal file
@@ -0,0 +1,243 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/fisikdetail.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
summaryfisikdetail:[],
|
||||
selected_summaryfisikdetail:{},
|
||||
total_summaryfisikdetails:0,
|
||||
last_id:-1,
|
||||
current_page:1,
|
||||
x_search:'',
|
||||
autocomplete_status:0,
|
||||
templatecodes:[],
|
||||
selected_templatecode:{},
|
||||
dialog_form_summary_detail:false,
|
||||
act:'',
|
||||
errors:[],
|
||||
detailtype:[{id:'C', name:'Centang'},{id:'V', name:'Value'},{id:'VK', name:'Value Nama Kelainan'}],
|
||||
selected_detailtype:{},
|
||||
save_status:0,
|
||||
save_error_message:'',
|
||||
alert_success: false,
|
||||
msg_success: ""
|
||||
},
|
||||
mutations: {
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_detailtype(state, val) {
|
||||
state.detailtype = val
|
||||
},
|
||||
update_selected_detailtype(state, val) {
|
||||
state.selected_detailtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_summaryfisikdetail(state, val) {
|
||||
state.summaryfisikdetail = val
|
||||
},
|
||||
update_selected_summaryfisikdetail(state, val) {
|
||||
state.selected_summaryfisikdetail = val
|
||||
},
|
||||
update_total_summaryfisikdetails(state, val) {
|
||||
state.total_summaryfisikdetails = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
state.current_page = 1
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_templatecodes(state, val) {
|
||||
state.templatecodes = val
|
||||
},
|
||||
update_selected_templatecode(state, val) {
|
||||
state.selected_templatecode = val
|
||||
},
|
||||
update_dialog_form_summary_detail(state, val) {
|
||||
state.dialog_form_summary_detail = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async deletedetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.deletedetail(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
var msg = "Template Kode " + prm.name +" berhasil di hapus"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_templatecode", {})
|
||||
context.commit("update_selected_detailtype", {})
|
||||
context.dispatch("searchdetail", {
|
||||
fifiksummaryId: prm.fisiksummaryId,
|
||||
search: prm.search,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async updatedetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.updatedetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
|
||||
context.commit("update_dialog_form_summary_detail", false)
|
||||
var msg = "Template Kode " + prm.name +" berhasil di update"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("searchdetail", {
|
||||
fifiksummaryId: prm.fisiksummaryId,
|
||||
search: prm.search,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async addnewdetail(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.addnewdetail(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
|
||||
context.commit("update_dialog_form_summary_detail", false)
|
||||
var msg = "Template Kode " + prm.name + " sudah disimpan dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("searchdetail", {
|
||||
fifiksummaryId: prm.fisiksummaryId,
|
||||
search: prm.search,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async searchdetail(context, prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.searchdetail(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,
|
||||
total_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_summaryfisikdetail", data.records)
|
||||
context.commit("update_total_summaryfisikdetails", data.total_page)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
}
|
||||
},
|
||||
|
||||
async searchtemplatecode(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchtemplatecode(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records
|
||||
}
|
||||
context.commit("update_templatecodes", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
271
one-ui/masterdata/one-md-summary-fisik/modules/fisikheader.js
Normal file
271
one-ui/masterdata/one-md-summary-fisik/modules/fisikheader.js
Normal file
@@ -0,0 +1,271 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/fisikheader.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id: -1,
|
||||
act:'new',
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
summaryfisik:[],
|
||||
selected_summaryfisik:{},
|
||||
x_search:"",
|
||||
current_page:1,
|
||||
total_summaryfisiks:0,
|
||||
autocomplete_status: 0,
|
||||
datakelainans:[],
|
||||
selected_datakelainan:{},
|
||||
dialog_form_summary:false,
|
||||
errors: [],
|
||||
get_data_status: 0,
|
||||
fitness:[],
|
||||
selected_fitness:{},
|
||||
formtype:'AND',
|
||||
save_status:0,
|
||||
save_error_message:'',
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
},
|
||||
mutations: {
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_formtype(state, val) {
|
||||
state.formtype = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_dialog_form_summary(state, val) {
|
||||
state.dialog_form_summary = val
|
||||
},
|
||||
update_selected_datakelainan(state, val) {
|
||||
state.selected_datakelainan = val
|
||||
},
|
||||
update_datakelainans(state, val) {
|
||||
state.datakelainans = val
|
||||
},
|
||||
update_total_summaryfisiks(state, val) {
|
||||
state.total_summaryfisiks = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
state.current_page = 1
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_summaryfisik(state, val) {
|
||||
state.summaryfisik = val
|
||||
},
|
||||
update_selected_summaryfisik(state, val) {
|
||||
state.selected_summaryfisik = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_fitness(state, val) {
|
||||
state.fitness = val
|
||||
},
|
||||
update_selected_fitness(state, val) {
|
||||
state.selected_fitness = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async update(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.update(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
|
||||
context.commit("update_dialog_form_summary", false)
|
||||
var msg = "Kelainan " + prm.kelainanname + " Fitness " + prm.fitnessname + " berhasil di update"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("search", {
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page,
|
||||
last_id: context.state.last_id
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
|
||||
context.commit("update_dialog_form_summary", false)
|
||||
var msg = "Kelainan " + prm.kelainanname + " Fitness " + prm.fitnessname + " sudah disimpan dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("search", {
|
||||
search: prm.search,
|
||||
current_page: 1,
|
||||
last_id: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
var msg = "Summary fisik Kelainan " + prm.kelainanname + " sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_fitness", {})
|
||||
context.commit("update_selected_datakelainan", {})
|
||||
context.dispatch("search", {
|
||||
search: prm.search,
|
||||
current_page: context.state.current_page,
|
||||
last_id: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(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,
|
||||
total_page: resp.data.total_page
|
||||
|
||||
}
|
||||
context.commit("update_summaryfisik", data.records)
|
||||
context.commit("update_total_summaryfisiks", data.total_page)
|
||||
if(prm.last_id !== -1){
|
||||
context.commit("update_selected_summaryfisik", data.records[prm.last_id])
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
}
|
||||
},
|
||||
|
||||
async searchkelainan(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchkelainan(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records
|
||||
}
|
||||
context.commit("update_datakelainans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async getfitness(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getfitness(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records
|
||||
}
|
||||
context.commit("update_fitness", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
25
one-ui/masterdata/one-md-summary-fisik/store.js
Normal file
25
one-ui/masterdata/one-md-summary-fisik/store.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import fisikheader from "./modules/fisikheader.js";
|
||||
import fisikdetail from "./modules/fisikdetail.js";
|
||||
import system from "../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
fisikheader: fisikheader,
|
||||
fisikdetail: fisikdetail,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user