Flatten nested repos
This commit is contained in:
250
test/vuex/one-md-methode-priority/api/methodepriority.js
Normal file
250
test/vuex/one-md-methode-priority/api/methodepriority.js
Normal file
@@ -0,0 +1,250 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function search(token, code, name) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/search', {
|
||||
token:token,
|
||||
code:code,
|
||||
nama: 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 getmethodereg(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/getmethodereg',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/save',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 newmethodepriority(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/newmethodepriority',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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/deletemethode',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 sendorder(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/sendorder',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 getmethode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/getmethode',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 searchcompany(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/searchcompany',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getmou(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/getmou',{id:prm.M_CompanyID,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 savenewmethode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/savenewmethode',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 saveeditmethode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/saveeditmethode',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 deletemethode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/deletemethode',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 searchtest(token,tes,mouid) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'methodepriority/searchtest',{token:token,search:tes,mouid:mouid});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column>
|
||||
<v-dialog v-model="dialogconfirmationdeletepat" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title dark class="headline error pt-2 pb-2" primary-title style="color:white">
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationdeletepat}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeletePat()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeletepat = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogconfirmationsend" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title dark class="headline success pt-2 pb-2" primary-title style="color:white">
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationsend}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="success darken-1 text-sm-left" flat @click="doOrderMethode()">Kirim</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationsend = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformmethode" persistent max-width="650">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Methode Pemeriksaan {{xmethodeprioritys.Nat_TestName}}</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-select item-text="Nat_MethodeName" readonly return-object :items="xmethodees" v-model="xmethode" label="Metode"></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field label="Prioritas" v-model="xpriority"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<span>Instrument : {{this.xinstrument}}</span>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-btn class="mt-1 mb-2" v-for="(vst,idx) in xorderdays" :key="vst.id" @click="changeDay(idx)" small :color="vst.isday === 'N' ? 'yellow' : 'green'">{{vst.M_DayOfWeekName}}
|
||||
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformmethode = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactpat === 'new'" color="blue darken-1" flat @click="saveNewMethode()">Simpan</v-btn>
|
||||
<v-btn v-if="xactpat === 'edit'" color="blue darken-1" flat @click="saveEditMethode()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> DAFTAR METHODE PEMERIKSAAN {{xmethodeprioritys.Nat_TestName}}
|
||||
<v-flex text-md-right>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-data-table :headers="headers" :items="xmethodes" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
|
||||
<td class="text-xs-left pa-2">{{ props.item.Nat_MethodeName}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.Nat_InstrumentName}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_DayOfWeekName}}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_MethodePriorityNumber}}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon class="ml-3" color="primary" @click="editMethode(props.item)">edit</v-icon>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
oldlabel: '',
|
||||
search_day: '',
|
||||
xpriority: '',
|
||||
xinstrument:'',
|
||||
headers: [
|
||||
|
||||
{
|
||||
text: "METODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "INSTRUMENT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "HARI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "30%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "PRIORITAS",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeletepat: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.dialog_confirmation_delete_meth
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_dialog_confirmation_delete_meth", val)
|
||||
}
|
||||
},
|
||||
xmethodeprioritys() {
|
||||
return this.$store.state.methodepriority.selected_methodepriority
|
||||
},
|
||||
msgconfirmationdeletepat() {
|
||||
return this.$store.state.methodepriority.msg_confirmation_delete_meth
|
||||
},
|
||||
dialogconfirmationsend: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.dialog_confirmation_send
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_dialog_confirmation_send", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationsend() {
|
||||
return this.$store.state.methodepriority.msg_confirmation_send
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.methodepriority.act
|
||||
},
|
||||
xactpat() {
|
||||
return this.$store.state.methodepriority.act_meth
|
||||
},
|
||||
xactsend() {
|
||||
return this.$store.state.methodepriority.act_send
|
||||
},
|
||||
|
||||
dialogformmethode: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.dialog_form_methode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_dialog_form_methode", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.methodepriority.search_status == 1
|
||||
},
|
||||
xmethodes(p) {
|
||||
return this.$store.state.methodepriority.methodes
|
||||
},
|
||||
xnoref: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.noref
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_noref", val)
|
||||
}
|
||||
},
|
||||
namamethode: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.namamethode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_nama_methode", val)
|
||||
}
|
||||
},
|
||||
xdob: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.dob
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_dob", val)
|
||||
}
|
||||
},
|
||||
xmethodees() {
|
||||
return this.$store.state.methodepriority.methodees
|
||||
},
|
||||
xmethode: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.selected_methode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_selected_methode", val)
|
||||
}
|
||||
},
|
||||
xorderautodays() {
|
||||
return this.$store.state.methodepriority.orderautodays
|
||||
},
|
||||
xorderautoday: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.orderautoday
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_orderautoday", val)
|
||||
}
|
||||
},
|
||||
xorderdays() {
|
||||
|
||||
xdays = this.$store.state.methodepriority.orderdays;
|
||||
console.log('xdays',xdays)
|
||||
return xdays
|
||||
},
|
||||
sub_total() {
|
||||
let days = this.xorderdays
|
||||
sub_total = 0
|
||||
days.forEach(function (vpx, idx) {
|
||||
let total = parseInt(vpx.total)
|
||||
sub_total = sub_total + total
|
||||
})
|
||||
return sub_total
|
||||
},
|
||||
dp() {
|
||||
let mindp = this.$store.state.methodepriority.selected_methodepriority.M_MouMinDP
|
||||
let dp = mindp / 100 * this.sub_total
|
||||
return dp
|
||||
},
|
||||
isbill() {
|
||||
let isbill = this.$store.state.methodepriority.selected_methodepriority.M_MouIsBill
|
||||
return isbill
|
||||
},
|
||||
isagingonhold() {
|
||||
let isagingonhold = this.$store.state.methodepriority.selected_methodepriority.M_MouIsAgingOnHold
|
||||
return isagingonhold
|
||||
},
|
||||
agingonhold() {
|
||||
let agingonhold = this.$store.state.methodepriority.selected_methodepriority.M_MouIsAgingOnHoldNote
|
||||
return agingonhold
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createNewMethode() {
|
||||
this.$store.commit("methodepriority/update_act_meth", 'new')
|
||||
this.xnoref = ''
|
||||
this.namamethode = ''
|
||||
this.$store.commit("methodepriority/update_selected_methode", [])
|
||||
this.xdob = ''
|
||||
this.$store.commit("methodepriority/update_orderdays", [])
|
||||
this.$store.commit("methodepriority/update_dialog_form_methode", true)
|
||||
},
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.methodepriority.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
changeDay(idx) {
|
||||
var arrOrders = this.$store.state.methodepriority.orderdays
|
||||
arrOrders[idx].isday = arrOrders[idx].isday === 'N' ? 'Y' : 'N'
|
||||
|
||||
this.$store.commit("methodepriority/update_orderdays", arrOrders)
|
||||
},
|
||||
saveNewMethode() {
|
||||
var prm = {}
|
||||
prm.M_MethodePriorityNat_TestID = this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestID
|
||||
prm.Nat_MethodeName = this.$store.state.methodepriority.selected_methodepriority.Nat_MethodeName
|
||||
prm.M_MethodePriorityNat_MethodeID = this.$store.state.methodepriority.selected_methode.Nat_MethodeID
|
||||
prm.M_MethodePriorityNumber = this.xpriority
|
||||
prm.orderdays = this.xorderdays
|
||||
this.$store.dispatch("methodepriority/savenewmethode", prm)
|
||||
|
||||
},
|
||||
editMethode(value) {
|
||||
this.$store.commit("methodepriority/update_act_meth", 'edit')
|
||||
this.$store.commit("methodepriority/update_x_meth_id", value.M_MethodePriorityID)
|
||||
this.xpriority = value.M_MethodePriorityNumber
|
||||
this.xinstrument = value.Nat_InstrumentName
|
||||
this.$store.commit("methodepriority/update_selected_methode", {
|
||||
Nat_MethodeID: value.Nat_MethodeID,
|
||||
Nat_MethodeName: value.Nat_MethodeName
|
||||
})
|
||||
this.isday = value.isday === 'N' ? false : true
|
||||
if ( value.M_DayOfWeekName == "No Local Setting") {
|
||||
value.days.forEach(function(d,idx) {
|
||||
value.days[idx].isday = 'Y';
|
||||
});
|
||||
}
|
||||
this.$store.commit("methodepriority/update_orderdays", value.days)
|
||||
this.$store.commit("methodepriority/update_dialog_form_methode", true)
|
||||
},
|
||||
saveEditMethode() {
|
||||
var prm = {}
|
||||
prm.M_MethodePriorityID = this.$store.state.methodepriority.x_meth_id
|
||||
prm.M_MethodePriorityNat_TestID = this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestID
|
||||
prm.Nat_MethodeName = this.$store.state.methodepriority.selected_methode.Nat_MethodeName
|
||||
prm.M_MethodePriorityNat_MethodeID = this.$store.state.methodepriority.selected_methode.Nat_MethodeID
|
||||
prm.M_MethodePriorityNumber = this.xpriority
|
||||
prm.orderdays = this.xorderdays
|
||||
this.$store.dispatch("methodepriority/saveeditmethode", prm)
|
||||
},
|
||||
thr_search_day: _.debounce(function () {
|
||||
this.$store.dispatch("methodepriority/searchday", {
|
||||
day: this.search_day,
|
||||
mouid: this.$store.state.methodepriority.selected_methodepriority.Nat_TestM_MouID
|
||||
})
|
||||
}, 2000),
|
||||
deleteMethode(value) {
|
||||
this.$store.commit("methodepriority/update_act_meth", 'delete')
|
||||
this.$store.commit("methodepriority/update_x_meth_id", value.M_MethodePriorityID)
|
||||
this.$store.commit("methodepriority/update_errors", [])
|
||||
var errors = this.$store.state.methodepriority.errors
|
||||
var msg = ''
|
||||
msg = "Yakin, akan menghapus data methode " + value.M_MethodePriorityName + " ?"
|
||||
this.$store.commit("methodepriority/update_msg_confirmation_delete_meth", msg)
|
||||
this.$store.commit("methodepriority/update_dialog_confirmation_delete_meth", true)
|
||||
},
|
||||
doDeletePat() {
|
||||
var prm = {}
|
||||
prm.M_MethodePriorityNat_TestID = this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestID
|
||||
prm.M_MethodePriorityID = this.$store.state.methodepriority.x_meth_id
|
||||
prm.M_MethodePriorityName = this.namamethode
|
||||
prm.M_CompanyName = this.$store.state.methodepriority.selected_methodepriority.M_CompanyName
|
||||
this.$store.dispatch("methodepriority/deletemethode", prm)
|
||||
},
|
||||
sendOrderMethode(value) {
|
||||
let msg = "Yakin, akan mengirim permintaan nomor " + this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestNumber + " ?"
|
||||
this.$store.commit("methodepriority/update_msg_confirmation_send", msg)
|
||||
this.$store.commit("methodepriority/update_dialog_confirmation_send", true)
|
||||
},
|
||||
doOrderMethode() {
|
||||
var prm = {}
|
||||
prm.Nat_TestID = this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestID
|
||||
prm.Nat_TestNumber = this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestNumber
|
||||
this.$store.dispatch("methodepriority/sendorder", prm)
|
||||
},
|
||||
convertMoney(money) {
|
||||
return one_money(money)
|
||||
},
|
||||
addTest() {
|
||||
var oldArr = this.$store.state.methodepriority.orderdays
|
||||
oldArr.push(this.$store.state.methodepriority.orderautoday)
|
||||
this.searchday = ''
|
||||
this.$store.commit("methodepriority/update_orderautodays", [])
|
||||
this.$store.commit("methodepriority/update_orderautoday", {})
|
||||
},
|
||||
deleteDataPx(idx) {
|
||||
var inx = parseInt(idx);
|
||||
var xrow = this.$store.state.methodepriority.orderdays[inx]
|
||||
if (parseInt(xrow.xid) !== 0) {
|
||||
var xdelday = this.$store.state.methodepriority.deleted_orderdays
|
||||
xdelday.push(xrow)
|
||||
this.$store.commit("methodepriority/update_deleted_orderdays", xdelday)
|
||||
}
|
||||
var oldArr = this.$store.state.methodepriority.orderdays
|
||||
oldArr.splice(inx, 1)
|
||||
this.$store.commit("methodepriority/update_orderdays", oldArr)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
search_city(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.methodepriority.update_autocomplete_status == 1) return
|
||||
this.thr_search_city()
|
||||
},
|
||||
search_day(val, old) {
|
||||
if (val == old) return
|
||||
if (!val) return
|
||||
if (val.length < 1) return
|
||||
if (this.$store.state.methodepriority.update_autocomplete_status == 1) return
|
||||
this.thr_search_day()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,450 @@
|
||||
<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" hide-details></v-text-field>
|
||||
<v-text-field class="xs4 ma-1" label="Pemeriksaan" placeholder="Cari..." outline v-model="name" hide-details></v-text-field>
|
||||
<span @click="searchMethode" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="methodeprioritys" :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;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("methodepriority/getmethodereg")
|
||||
this.$store.dispatch("methodepriority/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.methodepriority.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.Nat_TestID == this.$store.state.methodepriority.selected_methodepriority
|
||||
.Nat_TestID
|
||||
},
|
||||
searchMethode() {
|
||||
this.$store.dispatch("methodepriority/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.methodepriority.no_save == 0) {
|
||||
this.$store.commit("methodepriority/update_selected_methodepriority", pat)
|
||||
this.$store.commit("methodepriority/update_act_comp", 'edit')
|
||||
this.$store.dispatch("methodepriority/getmethode", {
|
||||
id: pat.Nat_TestID
|
||||
})
|
||||
} else {
|
||||
this.$store.commit("methodepriority/update_open_alert_confirmation", true)
|
||||
}
|
||||
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("methodepriority/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("methodepriority/update_no_save", 0)
|
||||
this.$store.commit("methodepriority/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("methodepriority/update_alert_success", val)
|
||||
},
|
||||
updateDialogFormOrder() {
|
||||
this.$store.commit("methodepriority/update_dialog_form_order", false)
|
||||
},
|
||||
updateDialogStatusOrder() {
|
||||
this.$store.commit("methodepriority/update_dialog_status_order", false)
|
||||
},
|
||||
setNewOrder() {
|
||||
this.$store.commit("methodepriority/update_selected_methodepriority", {})
|
||||
this.$store.commit("methodepriority/update_act_comp", 'new')
|
||||
this.$store.commit("methodepriority/update_dialog_form_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
setStatusOrder() {
|
||||
this.$store.commit("methodepriority/update_selected_methodepriority", {})
|
||||
this.$store.commit("methodepriority/update_dialog_status_order", true)
|
||||
this.search_company = ''
|
||||
},
|
||||
saveFormPerusahaan() {
|
||||
this.$store.commit("methodepriority/update_errors", [])
|
||||
var errors = this.$store.state.methodepriority.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("methodepriority/newmethodepriority", {
|
||||
companyid: this.xcompany.M_CompanyID,
|
||||
mouid: this.xmou.M_MouID,
|
||||
sdate: this.xsdate,
|
||||
note: this.xnote
|
||||
})
|
||||
}
|
||||
},
|
||||
thr_search_company: _.debounce(function () {
|
||||
this.$store.dispatch("methodepriority/searchcompany", this.search_company)
|
||||
}, 2000),
|
||||
closeDialogSuccess() {
|
||||
let arrmethodepriority = this.$store.state.methodepriority.methodeprioritys
|
||||
var idx = _.findIndex(arrmethodepriority, item => item.Nat_TestID === this.$store.state
|
||||
.methodepriority.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("methodepriority/search", {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("methodepriority/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.methodepriority.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.methodepriority.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.methodepriority.search_status == 1
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.methodepriority.act_comp
|
||||
},
|
||||
methodeprioritys() {
|
||||
return this.$store.state.methodepriority.methodeprioritys
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
dialogformorder() {
|
||||
return this.$store.state.methodepriority.dialog_form_order
|
||||
},
|
||||
dialogstatusorder() {
|
||||
return this.$store.state.methodepriority.dialog_status_order
|
||||
},
|
||||
xdate: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_date", val)
|
||||
}
|
||||
},
|
||||
xnote: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.note
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_note", val)
|
||||
}
|
||||
},
|
||||
xcompanies() {
|
||||
return this.$store.state.methodepriority.companies
|
||||
},
|
||||
xcompany: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_company", val)
|
||||
this.$store.dispatch("methodepriority/getmou", this.$store.state.methodepriority.company)
|
||||
}
|
||||
},
|
||||
xmous() {
|
||||
return this.$store.state.methodepriority.mous
|
||||
},
|
||||
xmou: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.mou
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_mou", val)
|
||||
}
|
||||
},
|
||||
startComputedDateFormatted() {
|
||||
return this.formatDate(this.xsdate)
|
||||
},
|
||||
xsdate: {
|
||||
get() {
|
||||
return this.$store.state.methodepriority.sdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("methodepriority/update_sdate", val)
|
||||
}
|
||||
},
|
||||
xstatuss() {
|
||||
return this.$store.state.methodepriority.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: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'Nat_TestCode',
|
||||
totalItems: this.$store.state.methodepriority.total_methodeprioritys
|
||||
},
|
||||
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.methodepriority.update_autocomplete_status == 1) return
|
||||
this.thr_search_company()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
test/vuex/one-md-methode-priority/index.php
Normal file
93
test/vuex/one-md-methode-priority/index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!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/icomoon-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 style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<one-methode-priority-list></one-methode-priority-list>
|
||||
</v-flex>
|
||||
<v-flex xs8 class="right" fill-height pa-1>
|
||||
<one-methode-priority-detail></one-methode-priority-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">
|
||||
window.calculate_age = function (inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
var year = now.diff(dob,'years')
|
||||
dob.add(year,'years')
|
||||
var month = now.diff(dob,'months')
|
||||
dob.add(month,'months')
|
||||
var day = now.diff(dob,'days')
|
||||
if (isNaN(year)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-methode-priority-list': httpVueLoader('./components/oneMethodePriorityList.vue'),
|
||||
'one-methode-priority-detail': httpVueLoader('./components/oneMethodePriorityDetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
518
test/vuex/one-md-methode-priority/modules/methodepriority.js
Normal file
518
test/vuex/one-md-methode-priority/modules/methodepriority.js
Normal file
@@ -0,0 +1,518 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/methodepriority.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
last_id: -1,
|
||||
last_saved_id: -1,
|
||||
x_meth_id: 0,
|
||||
act: 'edit',
|
||||
act_comp: 'new',
|
||||
act_meth: 'new',
|
||||
act_send: 'N',
|
||||
get_data_status: 0,
|
||||
search_methodepriority: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
dialog_form_order: false,
|
||||
dialog_edit_form_order:false,
|
||||
dialog_status_order: false,
|
||||
norm: '',
|
||||
methodepriority_name: '',
|
||||
methodeprioritys: [],
|
||||
total_methodeprioritys: 0,
|
||||
methodepriority_methode: [],
|
||||
date: '',
|
||||
note: '',
|
||||
sdate:moment(new Date()).format('YYYY-MM-DD'),
|
||||
companies: [],
|
||||
company: {},
|
||||
mous: [],
|
||||
mou: {},
|
||||
total_methodepriority: 0,
|
||||
selected_methodepriority: {},
|
||||
save_status: 0,
|
||||
btn_save_seen: true,
|
||||
pgrs_save: false,
|
||||
save_error_message: '',
|
||||
no_save: 0,
|
||||
open_alert_confirmation: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
dialog_success: false,
|
||||
dialog_confirmation_delete: false,
|
||||
msg_confirmation_delete: "",
|
||||
dialog_confirmation_send: false,
|
||||
msg_confirmation_send: "",
|
||||
dialog_confirmation_delete_meth: false,
|
||||
msg_confirmation_delete_meth: "",
|
||||
autocomplete_status: 0,
|
||||
dialog_form_methode: false,
|
||||
errors: [],
|
||||
methodes: [],
|
||||
noref: '',
|
||||
namamethode: '',
|
||||
dob: '',
|
||||
methodees: [],
|
||||
selected_methode: {},
|
||||
orderautodays:[],
|
||||
orderautoday:{},
|
||||
orderdays:[],
|
||||
deleted_orderdays:[],
|
||||
statuss:[]
|
||||
},
|
||||
mutations: {
|
||||
update_x_meth_id(state, val) {
|
||||
state.x_meth_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_act_comp(state, val) {
|
||||
state.act_comp = val
|
||||
},
|
||||
update_act_meth(state, val) {
|
||||
state.act_meth = val
|
||||
},
|
||||
update_act_send(state, val) {
|
||||
state.act_send = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, methodepriority) {
|
||||
state.search_error_message = methodepriority
|
||||
},
|
||||
update_search_methodepriority(state, methodepriority) {
|
||||
state.search_methodepriority = methodepriority
|
||||
},
|
||||
update_dialog_form_order(state, val) {
|
||||
state.dialog_form_order = val
|
||||
},
|
||||
update_dialog_edit_form_order(state, val) {
|
||||
state.dialog_edit_form_order = val
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
},
|
||||
update_methodepriority_name(state, val) {
|
||||
state.methodepriority_name = val
|
||||
},
|
||||
update_date(state, val) {
|
||||
state.date = val
|
||||
},
|
||||
update_sdate(state,val){
|
||||
state.sdate = val
|
||||
},
|
||||
update_note(state, val) {
|
||||
state.note = val
|
||||
},
|
||||
update_methodeprioritys(state, data) {
|
||||
state.methodeprioritys = data
|
||||
},
|
||||
update_selected_methodepriority(state, val) {
|
||||
state.selected_methodepriority = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_btn_save_seen(state, val) {
|
||||
state.btn_save_seen = val
|
||||
},
|
||||
update_pgrs_save(state, val) {
|
||||
state.pgrs_save = val
|
||||
},
|
||||
update_save_error_message(state, msg) {
|
||||
state.save_error_message = ''
|
||||
},
|
||||
update_no_save(state, val) {
|
||||
state.no_save = val
|
||||
},
|
||||
update_open_alert_confirmation(state, val) {
|
||||
state.open_alert_confirmation = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_dialog_success(state, val) {
|
||||
state.dialog_success = val
|
||||
},
|
||||
update_dialog_confirmation_delete(state, val) {
|
||||
state.dialog_confirmation_delete = val
|
||||
},
|
||||
update_msg_confirmation_delete(state, val) {
|
||||
state.msg_confirmation_delete = val
|
||||
},
|
||||
update_dialog_confirmation_send(state, val) {
|
||||
state.dialog_confirmation_send = val
|
||||
},
|
||||
update_msg_confirmation_send(state, val) {
|
||||
state.msg_confirmation_send = val
|
||||
},
|
||||
update_dialog_confirmation_delete_meth(state, val) {
|
||||
state.dialog_confirmation_delete_meth = val
|
||||
},
|
||||
update_msg_confirmation_delete_meth(state, val) {
|
||||
state.msg_confirmation_delete_meth = val
|
||||
},
|
||||
update_methodes(state, val) {
|
||||
state.methodes = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_methode(state, val) {
|
||||
state.dialog_form_methode = val
|
||||
},
|
||||
update_label_methode(state, val) {
|
||||
state.label_methode = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_company(state, val) {
|
||||
state.company = val
|
||||
},
|
||||
update_mous(state, val) {
|
||||
state.mous = val
|
||||
},
|
||||
update_mou(state, val) {
|
||||
state.mou = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_methodeprioritys(state, val) {
|
||||
state.total_methodeprioritys = val
|
||||
},
|
||||
update_dob(state, val) {
|
||||
state.dob = val
|
||||
},
|
||||
update_noref(state, val) {
|
||||
state.noref = val
|
||||
},
|
||||
update_nama_methode(state, val) {
|
||||
state.namamethode = val
|
||||
},
|
||||
update_methodees(state, val) {
|
||||
state.methodees = val
|
||||
},
|
||||
update_selected_methode(state, val) {
|
||||
state.selected_methode = val
|
||||
},
|
||||
update_orderautodays(state,data){
|
||||
state.orderautodays = data
|
||||
},
|
||||
update_orderautoday(state,val){
|
||||
state.orderautoday = val
|
||||
},
|
||||
update_orderdays(state,data){
|
||||
state.orderdays = data
|
||||
},
|
||||
update_deleted_orderdays(state,data){
|
||||
state.deleted_orderdays = data
|
||||
},
|
||||
update_statuss(state,data){
|
||||
state.statuss = data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_methodepriority", 1)
|
||||
try {
|
||||
let resp = await api.search(one_token(),prm.code, prm.name)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_methodepriority", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_methodepriority", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_methodeprioritys", data.records)
|
||||
context.commit("update_total_methodeprioritys", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
if (prm.lastid === -1) {
|
||||
context.commit("update_selected_methodepriority", data.records[0])
|
||||
var pat = data.records[0]
|
||||
context.commit("update_methodepriority_name", pat.Nat_MethodeName)
|
||||
context.dispatch("getmethode", {
|
||||
id: pat.Nat_TestID
|
||||
})
|
||||
} else {
|
||||
context.commit("update_selected_methodepriority", data.records[prm.lastid])
|
||||
var pat = data.records[prm.lastid]
|
||||
context.commit("update_methodepriority_name", pat.M_PatientName)
|
||||
context.dispatch("getmethode", {
|
||||
id: pat.Nat_TestID
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_methodepriority", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getmethodereg(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getmethodereg(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_methodees", data.records.methodees)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_last_id", prm.Nat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data methode " + prm.M_PatientName + " sudah terupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async newmethodepriority(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.newmethodepriority(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
console.log(resp.data.id)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data berhasil disimpan"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_dialog_form_order", false)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.xdelete(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_last_id", 0)
|
||||
context.commit("update_dialog_confirmation_delete", false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data methode " + prm.M_PatientName + " sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_methodepriority_name", '')
|
||||
context.commit("update_selected_title", {})
|
||||
context.commit("update_selected_methode", {})
|
||||
context.commit("update_selected_religion", {})
|
||||
context.commit("update_dob", '')
|
||||
context.commit("update_hp", '')
|
||||
context.commit("update_phone", '')
|
||||
context.commit("update_email", '')
|
||||
context.commit("update_selected_kartuidentitas", {})
|
||||
context.commit("update_noidentitas", '')
|
||||
context.commit("update_note", '')
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async sendorder(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.sendorder(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_send", false)
|
||||
context.commit("update_last_id", prm.Nat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Permintaan nomor " + prm.T_ReceiveReferenceHeaderNumber + " sudah berhasil dikirim ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async getmethode(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getmethode(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_methodes", data.records)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async searchcompany(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcompany(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companies", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async getmou(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getmou(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_mous", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async searchday(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchday(one_token(), prm.tes, prm.mouid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_orderautodays",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async savenewmethode(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savenewmethode(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_methode", false)
|
||||
context.commit("update_last_id", prm.M_MethodePriorityNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data methode " + prm.Nat_MethodeName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async saveeditmethode(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveeditmethode(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_methode", false)
|
||||
context.commit("update_last_id", prm.M_MethodePriorityNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Ubah data methode " + prm.Nat_MethodeName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async deletemethode(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deletemethode(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_delete_meth", false)
|
||||
context.commit("update_last_id", prm.M_MethodePriorityNat_TestID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data methode " + prm.T_ReceiveReferencePatientName + " dari pemeriksaan " + prm.Nat_MethodeName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
test/vuex/one-md-methode-priority/store.js
Normal file
27
test/vuex/one-md-methode-priority/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import methodepriority from "./modules/methodepriority.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
methodepriority: methodepriority,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user