Flatten nested repos
This commit is contained in:
BIN
test/vuex/one-md-so-template/.index.php.swp
Normal file
BIN
test/vuex/one-md-so-template/.index.php.swp
Normal file
Binary file not shown.
0
test/vuex/one-md-so-template/action.js
Normal file
0
test/vuex/one-md-so-template/action.js
Normal file
31
test/vuex/one-md-so-template/api.js
Normal file
31
test/vuex/one-md-so-template/api.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t02/search_bank";
|
||||
|
||||
export async function searchBank(query, page, rowPerPage = 15) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
query: query,
|
||||
page: page,
|
||||
rowPerPage: rowPerPage
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
data.query = query;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
query: query,
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
87
test/vuex/one-md-so-template/api/sotemplate.js
Normal file
87
test/vuex/one-md-so-template/api/sotemplate.js
Normal file
@@ -0,0 +1,87 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function lookup(token, search,all ) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/lookup', { token: token, search: search, all:all });
|
||||
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(token,name) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/addnewsotemplate', {
|
||||
token:token,
|
||||
name: name
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function update(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/editsotemplate', {
|
||||
id:prm.id,
|
||||
name: prm.name,
|
||||
flagpresotemplate: prm.flagpresotemplate,
|
||||
presotemplatemaxhour: prm.presotemplatemaxhour,
|
||||
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 xdelete(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/deletesotemplate', { 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
|
||||
};
|
||||
}
|
||||
}
|
||||
78
test/vuex/one-md-so-template/api/sotemplatedetail.js
Normal file
78
test/vuex/one-md-so-template/api/sotemplatedetail.js
Normal file
@@ -0,0 +1,78 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/addnewsotemplatedetail', 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 + 'sotemplate/deletesotemplatedetail', { 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function lookup(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/lookupdetail', { 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectlang(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/selectlang',{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
|
||||
};
|
||||
}
|
||||
}
|
||||
82
test/vuex/one-md-so-template/api/sotemplatetest.js
Normal file
82
test/vuex/one-md-so-template/api/sotemplatetest.js
Normal file
@@ -0,0 +1,82 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function search(token,search, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/searchtest', { token:token,search: search, id: id });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(token, sotemplateid, testid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/addnewsotemplatetest', {
|
||||
sotemplateid: sotemplateid,
|
||||
testid: testid,
|
||||
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 lookup(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/lookuptest', { 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function xdelete(token, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sotemplate/deletesotemplatetest', { 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
|
||||
};
|
||||
}
|
||||
}
|
||||
43
test/vuex/one-md-so-template/components/headerBox.vue
Normal file
43
test/vuex/one-md-so-template/components/headerBox.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<v-card>
|
||||
<v-btn class= "button parallelogram" color="success">Pasien Dokter</v-btn>
|
||||
<v-btn class= "button parallelogram" color="warning">MOU </v-btn>
|
||||
<v-btn class= "button parallelogram" color="error">Kirim Hasil </v-btn>
|
||||
<v-btn class= "button parallelogram" color="info"> Barcode</v-btn>
|
||||
</v-card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.v-card{
|
||||
text-align: center;
|
||||
}
|
||||
.v-btn__content{
|
||||
margin-top : -10px;
|
||||
}
|
||||
.button {
|
||||
|
||||
padding: 30px 16px;
|
||||
width : 20%;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
.parallelogram{
|
||||
transform: skew(-20deg);
|
||||
|
||||
}
|
||||
|
||||
.v-btn {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
|
||||
}
|
||||
</script>
|
||||
384
test/vuex/one-md-so-template/components/soTemplateDetail.vue
Normal file
384
test/vuex/one-md-so-template/components/soTemplateDetail.vue
Normal file
@@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<v-flex xs12>
|
||||
<v-card class="mb-2" color="white">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>TEMPLATE DETAIL : {{xsotemplates.name}}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<!--<v-btn @click="openFormSotemplateDetail(0)" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>-->
|
||||
</v-toolbar>
|
||||
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-4 pr-4 pb-4>
|
||||
<table>
|
||||
<tr>
|
||||
<th width="25%" class="text-md-center pt-2 pb-2">BAHASA</th>
|
||||
<th width="25%" class="text-md-center pt-2 pb-2">NAMA</th>
|
||||
<th width="20%" class="text-md-center pt-2 pb-2">SATUAN</th>
|
||||
<th class="text-md-center pt-2 pb-2">AKSI</th>
|
||||
</tr>
|
||||
<tr v-if="details.length > 0 " v-for="(detail,idx) in details">
|
||||
<td class="text-md-left pl-3">{{detail.M_LangName}}</td>
|
||||
<td class="text-md-left pl-3">{{detail.name}}</td>
|
||||
<td class="text-md-left pl-3">{{detail.unit}}</td>
|
||||
<td align="center" class="text-md-center">
|
||||
<!--<v-btn @click="editFormDetail(detail)" depressed small color="primary">
|
||||
<v-icon>edit</v-icon>
|
||||
</v-btn>-->
|
||||
<!--<v-btn @click="deleteDetail(detail)" depressed small color="error">
|
||||
<v-icon>delete</v-icon>
|
||||
</v-btn>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="details.length === 0">
|
||||
<td align="center" style="height:50px;text-align:center" colspan="8">Belum ada data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealertdetail" 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>
|
||||
{{msgalertdetail}}
|
||||
</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="dialogdeletealertdetail = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlertDetail()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogsotemplatedetail" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Sotemplate Detail</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formsotemplatedetail" v-model="validdetail" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
TEMPLATE : {{xsotemplates.name}}
|
||||
</v-flex>
|
||||
<v-flex xs12 sm12 d-flex>
|
||||
<v-select item-text="M_LangName" return-object :items="xlangs" v-model="xlang" label="Bahasa"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field label="Nama" v-model="xname"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field hint="isi jika hanya diperlukan" label="Satuan" v-model="xunit"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field label="Urutan" v-model="xorder"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormSotemplateDetail()">Tutup</v-btn>
|
||||
<v-btn color="blue darken-1" flat @click="saveFormSotemplateDetail()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background: white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table>tr>td:first {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
query: "",
|
||||
items: [],
|
||||
headers: [{
|
||||
text: "Day Off Week",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: " blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "Start",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
{
|
||||
text: "End",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
|
||||
{
|
||||
text: "Day",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
|
||||
{
|
||||
text: "Hour",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
|
||||
{
|
||||
text: "Minute",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
|
||||
{
|
||||
text: "At Time",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
},
|
||||
|
||||
{
|
||||
text: "Action",
|
||||
align: "Center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "blue lighten-4"
|
||||
}
|
||||
],
|
||||
isLoading: false,
|
||||
color: "success",
|
||||
validdetail: false,
|
||||
days: [{
|
||||
id: "2",
|
||||
name: "Senin"
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "Selasa"
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
name: "Rabu"
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
name: "Kamis"
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
name: "Jumat"
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
name: "Sabtu"
|
||||
}
|
||||
],
|
||||
seletedday: {
|
||||
id: 1,
|
||||
name: "Minggu"
|
||||
},
|
||||
xid: 0,
|
||||
xname: "",
|
||||
xunit:"",
|
||||
xorder:0,
|
||||
starthm: "",
|
||||
endhm: "",
|
||||
xday: "",
|
||||
xhour: "",
|
||||
xminute: "",
|
||||
flagattime: false,
|
||||
attime: "",
|
||||
readonlyattime: true,
|
||||
readonlyhour: false,
|
||||
readonlyminute: false,
|
||||
dialogdeletealertdetail: false,
|
||||
msgalertdetail: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("sotemplatedetail/selectlang")
|
||||
},
|
||||
computed: {
|
||||
details() {
|
||||
return this.$store.state.sotemplatedetail.sotemplatedetail
|
||||
},
|
||||
xsotemplates() {
|
||||
return this.$store.state.sotemplate.selected_sotemplate
|
||||
},
|
||||
dialogsotemplatedetail() {
|
||||
return this.$store.state.sotemplatedetail.dialog_form_sotemplate_detail
|
||||
},
|
||||
xispresotemplate() {
|
||||
return this.$store.state.sotemplatedetail.ispresotemplate
|
||||
},
|
||||
xlangs() {
|
||||
return this.$store.state.sotemplatedetail.langs
|
||||
},
|
||||
xlang: {
|
||||
get() {
|
||||
return this.$store.state.sotemplatedetail.lang
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sotemplatedetail/update_lang", val)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateDialogFormSotemplateDetail() {
|
||||
this.$store.commit("sotemplatedetail/update_dialog_form_sotemplate_detail", false)
|
||||
},
|
||||
openFormSotemplateDetail(val) {
|
||||
//console.log("masuk")
|
||||
this.xid = val
|
||||
this.$refs.formsotemplatedetail.reset()
|
||||
this.$refs.formsotemplatedetail.resetValidation()
|
||||
this.$store.commit("sotemplatedetail/update_dialog_form_sotemplate_detail", true)
|
||||
},
|
||||
editFormDetail(data) {
|
||||
this.xid = data.id
|
||||
this.xname = data.name
|
||||
this.xunit = data.unit
|
||||
this.xorder = data.xorder
|
||||
|
||||
var langs = this.$store.state.sotemplatedetail.langs
|
||||
var idx_lang = _.findIndex(langs, function (o) {
|
||||
return o.M_LangID == data.M_LangID
|
||||
})
|
||||
var lang = langs[idx_lang]
|
||||
this.$store.commit("sotemplatedetail/update_lang", lang)
|
||||
this.$store.commit("sotemplatedetail/update_dialog_form_sotemplate_detail", true)
|
||||
},
|
||||
saveFormSotemplateDetail() {
|
||||
if (this.$refs.formsotemplatedetail.validate()) {
|
||||
this.$store.dispatch("sotemplatedetail/save", {
|
||||
xid: this.xid,
|
||||
sotemplateid: this.$store.state.sotemplate.selected_sotemplate.id,
|
||||
sotemplatename: this.$store.state.sotemplate.selected_sotemplate.name,
|
||||
name: this.xname,
|
||||
unit:this.xunit,
|
||||
order:this.xorder,
|
||||
langid: this.xlang.M_LangID
|
||||
})
|
||||
}
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("sotemplate/update_alert_success", val)
|
||||
},
|
||||
changeAttime(value) {
|
||||
this.xhour = value === true ? 0 : this.xhour
|
||||
this.xminute = value === true ? 0 : this.xminute
|
||||
this.readonlyhour = value === true ? true : false
|
||||
this.readonlyminute = value === true ? true : false
|
||||
this.attime = value === true ? this.attime : ""
|
||||
this.readonlyattime = value === true ? false : true
|
||||
},
|
||||
deleteDetail(data) {
|
||||
this.xid = data.id
|
||||
|
||||
this.msgalertdetail = "Yakin, mau hapus detail " +data.name+" ?"
|
||||
this.dialogdeletealertdetail = true
|
||||
},
|
||||
closeDeleteAlertDetail() {
|
||||
this.$store.dispatch("sotemplatedetail/delete", {
|
||||
xid: this.xid,
|
||||
sotemplateid: this.$store.state.sotemplate.selected_sotemplate.id,
|
||||
sotemplatename: this.$store.state.sotemplate.selected_sotemplate.name
|
||||
})
|
||||
this.dialogdeletealertdetail = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
423
test/vuex/one-md-so-template/components/soTemplateList.vue
Normal file
423
test/vuex/one-md-so-template/components/soTemplateList.vue
Normal file
@@ -0,0 +1,423 @@
|
||||
<template>
|
||||
<v-layout>
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogdeletealert" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<v-layout row>
|
||||
<v-flex pb-1 xs12>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pr-2 xs12>
|
||||
{{msgalert}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialogdeletealert = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn color="primary" flat @click="closeDeleteAlert()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<v-flex xs12>
|
||||
<v-card class="scroll-container" style="/*max-height:645px;overflow: auto;*/">
|
||||
<v-toolbar color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>TEMPLATE</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<!--<v-btn @click="openFormSotemplate()" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>-->
|
||||
</v-toolbar>
|
||||
<v-snackbar v-model="snackbar" :color="color" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
|
||||
{{msgsnackbar}}
|
||||
<v-btn flat @click="updateAlert_success(false)">
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-center>
|
||||
<v-list-tile>
|
||||
<input type="text" v-model="xsearch" class="textinput" placeholder="Cari ..." />
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div style="overflow: auto;max-height:550px">
|
||||
<div v-for="(vs,idx) in vsotemplates" :key="vs.id">
|
||||
|
||||
<v-layout pa-2 v-if="isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxsolid" xs12>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-on="on">{{vs.detail}}</span>
|
||||
</template>
|
||||
<span>{{vs.detail}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxsolid text-center" style="padding-top:10px" pl-2 pb-2 pr-2 xs3>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<!--<v-icon v-if="vs.id > 1" style="color:#ffffff" @click="editSotemplate(vs)">edit</v-icon>-->
|
||||
<!--<v-icon v-if="vs.id > 1" style="color:#ffffff" @click="deleteSotemplate(vs)">clear</v-icon>-->
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
|
||||
<v-layout pa-2 v-if="!isSelected(vs)" row>
|
||||
<v-flex xs12 @click="selectMe(vs)">
|
||||
<v-layout row>
|
||||
<v-flex class="boxoutline" xs12>
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on }">
|
||||
<span v-on="on">{{vs.detail}}</span>
|
||||
</template>
|
||||
<span>{{vs.detail}}</span>
|
||||
</v-tooltip>
|
||||
</v-flex>
|
||||
<v-flex class="boxoutline text-center" style="padding-top:10px" pl-2 pb-2 pr-2 xs3>
|
||||
<v-layout row align-center justify-space-between>
|
||||
<!--<v-icon v-if="vs.id > 1" style="color:red" @click="editSotemplate(vs)">edit</v-icon>-->
|
||||
<!--<v-icon v-if="vs.id > 1" style="color:red" @click="deleteSotemplate(vs)">clear</v-icon>-->
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
</div>
|
||||
</div>
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-center" pt-3 xs12>
|
||||
<p style="margin-bottom:2px;color: rgba(0,0,0,0.54);font-size:12px;">Menampilkan <span class="red--text">{{xtotalfiltersotemplates}}</span> dari <span class="red--text">{{xtotalsotemplates}}</span> total data</p>
|
||||
<v-btn small v-if="xshowall === 'N'" flat @click="updateShowAll('Y')" color="primary" dark>Tampilkan Semua</v-btn>
|
||||
<v-btn small v-if="xshowall === 'Y'" flat @click="updateShowAll('N')" color="primary" dark>Batasi data</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogsotemplate" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Sotemplate</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formsotemplate" v-model="valid" lazy-validation>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="sotemplatename" label="Nama" :rules="nameRules" required></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormSotemplate()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormSotemplate()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormSotemplate()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.textinput {
|
||||
-webkit-transition: width 0.4s ease-in-out;
|
||||
transition: width 0.4s ease-in-out;
|
||||
background-color: white;
|
||||
background-position: 10px 10px;
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 40px;
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #607d8b;
|
||||
|
||||
}
|
||||
|
||||
.textinput:focus {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.textinput:focus::-webkit-input-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:focus::-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.textinput:-moz-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.boxoutline {
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxoutline:hover {
|
||||
background: rgba(0, 0, 0, 0.07) !important;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.boxsolid {
|
||||
color: #ffffff;
|
||||
border: 1px solid #ffffff;
|
||||
justify-content: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
padding-left: 10px;
|
||||
background: #f44336;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 1px
|
||||
}
|
||||
|
||||
.boxsolid:hover {
|
||||
background: #f44336de;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
color: "success",
|
||||
valid: false,
|
||||
sotemplatename: '',
|
||||
nameRules: [
|
||||
v => !!v || 'Nama Sotemplate harus diisi'
|
||||
],
|
||||
dialogdeletealert: false,
|
||||
msgalert: "",
|
||||
xid: 0,
|
||||
xsearch: ""
|
||||
}),
|
||||
mounted() {
|
||||
this.$store.dispatch("sotemplate/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
xact() {
|
||||
return this.$store.state.sotemplate.act
|
||||
},
|
||||
xerrorname() {
|
||||
return this.$store.state.sotemplate.error_name
|
||||
},
|
||||
xshowall() {
|
||||
return this.$store.state.sotemplate.show_all
|
||||
},
|
||||
vsotemplates() {
|
||||
return this.$store.state.sotemplate.sotemplates
|
||||
},
|
||||
xtotalsotemplates() {
|
||||
return this.$store.state.sotemplate.total_sotemplates
|
||||
},
|
||||
xtotalfiltersotemplates() {
|
||||
return this.$store.state.sotemplate.total_filter_sotemplates
|
||||
},
|
||||
dialogsotemplate() {
|
||||
return this.$store.state.sotemplate.dialog_form_sotemplate
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.sotemplate.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sotemplate/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.sotemplate.msg_success
|
||||
},
|
||||
lookupstatus() {
|
||||
return this.$store.state.sotemplate.lookup_sotemplate
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
updateShowAll(val) {
|
||||
this.$store.commit("sotemplate/update_show_all", val)
|
||||
this.$store.dispatch("sotemplate/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.id == this.$store.state.sotemplate.selected_sotemplate.id
|
||||
},
|
||||
subname(name) {
|
||||
var xname = name
|
||||
if (xname.length > 15) {
|
||||
xname = xname.substring(0, 12) + '...'
|
||||
}
|
||||
return xname
|
||||
},
|
||||
selectMe(sc) {
|
||||
this.$store.commit("sotemplate/update_selected_sotemplate", sc)
|
||||
//this.$store.commit("sotemplatetest/update_sotemplate_test",sc.sotemplatetests)
|
||||
this.$store.dispatch("sotemplatetest/lookup", {
|
||||
id: this.$store.state.sotemplate.selected_sotemplate.id
|
||||
})
|
||||
|
||||
this.$store.dispatch("sotemplatedetail/lookup", {
|
||||
id: this.$store.state.sotemplate.selected_sotemplate.id
|
||||
})
|
||||
},
|
||||
updateDialogFormSotemplate() {
|
||||
this.$store.commit("sotemplate/update_dialog_form_sotemplate", false)
|
||||
},
|
||||
openFormSotemplate() {
|
||||
this.$refs.formsotemplate.reset()
|
||||
this.$refs.formsotemplate.resetValidation()
|
||||
this.$store.commit("sotemplate/update_act", 'new')
|
||||
this.$store.commit("sotemplate/update_error_name", false)
|
||||
this.$store.commit("sotemplate/update_dialog_form_sotemplate", true)
|
||||
},
|
||||
saveFormSotemplate() {
|
||||
if (this.$refs.formsotemplate.validate()) {
|
||||
this.$store.dispatch("sotemplate/save", {
|
||||
name: this.sotemplatename
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
updateFormSotemplate() {
|
||||
if (this.$refs.formsotemplate.validate()) {
|
||||
this.$store.dispatch("sotemplate/update", {
|
||||
id: this.xid,
|
||||
name: this.sotemplatename
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("sotemplate/update_alert_success", val)
|
||||
},
|
||||
editSotemplate(data) {
|
||||
//console.log(data)
|
||||
this.xid = data.id
|
||||
this.sotemplatename = data.name
|
||||
this.$store.commit("sotemplate/update_act", 'edit')
|
||||
this.$store.commit("sotemplate/update_error_name", false)
|
||||
this.$store.commit("sotemplate/update_dialog_form_sotemplate", true)
|
||||
},
|
||||
deleteSotemplate(data) {
|
||||
//console.log(data)
|
||||
this.xid = data.id
|
||||
var xdata = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
sotemplatedetail: 'xxx',
|
||||
sotemplatetests: 'xxx'
|
||||
}
|
||||
this.$store.commit("sotemplate/update_selected_sotemplate", xdata)
|
||||
this.msgalert = "Yakin, mau hapus sotemplate " + data.name + " ?"
|
||||
this.dialogdeletealert = true
|
||||
},
|
||||
closeDeleteAlert() {
|
||||
this.$store.dispatch("sotemplate/delete", {
|
||||
sotemplateid: this.$store.state.sotemplate.selected_sotemplate.id,
|
||||
sotemplatename: this.$store.state.sotemplate.selected_sotemplate.name
|
||||
})
|
||||
this.dialogdeletealert = false
|
||||
},
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("sotemplate/lookup", {
|
||||
search: this.xsearch,
|
||||
all: this.xshowall
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
watch: {
|
||||
xsearch(val, old) {
|
||||
|
||||
if (val !== old && this.lookupstatus !== 1) {
|
||||
console.log(val)
|
||||
this.xsearch = val
|
||||
this.thr_search()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
219
test/vuex/one-md-so-template/components/soTemplateTest.vue
Normal file
219
test/vuex/one-md-so-template/components/soTemplateTest.vue
Normal file
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<v-layout >
|
||||
<v-flex xs12 >
|
||||
<v-card class="mb-2" color="white" style="min-height:100px" >
|
||||
<v-toolbar class="mb-1" color="blue lighten-3" dark height="50px">
|
||||
<v-toolbar-title>TEMPLATE TEST : {{xsotemplates.name}}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<!--<v-btn @click="openFormSotemplateTest()" icon>
|
||||
<v-icon>library_add</v-icon>
|
||||
</v-btn>-->
|
||||
</v-toolbar>
|
||||
<v-btn class="mt-1 mb-2" v-for="(vst,idx) in vsotemplatetests" :key="vst.id" small color="error">{{vst.name}} <!--<v-icon @click="deleteTest(vst)" right dark>clear</v-icon>--> </v-btn>
|
||||
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialogdeletealerttest"
|
||||
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>
|
||||
{{msgalerttest}}
|
||||
</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="dialogdeletealerttest = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="closeDeleteAlertTest()"
|
||||
>
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogsotemplatetest" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Template Pemeriksaan</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form
|
||||
ref="formsotemplatetest"
|
||||
v-model="validtest"
|
||||
lazy-validation
|
||||
>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
TEMPLATE : {{xsotemplates.name}}
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
label="Pemeriksaan"
|
||||
v-model="xselected_test"
|
||||
:items="xtests"
|
||||
:search-input.sync="search"
|
||||
auto-select-first
|
||||
no-filter
|
||||
return-object
|
||||
item-text="name"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Pemeriksaan"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<!--<v-btn color="blue darken-1" flat @click="updateDialogFormSotemplateTest()">Tutup</v-btn>-->
|
||||
<!--<v-btn color="blue darken-1" flat @click="saveFormSotemplateTest()">Simpan</v-btn>-->
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
color:"success",
|
||||
validtest:false,
|
||||
search:"",
|
||||
dialogdeletealerttest:false,
|
||||
xid:0,
|
||||
msgalerttest:""
|
||||
}),
|
||||
computed: {
|
||||
vsotemplatetests() {
|
||||
return this.$store.state.sotemplatetest.sotemplatetests
|
||||
},
|
||||
dialogsotemplatetest(){
|
||||
return this.$store.state.sotemplatetest.dialog_form_sotemplate_test
|
||||
},
|
||||
xselected_test: {
|
||||
get() {
|
||||
return this.$store.state.sotemplatetest.selected_test
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sotemplatetest/update_selected_test",val)
|
||||
}
|
||||
},
|
||||
xsotemplates(){
|
||||
return this.$store.state.sotemplate.selected_sotemplate
|
||||
},
|
||||
xtests(){
|
||||
return this.$store.state.sotemplatetest.tests
|
||||
},
|
||||
is_loading() {
|
||||
return this.$store.state.sotemplatetest.search_status == 1
|
||||
}
|
||||
},
|
||||
methods : {
|
||||
updateDialogFormSotemplateTest(){
|
||||
this.$store.commit("sotemplatetest/update_dialog_form_sotemplate_test",false)
|
||||
},
|
||||
openFormSotemplateTest(){
|
||||
this.$store.commit("sotemplatetest/update_selected_test",{})
|
||||
this.$refs.formsotemplatetest.reset()
|
||||
this.$refs.formsotemplatetest.resetValidation()
|
||||
this.$store.commit("sotemplatetest/update_dialog_form_sotemplate_test",true)
|
||||
},
|
||||
saveFormSotemplateTest(){
|
||||
if (this.$refs.formsotemplatetest.validate()) {
|
||||
this.$store.dispatch("sotemplatetest/save",{
|
||||
sotemplateid:this.$store.state.sotemplate.selected_sotemplate.id,
|
||||
sotemplatename:this.$store.state.sotemplate.selected_sotemplate.name,
|
||||
testid:this.xselected_test.id,
|
||||
testname:this.xselected_test.name
|
||||
})
|
||||
}
|
||||
},
|
||||
updateAlert_success(val){
|
||||
this.$store.commit("sotemplate/update_alert_success",val)
|
||||
},
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("sotemplatetest/search",{id:this.$store.state.sotemplate.selected_sotemplate.id})
|
||||
},2000),
|
||||
deleteTest(data){
|
||||
this.xid = data.id
|
||||
console.log(this.xid)
|
||||
this.$store.commit("sotemplatetest/update_selected_test",data)
|
||||
this.msgalerttest = "Yakin, mau hapus pemeriksaan "+this.xselected_test.name+ "dari sotemplate "+this.xsotemplates.name+" ?"
|
||||
this.dialogdeletealerttest = true
|
||||
},
|
||||
closeDeleteAlertTest(){
|
||||
this.$store.dispatch("sotemplatetest/delete",{
|
||||
xid:this.xid,
|
||||
sotemplateid:this.$store.state.sotemplate.selected_sotemplate.id,
|
||||
sotemplatename:this.$store.state.sotemplate.selected_sotemplate.name,
|
||||
testname:this.xselected_test.name
|
||||
})
|
||||
this.dialogdeletealerttest = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
search(val,old) {
|
||||
console.log(val)
|
||||
if (val !== "" && val !== old && val && val.length > 2){
|
||||
this.$store.commit("sotemplatetest/update_search",val)
|
||||
this.thr_search()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
81
test/vuex/one-md-so-template/index.php
Normal file
81
test/vuex/one-md-so-template/index.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<!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 xs3 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-so-template-list></one-so-template-list>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs9 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-so-template-test></one-so-template-test>
|
||||
<one-so-template-detail></one-so-template-detail>
|
||||
|
||||
|
||||
</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/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-so-template-list': httpVueLoader('./components/soTemplateList.vue'),
|
||||
'one-so-template-test': httpVueLoader('./components/soTemplateTest.vue'),
|
||||
'one-so-template-detail' : httpVueLoader('./components/soTemplateDetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
59
test/vuex/one-md-so-template/index0.php
Normal file
59
test/vuex/one-md-so-template/index0.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<!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>
|
||||
|
||||
<one-fo-verification-list> <one-fo-verification-list>
|
||||
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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>
|
||||
<!-- 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/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-fo-verification-list': httpVueLoader('./components/foVerificationList.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
73
test/vuex/one-md-so-template/kris.php
Normal file
73
test/vuex/one-md-so-template/kris.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<!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-flex xs6 class="left">
|
||||
<v-container fluid fill-height>
|
||||
<one-fo-verification-list> </one-fo-verification-list>
|
||||
</v-container>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="right">
|
||||
<v-container fluid fill-height>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<one-fo-verification-status></one-fo-verification-status>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<!-- pasien dokter mengko lebokno kene -->
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-flex>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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>
|
||||
<!-- 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/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-fo-verification-list': httpVueLoader('./components/oneFoVerificationListKris.vue'),
|
||||
'one-fo-verification-status': httpVueLoader('./components/oneFoVerificationStatus.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
195
test/vuex/one-md-so-template/modules/sotemplate.js
Normal file
195
test/vuex/one-md-so-template/modules/sotemplate.js
Normal file
@@ -0,0 +1,195 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/sotemplate.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
act:'new',
|
||||
lookup_sotemplate: 0,
|
||||
lookup_error_message: '',
|
||||
sotemplates: [],
|
||||
total_sotemplates: 0,
|
||||
total_filter_sotemplates: 0,
|
||||
selected_sotemplate: { name: "[ Belum memilih Tempalate ]" },
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_sotemplate: false,
|
||||
dialog_edit_form_sotemplate:false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
show_all:'N',
|
||||
error_name:false,
|
||||
get_data_status: 0,
|
||||
get_data_error_message: ''
|
||||
},
|
||||
mutations: {
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_error_name(state, val) {
|
||||
state.error_name = val
|
||||
},
|
||||
update_show_all(state, val) {
|
||||
state.show_all = val
|
||||
},
|
||||
update_lookup_error_message(state, status) {
|
||||
state.lookup_error_message = status
|
||||
},
|
||||
update_lookup_sotemplate(state, status) {
|
||||
state.lookup_sotemplate = status
|
||||
},
|
||||
update_sotemplates(state, data) {
|
||||
state.sotemplates = data.records
|
||||
state.total_sotemplates = data.total
|
||||
state.total_filter_sotemplates = data.total_filter
|
||||
},
|
||||
update_selected_sotemplate(state, val) {
|
||||
state.selected_sotemplate = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_sotemplate(state, val) {
|
||||
state.dialog_form_sotemplate = val
|
||||
},
|
||||
update_dialog_edit_form_sotemplate(state, val) {
|
||||
state.dialog_edit_form_sotemplate = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_get_data_error_message(state, val) {
|
||||
state.get_data_error_message = val
|
||||
}
|
||||
|
||||
},
|
||||
actions: {
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_sotemplate", 1)
|
||||
try {
|
||||
let resp = await api.lookup(one_token(), prm.search, prm.all)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_sotemplate", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_sotemplate", 2)
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
context.commit("update_sotemplates", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_sotemplate", 3)
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.save(one_token(),prm.name)
|
||||
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_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if(data.total !== -1){
|
||||
context.commit("update_error_name", false)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_sotemplate", false)
|
||||
var msg = "Template " + prm.name + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", { search: "" , all:context.show_all})
|
||||
}else{
|
||||
context.commit("update_error_name", true)
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async update(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.update(one_token(),prm)
|
||||
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_save_error_message", resp.message)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
|
||||
if(data.total !== -1){
|
||||
context.commit("update_error_name", false)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_dialog_form_sotemplate", false)
|
||||
var msg = "Template " + prm.name + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.dispatch("lookup", { search: "" , all:context.show_all})
|
||||
}else{
|
||||
context.commit("update_error_name", true)
|
||||
}
|
||||
|
||||
}
|
||||
} 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.sotemplateid)
|
||||
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)
|
||||
|
||||
//context.commit("update_dialog_form_sotemplate_detail", false)
|
||||
var msg = "Template " + prm.sotemplatename + " sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.commit("update_selected_sotemplate", {})
|
||||
context.dispatch("lookup", { search: "" })
|
||||
context.commit("sotemplatetest/update_sotemplate_test", [], { root: true })
|
||||
context.commit("sotemplatedetail/update_sotemplate_detail", [], { root: true })
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
133
test/vuex/one-md-so-template/modules/sotemplatedetail.js
Normal file
133
test/vuex/one-md-so-template/modules/sotemplatedetail.js
Normal file
@@ -0,0 +1,133 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/sotemplatedetail.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
sotemplatedetail: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_sotemplate_detail: false,
|
||||
lookup_sotemplate_detail: 0,
|
||||
langs: [],
|
||||
lang: {},
|
||||
|
||||
},
|
||||
mutations: {
|
||||
update_sotemplate_detail(state, data) {
|
||||
state.sotemplatedetail = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_sotemplate_detail(state, val) {
|
||||
state.dialog_form_sotemplate_detail = val
|
||||
console.log(state.dialog_form_sotemplate_detail)
|
||||
},
|
||||
update_lookup_sotemplate_detail(state, val) {
|
||||
state.lookup_sotemplate_detail = val
|
||||
},
|
||||
update_langs(state, data) {
|
||||
state.langs = data
|
||||
},
|
||||
update_lang(state, val) {
|
||||
state.lang = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
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("sotemplate/update_save_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("sotemplate/update_save_status", 2, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
|
||||
context.commit("update_dialog_form_sotemplate_detail", false)
|
||||
var msg = "Detail sotemplate " + prm.sotemplatename + " sudah update dong"
|
||||
context.commit("sotemplate/update_msg_success", msg, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
context.dispatch("lookup", {
|
||||
id: prm.sotemplateid
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_sotemplate_detail", 1)
|
||||
try {
|
||||
let resp = await api.lookup(one_token(),prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_sotemplate_detail", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_sotemplate_detail", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_sotemplate_detail", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_sotemplate_detail", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(),prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("sotemplate/update_save_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("sotemplate/update_save_status", 2, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
|
||||
//context.commit("update_dialog_form_sotemplate_detail", false)
|
||||
var msg = "Detail sotemplate " + prm.sotemplatename + " sudah dihapus dong"
|
||||
context.commit("sotemplate/update_msg_success", msg, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
context.dispatch("lookup", {
|
||||
id: prm.sotemplateid
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async selectlang(context) {
|
||||
context.commit("sotemplate/update_get_data_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.selectlang(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("sotemplate/update_get_data_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_get_data_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("sotemplate/update_get_data_status", 2, { root: true })
|
||||
context.commit("sotemplate/update_get_data_error_message", "", { root: true })
|
||||
context.commit("update_langs", resp.data.records.langs)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("sotemplate/update_get_data_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_get_data_error_message", e.message, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
138
test/vuex/one-md-so-template/modules/sotemplatetest.js
Normal file
138
test/vuex/one-md-so-template/modules/sotemplatetest.js
Normal file
@@ -0,0 +1,138 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/sotemplatetest.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
sotemplatetests: [],
|
||||
dialog_form_sotemplate_test: false,
|
||||
selected_sotemplate: {},
|
||||
selected_test: {},
|
||||
search_status: 0,
|
||||
tests: [],
|
||||
total_test: 0,
|
||||
search: '',
|
||||
lookup_sotemplate_test: 0
|
||||
},
|
||||
mutations: {
|
||||
update_sotemplate_test(state, data) {
|
||||
state.sotemplatetests = data
|
||||
},
|
||||
update_dialog_form_sotemplate_test(state, data) {
|
||||
state.dialog_form_sotemplate_test = data
|
||||
},
|
||||
update_selected_sotemplate(state, data) {
|
||||
state.selected_sotemplate = data
|
||||
},
|
||||
update_selected_test(state, data) {
|
||||
state.selected_test = data
|
||||
},
|
||||
update_search(state, val) {
|
||||
state.search = val
|
||||
},
|
||||
update_search_status(state, status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_tests(state, data) {
|
||||
state.tests = data.records
|
||||
state.total_test = data.total
|
||||
},
|
||||
update_lookup_sotemplate_test(state, val) {
|
||||
state.lookup_sotemplate_test = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async save(context, prm) {
|
||||
context.commit("sotemplate/update_save_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.save(one_token(),prm.sotemplateid, prm.testid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("sotemplate/update_save_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("sotemplate/update_save_status", 2, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
|
||||
context.commit("update_dialog_form_sotemplate_test", false)
|
||||
var msg = "Pemeriksaan " + prm.testname + " untuk sotemplate " + prm.sotemplatename + " sudah tersimpan dong"
|
||||
context.commit("sotemplate/update_msg_success", msg, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
context.dispatch("lookup", {
|
||||
id: prm.sotemplateid
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async search(context, prm) {
|
||||
//console.log('dsadas')
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.search(one_token(),context.state.search, prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
} else {
|
||||
context.commit("update_search_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_tests", data)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_status", 3)
|
||||
//context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_lookup_sotemplate_test", 1)
|
||||
try {
|
||||
let resp = await api.lookup(one_token(),prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_sotemplate_test", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_sotemplate_test", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_sotemplate_test", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_sotemplate_test", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("sotemplate/update_save_status", 1, { root: true })
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(),prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("sotemplate/update_save_status", 3, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
} else {
|
||||
context.commit("sotemplate/update_save_status", 2, { root: true })
|
||||
context.commit("sotemplate/update_save_error_message", resp.message, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
|
||||
//context.commit("update_dialog_form_sotemplate_promise", false)
|
||||
var msg = "Test " + prm.testname + " dari sotemplate " + prm.sotemplatename + " sudah dihapus dong"
|
||||
context.commit("sotemplate/update_msg_success", msg, { root: true })
|
||||
context.commit("sotemplate/update_alert_success", true, { root: true })
|
||||
context.dispatch("lookup", {
|
||||
id: prm.sotemplateid
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("sotemplate/update_save_status", 3, { root: true })
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
test/vuex/one-md-so-template/mutation.js
Normal file
0
test/vuex/one-md-so-template/mutation.js
Normal file
75
test/vuex/one-md-so-template/night.php
Normal file
75
test/vuex/one-md-so-template/night.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!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>
|
||||
<v-layout row wrap >
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-kiri></one-kiri>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-kanan></one-kanan>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer>
|
||||
</one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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>
|
||||
<!-- 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/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-kiri' : httpVueLoader('./components/oneKiri.vue'),
|
||||
'one-kanan' : httpVueLoader('./components/oneKanan.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
27
test/vuex/one-md-so-template/store.js
Normal file
27
test/vuex/one-md-so-template/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import sotemplate from "./modules/sotemplate.js";
|
||||
import sotemplatetest from "./modules/sotemplatetest.js";
|
||||
import sotemplatedetail from "./modules/sotemplatedetail.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
sotemplate: sotemplate,
|
||||
sotemplatetest: sotemplatetest,
|
||||
sotemplatedetail: sotemplatedetail,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user