1006 lines
38 KiB
Vue
1006 lines
38 KiB
Vue
<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>NEW FORCE PAYMENT</v-toolbar-title>
|
|
<v-spacer></v-spacer>
|
|
<!-- <v-btn v-if="xinstrument.name != 'Belum Pilih Control'" @click="openFormQc(0)" icon>
|
|
<v-icon>library_add</v-icon>
|
|
</v-btn> -->
|
|
<v-icon v-if="xinstrument.name != 'Belum Pilih Control'" style="color:white" @click="simpanAll()">save</v-icon>
|
|
</v-toolbar>
|
|
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
|
|
<v-list-tile>
|
|
</v-list-tile-content>
|
|
</v-list-tile>
|
|
</v-layout>
|
|
<v-divider></v-divider>
|
|
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
|
|
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
|
<v-card>
|
|
<v-card-title>
|
|
<span class="headline"></span>
|
|
</v-card-title>
|
|
<v-card-text class="pt-0 pb-0">
|
|
<v-form ref="formcontrolqc" v-model="validqc" lazy-validation>
|
|
<v-layout wrap>
|
|
<v-flex xs12>
|
|
<v-layout>
|
|
<v-flex xs6 pa-1>
|
|
<v-text-field v-model="xtransaction" label="Nomor Transaksi*" :rules="xtransactionRules" required></v-text-field>
|
|
|
|
</v-flex>
|
|
<v-flex xs6 pa-1>
|
|
<v-text-field v-model="xref" label="Nomor Ref*" :rules="xrefRules" required></v-text-field>
|
|
|
|
</v-flex>
|
|
</v-layout>
|
|
|
|
</v-flex>
|
|
<v-flex>
|
|
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn @click="saveFormQc()" color="blue en-3">SUBMIT</v-btn>
|
|
</v-card-actions>
|
|
</v-form>
|
|
</v-card>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-divider></v-divider>
|
|
<template>
|
|
<v-layout row justify-center>
|
|
<v-dialog v-model="dialogqc" persistent max-width="750px">
|
|
|
|
</v-dialog>
|
|
</v-layout>
|
|
</template>
|
|
|
|
</v-card>
|
|
</v-flex>
|
|
|
|
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
|
|
<template>
|
|
|
|
<v-dialog v-model="dialogdeletealertqc" max-width="30%">
|
|
<v-card>
|
|
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
|
Konfirmasi
|
|
</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>
|
|
{{msgalertqc}}
|
|
</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="dialogdeletealertqc = false">
|
|
Tutup
|
|
</v-btn>
|
|
<v-btn color="primary" flat @click="closeActiveAlertQc()">
|
|
Yakin lah
|
|
</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
|
|
</template>
|
|
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
|
|
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
|
</v-layout>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.searchbox .v-input.v-text-field .v-input__slot {
|
|
min-height: 60px;
|
|
}
|
|
|
|
.searchbox .v-btn {
|
|
min-height: 60px;
|
|
}
|
|
|
|
table.v-table tbody td,
|
|
table.v-table tbody th {
|
|
height: 40px;
|
|
}
|
|
|
|
table.v-table thead tr {
|
|
height: 40px;
|
|
}
|
|
|
|
.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: left;
|
|
height: 45px;
|
|
line-height: 45px;
|
|
padding-left: 10px;
|
|
background: #ffffff;
|
|
font-size: 10px;
|
|
font-weight: 50;
|
|
word-wrap: break-word;
|
|
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 = {
|
|
components: {
|
|
'one-date-picker': httpVueLoader('../../common/oneDatePicker.vue'),
|
|
'one-dialog-print': httpVueLoader('../../common/oneDialogPrintX.vue'),
|
|
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
|
},
|
|
data() {
|
|
return {
|
|
query: "",
|
|
items: [],
|
|
openprint: false,
|
|
urlprint: '',
|
|
printtitle: '',
|
|
printwidth: 600,
|
|
formatreport: 'pdf',
|
|
readonlydefault: false,
|
|
page: 1,
|
|
xname: '',
|
|
xphone: '',
|
|
xcode: '',
|
|
xdescription: '',
|
|
xipdescription: '',
|
|
xbasename: '',
|
|
isdefault: false,
|
|
issatellite: false,
|
|
search_control: '',
|
|
search_city: '',
|
|
search_district: '',
|
|
search_kelurahan: '',
|
|
search_company: '',
|
|
search_mou: '',
|
|
search_doctor: '',
|
|
search_test: '',
|
|
menufilterdatestart: false,
|
|
date: new Date().toISOString().substr(0, 10),
|
|
xtransactionRules: [
|
|
v => !!v || 'Nomor Transaksi harus diisi'
|
|
],
|
|
xrefRules : [
|
|
v => !!v || 'Nomor Referensi harus diisi'
|
|
],
|
|
descriptionRules: [
|
|
v => !!v || 'Alamat harus diisi'
|
|
],
|
|
xipdescriptionRules: [
|
|
v => !!v || 'Alamat IP harus diisi'
|
|
],
|
|
controlRules: [
|
|
v => !!v || 'Control harus dipilih'
|
|
],
|
|
cityRules: [
|
|
v => !!v || 'Kota harus dipilih'
|
|
],
|
|
districtRules: [
|
|
v => !!v || 'Kecamatan harus dipilih'
|
|
],
|
|
kelurahanRules: [
|
|
v => !!v || 'Kelurahan harus dipilih'
|
|
],
|
|
headers: [{
|
|
text: "PEMERIKSAAN",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "lab",
|
|
width: "30%",
|
|
class: "blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "INSTRUMENT",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "lab",
|
|
width: "10%",
|
|
class: "blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "MEAN",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "SD",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "TEA",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "VALUE",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "blue lighten-3 white--text"
|
|
}
|
|
],
|
|
pagination: {
|
|
descending: false,
|
|
page: 1,
|
|
rowsPerPage: 100,
|
|
sortBy: 'Nat_QcName ASC',
|
|
totalItems: this.$store.state.qc.total_transactions
|
|
},
|
|
statuss: [{
|
|
waktu: '16-07-2019 10:00',
|
|
status: 'Order Dibuat',
|
|
qc: 'Nagita Slavina'
|
|
},
|
|
{
|
|
waktu: '16-07-2019 11:00',
|
|
status: 'Order Dikirim',
|
|
qc: 'Nagita Slavina'
|
|
},
|
|
{
|
|
waktu: '16-07-2019 12:00',
|
|
status: 'Order dikonfirmasi',
|
|
qc: 'Chacha Frederica'
|
|
},
|
|
{
|
|
waktu: '16-07-2019 13:00',
|
|
status: 'Telah dibuat Surat Jalan',
|
|
qc: 'Chacha Frederica'
|
|
},
|
|
{
|
|
waktu: '16-07-2019 14:00',
|
|
status: 'Kurir akan mengambil sampel',
|
|
qc: 'Satria Subiantoro'
|
|
}
|
|
],
|
|
color: "success",
|
|
validqc: false,
|
|
xid: 0,
|
|
isinput: "N",
|
|
countprice: 0,
|
|
qcqcid: 0,
|
|
qcxname: "",
|
|
qclang: "",
|
|
qctext: "",
|
|
isadvance: "N",
|
|
qcformatadvance: "",
|
|
issenttocontrol: "N",
|
|
menustartdate: false,
|
|
menuenddate: false,
|
|
date: new Date().toISOString().substr(0, 10),
|
|
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
|
dialogdeletealertqc: false,
|
|
dialogverifyalertqc: false,
|
|
dialogreleasealertqc: false,
|
|
alertverify: false,
|
|
dialogunreleasealertqc: false,
|
|
dialogunverifyalertqc: false,
|
|
msgalertqc: ""
|
|
};
|
|
},
|
|
mounted() {},
|
|
computed: {
|
|
qcs() {
|
|
return this.$store.state.qc.qcs
|
|
},
|
|
xcontrol() {
|
|
return this.$store.state.control.selected_control
|
|
},
|
|
xinstrument() {
|
|
return this.$store.state.instrument.selected_instrument
|
|
},
|
|
dialogqc() {
|
|
return this.$store.state.qc.dialog_form_qc
|
|
},
|
|
xerrors() {
|
|
return this.$store.state.qc.errors
|
|
},
|
|
isLoading() {
|
|
return this.$store.state.qc.search_status == 1
|
|
},
|
|
filterComputedDateFormattedStart() {
|
|
return this.formatDate(this.xstartdate)
|
|
},
|
|
xstartdate: {
|
|
get() {
|
|
return this.$store.state.qc.startdate
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_startdate", val)
|
|
}
|
|
},
|
|
endComputedDateFormatted() {
|
|
return this.formatDate(this.xenddate)
|
|
},
|
|
xenddate: {
|
|
get() {
|
|
return this.$store.state.qc.enddate
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_enddate", val)
|
|
}
|
|
},
|
|
xorderautotests() {
|
|
return this.$store.state.qc.orderautotests
|
|
},
|
|
xorderautotest: {
|
|
get() {
|
|
return this.$store.state.qc.orderautotest
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_orderautotest", val)
|
|
}
|
|
},
|
|
xordertests() {
|
|
return this.$store.state.qc.ordertests
|
|
},
|
|
xautocitys() {
|
|
return this.$store.state.qc.autocitys
|
|
},
|
|
xautocity: {
|
|
get() {
|
|
return this.$store.state.qc.autocity
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autocity", val)
|
|
this.$store.dispatch("qc/searchdistrict", {
|
|
search: this.search_district,
|
|
id: val.M_CityID
|
|
})
|
|
}
|
|
},
|
|
xautodistricts() {
|
|
return this.$store.state.qc.autodistricts
|
|
},
|
|
xautodistrict: {
|
|
get() {
|
|
return this.$store.state.qc.autodistrict
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autodistrict", val)
|
|
this.$store.dispatch("qc/searchkelurahan", {
|
|
search: this.search_kelurahan,
|
|
id: val.M_DistrictID
|
|
})
|
|
}
|
|
},
|
|
xautokelurahans() {
|
|
return this.$store.state.qc.autokelurahans
|
|
},
|
|
xautokelurahan: {
|
|
get() {
|
|
return this.$store.state.qc.autokelurahan
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autokelurahan", val)
|
|
}
|
|
},
|
|
xautocompanys() {
|
|
return this.$store.state.qc.autocompanys
|
|
},
|
|
xautocompany: {
|
|
get() {
|
|
return this.$store.state.qc.autocompany
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autocompany", val)
|
|
this.$store.dispatch("qc/searchmou", {
|
|
search: this.search_mou,
|
|
id: val.M_CompanyID
|
|
})
|
|
}
|
|
},
|
|
xautomous() {
|
|
return this.$store.state.qc.automous
|
|
},
|
|
xautomou: {
|
|
get() {
|
|
return this.$store.state.qc.automou
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_automou", val)
|
|
}
|
|
},
|
|
xautodoctors() {
|
|
return this.$store.state.qc.autodoctors
|
|
},
|
|
xautodoctor: {
|
|
get() {
|
|
return this.$store.state.qc.autodoctor
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autodoctor", val)
|
|
this.$store.dispatch("qc/selectdescriptiondoctor", {
|
|
id: val.M_DoctorID
|
|
})
|
|
}
|
|
},
|
|
xdescriptiondoctors() {
|
|
return this.$store.state.qc.descriptiondoctors
|
|
},
|
|
xdescriptiondoctor: {
|
|
get() {
|
|
return this.$store.state.qc.descriptiondoctor
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_descriptiondoctor", val)
|
|
}
|
|
},
|
|
xstatuss() {
|
|
return this.$store.state.qc.statuss
|
|
},
|
|
dialogstatusorder() {
|
|
return this.$store.state.qc.dialog_status_order
|
|
},
|
|
xautocontrols() {
|
|
return this.$store.state.qc.autocontrols
|
|
},
|
|
xautocontrol: {
|
|
get() {
|
|
return this.$store.state.qc.autocontrol
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_autocontrol", val)
|
|
}
|
|
},
|
|
xsearch: {
|
|
get() {
|
|
return this.$store.state.qc.x_search
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_x_search", val)
|
|
}
|
|
},
|
|
xtransaction: {
|
|
get() {
|
|
return this.$store.state.qc.xtransaction
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_xtransaction", val)
|
|
}
|
|
},
|
|
xref: {
|
|
get() {
|
|
return this.$store.state.qc.xref
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_xref", val)
|
|
}
|
|
},
|
|
no_save: {
|
|
get() {
|
|
return this.$store.state.qc.no_save
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_no_save", val)
|
|
}
|
|
},
|
|
openalertconfirmation: {
|
|
get() {
|
|
return this.$store.state.qc.open_alert_confirmation
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_open_alert_confirmation", val)
|
|
}
|
|
},
|
|
curr_page: {
|
|
get() {
|
|
return this.$store.state.qc.current_page
|
|
},
|
|
set(val) {
|
|
if (this.$store.state.qc.no_save == 0) {
|
|
if (this.xinstrument.name == 'Belum Pilih Control') {
|
|
this.$store.commit("qc/update_current_page", val)
|
|
this.$store.dispatch("qc/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
sdate: this.xstartdate,
|
|
qc: this.xsearch,
|
|
current_page: val,
|
|
lastid: -1
|
|
})
|
|
} else {
|
|
this.$store.commit("qc/update_current_page", val)
|
|
this.$store.dispatch("qc/lookupbyid", {
|
|
instrumentid: this.$store.state.instrument.selected_instrument.Nat_QcNat_InstrumentID,
|
|
controlid: this.$store.state.instrument.selected_instrument.Nat_QcNat_QcControlID,
|
|
px: this.xsearch,
|
|
sdate: this.xstartdate,
|
|
current_page: val,
|
|
lastid: -1
|
|
})
|
|
}
|
|
} else {
|
|
this.$store.commit("qc/update_open_alert_confirmation", true)
|
|
}
|
|
|
|
|
|
}
|
|
},
|
|
xtotal_page: {
|
|
get() {
|
|
return this.$store.state.qc.total_data
|
|
},
|
|
set(val) {
|
|
this.$store.commit("qc/update_total_data", val)
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
isSelected(p) {
|
|
return p.id == this.$store.state.qc.selected_qc.id
|
|
},
|
|
selectMe(sc) {
|
|
if (sc == '0' && this.xinstrument.name == 'Belum Pilih Control') {
|
|
this.$store.commit("qc/update_selected_qc", {
|
|
name: ""
|
|
})
|
|
} else {
|
|
this.$store.commit("qc/update_selected_qc", sc)
|
|
}
|
|
|
|
|
|
},
|
|
updateDialogFormQc() {
|
|
this.$store.commit("qc/update_dialog_form_qc", false)
|
|
},
|
|
updateDialogStatusOrder() {
|
|
this.$store.commit("qc/update_dialog_status_order", false)
|
|
},
|
|
setStatusOrder(val) {
|
|
this.$store.commit("qc/update_qcs", {})
|
|
this.$store.commit("qc/update_dialog_status_order", true)
|
|
this.$store.commit("qc/update_statuss", val.statuss)
|
|
},
|
|
addTest() {
|
|
var oldArr = this.$store.state.qc.ordertests
|
|
oldArr.push(this.$store.state.qc.orderautotest)
|
|
this.searchtest = ''
|
|
this.$store.commit("qc/update_orderautotests", [])
|
|
this.$store.commit("qc/update_orderautotest", {})
|
|
},
|
|
deleteDataPx(idx) {
|
|
var inx = parseInt(idx);
|
|
var xrow = this.$store.state.qc.ordertests[inx]
|
|
if (parseInt(xrow.xid) !== 0) {
|
|
var xdeltest = this.$store.state.qc.deleted_ordertests
|
|
xdeltest.push(xrow)
|
|
this.$store.commit("qc/update_deleted_ordertests", xdeltest)
|
|
}
|
|
var oldArr = this.$store.state.qc.ordertests
|
|
oldArr.splice(inx, 1)
|
|
this.$store.commit("qc/update_ordertests", oldArr)
|
|
},
|
|
doPriceList(val) {
|
|
console.log(location)
|
|
var id = val.id
|
|
location.replace("/one-ui/control/vuex/one-md-price/" + "?id=" + id)
|
|
},
|
|
doPrice() {
|
|
console.log(location)
|
|
var id = this.xid
|
|
location.replace("/one-ui/control/vuex/one-md-price/" + "?id=" + id)
|
|
},
|
|
thr_search_control: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchcontrol", {
|
|
tes: this.search_control
|
|
})
|
|
}, 200),
|
|
thr_search_test: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchtest", {
|
|
search: this.search_test,
|
|
instrumentid: this.$store.state.instrument.selected_instrument.Nat_QcNat_InstrumentID,
|
|
controlid: this.$store.state.instrument.selected_instrument.Nat_QcNat_QcControlID,
|
|
tests: this.xordertests
|
|
})
|
|
}, 200),
|
|
thr_search_city: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchcity", {
|
|
search: this.search_city
|
|
})
|
|
}, 200),
|
|
thr_search_district: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchdistrict", {
|
|
search: this.search_district,
|
|
id: this.xautocity.M_CityID
|
|
})
|
|
}, 200),
|
|
thr_search_kelurahan: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchkelurahan", {
|
|
search: this.search_kelurahan,
|
|
id: this.xautodistrict.M_DistrictID
|
|
})
|
|
}, 200),
|
|
thr_search: _.debounce(function () {
|
|
this.$store.dispatch("control/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.dispatch("instrument/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.dispatch("qc/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
sdate: this.xstartdate,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.commit("instrument/update_selected_instrument", {
|
|
name: "Belum Pilih Control"
|
|
})
|
|
}, 200),
|
|
thr_sdate: _.debounce(function () {
|
|
this.$store.dispatch("control/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.dispatch("instrument/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.dispatch("qc/lookupbyname", {
|
|
control: this.$store.state.control.x_search,
|
|
instrument: this.$store.state.instrument.x_search,
|
|
sdate: this.xstartdate,
|
|
qc: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.commit("instrument/update_selected_instrument", {
|
|
name: "Belum Pilih Control"
|
|
})
|
|
}, 200),
|
|
thr_search_company: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchcompany", {
|
|
search: this.search_company
|
|
})
|
|
}, 200),
|
|
thr_search_mou: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchmou", {
|
|
search: this.search_mou,
|
|
id: this.xautocompany.M_CompanyID
|
|
})
|
|
}, 200),
|
|
thr_search_doctor: _.debounce(function () {
|
|
this.$store.dispatch("qc/searchdoctor", {
|
|
search: this.search_doctor
|
|
})
|
|
}, 200),
|
|
searchControl() {
|
|
this.$store.dispatch("qc/lookup", {
|
|
id: this.xcontrol.Nat_InstrumentName === "Belum Pilih Control" ? "0" : this.$store.state
|
|
.control.selected_control
|
|
.id,
|
|
sdate: this.xstartdate,
|
|
search: this.xsearch,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
},
|
|
doPrint() {
|
|
console.log('doprint')
|
|
this.printwidth = 1028
|
|
this.printtitle = ""
|
|
let qc = one_qc()
|
|
var id = this.xid
|
|
var d = new Date();
|
|
var n = d.getTime()
|
|
var rptname = 'control_price'
|
|
var formatrpt = this.formatreport
|
|
|
|
this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
|
|
".rptdesign&__format=" +
|
|
formatrpt + "&PQcID=" + id + "&qcxname=" + qc.Nat_QcQcname +
|
|
"&tm=" + n
|
|
|
|
this.openprint = true
|
|
},
|
|
closePrint() {
|
|
this.openprint = false
|
|
},
|
|
openFormQc(val) {
|
|
this.xid = val
|
|
this.$store.commit("qc/update_ordertests", [])
|
|
this.$store.commit("qc/update_dialog_form_qc", true)
|
|
},
|
|
editFormQc(val) {
|
|
this.xid = val.id
|
|
this.xname = val.Nat_QcName
|
|
this.xdescription = val.Nat_QcDescription
|
|
this.$store.commit("qc/update_autocontrols", [{
|
|
Nat_QcControlID: val.Nat_QcControlID,
|
|
Nat_QcControlName: val.Nat_QcControlName
|
|
}])
|
|
this.$store.commit("qc/update_autocontrol", {
|
|
Nat_QcControlID: val.Nat_QcControlID,
|
|
Nat_QcControlName: val.Nat_QcControlName
|
|
})
|
|
this.$store.commit("qc/update_dialog_form_qc", true)
|
|
},
|
|
checkError(value) {
|
|
var errors = this.$store.state.qc.errors
|
|
if (errors.includes(value)) {
|
|
return true
|
|
} else {
|
|
return false
|
|
}
|
|
},
|
|
forgetAlertConfirmation() {
|
|
this.$store.commit("qc/update_no_save", 0)
|
|
this.$store.commit("qc/update_open_alert_confirmation", false)
|
|
},
|
|
closeAlertConfirmation() {
|
|
this.$store.commit("qc/update_open_alert_confirmation", false)
|
|
},
|
|
changeQc() {
|
|
this.$store.commit("qc/update_no_save", 1)
|
|
},
|
|
saveFormQc() {
|
|
if (this.$refs.formcontrolqc.validate()) {
|
|
this.$store.dispatch("qc/save", {
|
|
xid: this.xid,
|
|
notransaction: this.xtransaction,
|
|
noref: this.xref,
|
|
search: this.$store.state.control.xsearch,
|
|
sdate : this.$store.state.control.startdate
|
|
})
|
|
}
|
|
},
|
|
simpanAll() {
|
|
this.$store.dispatch("qc/saveall", {
|
|
xid: this.xid,
|
|
controlid: this.$store.state.instrument.selected_instrument.Nat_QcControlID,
|
|
controlname: this.$store.state.instrument.selected_instrument.Nat_QcControlName,
|
|
instrumentid: this.$store.state.instrument.selected_instrument.Nat_InstrumentID,
|
|
instrumentname: this.$store.state.instrument.selected_instrument.Nat_InstrumentName,
|
|
tests: this.$store.state.qc.qcs,
|
|
sdate: this.xstartdate,
|
|
scontrol: this.$store.state.control.x_search,
|
|
sinstrument: this.xsearch
|
|
})
|
|
|
|
},
|
|
set_date2(x) {
|
|
this.startdate = x.new_date
|
|
},
|
|
set_date3(x) {
|
|
this.enddate = x.new_date
|
|
},
|
|
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')}`
|
|
},
|
|
updateAlert_success(val) {
|
|
this.$store.commit("control/update_alert_success", val)
|
|
},
|
|
activeFormQc(data) {
|
|
this.xid = data.id
|
|
|
|
this.msgalertqc = "Yakin, mau mengaktifkan qc ini?"
|
|
this.dialogdeletealertqc = true
|
|
},
|
|
closeActiveAlertQc() {
|
|
this.$store.dispatch("qc/activeqc", {
|
|
xid: this.xid,
|
|
controlid: this.$store.state.instrument.selected_instrument.Nat_QcControlID,
|
|
controlname: this.$store.state.instrument.selected_instrument.Nat_QcControlName,
|
|
instrumentid: this.$store.state.instrument.selected_instrument.Nat_InstrumentID,
|
|
instrumentname: this.$store.state.instrument.selected_instrument.Nat_InstrumentName,
|
|
name: this.xname,
|
|
scontrol: this.$store.state.control.x_search,
|
|
sqc: this.xsearch
|
|
})
|
|
this.dialogdeletealertqc = false
|
|
}
|
|
},
|
|
watch: {
|
|
xsearch(val, old) {
|
|
console.log(val)
|
|
this.xsearch = val
|
|
this.thr_search()
|
|
|
|
},
|
|
xstartdate(val, old) {
|
|
console.log(val)
|
|
this.xstartdate = val
|
|
this.thr_sdate()
|
|
},
|
|
search_control(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_control()
|
|
},
|
|
search_test(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_test()
|
|
},
|
|
search_city(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_city()
|
|
},
|
|
search_district(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_district()
|
|
},
|
|
search_kelurahan(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_kelurahan()
|
|
},
|
|
search_company(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_company()
|
|
},
|
|
search_mou(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_mou()
|
|
},
|
|
search_doctor(val, old) {
|
|
if (val == old) return
|
|
if (!val) return
|
|
if (val.length < 1) return
|
|
if (this.$store.state.qc.update_autocomplete_status == 1) return
|
|
this.thr_search_doctor()
|
|
}
|
|
}
|
|
}
|
|
</script> |