add modules folder based on s_menu
This commit is contained in:
349
test/vuex/acc-one-surat-jalan/components/form.vue
Normal file
349
test/vuex/acc-one-surat-jalan/components/form.vue
Normal file
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<v-card class="pa-2">
|
||||
<v-snackbar
|
||||
v-model="snackbar.isOpen" :timeout="3000" :multi-line="false"
|
||||
:vertical="false" :top="true" :color="snackbar.color"
|
||||
>
|
||||
{{ snackbar.message }}
|
||||
<v-btn flat @click="closeSnackbar()">Tutup</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<h3>NOMOR : {{ this.s_suratjalan.SuratJalanNumber ?? '-' }}</h3>
|
||||
<h3>STATUS : {{ this.s_suratjalan.i_status }}</h3>
|
||||
<v-layout row wrap class="mt-2">
|
||||
<v-flex xs6 class="pr-1">
|
||||
<v-autocomplete
|
||||
v-model="s_suratjalan.i_tftype" label="Jenis Transfer" outline @input="getTFReq"
|
||||
hide-details :disabled="isDraft()" :items="['Persediaan', 'Non Persediaan']"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="pl-1">
|
||||
<v-autocomplete
|
||||
v-model="s_suratjalan.i_tfrequest" label="Transfer Request Number" return-object
|
||||
outline hide-details :disabled="isDraft()" @input="getTFDetail"
|
||||
:items="l_tfrequest" item-text="T_GoodsTransferNum"
|
||||
>
|
||||
<template v-slot:item="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
{{ data.item.T_GoodsTransferNum }}
|
||||
</v-list-tile-title>
|
||||
<v-list-tile-sub-title>
|
||||
Type: {{ data.item.T_GoodsTransferType == 'P' ? 'Persediaan' : 'Non Persediaan'}},
|
||||
Tanggal: {{ data.item.T_GoodsTransferDate }}
|
||||
</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 class="pr-1 pt-2">
|
||||
<v-text-field
|
||||
v-model="sjDateFormated" label="Tanggal"
|
||||
readonly outline hide-details :disabled="isDraft()"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="pl-1 pt-2">
|
||||
<v-autocomplete
|
||||
v-model="s_suratjalan.i_isInternal" :items="['Internal', 'Eksternal']" :disabled="isDraft()"
|
||||
outline hide-details label="Jenis Kurir" @input="getEkspedisi"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 class="pr-1 pt-2">
|
||||
<v-autocomplete
|
||||
v-model="s_suratjalan.i_ekspedisi" :items="l_ekspedisi" label="Ekspedisi" :disabled="isDraft()"
|
||||
outline hide-details return-object item-text="ExpeditionName" @input="getStaff"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="px-1 pt-2">
|
||||
<v-autocomplete
|
||||
v-model="s_suratjalan.i_staff" :items="l_staff" label="Staff" @input="setPhone" :disabled="isDraft()"
|
||||
outline hide-details return-object item-text="ExpeditionStaffName"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs4 class="pl-1 pt-2">
|
||||
<v-text-field
|
||||
v-model="s_suratjalan.i_phone" label="Nomor HP"
|
||||
outline hide-details :disabled="isDraft()"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 class="pt-2">
|
||||
<v-textarea
|
||||
v-model="s_suratjalan.i_notes" label="Catatan"
|
||||
outline hide-details :disabled="isDraft()"
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<div>
|
||||
<v-data-table
|
||||
:headers="header" :items="s_suratjalan.detail" :loading="false"
|
||||
hide-actions class="elevation-1 mb-2 mt-4"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-2">{{ (props.index + 1) }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.M_ItemDesc }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.Quantity }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.ItemUnitName ?? '-' }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<div class="mt-2 pa-2 text-xs-center">
|
||||
<v-pagination v-model="d_page" :length="detpage_len" :total-visible="5"></v-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex grow class="pr-1 mt-2">
|
||||
<v-btn outline color="primary" class="white--text" @click="kirimSJ()" :disabled="isDraft()">
|
||||
Simpan & Kirim
|
||||
<v-icon v-show="isDraft()" right>check_circle</v-icon>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex shrink class="pl-1 mt-2">
|
||||
<v-btn outline color="primary" class="white--text" @click="cancelSJ()" :disabled="isDraft()">Batal</v-btn>
|
||||
<v-btn color="primary" class="white--text" @click="simpanSJ()" :disabled="isDraft()">Simpan</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
component: {},
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
header: [
|
||||
{
|
||||
text: "No.", align: "center", sortable: false,
|
||||
value: "requestDate", width: "10%", class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "ITEM", align: "center", sortable: false,
|
||||
value: "requestDate", width: "30%", class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "KUANTITAS", align: "center", sortable: false,
|
||||
value: "requestDate", width: "20%", class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "SATUAN", align: "center", sortable: false,
|
||||
value: "requestDate", width: "20%", class: "blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
i_tftype: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_tftype
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_tftype", val);
|
||||
}
|
||||
},
|
||||
i_tfrequest: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_tfrequest
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_tfrequest", val);
|
||||
}
|
||||
},
|
||||
i_isInternal: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_isInternal
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_isInternal", val)
|
||||
}
|
||||
},
|
||||
i_ekspedisi: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_ekspedisi
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_ekspedisi", val)
|
||||
}
|
||||
},
|
||||
i_staff: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_staff
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_staff", val)
|
||||
}
|
||||
},
|
||||
i_phone: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_phone
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_phone", val)
|
||||
}
|
||||
},
|
||||
i_notes: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_notes
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_notes", val)
|
||||
}
|
||||
},
|
||||
i_date: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.i_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_i_date", val)
|
||||
}
|
||||
},
|
||||
sjDateFormated() {
|
||||
return this.formatDate(this.s_suratjalan.i_date)
|
||||
},
|
||||
l_ekspedisi() {
|
||||
return this.$store.state.suratjalan.l_ekspedisi
|
||||
},
|
||||
l_staff() {
|
||||
return this.$store.state.suratjalan.l_staff
|
||||
},
|
||||
l_tfrequest() {
|
||||
return this.$store.state.suratjalan.l_tfrequest
|
||||
},
|
||||
s_suratjalan: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.s_suratjalan;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_s_suratjalan", val);
|
||||
}
|
||||
},
|
||||
detpage_len() {
|
||||
let total = parseInt(this.s_suratjalan.detailtotal)
|
||||
if (!total || total == 0) {
|
||||
return 1
|
||||
}
|
||||
return Math.ceil(total/5)
|
||||
},
|
||||
d_page: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.d_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_d_page", val)
|
||||
this.$store.dispatch("suratjalan/detailSuratJalan", {
|
||||
SuratJalanID: this.s_suratjalan.SuratJalanID,
|
||||
page: this.d_page}
|
||||
)
|
||||
}
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.snackbar
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_snackbar", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
const [year, month, day] = date.split("-")
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
async getTFReq() {
|
||||
this.$store.dispatch("suratjalan/listingTransferRequest");
|
||||
},
|
||||
async getTFDetail() {
|
||||
this.$store.dispatch("suratjalan/listingTFdetail");
|
||||
},
|
||||
async getEkspedisi() {
|
||||
this.$store.dispatch("suratjalan/listingEkspedisi");
|
||||
this.s_suratjalan.i_ekspedisi = {}
|
||||
this.s_suratjalan.i_staff = {}
|
||||
this.s_suratjalan.i_phone = ""
|
||||
},
|
||||
async getStaff() {
|
||||
this.$store.dispatch("suratjalan/listingEkspedisiStaff");
|
||||
this.s_suratjalan.i_staff = {}
|
||||
this.s_suratjalan.i_phone = ""
|
||||
},
|
||||
async setPhone() {
|
||||
this.s_suratjalan.i_phone = this.s_suratjalan.i_staff.ExpeditionStaffMobile
|
||||
},
|
||||
async simpanSJ() {
|
||||
const sj = this.s_suratjalan
|
||||
let kurir = Object.keys(sj.i_ekspedisi).length
|
||||
let staff = Object.keys(sj.i_staff).length
|
||||
let tfreq = Object.keys(sj.i_tfrequest).length
|
||||
let nohpn = sj.i_phone
|
||||
let typet = sj.i_tftype
|
||||
if (kurir <= 0 || staff <= 0 || tfreq <= 0 || nohpn == "" || typet == "") {
|
||||
let x = {isOpen: true, color: "error", message: "form belum lengkap"}
|
||||
this.snackbar = x
|
||||
return
|
||||
}
|
||||
|
||||
if (this.s_suratjalan.i_status == 'BARU') {
|
||||
this.$store.dispatch("suratjalan/createSuratJalan")
|
||||
} else {
|
||||
this.$store.dispatch("suratjalan/updateSuratJalan")
|
||||
}
|
||||
},
|
||||
cancelSJ() {
|
||||
this.$store.dispatch("suratjalan/newForm")
|
||||
this.$store.dispatch("suratjalan/listingSuratJalan")
|
||||
// let id = this.s_suratjalan.SuratJalanID
|
||||
// this.$store.dispatch("suratjalan/detailSuratJalan", {SuratJalanID: id, page: this.d_page})
|
||||
},
|
||||
closeSnackbar() {
|
||||
let x = {isOpen: false, color: "", message: ""}
|
||||
this.snackbar = x
|
||||
},
|
||||
isDraft() {
|
||||
let status = this.s_suratjalan.i_status
|
||||
if (status === 'Draft' || status === 'BARU') {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
async kirimSJ() {
|
||||
let sj = this.s_suratjalan
|
||||
let kurir = Object.keys(sj.i_ekspedisi).length
|
||||
let staff = Object.keys(sj.i_staff).length
|
||||
let tfreq = Object.keys(sj.i_tfrequest).length
|
||||
let nohpn = sj.i_phone
|
||||
let typet = sj.i_tftype
|
||||
|
||||
if (kurir <= 0 || staff <= 0 || tfreq <= 0 || nohpn == "" || typet == "") {
|
||||
let x = { isOpen: true, color: "error", message: "Tedapat form yang masih kosong"}
|
||||
this.$store.commit("suratjalan/update_snackbar", x)
|
||||
return
|
||||
}
|
||||
|
||||
if (sj.i_status == 'BARU') {
|
||||
sj.i_status = 'Process'
|
||||
await this.$store.commit("suratjalan/update_s_suratjalan", sj)
|
||||
await this.$store.dispatch("suratjalan/createSuratJalan")
|
||||
}
|
||||
if (sj.i_status == 'Draft') {
|
||||
sj.i_status = 'Process'
|
||||
await this.$store.commit("suratjalan/update_s_suratjalan", sj)
|
||||
await this.$store.dispatch("suratjalan/updateSuratJalan")
|
||||
}
|
||||
|
||||
// await this.$store.dispatch("suratjalan/updateSuratJalan")
|
||||
// await this.$store.dispatch("suratjalan/generateJurnal", this.s_suratjalan)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
296
test/vuex/acc-one-surat-jalan/components/listing.vue
Normal file
296
test/vuex/acc-one-surat-jalan/components/listing.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-toolbar color="primary" dark>
|
||||
<v-toolbar-title class="white--text">LISTING SURAT JALAN</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon @click="newForm()">
|
||||
<v-icon>add_box</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card class="pa-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs2 class="pr-1">
|
||||
<v-menu
|
||||
v-model="menuStartDate" lazy offset-y full-width
|
||||
:close-on-content-click="false" :nudge-right="40"
|
||||
transition="scale-transition" max-width="290px" min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="startDateFormated" label="Tanggal Awal"
|
||||
readonly outline hide-details v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker no-title v-model="f_startdate" @input="menuStartDate = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs2 class="px-1">
|
||||
<v-menu
|
||||
v-model="menuEndDate" lazy offset-y full-width
|
||||
:close-on-content-click="false" :nudge-right="40"
|
||||
transition="scale-transition" max-width="290px" min-width="290px"
|
||||
>
|
||||
<template v-slot:activator="{on}">
|
||||
<v-text-field
|
||||
v-model="endDateFormated" label="Tanggal Akhir"
|
||||
readonly outline hide-details v-on="on"
|
||||
></v-text-field>
|
||||
</template>
|
||||
<v-date-picker no-title v-model="f_enddate" @input="menuEndDate = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs3 class="px-1">
|
||||
<v-autocomplete
|
||||
v-model="f_cabang" :items="l_cabang" label="Cabang"
|
||||
outline hide-details return-object item-text="M_BranchName"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs2 class="px-1">
|
||||
<v-autocomplete
|
||||
v-model="f_status" :items="l_status"
|
||||
outline hide-details label="status"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs2 class="px-1">
|
||||
<v-text-field
|
||||
v-model="f_search" label="No Surat Jalan"
|
||||
outline hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs1 class="pl-1">
|
||||
<v-btn
|
||||
dark color="primary" @click="searchSuratJalan()"
|
||||
style="min-width: 50px; height: 100%; margin: 0;"
|
||||
>
|
||||
<v-icon>search</v-icon>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 mt-2">
|
||||
<v-data-table
|
||||
:headers="headers" :items="l_suratjalan.records" :loading="false"
|
||||
hide-actions class="elevation-1 mb-2"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<tr @click="selectSuratJalan(props.item)" :class="{'yellow lighten-4':isSelected(props.item)}">
|
||||
<td class="text-xs-center pa-2">{{ props.item.SuratJalanNumber }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.M_BranchName }}</td>
|
||||
<td class="text-xs-center pa-2">{{ props.item.ExpeditionStaffName }}</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-chip small :color="checkColor(props.item.SuratJalanStatus)">
|
||||
{{ props.item.SuratJalanStatus }}
|
||||
</v-chip>
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon
|
||||
small @click="deleteSJ(props.item)" color="red"
|
||||
:disabled="props.item.SuratJalanStatus != 'Draft'"
|
||||
>
|
||||
delete
|
||||
</v-icon>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<div class="pa-2 mt-2 text-xs-center">
|
||||
<v-pagination v-model="paginat" :length="paginat_len" :total-visible="5"></v-pagination>
|
||||
</div>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {},
|
||||
mounted() {
|
||||
this.$store.dispatch("suratjalan/getBranches");
|
||||
this.$store.dispatch("suratjalan/listingSuratJalan");
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuStartDate: false,
|
||||
menuEndDate: false,
|
||||
headers: [
|
||||
{
|
||||
text: "SURAT JALAN",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "requestDate",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "CABANG",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "requestDate",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "PETUGAS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "requestDate",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "requestDate",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "requestDate",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
f_startdate: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.f_startdate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_f_startdate", val)
|
||||
}
|
||||
},
|
||||
startDateFormated() {
|
||||
return this.formatDate(this.f_startdate)
|
||||
},
|
||||
f_enddate: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.f_enddate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_f_enddate", val)
|
||||
}
|
||||
},
|
||||
endDateFormated() {
|
||||
return this.formatDate(this.f_enddate)
|
||||
},
|
||||
f_cabang: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.f_cabang
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_f_cabang", val)
|
||||
}
|
||||
},
|
||||
f_status: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.f_status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_f_status", val)
|
||||
}
|
||||
},
|
||||
f_search: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.f_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_f_search", val)
|
||||
}
|
||||
},
|
||||
l_suratjalan() {
|
||||
return this.$store.state.suratjalan.l_suratjalan
|
||||
},
|
||||
l_cabang() {
|
||||
return this.$store.state.suratjalan.l_cabang
|
||||
},
|
||||
l_status() {
|
||||
return this.$store.state.suratjalan.l_status
|
||||
},
|
||||
paginat: {
|
||||
get() {
|
||||
return this.$store.state.suratjalan.paginat
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("suratjalan/update_paginat", val)
|
||||
this.$store.dispatch("suratjalan/listingSuratJalan");
|
||||
}
|
||||
},
|
||||
paginat_len() {
|
||||
let total = this.l_suratjalan.total
|
||||
if (total == undefined || total == 0) {
|
||||
return 1
|
||||
}
|
||||
return Math.ceil(total/10)
|
||||
},
|
||||
i_phone() {
|
||||
return this.$store.state.suratjalan.i_phone
|
||||
},
|
||||
s_suratjalan() {
|
||||
return this.$store.state.suratjalan.s_suratjalan
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatDate(date) {
|
||||
if (!date) return null
|
||||
const [year, month, day] = date.split("-")
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
searchSuratJalan() {
|
||||
this.$store.dispatch("suratjalan/listingSuratJalan");
|
||||
},
|
||||
selectSuratJalan(item) {
|
||||
this.$store.dispatch("suratjalan/mapDetailSuratJalan", {SuratJalanID: item.SuratJalanID, page: 1})
|
||||
},
|
||||
isSelected(item) {
|
||||
return item.SuratJalanID === this.s_suratjalan.SuratJalanID
|
||||
},
|
||||
confirmSJ(item) {
|
||||
if (item.SuratJalanID == '' || item.SuratJalanID == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.i_phone || !item.SuratJalanEkspedisiID || !item.SuratJalanEkspedisiStaffID) {
|
||||
let x = { isOpen: true, color: "error", message: "Ekpedisi/Staff/No Hp Masih kosong"}
|
||||
this.$store.commit("suratjalan/update_snackbar", x)
|
||||
return
|
||||
}
|
||||
|
||||
this.$store.dispatch("suratjalan/generateJurnal", item)
|
||||
},
|
||||
deleteSJ(item) {
|
||||
if (item.SuratJalanID == '' || item.SuratJalanID == null) {
|
||||
return
|
||||
}
|
||||
|
||||
this.$store.dispatch("suratjalan/deleteSuratJalan", {
|
||||
SJalanID: item.SuratJalanID,
|
||||
TGoodID: item.SuratJalanT_GoodsTransferID
|
||||
})
|
||||
},
|
||||
checkColor(status) {
|
||||
switch (status) {
|
||||
case 'Process':
|
||||
return 'orange'
|
||||
case 'Completed':
|
||||
return 'green'
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
},
|
||||
newForm() {
|
||||
this.$store.dispatch("suratjalan/newForm")
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user