Initial import
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,485 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout>
|
||||
<v-text-field class="xs4 ma-1" label="Kode" placeholder="Cari..." outline v-model="code" @keyup.enter="searchTest" hide-details></v-text-field>
|
||||
<v-text-field class="xs4 ma-1" label="Pemeriksaan" placeholder="Cari..." outline v-model="name" @keyup.enter="searchTest"
|
||||
hide-details></v-text-field>
|
||||
<!-- <span @click="searchTest" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span> -->
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card class="scroll-container" style="max-height:645px;overflow: auto;">
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="normalvalues" :loading="isLoading" :pagination.sync="pagination" class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestCode}}</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.Nat_TestName}}</td>
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination v-model="page" :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
|
||||
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogformorder" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Perusahaan</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-form ref="formcompany">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete label="Perusahaan*" v-model="xcompany" :items="xcompanies" :search-input.sync="search_company" auto-select-first
|
||||
no-filter item-text="M_CompanyName" return-object :loading="isLoading" no-data-text="Pilih Perusahaan">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requirexcompany')" class="error pl-2 pr-2" style="color:#fff">Pilih perusahaan dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-select item-text="M_MouName" return-object :items="xmous" v-model="xmou" label="MOU*"></v-select>
|
||||
<p v-if="checkError('requirexmou')" class="error pl-2 pr-2" style="color:#fff">Pilih MOU dulu dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-menu ref="menusdate" v-model="menusdate" :close-on-content-click="false" :nudge-right="0" lazy transition="scale-transition"
|
||||
offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field v-model="startComputedDateFormatted" label="Tgl. Order*" readonly v-on="on" @blur="date = deFormatedDate(startComputedDateFormatted)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker v-model="xsdate" no-title @input="menusdate = false"></v-date-picker>
|
||||
<p v-if="checkError('requirexsdate')" class="error pl-2 pr-2" style="color:#fff">Tanggal order harus diisi dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field v-model="xnote" label="Catatan"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogFormOrder()">Tutup</v-btn>
|
||||
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormPerusahaan()">Simpan</v-btn>
|
||||
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormPerusahaan()">Simpan Perubahan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialogstatusorder" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Status</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-timeline>
|
||||
<v-timeline-item v-for="(status, i) in xstatuss" :key="i" :waktu="status.waktu" :user="status.user" small>
|
||||
<template>
|
||||
<span :class="`headline font-weight-bold cyan--text`" v-text="status.status"></span>
|
||||
</template>
|
||||
<div class="py-3">
|
||||
<h2 :class="`headline font-weight-light mb-3 cyan--text`"></h2>
|
||||
<div>
|
||||
{{status.waktu}}
|
||||
<p> [ {{status.user}} ] </p>
|
||||
</div>
|
||||
</div>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="updateDialogStatusOrder()">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.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 = {
|
||||
components: {
|
||||
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("normalvalue/getsexreg")
|
||||
this.$store.dispatch("normalvalue/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.normalvalue.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.Nat_TestID == this.$store.state.normalvalue.selected_normalvalue
|
||||
.Nat_TestID
|
||||
},
|
||||
searchTest() {
|
||||
this.$store.dispatch("normalvalue/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.normalvalue.no_save == 0) {
|
||||
this.$store.commit("normalvalue/update_selected_normalvalue", pat)
|
||||
this.$store.commit("normalvalue/update_act_comp", 'edit')
|
||||
this.$store.dispatch("normalvalue/getnilainormal", {
|
||||
id: pat.Nat_TestID
|
||||
})
|
||||
} else {
|
||||
this.$store.commit("normalvalue/update_open_alert_confirmation", true)
|
||||
}
|
||||
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("normalvalue/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("normalvalue/update_no_save", 0)
|
||||
this.$store.commit("normalvalue/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("normalvalue/update_alert_success", val)
|
||||
},
|
||||
updateDialogFormOrder() {
|
||||
this.$store.commit("normalvalue/update_dialog_form_order", false)
|
||||
},
|
||||
updateDialogStatusOrder() {
|
||||
this.$store.commit("normalvalue/update_dialog_status_order", false)
|
||||
},
|
||||
setNewOrder() {
|
||||
this.$store.commit("normalvalue/update_selected_normalvalue", {})
|
||||
this.$store.commit("normalvalue/update_act_comp", 'new')
|
||||
this.$store.commit("normalvalue/update_dialog_form_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
setStatusOrder() {
|
||||
this.$store.commit("normalvalue/update_selected_normalvalue", {})
|
||||
this.$store.commit("normalvalue/update_dialog_status_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
saveFormPerusahaan() {
|
||||
this.$store.commit("normalvalue/update_errors", [])
|
||||
var errors = this.$store.state.normalvalue.errors
|
||||
if (_.isEmpty(this.xcompany)) {
|
||||
errors.push("requirexcompany")
|
||||
}
|
||||
if (_.isEmpty(this.xmou)) {
|
||||
errors.push("requirexmou")
|
||||
}
|
||||
if (_.isEmpty(this.xsdate)) {
|
||||
errors.push("requirexsdate")
|
||||
}
|
||||
if (errors.length === 0) {
|
||||
this.$store.dispatch("normalvalue/newnormalvalue", {
|
||||
companyid: this.xcompany.M_CompanyID,
|
||||
mouid: this.xmou.M_MouID,
|
||||
sdate: this.xsdate,
|
||||
note: this.xnote
|
||||
})
|
||||
}
|
||||
},
|
||||
thr_search_company: _.debounce(function () {
|
||||
this.$store.dispatch("normalvalue/searchcompany", this.search_company)
|
||||
}, 2000),
|
||||
closeDialogSuccess() {
|
||||
let arrnormalvalue = this.$store.state.normalvalue.normalvalues
|
||||
var idx = _.findIndex(arrnormalvalue, item => item.Nat_TestID === this.$store.state
|
||||
.normalvalue.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("normalvalue/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("normalvalue/update_dialog_success", false)
|
||||
},
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate(date) {
|
||||
if (!date) return null
|
||||
|
||||
const [day, month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.normalvalue.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.normalvalue.search_status == 1
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.normalvalue.act_comp
|
||||
},
|
||||
normalvalues() {
|
||||
return this.$store.state.normalvalue.normalvalues
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
dialogformorder() {
|
||||
return this.$store.state.normalvalue.dialog_form_order
|
||||
},
|
||||
dialogstatusorder() {
|
||||
return this.$store.state.normalvalue.dialog_status_order
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_date", val)
|
||||
}
|
||||
},
|
||||
xnote: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_note", val)
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.normalvalue.companies
|
||||
},
|
||||
xcompany: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_company", val)
|
||||
this.$store.dispatch("normalvalue/getmou", this.$store.state.normalvalue.company)
|
||||
}
|
||||
},
|
||||
xmous() {
|
||||
return this.$store.state.normalvalue.mous
|
||||
},
|
||||
xmou: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.mou
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_mou", val)
|
||||
}
|
||||
},
|
||||
startComputedDateFormatted() {
|
||||
return this.formatDate(this.xsdate)
|
||||
},
|
||||
xsdate: {
|
||||
get() {
|
||||
return this.$store.state.normalvalue.sdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("normalvalue/update_sdate", val)
|
||||
}
|
||||
},
|
||||
xstatuss() {
|
||||
return this.$store.state.normalvalue.statuss
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
code: '',
|
||||
name: '',
|
||||
search_company: '',
|
||||
menusdate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
page: 1,
|
||||
headers: [{
|
||||
text: "KODE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "40%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
ascending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'Nat_TestCode',
|
||||
totalItems: this.$store.state.normalvalue.total_normalvalues
|
||||
},
|
||||
statuss: [{
|
||||
waktu: '16-07-2019 10:00',
|
||||
status: 'Order Dibuat',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 11:00',
|
||||
status: 'Order Dikirim',
|
||||
user: 'Nagita Slavina'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 12:00',
|
||||
status: 'Order dikonfirmasi',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 13:00',
|
||||
status: 'Telah dibuat Surat Jalan',
|
||||
user: 'Chacha Frederica'
|
||||
},
|
||||
{
|
||||
waktu: '16-07-2019 14:00',
|
||||
status: 'Kurir akan mengambil sampel',
|
||||
user: 'Satria Subiantoro'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
search_company(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.normalvalue.update_autocomplete_status == 1) return
|
||||
this.thr_search_company()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user