add modules folder based on s_menu
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog v-model="dialog_attachment" persistent max-width="60vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
UPLOAD BUKTI PENERIMAAN/PELAKSANAAN
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="mb-2 pa-2" style="border: 1px solid black;">
|
||||
<input
|
||||
type="file" id="files" ref="files" multiple
|
||||
accept="image/*" v-on:change="addAttachment($event)"
|
||||
>
|
||||
</v-flex>
|
||||
<v-flex
|
||||
v-for="(nota) in preview_attachment"
|
||||
xs4 class="pa-2" :key="nota.attach_id"
|
||||
>
|
||||
<div style="position: relative; padding-bottom: 35px;">
|
||||
<v-img
|
||||
:src="makeImageURL(nota)" aspect-ratio="1" contain
|
||||
class="grey lighten-2" @click="fullview(nota, -1)"
|
||||
></v-img>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex
|
||||
v-for="(url, index) in attachViews"
|
||||
xs4 class="pa-2" :key="index"
|
||||
>
|
||||
<div style="position: relative; padding-bottom: 35px;">
|
||||
<v-img
|
||||
:src="url" aspect-ratio="1" contain
|
||||
class="grey lighten-2" @click="fullview(url, index)"
|
||||
></v-img>
|
||||
<v-icon
|
||||
color="red" class="close-button"
|
||||
@click="removeAttachment(index)"
|
||||
>close</v-icon>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="BatalAddAttachment()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn
|
||||
v-if="selected_rojasa.ReceiveOrderPoConfirmed != 'Y'"
|
||||
@click="SimpanAttachment()" color="primary" class="white--text"
|
||||
>Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="dialog_fullview" persistent max-width="50vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
{{ viewtitle }}
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="red" fab small outline @click="dialog_fullview = false">
|
||||
<v-icon color="red">close</v-icon>
|
||||
</v-btn>
|
||||
</v-card-title>
|
||||
<v-card-text style="max-height: 80vh; overflow-y: auto;">
|
||||
<div class="pa-2">
|
||||
<v-img
|
||||
:src="viewurl" contain class="grey lighten-2"
|
||||
></v-img>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn class="mr-2" color="red" flat outline @click="dialog_fullview = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.close-button {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
attachViews: [],
|
||||
attachFiles: [],
|
||||
dialog_fullview: false,
|
||||
viewtitle: "",
|
||||
viewurl: ""
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_attachment: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_attachment
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_attachment", val)
|
||||
}
|
||||
},
|
||||
selected_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", val)
|
||||
}
|
||||
},
|
||||
preview_attachment: {
|
||||
get() {
|
||||
return this.$store.state.roservice.preview_attachment
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_preview_attachment", val)
|
||||
}
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.roservice.loading_process
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addAttachment(event) {
|
||||
const files = event.target.files;
|
||||
if (files.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let index = 0; index < files.length; index++) {
|
||||
const file = files[index];
|
||||
const url = URL.createObjectURL(file);
|
||||
|
||||
this.attachFiles.push(file);
|
||||
this.attachViews.push(url);
|
||||
}
|
||||
event.target.value = null;
|
||||
},
|
||||
fullview(url, index) {
|
||||
if (index < 0) {
|
||||
this.viewtitle = url.img_url;
|
||||
this.viewurl = this.makeImageURL(url);
|
||||
} else {
|
||||
this.viewtitle = this.attachFiles[index].name;
|
||||
this.viewurl = url;
|
||||
}
|
||||
this.dialog_fullview = true;
|
||||
},
|
||||
makeImageURL(nota) {
|
||||
const year = new Date(nota.created).getFullYear();
|
||||
const baseURL = BASE_URL + `/one-media/order-jasa/${year}/`;
|
||||
return baseURL + nota.img_url;
|
||||
},
|
||||
removeAttachment(index) {
|
||||
URL.revokeObjectURL(this.attachFiles[index]);
|
||||
this.attachFiles.splice(index, 1);
|
||||
this.attachViews.splice(index, 1);
|
||||
},
|
||||
BatalAddAttachment() {
|
||||
this.attachFiles = [];
|
||||
this.attachViews = [];
|
||||
this.preview_attachment = [];
|
||||
this.dialog_attachment = false;
|
||||
},
|
||||
SimpanAttachment() {
|
||||
if (!this.loading_process) {
|
||||
let formdata = new FormData();
|
||||
let listfiles = this.attachFiles;
|
||||
let rojasa = this.selected_rojasa;
|
||||
|
||||
for (let index = 0; index < listfiles.length; index++) {
|
||||
const file = listfiles[index];
|
||||
formdata.append('files['+index+']', file)
|
||||
}
|
||||
|
||||
formdata.append('token', one_token())
|
||||
formdata.append('ronumber', rojasa.ReceiveOrderPoNumber)
|
||||
formdata.append('tjasaID', rojasa.T_KontrakJasaID)
|
||||
formdata.append('poID', rojasa.PurchaseOrderID)
|
||||
formdata.append('roID', rojasa.ReceiveOrderPoID)
|
||||
|
||||
this.$store.dispatch("roservice/uploadAttachment", formdata)
|
||||
} else {
|
||||
let snac = {color: 'warning', msg: 'proses sedang berjalan', state: true}
|
||||
this.$store.commit('roservice/update_snackbar', snac)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialog_fullview(val) {
|
||||
if (!val) {
|
||||
this.viewurl = ""
|
||||
this.viewtitle = ""
|
||||
}
|
||||
},
|
||||
dialog_attachment(val) {
|
||||
if (val) {
|
||||
this.attachFiles = []
|
||||
this.attachViews = []
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
251
test/vuex/acc-one-receive-jasa/components/dialog-add-jasa.vue
Normal file
251
test/vuex/acc-one-receive-jasa/components/dialog-add-jasa.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_pickjasa" persistent width="60vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">PILIH ORDER JASA</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
v-model="temp_selected_order" :loading="loading"
|
||||
:items="list_pojasa.records" hide-no-data
|
||||
:search-input.sync="keyword" cache-items
|
||||
outline label="Cari nomor order jasa" hide-details
|
||||
item-text="PurchaseOrderNumber" return-object
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 mt-2>
|
||||
<v-data-table
|
||||
:headers="headers" class="elevation-1" hide-actions
|
||||
:items="temp_selected_order ? [temp_selected_order] : []"
|
||||
:expand="expand" item-key="PurchaseOrderID"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr @click="props.expanded = !props.expanded">
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon>{{ props.expanded
|
||||
? "keyboard_arrow_down"
|
||||
: "keyboard_arrow_right"
|
||||
}}</v-icon>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.PurchaseOrderNumber }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.SupplierName }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.T_KontrakJasaJenisKontrak }}</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.T_KontrakJasaJenisKontrak == 'once'
|
||||
? props.item.T_KontrakJasaEndDate
|
||||
: props.item.periode
|
||||
}}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.PurchaseOrderNote }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template v-slot:expand="props">
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<v-data-table
|
||||
:headers="headers_expand" class="elevation-0"
|
||||
:items="props.item.detail" hide-actions
|
||||
>
|
||||
<template v-slot:items="expnd">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ expnd.item.M_ItemCode }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ expnd.item.M_ItemDesc }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ expnd.item.ItemUnitName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ expnd.item.qty }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalPickPO()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanReceive()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
loading: false,
|
||||
expand: false,
|
||||
temp_selected_order: null,
|
||||
headers: [
|
||||
{
|
||||
text: " ", align: "center", sortable: false,
|
||||
value: "check", width: "5%", class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NO PURCHASE ORDER", align: "center", sortable: false,
|
||||
value: "nopo", width: "25%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "SUPPLIER", align: "center", sortable: false,
|
||||
value: "supplier", width: "20%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "JENIS KONTRAK", align: "center", sortable: false,
|
||||
value: "type", width: "5%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "PERIODE", align: "center", sortable: false,
|
||||
value: "periode", width: "25%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "CATATAN", align: "center", sortable: false,
|
||||
value: "note", width: "25%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
],
|
||||
headers_expand: [
|
||||
{
|
||||
text: "ITEM CODE", align: "center", sortable: false,
|
||||
value: "code", width: "25%", class: "pa-1 blue lighten-4 black--text",
|
||||
},
|
||||
{
|
||||
text: "ITEM", align: "center", sortable: false,
|
||||
value: "item", width: "25%", class: "pa-1 blue lighten-4 black--text",
|
||||
},
|
||||
{
|
||||
text: "UNIT", align: "center", sortable: false,
|
||||
value: "unit", width: "25%", class: "pa-1 blue lighten-4 black--text",
|
||||
},
|
||||
{
|
||||
text: "QTY", align: "center", sortable: false,
|
||||
value: "qty", width: "25%", class: "pa-1 blue lighten-4 black--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_pickjasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_pickjasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_pickjasa", val)
|
||||
}
|
||||
},
|
||||
list_pojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.list_pojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_list_pojasa", val)
|
||||
}
|
||||
},
|
||||
data_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.data_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_data_rojasa", val)
|
||||
}
|
||||
},
|
||||
form_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.form_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_form_rojasa", val)
|
||||
}
|
||||
},
|
||||
selected_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
searchOrder(keyword) {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch("roservice/lookupOrderJasa", keyword)
|
||||
this.loading = false
|
||||
}, 500);
|
||||
},
|
||||
batalPickPO() {
|
||||
this.temp_selected_order = null
|
||||
this.list_pojasa = {}
|
||||
this.dialog_pickjasa = false
|
||||
},
|
||||
simpanReceive() {
|
||||
var formrojasa = JSON.parse(JSON.stringify(this.form_rojasa));
|
||||
const receiveOrder = JSON.parse(JSON.stringify(this.temp_selected_order));
|
||||
|
||||
formrojasa.TJasaID = receiveOrder.T_KontrakJasaID
|
||||
formrojasa.reference = receiveOrder.PurchaseOrderNumber
|
||||
formrojasa.typekontrak = receiveOrder.T_KontrakJasaJenisKontrak
|
||||
formrojasa.startdate = receiveOrder.T_KontrakJasaStartDate
|
||||
formrojasa.enddate = receiveOrder.T_KontrakJasaEndDate
|
||||
let used = receiveOrder.T_KontrakJasaUsedCount + " / " + receiveOrder.T_KontrakJasaJumlahPI
|
||||
formrojasa.usedcount = used
|
||||
|
||||
this.data_rojasa = receiveOrder.detail;
|
||||
this.form_rojasa = formrojasa;
|
||||
|
||||
this.temp_selected_order = null
|
||||
this.list_pojasa = {}
|
||||
this.dialog_pickjasa = false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
keyword (newVal, oldVal) {
|
||||
if (!newVal) return;
|
||||
if (newVal === oldVal) return;
|
||||
if (newVal.length < 1) return;
|
||||
this.searchOrder(newVal);
|
||||
},
|
||||
dialog_pickjasa(val) {
|
||||
if (val) {
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
let list = this.list_pojasa.records
|
||||
let curr = this.selected_rojasa
|
||||
let form = this.form_rojasa
|
||||
|
||||
if (list.length > 0) {
|
||||
let current = {}
|
||||
|
||||
if (curr.PurchaseOrderID) {
|
||||
current = list.find((item) =>
|
||||
item.PurchaseOrderID == curr.PurchaseOrderID
|
||||
)
|
||||
this.temp_selected_order = current
|
||||
}
|
||||
|
||||
if (form.reference) {
|
||||
current = list.find((item) =>
|
||||
item.PurchaseOrderNumber == form.reference
|
||||
)
|
||||
this.temp_selected_order = current
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
307
test/vuex/acc-one-receive-jasa/components/dialog-confirm-ro.vue
Normal file
307
test/vuex/acc-one-receive-jasa/components/dialog-confirm-ro.vue
Normal file
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_confirm_ro" persistent width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">FORM RO JASA</v-card-title>
|
||||
<v-card-text>
|
||||
<!-- first row -->
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3>
|
||||
<v-menu
|
||||
v-model="menuROdate" offset-y lazy min-width="290px"
|
||||
transition="scale-transition" max-width="290px" full-width
|
||||
:nudge-right="40" :close-on-content-click="false"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="formattedRODate" label="Tanggal RO"
|
||||
hide-details readonly v-on="on" outline
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="form_rojasa.rodate" no-title
|
||||
@input="menuROdate = false" readonly
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_branch" hide-details outline readonly
|
||||
v-model="form_rojasa.branchcode" label="Cabang"
|
||||
item-text="M_BranchName" item-value="M_BranchCode"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_supplier" hide-details outline readonly
|
||||
v-model="form_rojasa.supplierID" label="Vendor"
|
||||
item-text="SupplierName" item-value="SupplierID"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.orderjasano" hide-details outline
|
||||
label="No Order Jasa" placeholder="nomor order jasa" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- second row -->
|
||||
<v-layout row wrap class="mt-2">
|
||||
<v-flex xs3>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.reference" hide-details outline
|
||||
label="Reference" placeholder="purchase order" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.typekontrak" hide-details outline
|
||||
label="Type Kontrak" placeholder="contract type" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.startdate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.enddate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.usedcount" hide-details outline
|
||||
label="Terpakai / Sisa Kontrak" placeholder="0 / 0" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- third row -->
|
||||
<v-layout row wrap class="mt-2">
|
||||
<v-flex xs12 mt-2>
|
||||
<v-textarea
|
||||
v-model="form_rojasa.catatan" auto-grow readonly
|
||||
rows="1" outline label="Catatan" hide-details
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap class="mt-3">
|
||||
<v-flex xs12 v-if="data_rojasa.length > 0">
|
||||
<v-data-table
|
||||
:headers="headers" :items="data_rojasa"
|
||||
:expand="expand" class="elevation-1" hide-actions
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.M_ItemDesc }}
|
||||
<v-chip label small>{{ props.item.M_ItemCode }}</v-chip>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.qty }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ItemUnitName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div v-if="props.item.inspeksi">
|
||||
<p v-if="props.item.inspeksi.kesimpulan == 'accept'" class="mb-0">
|
||||
Diterima
|
||||
</p>
|
||||
<p v-else-if="props.item.inspeksi.kesimpulan == 'reject'" class="mb-0">
|
||||
Ditolak <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
<p v-else class="mb-0">
|
||||
Diterima dengan catatan <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="green" dark @click="openInspeksi(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>note_add</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Inspeksi Jasa</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalROJasa()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn
|
||||
v-if="selected_rojasa.ReceiveOrderPoConfirmed != 'Y'"
|
||||
@click="confirmROJasa()" color="primary" class="white--text"
|
||||
>Konfirmasi</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
menuROdate: false,
|
||||
expand: false,
|
||||
headers: [
|
||||
{
|
||||
text: "ITEM JASA", align: "center", sortable: false,
|
||||
value: "nopo", width: "40%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "QTY", align: "center", sortable: false,
|
||||
value: "type", width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "UNIT ITEM", align: "center", sortable: false,
|
||||
value: "item", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "INSPEKSI", align: "center", sortable: false,
|
||||
value: "inspec", width: "20%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false,
|
||||
value: "act", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_confirm_ro: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_confirm_ro
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_confirm_ro", val)
|
||||
}
|
||||
},
|
||||
form_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.form_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_form_rojasa", val)
|
||||
}
|
||||
},
|
||||
data_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.data_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_data_rojasa", val)
|
||||
}
|
||||
},
|
||||
selected_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", val)
|
||||
}
|
||||
},
|
||||
preview_attachment: {
|
||||
get() {
|
||||
return this.$store.state.roservice.preview_attachment
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_preview_attachment", val)
|
||||
}
|
||||
},
|
||||
formattedRODate() {
|
||||
return this.formatDate(this.form_rojasa.rodate)
|
||||
},
|
||||
list_supplier() {
|
||||
return this.$store.state.roservice.list_supplier
|
||||
},
|
||||
list_branch() {
|
||||
return this.$store.state.roservice.list_branch
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.roservice.loading_process
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null;
|
||||
const [year, month, day] = date.split('-');
|
||||
return `${day}-${month}-${year}`;
|
||||
},
|
||||
openInspeksi(item) {
|
||||
if (item.inspeksi) {
|
||||
this.$store.commit("roservice/update_form_inspeksi", item.inspeksi)
|
||||
}
|
||||
this.$store.commit("roservice/update_selected_jasainspek", item)
|
||||
this.$store.commit("roservice/update_dialog_inspeksi", true)
|
||||
},
|
||||
batalROJasa() {
|
||||
this.selected_rojasa = {}
|
||||
this.data_rojasa = []
|
||||
this.dialog_confirm_ro = false
|
||||
},
|
||||
confirmROJasa() {
|
||||
let attachment = this.preview_attachment;
|
||||
if (attachment.length <= 0) {
|
||||
this.showSnackbar("belum upload nota/attachment");
|
||||
return;
|
||||
}
|
||||
|
||||
let detail = this.data_rojasa;
|
||||
for (const element of detail) {
|
||||
if (!element.inspeksi) {
|
||||
this.showSnackbar("belum mengisi form inspeksi jasa");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.loading_process) {
|
||||
this.showSnackbar("proses sedang berjalan");
|
||||
return;
|
||||
}
|
||||
|
||||
this.$store.dispatch("roservice/confirmReceiveOrder");
|
||||
},
|
||||
showSnackbar(msg) {
|
||||
let snac = {color: 'warning', msg: msg, state: true}
|
||||
this.$store.commit("roservice/update_snackbar", snac)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialog_confirm_ro(val) {
|
||||
if (!val) {
|
||||
this.$nextTick(() => {
|
||||
this.form_rojasa = {
|
||||
rodate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
supplierID: 0,
|
||||
orderjasano: "",
|
||||
branchcode: one_user()['M_BranchCode'],
|
||||
reference: "",
|
||||
typekontrak: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
usedcount: "0 / 0",
|
||||
catatan: ""
|
||||
}
|
||||
this.data_rojasa = []
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_deletero" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">DELETE RECEIVE ORDER JASA</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3 class="pr-2"><strong>Tanggal</strong></v-flex>
|
||||
<v-flex xs9>: {{ selected_rojasa.ReceiveOrderPoIDate }}</v-flex>
|
||||
|
||||
<v-flex xs3 class="pr-2"><strong>Nomor</strong></v-flex>
|
||||
<v-flex xs9>: {{ selected_rojasa.ReceiveOrderPoNumber }}</v-flex>
|
||||
|
||||
<v-flex xs3 class="pr-2"><strong>Nomor Referensi</strong></v-flex>
|
||||
<v-flex xs9>: {{ selected_rojasa.ReceiveOrderPoRefNumber }}</v-flex>
|
||||
|
||||
<v-flex xs3 class="pr-2"><strong>Supplier</strong></v-flex>
|
||||
<v-flex xs9>: {{ selected_rojasa.SupplierName }}</v-flex>
|
||||
|
||||
<v-flex xs3 class="pr-2"><strong>Catatan</strong></v-flex>
|
||||
<v-flex xs9>: {{ selected_rojasa.ReceiveOrderPoNote }}</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalDelete()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="confirmDelete()" color="primary" class="white--text">Hapus</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_deletero: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_deletero
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_deletero", val)
|
||||
}
|
||||
},
|
||||
selected_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", val)
|
||||
}
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.roservice.loading_process
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
batalDelete() {
|
||||
this.selected_rojasa = {}
|
||||
this.dialog_deletero = false
|
||||
},
|
||||
confirmDelete() {
|
||||
if (!this.loading_process) {
|
||||
this.$store.dispatch("roservice/deleteReceiveOrder")
|
||||
} else {
|
||||
let snac = {color: 'warning', msg: 'proses sedang berjalan', state: true}
|
||||
this.$store.commit('roservice/update_snackbar', snac)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
300
test/vuex/acc-one-receive-jasa/components/dialog-edit-ro.vue
Normal file
300
test/vuex/acc-one-receive-jasa/components/dialog-edit-ro.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_editro" persistent width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">EDIT FORM RO JASA</v-card-title>
|
||||
<v-card-text>
|
||||
<!-- first row -->
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3>
|
||||
<v-menu
|
||||
v-model="menuROdate" offset-y lazy min-width="290px"
|
||||
transition="scale-transition" max-width="290px" full-width
|
||||
:nudge-right="40" :close-on-content-click="false"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="formattedRODate" label="Tanggal RO"
|
||||
hide-details readonly v-on="on" outline
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="form_rojasa.rodate" no-title
|
||||
@input="menuROdate = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_branch" hide-details outline
|
||||
v-model="form_rojasa.branchcode" label="Cabang"
|
||||
item-text="M_BranchName" item-value="M_BranchCode"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_supplier" hide-details outline
|
||||
v-model="form_rojasa.supplierID" label="Vendor"
|
||||
item-text="SupplierName" item-value="SupplierID"
|
||||
@input="changeSupplier(form_rojasa)"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.orderjasano" hide-details outline
|
||||
label="No Order Jasa" placeholder="nomor order jasa"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- second row -->
|
||||
<v-layout row wrap mt-2>
|
||||
<v-flex xs3>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.reference" hide-details outline
|
||||
label="Reference" placeholder="purchase order" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.typekontrak" hide-details outline
|
||||
label="Type Kontrak" placeholder="contract type" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.startdate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.enddate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.usedcount" hide-details outline
|
||||
label="Terpakai / Sisa Kontrak" placeholder="0 / 0" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- third row -->
|
||||
<v-layout row wrap mt-2>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
v-model="form_rojasa.catatan" auto-grow
|
||||
rows="1" outline label="Catatan" hide-details
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
<v-flex xs3 mt-2>
|
||||
<v-btn
|
||||
block color="info" @click="changeItemJasa()"
|
||||
:disabled="form_rojasa.branchcode == '' || form_rojasa.supplierID == ''"
|
||||
>TAMBAH ITEM</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- table detail item -->
|
||||
<v-layout row wrap mt-3>
|
||||
<v-flex xs12 v-if="data_rojasa.length > 0">
|
||||
<v-data-table
|
||||
:headers="headers" :items="data_rojasa"
|
||||
:expand="expand" class="elevation-1" hide-actions
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.M_ItemDesc }}
|
||||
<v-chip label small>{{ props.item.M_ItemCode }}</v-chip>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.qty }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ItemUnitName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div v-if="props.item.inspeksi">
|
||||
<p class="mb-0" v-if="props.item.inspeksi.kesimpulan == 'accept'">
|
||||
Diterima
|
||||
</p>
|
||||
<p class="mb-0" v-if="props.item.inspeksi.kesimpulan == 'reject'">
|
||||
Ditolak <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
<p class="mb-0" v-if="props.item.inspeksi.kesimpulan == 'acceptnote'">
|
||||
Diterima dgn Catatan <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="green" dark @click="openInspeksi(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>note_add</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Inspeksi Jasa</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalEdit()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanEdit()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
menuROdate: false,
|
||||
expand: false,
|
||||
headers: [
|
||||
{
|
||||
text: "ITEM JASA", align: "center", sortable: false,
|
||||
value: "nopo", width: "40%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "QTY", align: "center", sortable: false,
|
||||
value: "type", width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "UNIT ITEM", align: "center", sortable: false,
|
||||
value: "item", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "INSPEKSI", align: "center", sortable: false,
|
||||
value: "inspec", width: "20%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false,
|
||||
value: "act", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_editro: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_editro
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_editro", val)
|
||||
}
|
||||
},
|
||||
form_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.form_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_form_rojasa", val)
|
||||
}
|
||||
},
|
||||
data_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.data_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_data_rojasa", val)
|
||||
}
|
||||
},
|
||||
selected_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", val)
|
||||
}
|
||||
},
|
||||
formattedRODate() {
|
||||
return this.formatDate(this.form_rojasa.rodate)
|
||||
},
|
||||
list_supplier() {
|
||||
return this.$store.state.roservice.list_supplier
|
||||
},
|
||||
list_branch() {
|
||||
return this.$store.state.roservice.list_branch
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.roservice.loading_process
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null;
|
||||
const [year, month, day] = date.split('-');
|
||||
return `${day}-${month}-${year}`;
|
||||
},
|
||||
changeSupplier(oldform) {
|
||||
let new_form = {
|
||||
...oldform,
|
||||
reference: "",
|
||||
typekontrak: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
usedcount: "0 / 0",
|
||||
catatan: ""
|
||||
}
|
||||
|
||||
this.form_rojasa = new_form
|
||||
this.data_rojasa = []
|
||||
},
|
||||
changeItemJasa() {
|
||||
this.$store.dispatch("roservice/lookupOrderJasa", 'PO')
|
||||
this.$store.commit("roservice/update_dialog_pickjasa", true)
|
||||
},
|
||||
openInspeksi(item) {
|
||||
if (item.inspeksi) {
|
||||
this.$store.commit("roservice/update_form_inspeksi", item.inspeksi)
|
||||
}
|
||||
this.$store.commit("roservice/update_selected_jasainspek", item)
|
||||
this.$store.commit("roservice/update_dialog_inspeksi", true)
|
||||
},
|
||||
simpanEdit() {
|
||||
if (this.data_rojasa.length <= 0) {
|
||||
let snac = {color: 'warning', msg: "item tidak boleh kosong", state: true}
|
||||
this.$store.commit("roservice/update_snackbar", snac)
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.loading_process) {
|
||||
this.$store.dispatch("roservice/saveEditReceiveOrder")
|
||||
} else {
|
||||
let snac = {color: 'warning', msg: "proses sedang berjalan", state: true}
|
||||
this.$store.commit("roservice/update_snackbar", snac)
|
||||
}
|
||||
},
|
||||
batalEdit() {
|
||||
this.form_rojasa = {
|
||||
rodate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
supplierID: 0,
|
||||
orderjasano: "",
|
||||
branchcode: one_user()['M_BranchCode'],
|
||||
reference: "",
|
||||
typekontrak: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
usedcount: "0 / 0",
|
||||
catatan: ""
|
||||
}
|
||||
this.data_rojasa = []
|
||||
this.dialog_editro = false
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
313
test/vuex/acc-one-receive-jasa/components/dialog-form-ro.vue
Normal file
313
test/vuex/acc-one-receive-jasa/components/dialog-form-ro.vue
Normal file
@@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_formro" persistent width="70vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">FORM RO JASA</v-card-title>
|
||||
<v-card-text style="max-height: 80vh; overflow-y: auto;">
|
||||
<!-- first row -->
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3>
|
||||
<v-menu
|
||||
v-model="menuROdate" offset-y lazy min-width="290px"
|
||||
transition="scale-transition" max-width="290px" full-width
|
||||
:nudge-right="40" :close-on-content-click="false"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="formattedRODate" label="Tanggal RO"
|
||||
hide-details readonly v-on="on" outline
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="form_rojasa.rodate" no-title
|
||||
@input="menuROdate = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_branch" hide-details outline
|
||||
v-model="form_rojasa.branchcode" label="Cabang"
|
||||
item-text="M_BranchName" item-value="M_BranchCode"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="list_supplier" hide-details outline
|
||||
v-model="form_rojasa.supplierID" label="Vendor"
|
||||
item-text="SupplierName" item-value="SupplierID"
|
||||
@input="changeSupplier(form_rojasa)"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.orderjasano" hide-details outline
|
||||
label="Referensi" placeholder="Nomor Delivery / Supplier Invoice"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- second row -->
|
||||
<v-layout row wrap class="mt-2">
|
||||
<v-flex xs3>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.reference" hide-details outline
|
||||
label="No PO" placeholder="purchase order" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.typekontrak" hide-details outline
|
||||
label="Type Kontrak" placeholder="contract type" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.startdate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.enddate" hide-details outline
|
||||
label="Periode" placeholder="contract periode" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs2 pl-2>
|
||||
<v-text-field
|
||||
v-model="form_rojasa.usedcount" hide-details outline
|
||||
label="Terpakai / Sisa Kontrak" placeholder="0 / 0" readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<!-- third row -->
|
||||
<v-layout row wrap class="mt-2">
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
v-model="form_rojasa.catatan" auto-grow
|
||||
rows="1" outline label="Catatan" hide-details
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
<v-flex xs3 mt-2>
|
||||
<v-btn
|
||||
block color="info" @click="selectOrderJasa()"
|
||||
:disabled="form_rojasa.branchcode == '' || form_rojasa.supplierID == ''"
|
||||
>TAMBAH ITEM</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap class="mt-3">
|
||||
<v-flex xs12 v-if="data_rojasa.length > 0">
|
||||
<v-data-table
|
||||
:headers="headers" :items="data_rojasa" :expand="expand"
|
||||
class="elevation-1" hide-actions
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-left pa-2">
|
||||
{{ props.item.M_ItemDesc }}
|
||||
<v-chip label small>{{ props.item.M_ItemCode }}</v-chip>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2" >
|
||||
{{ props.item.qty }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ItemUnitName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div v-if="props.item.inspeksi">
|
||||
<p v-if="props.item.inspeksi.kesimpulan == 'accept'" class="mb-0">
|
||||
Diterima
|
||||
</p>
|
||||
<p v-else-if="props.item.inspeksi.kesimpulan == 'reject'" class="mb-0">
|
||||
Ditolak <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
<p v-else class="mb-0">
|
||||
Diterima dengan catatan <br>
|
||||
{{ props.item.inspeksi.catatan_kesimpulan }}
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="green" dark @click="openInspeksi(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>note_add</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Inspeksi Jasa</span>
|
||||
</v-tooltip>
|
||||
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="warning" dark @click="cancelOrder(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>cancel</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Batal Order</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalROJasa()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanROJasa()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
menuROdate: false,
|
||||
expand: false,
|
||||
headers: [
|
||||
{
|
||||
text: "ITEM JASA", align: "center", sortable: false,
|
||||
value: "nopo", width: "40%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "QTY", align: "center", sortable: false,
|
||||
value: "type", width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "UNIT ITEM", align: "center", sortable: false,
|
||||
value: "item", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "INSPEKSI", align: "center", sortable: false,
|
||||
value: "inspec", width: "20%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false,
|
||||
value: "act", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_formro: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_formro
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_formro", val)
|
||||
}
|
||||
},
|
||||
form_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.form_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_form_rojasa", val)
|
||||
}
|
||||
},
|
||||
data_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.data_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_data_rojasa", val)
|
||||
}
|
||||
},
|
||||
formattedRODate() {
|
||||
return this.formatDate(this.form_rojasa.rodate)
|
||||
},
|
||||
list_supplier() {
|
||||
return this.$store.state.roservice.list_supplier
|
||||
},
|
||||
list_branch() {
|
||||
return this.$store.state.roservice.list_branch
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.roservice.loading_process
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null;
|
||||
const [year, month, day] = date.split('-');
|
||||
return `${day}-${month}-${year}`;
|
||||
},
|
||||
changeSupplier(oldform) {
|
||||
let newform = {
|
||||
...oldform,
|
||||
reference: "",
|
||||
typekontrak: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
usedcount: "0 / 0",
|
||||
catatan: ""
|
||||
}
|
||||
|
||||
this.form_rojasa = newform
|
||||
this.data_rojasa = []
|
||||
},
|
||||
selectOrderJasa() {
|
||||
this.$store.dispatch("roservice/lookupOrderJasa", 'PO')
|
||||
this.$store.commit("roservice/update_dialog_pickjasa", true)
|
||||
},
|
||||
openInspeksi(item) {
|
||||
this.$store.commit("roservice/update_selected_jasainspek", item)
|
||||
this.$store.commit("roservice/update_dialog_inspeksi", true)
|
||||
},
|
||||
cancelOrder(item) {
|
||||
let current = JSON.parse(JSON.stringify(this.data_rojasa))
|
||||
let neulist = current.filter((obj) => obj.PODetailID == item.PODetailID)
|
||||
this.data_rojasa = neulist
|
||||
},
|
||||
batalROJasa() {
|
||||
this.dialog_formro = false
|
||||
this.data_rojasa = []
|
||||
},
|
||||
simpanROJasa() {
|
||||
if (this.data_rojasa.length <= 0) {
|
||||
let snac = {color: 'warning', msg: "item tidak boleh kosong", state: true}
|
||||
this.$store.commit("roservice/update_snackbar", snac)
|
||||
}
|
||||
|
||||
if (!this.loading_process) {
|
||||
this.$store.dispatch("roservice/saveReceiveOrder")
|
||||
} else {
|
||||
let snac = {color: 'warning', msg: "proses sedang berjalan", state: true}
|
||||
this.$store.commit("roservice/update_snackbar", snac)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialog_formro(val) {
|
||||
if (val) {
|
||||
this.$nextTick(() => {
|
||||
this.form_rojasa = {
|
||||
rodate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
supplierID: 0,
|
||||
orderjasano: "",
|
||||
branchcode: one_user()['M_BranchCode'],
|
||||
reference: "",
|
||||
typekontrak: "",
|
||||
startdate: "",
|
||||
enddate: "",
|
||||
usedcount: "0 / 0",
|
||||
catatan: ""
|
||||
}
|
||||
this.data_rojasa = []
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
155
test/vuex/acc-one-receive-jasa/components/dialog-inspeksi.vue
Normal file
155
test/vuex/acc-one-receive-jasa/components/dialog-inspeksi.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_inspeksi" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2" primary-title>
|
||||
FORM INSPEKSI JASA
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-radio-group
|
||||
v-model="form_inspeksi.hasil_pengerjaan" row
|
||||
label="Hasil Pengerjaan" hide-details
|
||||
>
|
||||
<v-radio label="Baik" value="good"></v-radio>
|
||||
<v-radio label="Tidak Baik" value="bad"></v-radio>
|
||||
</v-radio-group>
|
||||
<v-text-field
|
||||
v-if="form_inspeksi.hasil_pengerjaan == 'bad'" outline
|
||||
v-model="form_inspeksi.catatan_pengerjaan" class="mt-2"
|
||||
label="Catatan Pengerjaan" hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 mt-2>
|
||||
<v-radio-group
|
||||
v-model="form_inspeksi.kesimpulan" row
|
||||
label="Kesimpulan" hide-details
|
||||
>
|
||||
<v-radio label="Diterima" value="accept"></v-radio>
|
||||
<v-radio label="Ditolak" value="reject"></v-radio>
|
||||
<v-radio label="Diterima dengan catatan" value="acceptnote"></v-radio>
|
||||
</v-radio-group>
|
||||
</v-flex>
|
||||
<v-flex xs12 mt-2>
|
||||
<v-textarea
|
||||
v-if="form_inspeksi.kesimpulan != 'accept'" outline
|
||||
v-model="form_inspeksi.catatan_kesimpulan" rows="1"
|
||||
label="Catatan" auto-grow hide-details
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row mt-2>
|
||||
<v-flex xs6 pr-1>
|
||||
<v-autocomplete
|
||||
label="Staff Pemeriksa" outline hide-details
|
||||
v-model="form_inspeksi.pemeriksa" :items="list_staff"
|
||||
item-text="M_UserUsername" item-value="M_UserID"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 pl-1>
|
||||
<v-text-field
|
||||
label="Petugas Pengerjaan" hide-details
|
||||
v-model="form_inspeksi.pekerja" outline
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn class="white--text" color="error" @click="tutupInspeksi()">Tutup</v-btn>
|
||||
<v-btn
|
||||
v-if="!dialog_confirm_ro"
|
||||
class="white--text" color="primary" @click="saveInspeksi()"
|
||||
>Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list_staff() {
|
||||
return this.$store.state.roservice.list_staff
|
||||
},
|
||||
dialog_confirm_ro() {
|
||||
return this.$store.state.roservice.dialog_confirm_ro
|
||||
},
|
||||
dialog_inspeksi: {
|
||||
get() {
|
||||
return this.$store.state.roservice.dialog_inspeksi
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_dialog_inspeksi", val)
|
||||
}
|
||||
},
|
||||
form_inspeksi: {
|
||||
get() {
|
||||
return this.$store.state.roservice.form_inspeksi
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_form_inspeksi", val)
|
||||
}
|
||||
},
|
||||
selected_jasainspek: {
|
||||
get() {
|
||||
return this.$store.state.roservice.selected_jasainspek
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_selected_jasainspek", val)
|
||||
}
|
||||
},
|
||||
data_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.data_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_data_rojasa", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tutupInspeksi() {
|
||||
this.selected_jasainspek = {}
|
||||
this.dialog_inspeksi = false
|
||||
},
|
||||
saveInspeksi() {
|
||||
const form = JSON.parse(JSON.stringify(this.form_inspeksi));
|
||||
let detail = JSON.parse(JSON.stringify(this.data_rojasa));
|
||||
let data = JSON.parse(JSON.stringify(this.selected_jasainspek));
|
||||
|
||||
detail.forEach(element => {
|
||||
if (element.PODetailID === data.PODetailID) {
|
||||
element.inspeksi = form
|
||||
}
|
||||
});
|
||||
|
||||
this.$store.commit('roservice/update_data_rojasa', detail)
|
||||
this.selected_jasainspek = {}
|
||||
this.dialog_inspeksi = false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialog_inspeksi(val) {
|
||||
if (!val) {
|
||||
this.$nextTick(() => {
|
||||
this.form_inspeksi = {
|
||||
hasil_pengerjaan: "good",
|
||||
catatan_pengerjaan: "",
|
||||
kesimpulan: "accept",
|
||||
catatan_kesimpulan: "",
|
||||
pemeriksa: "",
|
||||
pekerja: ""
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
331
test/vuex/acc-one-receive-jasa/components/one-layout.vue
Normal file
331
test/vuex/acc-one-receive-jasa/components/one-layout.vue
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar color="primary" dark>
|
||||
<v-toolbar-title class="white--text">RECEIVE ORDER JASA</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon @click="openFormRO()">
|
||||
<v-icon large>add_box</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card class="pa-2">
|
||||
<v-layout row align-center>
|
||||
<v-flex xs3>
|
||||
<v-menu
|
||||
v-model="menuStartdateFilter" offset-y lazy min-width="290px"
|
||||
transition="scale-transition" max-width="290px" full-width
|
||||
:nudge-right="40" :close-on-content-click="false"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="formattedStartdate" label="Tanggal Awal"
|
||||
hide-details readonly v-on="on" outline
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="filterjasa.startdate" no-title
|
||||
@input="menuStartdateFilter = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-menu
|
||||
v-model="menuEnddateFilter" offset-y lazy min-width="290px"
|
||||
transition="scale-transition" max-width="290px" full-width
|
||||
:nudge-right="40" :close-on-content-click="false"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="formattedEnddate" label="Tanggal Akhir"
|
||||
hide-details readonly v-on="on" outline
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker
|
||||
v-model="filterjasa.enddate" no-title
|
||||
@input="menuEnddateFilter = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-autocomplete
|
||||
:items="liststatus" hide-details outline
|
||||
v-model="filterjasa.status" label="Status"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-2>
|
||||
<v-text-field
|
||||
v-model="filterjasa.search" hide-details outline
|
||||
label="Cari" placeholder="cai nomor po..."
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 mt-2">
|
||||
<v-data-table
|
||||
:headers="headers" :items="list_rojasa.records"
|
||||
class="elevation-1" hide-actions
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ReceiveOrderPoIDate }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ReceiveOrderPoNumber }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ReceiveOrderPoRefNumber }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.SupplierName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.item.ReceiveOrderPoNote }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div v-if="props.item.ReceiveOrderPoConfirmed == 'Y'">
|
||||
<v-chip small color="primary" text-color="white">Confirmed</v-chip>
|
||||
</div>
|
||||
<div v-else>
|
||||
<v-chip small color="warning" text-color="white">Unconfirmed</v-chip>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<div v-show="props.item.ReceiveOrderPoConfirmed != 'Y'">
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="green" dark @click="addAttachment(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>attachment</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Upload Nota</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="warning" dark @click="confirmRO(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>send</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Konfirmasi Order</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="info" dark @click="editRO(props.item)" v-on="on"
|
||||
style="min-width: 40px; margin: 0;" small
|
||||
>
|
||||
<v-icon small>edit</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Edit Order</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="red" dark @click="deleteRO(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>delete</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Hapus Order</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
<div v-show="props.item.ReceiveOrderPoConfirmed == 'Y'">
|
||||
<v-tooltip bottom pr-2>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="info" dark @click="confirmRO(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>visibility</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Detail Order</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="green" dark @click="addAttachment(props.item)"
|
||||
style="min-width: 40px; margin: 0;" small v-on="on"
|
||||
>
|
||||
<v-icon small>attach_file</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>View Nota</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider class="my-1"></v-divider>
|
||||
<div class="pa-2 mt-1 text-xs-center">
|
||||
<v-pagination v-model="currpage_rojasa" :length="pagelength" :total-visible="10"></v-pagination>
|
||||
</div>
|
||||
</v-card>
|
||||
|
||||
<v-snackbar v-model="snackbar.state" multi-line top :timeout="3000" :color="snackbar.color">
|
||||
{{ snackbar.msg }}
|
||||
<v-btn class="ml-2" round flat @click="snackbar.state = false">Tutup</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<dialog-form-ro></dialog-form-ro>
|
||||
<dialog-add-jasa></dialog-add-jasa>
|
||||
<dialog-inspeksi></dialog-inspeksi>
|
||||
<dialog-add-attachment></dialog-add-attachment>
|
||||
<dialog-delete-ro></dialog-delete-ro>
|
||||
<dialog-confirm-ro></dialog-confirm-ro>
|
||||
<dialog-edit-ro></dialog-edit-ro>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'dialog-form-ro': httpVueLoader('./dialog-form-ro.vue'),
|
||||
'dialog-inspeksi': httpVueLoader('./dialog-inspeksi.vue'),
|
||||
'dialog-add-attachment': httpVueLoader('./dialog-add-attachment.vue'),
|
||||
'dialog-add-jasa': httpVueLoader('./dialog-add-jasa.vue'),
|
||||
'dialog-delete-ro': httpVueLoader('./dialog-delete-ro.vue'),
|
||||
'dialog-confirm-ro': httpVueLoader('./dialog-confirm-ro.vue'),
|
||||
'dialog-edit-ro': httpVueLoader('./dialog-edit-ro.vue'),
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch('roservice/lookupCabang');
|
||||
this.$store.dispatch('roservice/lookupVendor');
|
||||
this.$store.dispatch('roservice/lookupStaff');
|
||||
this.$store.dispatch('roservice/lookupReceiveOrder');
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuStartdateFilter: false,
|
||||
menuEnddateFilter: false,
|
||||
headers: [
|
||||
{
|
||||
text: "TANGGAL RO", align: "center", sortable: false,
|
||||
value: "date", width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NOMOR RO", align: "center", sortable: false,
|
||||
value: "nopo", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "NOMOR PO", align: "center", sortable: false,
|
||||
value: "noro", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "SUPPLIER", align: "center", sortable: false,
|
||||
value: "supp", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "CATATAN", align: "center", sortable: false,
|
||||
value: "note", width: "20%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "STATUS", align: "center", sortable: false,
|
||||
value: "status", width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false,
|
||||
value: "acts", width: "15%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filterjasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.filterjasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_filterjasa", val)
|
||||
}
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.roservice.snackbar
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_snackbar", val)
|
||||
}
|
||||
},
|
||||
currpage_rojasa: {
|
||||
get() {
|
||||
return this.$store.state.roservice.currpage_rojasa
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("roservice/update_currpage_rojasa", val)
|
||||
this.$store.dispatch('roservice/lookupReceiveOrder')
|
||||
}
|
||||
},
|
||||
list_rojasa() {
|
||||
return this.$store.state.roservice.list_rojasa
|
||||
},
|
||||
pagelength() {
|
||||
let total = this.list_rojasa.total
|
||||
if (total === undefined || total < 1) return 1
|
||||
return Math.ceil(total/10)
|
||||
},
|
||||
liststatus() {
|
||||
return this.$store.state.roservice.liststatus
|
||||
},
|
||||
formattedStartdate() {
|
||||
return this.formatDate(this.filterjasa.startdate)
|
||||
},
|
||||
formattedEnddate() {
|
||||
return this.formatDate(this.filterjasa.enddate)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null;
|
||||
const [year, month, day] = date.split('-');
|
||||
return `${day}-${month}-${year}`;
|
||||
},
|
||||
openFormRO() {
|
||||
this.$store.commit("roservice/update_dialog_formro", true)
|
||||
},
|
||||
addAttachment(item) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", item)
|
||||
this.$store.dispatch("roservice/lookupAttachment")
|
||||
this.$store.commit("roservice/update_dialog_attachment", true)
|
||||
},
|
||||
confirmRO(item) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", item)
|
||||
this.$store.dispatch("roservice/lookupAttachment")
|
||||
this.$store.dispatch("roservice/lookupDetailReceiveOrder")
|
||||
this.$store.commit("roservice/update_dialog_confirm_ro", true)
|
||||
},
|
||||
editRO(item) {
|
||||
this.$store.commit("roservice/update_selected_rojasa", item)
|
||||
this.$store.dispatch("roservice/lookupDetailReceiveOrder")
|
||||
this.$store.commit("roservice/update_dialog_editro", true)
|
||||
},
|
||||
deleteRO(item) {
|
||||
if (item.ReceiveOrderPoConfirmed === 'N') {
|
||||
this.$store.commit("roservice/update_selected_rojasa", item)
|
||||
this.$store.commit("roservice/update_dialog_deletero", true)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterjasa: {
|
||||
handler(val) {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch('roservice/lookupReceiveOrder');
|
||||
}, 500);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user