Flatten nested repos
This commit is contained in:
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>
|
||||
Reference in New Issue
Block a user