Files
FE_CPONE/test/vuex/one-futurelog/components/oneInfoList.vue
2026-04-27 10:13:31 +07:00

904 lines
35 KiB
Vue

<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-card tile flat color=" pa-2 teal lighten-3">
<h5 class=" subtitle-1 font-weight-bold">FUTURE ORDER LOG</h5>
</v-card>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
</v-layout>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<div v-html="infos"></div>
</v-flex>
</v-layout>
<v-divider></v-divider>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialoginfo" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM CONTROL</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formcontrolinfo" v-model="validinfo" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-layout>
<v-flex xs7 pa-1>
<v-autocomplete label="Instrumen" v-model="xorderautoinfo" :items="xorderautoinfos" :search-input.sync="search_info" auto-select-first
no-filter item-text="Nat_InstrumentName" return-object no-data-text="Cari Instrumen"
outline small>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.Nat_InstrumentName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs5 pa-1>
<v-btn @click="addInstrument()" color="teal en-3">Tambah</v-btn>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs4 v-for="(vst,idx) in xorderinfos" :key="vst.Nat_InstrumentID" class="pr-2 pb-1">
<v-layout row>
<v-flex class="boxoutline" style="text-overflow:ellipsis;overflow:hidden;" xs11>
<v-btn class="ml-4" large @click="deleteDataPx(idx)" color="error">
<v-icon left>close</v-icon>{{vst.Nat_InstrumentName}}</v-btn>
</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 color="teal darken-1" flat @click="updateDialogFormInstrument()">Tutup</v-btn>
<v-btn color="teal darken-1" flat @click="saveFormInstrument()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</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="dialogdeletealertinfo" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertinfo}}
</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="dialogdeletealertinfo = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertInstrument()">
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: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
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: [],
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
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_info: '',
menufilterdatestart: false,
xnameRules: [
v => !!v || 'Nama harus diisi'
],
xcodeRules: [
v => !!v || 'Kode 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: "JAM",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 teal lighten-3 white--text"
},
{
text: "KUOTA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 teal lighten-3 white--text"
}
],
headerareas: [{
text: "AREA",
align: "left",
sortable: false,
value: "mr",
width: "70%",
class: "pa-2 teal lighten-3 white--text"
},
{
text: "BIAYA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 teal lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'Nat_InstrumentName ASC',
totalItems: this.$store.state.info.total_transactions
},
statuss: [{
waktu: '16-07-2019 10:00',
status: 'Order Dibuat',
info: 'Nagita Slavina'
},
{
waktu: '16-07-2019 11:00',
status: 'Order Dikirim',
info: 'Nagita Slavina'
},
{
waktu: '16-07-2019 12:00',
status: 'Order dikonfirmasi',
info: 'Chacha Frederica'
},
{
waktu: '16-07-2019 13:00',
status: 'Telah dibuat Surat Jalan',
info: 'Chacha Frederica'
},
{
waktu: '16-07-2019 14:00',
status: 'Kurir akan mengambil sampel',
info: 'Satria Subiantoro'
}
],
color: "success",
validinfo: false,
xid: 0,
isinput: "N",
countprice: 0,
infoinfoid: 0,
infoxname: "",
infolang: "",
infotext: "",
isadvance: "N",
infoformatadvance: "",
issenttocontrol: "N",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertinfo: false,
dialogverifyalertinfo: false,
dialogreleasealertinfo: false,
alertverify: false,
dialogunreleasealertinfo: false,
dialogunverifyalertinfo: false,
msgalertinfo: ""
};
},
mounted() {
this.$store.dispatch("info/lookupbyname")
},
computed: {
infos() {
return this.$store.state.info.infos
},
infokuotas() {
return this.$store.state.info.infokuotas
},
xcontrol() {
return this.$store.state.control.selected_control
},
xorderintruments() {
return this.$store.state.control.orderinfos
},
dialoginfo() {
return this.$store.state.info.dialog_form_info
},
xerrors() {
return this.$store.state.info.errors
},
isLoading() {
return this.$store.state.info.search_status == 1
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.info.startdate
},
set(val) {
this.$store.commit("info/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.info.enddate
},
set(val) {
this.$store.commit("info/update_enddate", val)
}
},
xautocitys() {
return this.$store.state.info.autocitys
},
xautocity: {
get() {
return this.$store.state.info.autocity
},
set(val) {
this.$store.commit("info/update_autocity", val)
this.$store.dispatch("info/searchdistrict", {
search: this.search_district,
id: val.M_CityID
})
}
},
xautodistricts() {
return this.$store.state.info.autodistricts
},
xautodistrict: {
get() {
return this.$store.state.info.autodistrict
},
set(val) {
this.$store.commit("info/update_autodistrict", val)
this.$store.dispatch("info/searchkelurahan", {
search: this.search_kelurahan,
id: val.M_DistrictID
})
}
},
xautokelurahans() {
return this.$store.state.info.autokelurahans
},
xautokelurahan: {
get() {
return this.$store.state.info.autokelurahan
},
set(val) {
this.$store.commit("info/update_autokelurahan", val)
}
},
xautocompanys() {
return this.$store.state.info.autocompanys
},
xautocompany: {
get() {
return this.$store.state.info.autocompany
},
set(val) {
this.$store.commit("info/update_autocompany", val)
this.$store.dispatch("info/searchmou", {
search: this.search_mou,
id: val.M_CompanyID
})
}
},
xautomous() {
return this.$store.state.info.automous
},
xautomou: {
get() {
return this.$store.state.info.automou
},
set(val) {
this.$store.commit("info/update_automou", val)
}
},
xautodoctors() {
return this.$store.state.info.autodoctors
},
xautodoctor: {
get() {
return this.$store.state.info.autodoctor
},
set(val) {
this.$store.commit("info/update_autodoctor", val)
this.$store.dispatch("info/selectdescriptiondoctor", {
id: val.M_DoctorID
})
}
},
xdescriptiondoctors() {
return this.$store.state.info.descriptiondoctors
},
xdescriptiondoctor: {
get() {
return this.$store.state.info.descriptiondoctor
},
set(val) {
this.$store.commit("info/update_descriptiondoctor", val)
}
},
xstatuss() {
return this.$store.state.info.statuss
},
dialogstatusorder() {
return this.$store.state.info.dialog_status_order
},
xautocontrols() {
return this.$store.state.info.autocontrols
},
xautocontrol: {
get() {
return this.$store.state.info.autocontrol
},
set(val) {
this.$store.commit("info/update_autocontrol", val)
}
},
xorderautoinfos() {
return this.$store.state.info.orderautoinfos
},
xorderautoinfo: {
get() {
return this.$store.state.info.orderautoinfo
},
set(val) {
this.$store.commit("info/update_orderautoinfo", val)
}
},
xorderinfos() {
return this.$store.state.info.orderinfos
},
no_save: {
get() {
return this.$store.state.info.no_save
},
set(val) {
this.$store.commit("info/update_no_save", val)
}
},
openalertconfirmation: {
get() {
return this.$store.state.info.open_alert_confirmation
},
set(val) {
this.$store.commit("info/update_open_alert_confirmation", val)
}
},
xsearch: {
get() {
return this.$store.state.info.x_search
},
set(val) {
this.$store.commit("info/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.info.current_page
},
set(val) {
this.$store.dispatch("info/lookupbyname", {
area: this.xsearch,
current_page: val,
lastid: -1
})
}
},
filterComputedDateFormattedStart() {
return this.formatDate(this.xstartdate)
},
xtotal_page: {
get() {
return this.$store.state.info.total_data
},
set(val) {
this.$store.commit("info/update_total_data", val)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.info.selected_info.id
},
selectMe(sc) {
},
updateDialogFormInstrument() {
this.$store.commit("info/update_dialog_form_info", false)
},
updateDialogStatusOrder() {
this.$store.commit("info/update_dialog_status_order", false)
},
setStatusOrder(val) {
this.$store.commit("info/update_infos", {})
this.$store.commit("info/update_dialog_status_order", true)
this.$store.commit("info/update_statuss", val.statuss)
},
addInstrument() {
var oldArr = this.$store.state.info.orderinfos
oldArr.push(this.$store.state.info.orderautoinfo)
this.searchinfo = ''
this.$store.commit("info/update_orderautoinfos", [])
this.$store.commit("info/update_orderautoinfo", {})
},
deleteDataPx(idx) {
var inx = parseInt(idx);
var xrow = this.$store.state.info.orderinfos[inx]
if (parseInt(xrow.xid) !== 0) {
var xdeltest = this.$store.state.info.deleted_orderinfos
xdeltest.push(xrow)
this.$store.commit("info/update_deleted_orderinfos", xdeltest)
}
var oldArr = this.$store.state.info.orderinfos
oldArr.splice(inx, 1)
this.$store.commit("inforegister/update_orderinfos", 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("info/searchcontrol", {
tes: this.search_control
})
}, 200),
thr_search_info: _.debounce(function () {
this.$store.dispatch("info/searchinfo", {
search: this.search_info,
controlid: this.$store.state.control.selected_control.id,
infos: this.xorderinfos
})
}, 200),
thr_search_city: _.debounce(function () {
this.$store.dispatch("info/searchcity", {
search: this.search_city
})
}, 200),
thr_search_district: _.debounce(function () {
this.$store.dispatch("info/searchdistrict", {
search: this.search_district,
id: this.xautocity.M_CityID
})
}, 200),
thr_search_kelurahan: _.debounce(function () {
this.$store.dispatch("info/searchkelurahan", {
search: this.search_kelurahan,
id: this.xautodistrict.M_DistrictID
})
}, 200),
thr_search: _.debounce(function () {
this.$store.dispatch("info/lookupbyname", {
area: this.xsearch,
current_page: 1,
lastid: -1
})
}, 200),
thr_search_company: _.debounce(function () {
this.$store.dispatch("info/searchcompany", {
search: this.search_company
})
}, 200),
thr_search_mou: _.debounce(function () {
this.$store.dispatch("info/searchmou", {
search: this.search_mou,
id: this.xautocompany.M_CompanyID
})
}, 200),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("info/searchdoctor", {
search: this.search_doctor
})
}, 200),
searchControl() {
this.$store.dispatch("info/lookup", {
id: this.xcontrol.name === "Belum Pilih Control" ? "0" : this.$store.state.control.selected_control
.id,
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
doPrint() {
console.log('doprint')
this.printwidth = 1028
this.printtitle = ""
let info = one_info()
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 + "&PInstrumentID=" + id + "&infoxname=" + info.Nat_InstrumentInstrumentname +
"&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
openFormInstrument(val) {
this.xid = val
this.$store.commit("info/update_orderinfos", [])
this.$store.commit("info/update_dialog_form_info", true)
},
editFormInstrument(val) {
this.xid = val.id
this.xname = val.Nat_InstrumentName
this.xdescription = val.Nat_InstrumentDescription
this.$store.commit("info/update_autocontrols", [{
Nat_QcControlID: val.Nat_QcControlID,
Nat_QcControlName: val.Nat_QcControlName
}])
this.$store.commit("info/update_autocontrol", {
Nat_QcControlID: val.Nat_QcControlID,
Nat_QcControlName: val.Nat_QcControlName
})
this.$store.commit("info/update_dialog_form_info", true)
},
checkError(value) {
var errors = this.$store.state.info.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
forgetAlertConfirmation() {
this.$store.commit("info/update_no_save", 0)
this.$store.commit("info/update_open_alert_confirmation", false)
},
closeAlertConfirmation() {
this.$store.commit("info/update_open_alert_confirmation", false)
},
changeQc() {
this.$store.commit("info/update_no_save", 1)
},
saveFormInstrument() {
if (this.$refs.formcontrolinfo.validate()) {
this.$store.dispatch("info/save", {
xid: this.xid,
controlid: this.$store.state.control.selected_control.id,
controlname: this.$store.state.control.selected_control.name,
infos: this.xorderinfos,
scontrol: this.$store.state.control.x_search,
sinfo: this.xsearch
})
}
},
simpanAll() {
this.$store.dispatch("info/saveall", {
xid: this.xid,
controlid: this.$store.state.control.selected_control.id,
controlname: this.$store.state.control.selected_control.name,
infos: this.$store.state.info.infos,
scontrol: this.$store.state.control.x_search,
sinfo: 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)
},
deleteFormInstrument(data) {
this.xid = data.id
this.msgalertinfo = "Yakin, mau hapus info ini?"
this.dialogdeletealertinfo = true
},
closeDeleteAlertInstrument() {
this.$store.dispatch("info/delete", {
xid: this.xid,
controlid: this.$store.state.control.selected_control.id,
controlname: this.$store.state.control.selected_control.name,
infoid: this.$store.state.info.selected_info.Nat_InstrumentID,
infoname: this.$store.state.info.selected_info.Nat_InstrumentName,
name: this.xname,
scontrol: this.$store.state.control.x_search,
sinfo: this.xsearch
})
this.dialogdeletealertinfo = false
}
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_control(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.info.update_autocomplete_status == 1) return
this.thr_search_control()
},
search_info(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.info.update_autocomplete_status == 1) return
this.thr_search_info()
},
search_city(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.info.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.info.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.info.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.info.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.info.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.info.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>