Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template v-if="userData.RoleDetails.IsCreateStockOutTransactionWarehouse || userData.RoleDetails.IsUpdateStockOutTransactionWarehouse || userData.RoleDetails.IsReadStockOutTransactionWarehouse">
- <b-tabs pills card>
- <b-tab title="Transaksi Gudang" active>
- <div v-if="loading" class="col-lg-12 d-flex justify-content-center mb-3">
- <b-spinner label="Loading..."></b-spinner>
- </div>
- <div class="row">
- <div class="col-lg-12 button-back-div">
- <router-link :to="{ name: 'StockOutV3Management.index' }" class="btn btn-primary">Kembali</router-link>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row">
- <!-- Nama Bendera field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="flagName" class="form-label" style="color: black;">Nama Bendera Pengirim</label>
- <vue-select disabled v-model="selectedLegalEntity" class="vue-select2" name="role" :options="legalEntity" label="Name"></vue-select>
- </div>
- </div>
- <!-- Nama Cabang field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="flagName" class="form-label" style="color: black;">Nama Cabang Pengirim</label>
- <vue-select disabled v-model="selectedBranch" class="vue-select2" name="role" :options="branch" label="Name"></vue-select>
- </div>
- </div>
- <!-- Nama Bendera field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="flagName" class="form-label" style="color: black;">Nama Bendera Penerima</label>
- <vue-select :disabled="!$route.name.includes('.create')" v-model="selectedLegalEntityR" class="vue-select2" name="role" :options="legalEntity" label="Name"></vue-select>
- <label v-if="$v.selectedLegalEntityR.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- <!-- Nama Cabang field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="flagName" class="form-label" style="color: black;">Nama Cabang Penerima</label>
- <vue-select v-if="selectedLegalEntityR" :disabled="!$route.name.includes('.create')" v-model="selectedBranchR" class="vue-select2" name="role" :options="selectedLegalEntityR.branches" label="Name"></vue-select>
- <label v-if="$v.selectedBranchR.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- <!-- Penerima field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="supplierContact" class="form-label" style="color: black;">Pengirim</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockOut.SenderName" name="SupplierContact" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Penerima field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="supplierContact" class="form-label" style="color: black;">Penerima</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockOut.ReceiverName" name="SupplierContact" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Tanggal field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="date" class="form-label" style="color: black;">Tanggal</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockOut.created_at" name="Date" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Tipe Pembayaran -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Penjadwalan</label>
- <vue-select :disabled="!$route.name.includes('.create')" v-model="selectedSchedules" class="vue-select2" name="role" :options="schedules" label="Name"></vue-select>
- <label v-if="$v.selectedSchedules.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- <!-- Kode Barang Keluar field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="date" class="form-label" style="color: black;">Kode Barang Keluar</label>
- <input disabled placeholder="Auto generate..." id="date" type="text" v-model="stockOut.Code" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Nama field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="flagName" class="form-label" style="color: black;">Nama</label>
- <input :disabled="$route.name.includes('.detail')" class="form-control" name="Name" v-model="stockOut.Name" placeholder="Ketik nama" />
- <label v-if="$v.stockOut.Name.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="deliveryOrderID" class="form-label" style="color: black;">Nomor Surat Jalan</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockOut.DeliveryOrderCode" name="DeliveryOrderID" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Nomor Receipt field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="deliveryOrderID" class="form-label" style="color: black;">Nomor Faktur</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockOut.ReceiptCode" name="DeliveryOrderID" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <div v-if="$route.name.includes('.detail')" class="col-lg-6">
- <label for="deliveryOrderID" class="form-label" style="color: black;">Unduh Surat Jalan</label>
- <button @click="downloadSuratJalan()" class="btn btn-primary" style="width: 100%; background-color: #20c197; border: none;"><img src="@/assets/images/file-text.png" alt="Alternate Text" /> Surat Jalan</button>
- </div>
- <div v-if="$route.name.includes('.detail')" class="col-lg-6">
- <label for="deliveryOrderID" class="form-label" style="color: black;">Unduh Faktur</label>
- <button @click="downloadKwitansi()" class="btn btn-primary" style="width: 100%; background-color: #20c197; border: none;"><img src="@/assets/images/file-text.png" alt="Alternate Text" /> Faktur</button>
- </div>
- </div>
- </div>
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row">
- <div class="col-lg-12">
- <label>Jika anda mengirimkan barang dengan armada internal, silahkan mengisi form dibawah ini.</label>
- </div>
- <!-- Nomor Polisi Kendaraan field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nomor Polisi Kendaraan (Pengirim)</label>
- <vue-select :disabled="$route.name.includes('.detail')" v-model="selectedLicensePlateNumber" class="vue-select2" name="role" :options="JSON.parse(selectedBranch.ListLicencePlateNumber)" label="LicencePlateNumber"></vue-select>
- <!-- <input :disabled="$route.name.includes('.detail')" placeholder="Ketik nomor polisi kendaraan..." type="text" v-model="stockOut.LicensePlateNumber" name="CarNumber" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;"> -->
- </div>
- </div>
- <!-- Nomor Polisi Kendaraan field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nomor Polisi Kendaraan (Penerima)</label>
- <vue-select v-if="selectedBranchR.Id" :disabled="$route.name.includes('.detail')" v-model="selectedLicensePlateNumberR" class="vue-select2" name="role" :options="JSON.parse(selectedBranchR.ListLicencePlateNumber)" label="LicencePlateNumber"></vue-select>
- <!-- <input :disabled="$route.name.includes('.detail')" placeholder="Ketik nomor polisi kendaraan..." type="text" v-model="stockOut.LicensePlateNumber" name="CarNumber" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;"> -->
- </div>
- </div>
- <!-- Nama Driver field [Gudang Pusat] -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nama Driver</label>
- <vue-select :disabled="$route.name.includes('.detail') || stockOut.Properties == 'Terjadwal'" v-model="selectedDriver" class="vue-select2" name="role" :options="employee.filter(x => x.LegalEntityId == userData.LegalEntityId).filter(y => y.BranchId == userData.BranchId)" label="Name">
- <template v-slot:option="option">
- {{ option.RegistrationNumber }} - {{ option.Name }}
- </template>
- </vue-select>
- </div>
- </div>
- <!-- Nama Helper [Gudang Pusat] -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nama Co-Driver</label>
- <vue-select :disabled="$route.name.includes('.detail') || stockOut.Properties == 'Terjadwal'" v-model="selectedCoDriver" class="vue-select2" name="role" :options="employee.filter(x => x.LegalEntityId == userData.LegalEntityId).filter(y => y.BranchId == userData.BranchId)" label="Name">
- <template v-slot:option="option">
- {{ option.RegistrationNumber }} - {{ option.Name }}
- </template>
- </vue-select>
- </div>
- </div>
- </div>
- <hr/>
- <div class="row">
- <div class="col-lg-12">
- <label>Jika anda menggunakan jasa ekspedisi, silahkan mengisi form dibawah ini.</label>
- </div>
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nama Ekspedisi</label>
- <input :disabled="$route.name.includes('.detail')" placeholder="Ketik nama ekspedisi..." v-model="stockOut.ExpeditionName" type="text" name="CarNumber" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Nomor Resi</label>
- <input :disabled="$route.name.includes('.detail')" placeholder="Ketik nomor resi..." v-model="stockOut.ExpeditionReceipt" type="text" name="CarNumber" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- </div>
- <hr/>
- <div class="row">
- <div class="col-lg-12">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Keterangan</label>
- <textarea :disabled="$route.name.includes('.detail')" placeholder="Ketik keterangan..." v-model="stockOut.Description" type="text" name="CarNumber" required class="validate form-control" style="border: 1px solid black;"></textarea>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div style="padding-left: 15px;"><button :disabled="$v.selectedLegalEntityR.$invalid || $v.selectedLegalEntityR.$invalid || $v.selectedSchedules.$invalid || $v.stockOut.Name.$invalid" v-if="$route.name.includes('.create')" @click="tambahBarang()" class="btn btn-primary" style="margin-top: 30px;">Tambah Barang</button></div>
- <hr v-if="!$route.name.includes('.create')" />
- <div v-if="$route.name.includes('.draft') || $route.name.includes('.edit')">
- <div class="row">
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row" v-if="$route.name.includes('.draft') || $route.name.includes('.edit')">
- <!-- Kode Barang Masuk field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="date" class="form-label" style="color: black;">Kode Barang</label>
- <!-- <select class="form-control" v-model="selectedInventory" @change="onChange(selectedInventory)">
- <option v-for="option in inventory" :value="inventory" :key="option.id">{{ option.Code }}</option>
- </select> -->
- <vue-select v-if="stockOut.Properties == 'Tidak Terjadwal'" v-model="selectedInventory" class="vue-select2" name="role" :options="inventory.filter(x => x.itembranch[0] != undefined && x.WarehouseCategory != 'Alat Tulis')" label="Code">
- <template v-slot:option="option">
- {{ option.Code }} - {{ option.Name }}
- </template>
- </vue-select>
- <vue-select v-if="stockOut.Properties == 'Terjadwal'" v-model="selectedInventory" class="vue-select2" name="role" :options="inventory.filter(x => x.LegalEntityId == selectedLegalEntityR.Id && x.BranchId == selectedBranchR.Id)" label="Name">
- <template v-slot:option="option">
- {{ option.alocation.Code }} - {{ option.alocation.Name }}
- </template>
- </vue-select>
- </div>
- <label v-if="$v.selectedInventory.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- <!-- Nama Barang field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Nama Barang</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.Name" name="PengadaanTotal" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Kode Barang field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="productNumber" class="form-label" style="color: black;">Kode Barang</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.Code" name="ProductName" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Kategori field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="category" class="form-label" style="color: black;">Kategori Barang</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.Category" name="Category" required maxlength="32" minlength="2" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Tipe Harga Jual field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="date" class="form-label" style="color: black;">Tipe Harga Jual</label>
- <!-- <select class="form-control" v-model="selectedInventory" @change="onChange(selectedInventory)">
- <option v-for="option in inventory" :value="inventory" :key="option.id">{{ option.Code }}</option>
- </select> -->
- <vue-select v-model="selectedPriceType" class="vue-select2" name="role" :options="priceType" label="Code"></vue-select>
- <label v-if="$v.selectedPriceType.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- <!-- Jumlah Barang Rekondisi field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Barang Rekondisi</label><span style="margin-left: 10px;" v-b-tooltip.hover title="Barang yang Pernah Diperbaiki/Dikanibalkan"><i class="fa fa-question-circle"></i></span>
- <input placeholder="Ketik jumlah barang rekondisi" class="form-control" v-model="selectedInventory.BundleRefurbishQuantity" />
- <label v-if="$v.selectedInventory.BundleRefurbishQuantity.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Jumlah Kondisi 100% field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Kondisi 100%</label>
- <input class="form-control" placeholder="Ketik jumlah kondisi 100%" v-model="selectedInventory.BundleQuantity100" />
- <label v-if="$v.selectedInventory.BundleQuantity100.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Harga Jual Kondisi 100% field -->
- <div class="col-lg-6" >
- <div class="form-group form-float" v-if="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <label v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-label" style="color: black;">Harga Jual Reguler Kondisi 100%</label>
- <div v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-control disabled-field">{{ selectedInventory.Price100 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Owner'" class="form-label" style="color: black;">Harga Jual Owner Kondisi 100%</label>
- <div v-if="selectedPriceType == 'Harga Jual Owner'" class="form-control disabled-field">{{ selectedInventory.ExtraPrice100 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-label" style="color: black;">Harga Jual Bazaar Kondisi 100%</label>
- <div v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-control disabled-field">{{ selectedInventory.BazaarPrice100 | currency }}</div>
- </div>
- </div>
- <!-- Jumlah Kondisi 90% field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Kondisi 90%</label>
- <input class="form-control" placeholder="Ketik jumlah kondisi 90%" v-model="selectedInventory.BundleQuantity90" />
- <label v-if="$v.selectedInventory.BundleQuantity90.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Harga Jual Kondisi 90% field -->
- <div class="col-lg-6" >
- <div class="form-group form-float" v-if="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <label v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-label" style="color: black;">Harga Jual Reguler Kondisi 90%</label>
- <div v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-control disabled-field">{{ selectedInventory.Price90 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Owner'" class="form-label" style="color: black;">Harga Jual Owner Kondisi 90%</label>
- <div v-if="selectedPriceType == 'Harga Jual Owner'" class="form-control disabled-field">{{ selectedInventory.ExtraPrice90 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-label" style="color: black;">Harga Jual Bazaar Kondisi 90%</label>
- <div v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-control disabled-field">{{ selectedInventory.BazaarPrice90 | currency }}</div>
- </div>
- </div>
- <!-- Jumlah Kondisi 60% field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Kondisi 60%</label>
- <input class="form-control" placeholder="Ketik jumlah kondisi 60%" v-model="selectedInventory.BundleQuantity60" />
- <label v-if="$v.selectedInventory.BundleQuantity60.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Harga Jual Kondisi 90% field -->
- <div class="col-lg-6" >
- <div class="form-group form-float" v-if="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <label v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-label" style="color: black;">Harga Jual Reguler Kondisi 60%</label>
- <div v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-control disabled-field">{{ selectedInventory.Price60 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Owner'" class="form-label" style="color: black;">Harga Jual Owner Kondisi 60%</label>
- <div v-if="selectedPriceType == 'Harga Jual Owner'" class="form-control disabled-field">{{ selectedInventory.ExtraPrice60 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-label" style="color: black;">Harga Jual Bazaar Kondisi 60%</label>
- <div v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-control disabled-field">{{ selectedInventory.BazaarPrice60 | currency }}</div>
- </div>
- </div>
- <!-- Jumlah Kondisi 30% field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Kondisi di bawah 30%</label>
- <input separator="." placeholder="Ketik jumlah kondisi 30%" class="form-control" v-model="selectedInventory.BundleQuantity30" />
- <label v-if="$v.selectedInventory.BundleQuantity30.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Harga Jual Kondisi 30% field -->
- <div class="col-lg-6" >
- <div class="form-group form-float" v-if="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <label v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-label" style="color: black;">Harga Jual Reguler Kondisi dibawah 30%</label>
- <div v-if="selectedPriceType == 'Harga Jual Reguler'" class="form-control disabled-field">{{ selectedInventory.Price30 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Owner'" class="form-label" style="color: black;">Harga Jual Owner Kondisi 30%</label>
- <div v-if="selectedPriceType == 'Harga Jual Owner'" class="form-control disabled-field">{{ selectedInventory.ExtraPrice30 | currency }}</div>
- <label v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-label" style="color: black;">Harga Jual Bazaar Kondisi 30%</label>
- <div v-if="selectedPriceType == 'Harga Jual Bazaar'" class="form-control disabled-field">{{ selectedInventory.BazaarPrice30 | currency }}</div>
- </div>
- </div>
- </div>
- <div class="row" v-if="$route.name.includes('.draft') || $route.name.includes('.edit')">
- <div class="col-lg-3" style="padding-left: 15px; margin-bottom: 30px;">
- <button :disabled="$v.selectedInventory.$invalid || $v.selectedInventory.BundleQuantity100.$invalid || $v.selectedInventory.BundleQuantity90.$invalid || $v.selectedInventory.BundleQuantity60.$invalid || $v.selectedInventory.BundleQuantity30.$invalid || $v.selectedInventory.BundleRefurbishQuantity.$invalid" @click="tambah" type="submit" class="btn waves-effect add-btn" style="width: 100%; background-color: #20c197; color: white; margin-top: 30px;">
- Tambah
- </button>
- </div>
- </div>
- </div>
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row" >
- <!-- Jumlah Pengadaan field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Seluruh Transaksi</label>
- <div class="form-control disabled-field">{{ stockOut.ItemQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Jenis Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Sumber Dana</label>
- <div class="form-group form-float">
- <vue-select v-model="stockOut.Tags" :disabled="$route.name.includes('.detail')" class="vue-select2" name="role" :options="tags" label="Name"></vue-select>
- </div>
- </div>
- </div>
- <!-- Jenis Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Jenis Pembayaran</label>
- <div class="form-group form-float">
- <vue-select v-model="stockOut.PaymentStatus" :disabled="$route.name.includes('.detail')" class="vue-select2" name="role" :options="paymentStatus" label="Name"></vue-select>
- </div>
- </div>
- </div>
- <!-- Total Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Total Harga (Rp)</label>
- <div class="form-control disabled-field">{{ stockOut.Total | currency }}</div>
- </div>
- </div>
- <!-- Nominal Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Nominal Pembayaran Pengadaan (Rp)</label>
- <money v-if="!$route.name.includes('.detail')" type="text" v-model="stockOut.Nominal" required class="validate form-control" style="border: 1px solid black;"></money>
- <div v-if="$route.name.includes('.detail')" class="form-control disabled-field">{{ stockOut.Nominal | currency }}</div>
- </div>
- </div>
- <!-- Sisa Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Sisa Pembayaran Pengadaan (Rp)</label>
- <div class="form-control disabled-field">{{ stockOut.Sisa | currency }}</div>
- </div>
- </div>
- </div>
- <hr />
- <div class="row" v-if="!$route.name.includes('.detail')">
- <label style="padding-left: 15px;">Tipe file foto adalah <b>.jpeg/.jpg/.png</b> dan ukuran maksimal foto adalah <b>4 MB</b></label>
- </div>
- <div class="row">
- <label class="form-label" style="color: black; margin-bottom: 15px; margin-left: 15px;">Lampiran</label>
- </div>
- <div class="row">
- <!-- Lampiran 1 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture1" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage1">Upload photo</base64-upload>
- </div>
- <!-- Lampiran 2 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture2" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage2">Upload photo</base64-upload>
- </div>
- </div>
- <div class="row">
- <!-- Lampiran 3 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture3" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage3">Upload photo</base64-upload>
- </div>
- <!-- Lampiran 4 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture4" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage4">Upload photo</base64-upload>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div v-if="$route.name.includes('.detail')">
- <div class="row">
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row">
- <!-- Jumlah Pengadaan field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Seluruh Transaksi</label>
- <div class="form-control disabled-field">{{ stockOut.ItemQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Jenis Pembayaran field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Sumber Dana</label>
- <div class="form-group form-float">
- <vue-select v-model="stockOut.Tags" :disabled="$route.name.includes('.detail')" class="vue-select2" name="role" :options="tags" label="Name"></vue-select>
- </div>
- </div>
- </div>
- <!-- Jenis Pembayaran field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Jenis Pembayaran</label>
- <div class="form-group form-float">
- <vue-select v-model="stockOut.PaymentStatus" :disabled="$route.name.includes('.detail')" class="vue-select2" name="role" :options="paymentStatus" label="Name"></vue-select>
- </div>
- </div>
- </div>
- <!-- Total Pembayaran field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Total Harga (Rp)</label>
- <div class="form-control disabled-field">{{ stockOut.Total | currency }}</div>
- </div>
- </div>
- <!-- Nominal Pembayaran field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Nominal Pembayaran Pengadaan (Rp)</label>
- <money v-if="!$route.name.includes('.detail')" type="text" v-model="stockOut.Nominal" required class="validate form-control" style="border: 1px solid black;"></money>
- <div v-if="$route.name.includes('.detail')" class="form-control disabled-field">{{ stockOut.Nominal | currency }}</div>
- </div>
- </div>
- <!-- Sisa Pembayaran field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Sisa Pembayaran Pengadaan (Rp)</label>
- <div class="form-control disabled-field">{{ stockOut.Sisa | currency }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-lg-6" style="padding-left: 30px; padding-right: 30px;">
- <div class="row">
- <label class="form-label" style="color: black; margin-bottom: 15px; margin-left: 15px;">Lampiran</label>
- </div>
- <div class="row">
- <!-- Lampiran 1 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture1" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage1">Upload photo</base64-upload>
- </div>
- <!-- Lampiran 2 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture2" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage2">Upload photo</base64-upload>
- </div>
- </div>
- <div class="row">
- <!-- Lampiran 3 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture3" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage3">Upload photo</base64-upload>
- </div>
- <!-- Lampiran 4 -->
- <div class="col-lg-6">
- <img v-if="$route.name.includes('.detail')" :src="'data:image/jpeg;base64,' + stockOut.Picture4" class="img-fluid img-thumbnail" />
- <base64-upload v-if="!$route.name.includes('.detail')" class="img-fluid img-thumbnail" imageSrc="/img/uploads.png" @change="changeImage4">Upload photo</base64-upload>
- </div>
- </div>
- </div>
- </div>
- </div>
- <hr v-if="!$route.name.includes('.create')" />
- <div class="row" v-if="!$route.name.includes('.create')">
- <!-- List Appendable Item -->
- <div class="col-lg-12" style="padding-left: 30px;">
- <h5>Data Barang</h5>
- </div>
- <div class="col-lg-12">
- <div class="table-div-append">
- <b-table striped hover
- id="stockOutItemCollection"
- :items="itemdetails"
- :fields="fieldLookup()"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-slot:cell(Delete)="data">
- <button class="btn btn-danger" v-if="!$route.name.includes('.detail')" @click="hapus(data.item.Id, data.item)"><span><i class="fa fa-times"></i></span></button>
- </template>
- <template v-slot:cell(SupplierId)="data">
- <label v-if="data.item.SupplierId">{{ supplier[data.item.SupplierId].Name }}</label>
- </template>
- <template v-slot:cell(IsAssembly)="data">
- <label v-if="data.item.IsAssembly == 1">Ya</label>
- <label v-if="data.item.IsAssembly == 0">Tidak</label>
- </template>
- <template v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-slot:cell(Price30)="data">
- {{ data.item.Price30 | currency }}
- </template>
- <template v-slot:cell(Quantity100)="data">
- {{ data.item.Quantity100 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity90)="data">
- {{ data.item.Quantity90 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity60)="data">
- {{ data.item.Quantity60 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity30)="data">
- {{ data.item.Quantity30 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(RefurbishQuantity)="data">
- {{ data.item.RefurbishQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(TotalQuantity)="data">
- {{ data.item.TotalQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- </b-table>
- </div>
- </div>
- <div class="col-lg-12" style="display: none;">
- <div class="table-div-append">
- <b-table striped hover
- id="stockOutDeliveryOrder"
- :items="itemdetails"
- :fields="fieldLookup()"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-slot:cell(Delete)="data">
- <button class="btn btn-danger" v-if="!$route.name.includes('.detail')" @click="hapus(data.item.Id, data.item)"><span><i class="fa fa-times"></i></span></button>
- </template>
- <template v-slot:cell(SupplierId)="data">
- <label v-if="data.item.SupplierId">{{ supplier[data.item.SupplierId].Name }}</label>
- </template>
- <template v-slot:cell(IsAssembly)="data">
- <label v-if="data.item.IsAssembly == 1">Ya</label>
- <label v-if="data.item.IsAssembly == 0">Tidak</label>
- </template>
- <template v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-slot:cell(Price30)="data">
- {{ data.item.Price30 | currency }}
- </template>
- <template v-slot:cell(Quantity100)="data">
- {{ data.item.Quantity100 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity90)="data">
- {{ data.item.Quantity90 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity60)="data">
- {{ data.item.Quantity60 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity30)="data">
- {{ data.item.Quantity30 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(RefurbishQuantity)="data">
- {{ data.item.RefurbishQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(TotalQuantity)="data">
- {{ data.item.TotalQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- </b-table>
- </div>
- </div>
- <div class="col-lg-12" style="display: none;">
- <div class="table-div-append">
- <b-table striped hover
- id="stockOutReceipt"
- :items="itemdetails"
- :fields="fieldLookup()"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-slot:cell(Delete)="data">
- <button class="btn btn-danger" v-if="!$route.name.includes('.detail')" @click="hapus(data.item.Id, data.item)"><span><i class="fa fa-times"></i></span></button>
- </template>
- <template v-slot:cell(SupplierId)="data">
- <label v-if="data.item.SupplierId">{{ supplier[data.item.SupplierId].Name }}</label>
- </template>
- <template v-slot:cell(IsAssembly)="data">
- <label v-if="data.item.IsAssembly == 1">Ya</label>
- <label v-if="data.item.IsAssembly == 0">Tidak</label>
- </template>
- <template v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-slot:cell(Price30)="data">
- {{ data.item.Price30 | currency }}
- </template>
- <template v-slot:cell(Quantity100)="data">
- {{ data.item.Quantity100 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity90)="data">
- {{ data.item.Quantity90 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity60)="data">
- {{ data.item.Quantity60 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(Quantity30)="data">
- {{ data.item.Quantity30 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(RefurbishQuantity)="data">
- {{ data.item.RefurbishQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- <template v-slot:cell(TotalQuantity)="data">
- {{ data.item.TotalQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}
- </template>
- </b-table>
- </div>
- </div>
- </div>
- <div v-if="$route.name.includes('.edit')" class="row">
- <div class="col-lg-12 button-div">
- <button :disabled="itemdetails.length == 0" v-on:click="save()" class="btn btn-success">Simpan</button>
- <router-link :to="{ name: 'StockOutV3Management.index' }" class="btn btn-default">Batal</router-link>
- </div>
- </div>
- <div v-if="$route.name.includes('.draft')" class="row">
- <div class="col-lg-12 button-div">
- <button :disabled="itemdetails.length == 0" v-on:click="saveDraft()" class="btn btn-success">Simpan</button>
- <router-link :to="{ name: 'StockOutV3Management.index' }" class="btn btn-default">Batal</router-link>
- </div>
- </div>
- </b-tab>
- </b-tabs>
- </template>
- <style>
- .card-header {
- width: 1620px;
- height: 78px;
- background-color: #20c197;
- border-radius: 0px !important;
- padding-left: 10px;
- padding-top: 0px;
- padding-right: 0px;
- padding-bottom: 0px;
- }
- .nav-pills .nav-link.active, .nav-pills .show>.nav-link {
- color: black;
- background-color: #f8f8ff;
- border-radius: 0px;
- border-bottom: 3px solid #0059aa;
- }
- .nav-item {
- background: #f8f8ff;
- width: 200px;
- text-align: center;
- padding-top: 8px;
- }
- .nav-link {
- font-size: 20px;
- color: #707070;
- padding-top: 15px;
- }
- .button-div {
- text-align: right;
- margin-top: 30px;
- }
- .btn-success {
- width: 132px;
- background-color: #20c197;
- border: none;
- }
- .btn-danger {
- width: 132px;
- margin-left: 15px;
- border: none;
- }
- </style>
- <script>
- import moment from 'moment'
- import $ from 'jquery'
- // import VueNumeric from 'vue-numeric'
- import Inventories from '@/services/Inventories/Inventory'
- import LegalEntities from '@/services/Companies/LegalEntities'
- import Branches from '@/services/Companies/Branches'
- import StockOut from '@/services/Inventories/StockOutV3'
- import Schedulings from '@/services/Inventories/Schedulings'
- import ItemDetails from '@/services/Inventories/ItemDetails'
- // import Bill from '@/services/Accounting/BillV3'
- import Employees from '@/services/Employees/Employees'
- import VueSelect from 'vue-select'
- import 'vue-select/dist/vue-select.css'
- import Base64Upload from 'vue-base64-upload'
- import jsPDF from 'jspdf'
- import 'jspdf-autotable'
- import { required } from 'vuelidate/lib/validators'
- export default {
- name: 'StockOutWtV3Management.create',
- components: {
- VueSelect,
- // VueNumeric,
- Base64Upload
- },
- data () {
- return {
- //Loading
- loading: true,
- exportData: [],
- userData: {},
- ItemDetails: {},
- employee: [],
- item: {
- "Id": null,
- "Name": null,
- "Code": null,
- "Category": null,
- "BundleTotalQuantity": 0,
- // "BundleQuantity100": 0,
- // "BundleQuantity90": 0,
- // "BundleQuantity60": 0,
- // "BundleQuantity30": 0,
- // "BundleRefurbishQuantity": 0,
- "BundleIsAssembly": 0
- },
- stockOut: {
- Total: 0,
- Nominal: 0,
- Sisa: 0,
- ItemQuantity: 0,
- ItemCollection: []
- },
- deliveryOrder: {
- Total: 0,
- Nominal: 0,
- Sisa: 0,
- ItemQuantity: 0,
- ItemPrice: 0,
- ItemCollection: []
- },
- receipt: {
- Total: 0,
- Nominal: 0,
- Sisa: 0,
- ItemQuantity: 0,
- ItemPrice: 0,
- ItemCollection: []
- },
- selectedDriver: {},
- selectedCoDriver: {},
- selectedLegalEntity: {},
- selectedBranch: {},
- selectedLegalEntityR: {},
- selectedBranchR: {},
- selectedSupplier: {},
- selectedInventory: [],
- selectedPaymentStatus: [],
- selectedTags: [],
- selectedTransactionWarehouseType: [],
- selectedSchedules: {},
- selectedPriceType: [],
- selectedLicensePlateNumber: {},
- selectedLicensePlateNumberR: {},
- inventory: [],
- supplier: [],
- legalEntity: [],
- branch: [],
- transactionWarehouseType: ['Internal','Eksternal'],
- paymentStatus: ['Lunas','Kredit','Pembayaran Ditunda'],
- tags: ['Kas Besar','Kas Kecil','Bank'],
- schedules: ['Terjadwal','Tidak Terjadwal'],
- priceType: ['Harga Jual Reguler','Harga Jual Owner', 'Harga Jual Bazaar'],
- itemCollectionField: [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah Barang Kondisi 100%', sortable: true },
- { key: 'Price100', label: 'Harga Barang Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Price90', label: 'Harga Barang Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Price60', label: 'Harga Barang Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- { key: 'Price30', label: 'Harga Barang Kondisi 30%', sortable: true },
- { key: 'RefurbishQuantity', label: 'Jumlah Barang Rekondisi', sortable: true },
- { key: 'Delete', label: ''},
- ],
- deliveryOrderField: [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah Barang Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- ],
- receiptField: [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah Barang Kondisi 100%', sortable: true },
- { key: 'Price100', label: 'Harga Barang Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Price90', label: 'Harga Barang Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Price60', label: 'Harga Barang Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- { key: 'Price30', label: 'Harga Barang Kondisi 30%', sortable: true },
- ],
- // itemCollectionField: this.fieldLookup(),
- }
- },
- validations: {
- selectedLegalEntityR: {
- required
- },
- selectedBranchR: {
- required
- },
- selectedSchedules: {
- required
- },
- selectedPriceType: {
- required
- },
- selectedInventory: {
- required,
- BundleQuantity100: {
- required
- },
- BundleQuantity90: {
- required
- },
- BundleQuantity60: {
- required
- },
- BundleQuantity30: {
- required
- },
- BundleRefurbishQuantity: {
- required
- }
- },
- stockOut: {
- Name: {
- required
- }
- }
- },
- beforeUpdate: function () {
- this.stockOut.Sisa = parseInt(this.stockOut.Total) - parseInt(this.stockOut.Nominal)
- this.stockOut.ReceiverName = this.selectedLegalEntityR.Name + " - " + this.selectedBranchR.Name
- this.stockOut.SenderName = this.selectedLegalEntity.Name + " - " + this.selectedBranch.Name
- this.stockOut.LicensePlateNumber = this.selectedLicensePlateNumber.LicencePlateNumber
- this.stockOut.LicensePlateNumberR = this.selectedLicensePlateNumberR.LicensePlateNumber
- this.stockOut.DriverId = this.selectedDriver.Id
- this.stockOut.CoDriverId = this.selectedCoDriver.Id
- this.stockOut.LegalEntityId = this.selectedLegalEntity.Id
- this.stockOut.BranchId = this.selectedBranch.Id
- this.stockOut.LegalEntityIdR = this.selectedLegalEntityR.Id
- this.stockOut.BranchIdR = this.selectedBranchR.Id
- this.item = this.selectedInventory
- // if(this.stockOut.Properties == 'Terjadwal') {
- // this.item.BundleQuantity100 = this.selectedInventory.alocation.Quantity100
- // this.item.BundleQuantity90 = this.selectedInventory.alocation.Quantity90
- // this.item.BundleQuantity60 = this.selectedInventory.alocation.Quantity60
- // this.item.BundleQuantity30 = this.selectedInventory.alocation.Quantity30
- // }
- this.sellingPriceAccess = this.userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse
- },
- created: function () {
- this.init()
- },
- mounted: function () {
- window.$ = $
- if(localStorage.userData !== undefined) {
- this.userData = JSON.parse(localStorage.userData)
- } else {
- this.$router.push({ name: 'home' })
- location.reload()
- }
- },
- methods: {
- init: async function () {
- let legalEntity = await LegalEntities.index()
- let branch = await Branches.index()
- let employee = await Employees.index()
- this.legalEntity = legalEntity.data
- this.branch = branch.data
- this.employee = employee.data
- this.selectedLegalEntity = this.lookupData(legalEntity.data, 1)
- this.selectedBranch = this.lookupData(branch.data, 1)
- this.loading = false
- if(this.$route.params.id) {
- let edit = await StockOut.detail(this.$route.params.id)
- this.stockOut = edit.data
- this.selectedDriver = this.lookupData(employee.data, edit.data.DriverId)
- this.selectedCoDriver = this.lookupData(employee.data, edit.data.CoDriverId)
- this.selectedLicensePlateNumber = [edit.data.LicensePlateNumber]
- this.selectedLicensePlateNumberR = [edit.data.LicensePlateNumberR]
- this.selectedLegalEntityR = this.lookupData(legalEntity.data, edit.data.LegalEntityIdR)
- this.selectedBranchR = this.lookupData(branch.data, edit.data.BranchIdR)
- this.selectedSchedules = [edit.data.Properties]
- if(this.stockOut.Properties == 'Tidak Terjadwal') {
- let inventory = await Inventories.index()
- this.inventory = inventory.data
- for(var i = 0; i < inventory.data.length; i ++) {
- this.inventory[i].itembranch = this.filterBarangCabang(inventory.data[i].inventory_branches, this.userData.LegalEntityId, this.userData.BranchId)
- }
- }
- if(this.stockOut.Properties == 'Terjadwal') {
- let scheduling = await Schedulings.index()
- console.log(scheduling.data)
- this.inventory = scheduling.data
- for(var j = 0; j < scheduling.data.length; j ++) {
- this.inventory[j].Name = scheduling.data[j].alocation.Name
- this.inventory[j].Code = scheduling.data[j].alocation.Code
- this.inventory[j].Category = scheduling.data[j].alocation.Category
- this.inventory[j].itembranch = [scheduling.data[j].alocation.inventory_branch]
- this.inventory[j].Price100 = scheduling.data[j].alocation.inventory_branch.inventory.Price100
- this.inventory[j].Price90 = scheduling.data[j].alocation.inventory_branch.inventory.Price90
- this.inventory[j].Price60 = scheduling.data[j].alocation.inventory_branch.inventory.Price60
- this.inventory[j].Price30 = scheduling.data[j].alocation.inventory_branch.inventory.Price30
- this.inventory[j].ExtraPrice100 = scheduling.data[j].alocation.inventory_branch.inventory.ExtraPrice100
- this.inventory[j].ExtraPrice90 = scheduling.data[j].alocation.inventory_branch.inventory.ExtraPrice90
- this.inventory[j].ExtraPrice60 = scheduling.data[j].alocation.inventory_branch.inventory.ExtraPrice60
- this.inventory[j].ExtraPrice30 = scheduling.data[j].alocation.inventory_branch.inventory.ExtraPrice30
- this.inventory[j].itembranch[0].TotalQuantity = scheduling.data[j].alocation.TotalQuantity
- this.inventory[j].itembranch[0].Quantity100 = scheduling.data[j].alocation.Quantity100
- this.inventory[j].itembranch[0].Quantity90 = scheduling.data[j].alocation.Quantity90
- this.inventory[j].itembranch[0].Quantity60 = scheduling.data[j].alocation.Quantity60
- this.inventory[j].itembranch[0].Quantity30 = scheduling.data[j].alocation.Quantity30
- }
- }
- let itemdetails = await ItemDetails.findbymodule('Transaction Warehouse', this.$route.params.id)
- this.itemdetails = itemdetails.data
- this.selectedPaymentStatus = [edit.data.PaymentStatus]
- this.stockOut.Tags = [edit.data.Tags]
- this.stockOut.Total = this.totalPriceItemDetails(this.itemdetails)
- this.stockOut.Sisa = parseInt(this.stockOut.Total) - parseInt(this.stockOut.Nominal)
- this.selectedLegalEntityR = this.lookupData(legalEntity.data, edit.data.LegalEntityId)
- this.selectedBranchR = this.lookupData(branch.data, edit.data.BranchId)
- this.selectedLegalEntityR = this.lookupData(legalEntity.data, edit.data.LegalEntityIdR)
- this.selectedBranchR = this.lookupData(branch.data, edit.data.BranchIdR)
- this.selectedInventory.BundleQuantity100 = 0
- this.selectedInventory.BundleQuantity90 = 0
- this.selectedInventory.BundleQuantity60 = 0
- this.selectedInventory.BundleQuantity30 = 0
- }
- },
- fieldLookup() {
- let field = [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah Barang Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- { key: 'RefurbishQuantity', label: 'Jumlah Barang Rekondisi', sortable: true },
- { key: 'Delete', label: ''},
- ]
- if(this.userData.RoleDetails.IsReadSellingPriceStockOutTransactionWarehouse == 1) {
- field.splice(10, 0,
- { key: 'Price100', label: 'Harga Barang Kondisi 100%', sortable: true },
- { key: 'Price90', label: 'Harga Barang Kondisi 90%', sortable: true },
- { key: 'Price60', label: 'Harga Barang Kondisi 60%', sortable: true },
- { key: 'Price30', label: 'Harga Barang Kondisi 30%', sortable: true },
- )
- }
- return field
- },
- filterBarangCabang: function(json, legalEntityId, branchId) {
- let data = []
- console.log(legalEntityId)
- console.log(branchId)
- for(var i = 0; i < json.length; i++) {
- if((json[i].LegalEntityId == legalEntityId) && (json[i].BranchId == branchId)) {
- data.push(json[i])
- }
- }
- return data
- },
- tambahBarang: async function() {
- this.stockOut.Type = "Transaction Warehouse"
- // this.stockOut.Tags = "Kas Besar"
- this.stockOut.DeliveryStatus = "Draft"
- this.stockOut.ItemCollection = "[]"
- this.stockOut.Properties = this.selectedSchedules
- this.stockOut.Source = "Transaction Warehouse"
- this.stockOut.SourceId = null
- this.stockOut.TransferType = "StockOut"
- this.stockOut.PaymentStatus = ''
- this.stockOut.Tags = ''
- console.log(this.stockOut)
- try {
- this.stockOut.Code = 'KTG/' + this.userData.LegalEntityId + this.userData.BranchId + '/' + moment().format('DD') + moment().format('MM') + moment().format('YY') + "/" + this.userData.Id + "/" + moment().format('HH') + moment().format('mm') + moment().format('ss')
- this.stockOut.DeliveryOrderCode = 'SJ/' + this.userData.LegalEntityId + this.userData.BranchId + '/' + moment().format('DD') + moment().format('MM') + moment().format('YY') + "/" + this.userData.Id + "/" + moment().format('HH') + moment().format('mm') + moment().format('ss')
- this.stockOut.ReceiptCode = 'FTG/' + this.userData.LegalEntityId + this.userData.BranchId + '/' + moment().format('DD') + moment().format('MM') + moment().format('YY') + "/" + this.userData.Id + "/" + moment().format('HH') + moment().format('mm') + moment().format('ss')
- // this.stockOut.Name = "Transaction Gudang Cabang - " + this.stockOut.Code
- let result = await StockOut.create(this.stockOut)
- let id = result.data.id
- if(result.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Data Disimpan sebagai draft',
- icon: 'info',
- showConfirmButton: false
- })
- if(id) {
- this.$router.push({ name: 'StockOutWtV3Management.draft', params: { id: id } })
- location.reload()
- }
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- tambah: async function () {
- let items = this.selectedInventory
- console.log(items.itembranch[0].Quantity100 + ">=" + parseInt(items.BundleQuantity100))
- console.log(items.itembranch[0].Quantity90 + ">=" + parseInt(items.BundleQuantity90))
- console.log(items.itembranch[0].Quantity60 + ">=" + parseInt(items.BundleQuantity60))
- console.log(items.itembranch[0].Quantity30 + ">=" + parseInt(items.BundleQuantity30))
- console.log(items.itembranch[0].RefurbishQuantity + ">=" + parseInt(items.BundleRefurbishQuantity))
- console.log(parseInt(items.itembranch[0].Quantity100) >= parseInt(items.BundleQuantity100))
- console.log(parseInt(items.itembranch[0].Quantity90) >= parseInt(items.BundleQuantity90))
- console.log(parseInt(items.itembranch[0].Quantity60) >= parseInt(items.BundleQuantity60))
- console.log(parseInt(items.itembranch[0].Quantity30) >= parseInt(items.BundleQuantity30))
- console.log(parseInt(items.itembranch[0].RefurbishQuantity) >= parseInt(items.BundleRefurbishQuantity))
- if(this.stockOut.Properties == 'Terjadwal') {
- this.stockOut.DriverId = this.selectedInventory.DriverId
- this.stockOut.CoDriverId = this.selectedInventory.CoDriverId
- }
- if((parseInt(items.itembranch[0].Quantity100) >= parseInt(this.item.BundleQuantity100)) ||
- (parseInt(items.itembranch[0].Quantity90) >= parseInt(this.item.BundleQuantity90)) ||
- (parseInt(items.itembranch[0].Quantity60) >= parseInt(this.item.BundleQuantity60)) ||
- (parseInt(items.itembranch[0].Quantity30) >= parseInt(this.item.BundleQuantity30)) ||
- (parseInt(items.itembranch[0].RefurbishQuantity) >= parseInt(this.item.BundleRefurbishQuantity))) {
- items.Position = "Keluar"
- items.ItemId = items.itembranch[0].Id
- items.Source = "Transaction Warehouse"
- items.SourceId = this.$route.params.id
- items.Reason = ''
- items.EmployeeId = this.userData.EmployeeId
- items.Quantity100 = items.BundleQuantity100
- items.Quantity90 = items.BundleQuantity90
- items.Quantity60 = items.BundleQuantity60
- items.Quantity30 = items.BundleQuantity30
- items.RefurbishQuantity = items.BundleRefurbishQuantity
- items.Properties = this.stockOut.selectedSchedules
- items.SenderName = this.stockOut.SenderName
- items.ReceiverName = this.stockOut.ReceiverName
- items.TotalQuantity = parseInt(items.BundleQuantity100) + parseInt(items.BundleQuantity90) + parseInt(items.BundleQuantity60) + parseInt(items.BundleQuantity30)
- if(this.selectedPriceType == 'Harga Jual Reguler') {
- items.Price100 = this.selectedInventory.Price100
- items.Price90 = this.selectedInventory.Price90
- items.Price60 = this.selectedInventory.Price60
- items.Price30 = this.selectedInventory.Price30
- }
- if(this.selectedPriceType == 'Harga Jual Owner') {
- items.Price100 = this.selectedInventory.ExtraPrice100
- items.Price90 = this.selectedInventory.ExtraPrice90
- items.Price60 = this.selectedInventory.ExtraPrice60
- items.Price30 = this.selectedInventory.ExtraPrice30
- }
- if(this.selectedPriceType == 'Harga Jual Bazaar') {
- items.Price100 = this.selectedInventory.BazaarPrice100
- items.Price90 = this.selectedInventory.BazaarPrice90
- items.Price60 = this.selectedInventory.BazaarPrice60
- items.Price30 = this.selectedInventory.BazaarPrice30
- }
- if(this.selectedAssembly == 'Ya') {
- items.IsAssembly = 1
- items.UnassemblyQuantity = parseInt(items.BundleQuantity100) + parseInt(items.BundleQuantity90) + parseInt(items.BundleQuantity60) + parseInt(items.BundleQuantity30)
- items.AssemblyQuantity = 0
- items.Cancel = 0
- }
- if(this.selectedAssembly == 'Tidak') {
- items.isAssembly = 0
- }
- try {
- let itemdetailsBefore = await ItemDetails.findbymodule('Transaction Warehouse', this.$route.params.id)
- if(!isNaN(this.totalItemDetails(itemdetailsBefore.data))) {
- console.log(items)
- let result = await ItemDetails.create(items)
- let itemdetails = await ItemDetails.findbymodule('Transaction Warehouse', this.$route.params.id)
- if(itemdetails.status == 200) {
- this.stockOut.ItemQuantity = this.totalItemDetails(itemdetails.data)
- this.stockOut.Name = "Transaction Warehouse - " + this.selectedInventory.Name
- await StockOut.edit(this.$route.params.id, this.stockOut)
- }
- if(result.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Data barang telah Disimpan',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'StockOutWtV3Management.draft', params: { id: this.$route.params.id } })
- location.reload()
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- }
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- } else {
- alert("Jumlah Yang dikeluarkan melebihi batas")
- }
- },
- hapus: async function(id, json) {
- json.EmployeeId = this.userData.EmployeeId
- json.LegalEntityId = this.userData.LegalEntityId
- json.BranchId = this.userData.BranchId
- json.Source = "Transaction Warehouse"
- json.SourceId = this.$route.params.id
- json.Reason = ''
- try {
- let result = await ItemDetails.edit(id, json)
- let itemdetails = await ItemDetails.findbymodule('Transaction Warehouse', this.$route.params.id)
- if(itemdetails.status == 200) {
- this.stockOut.ItemQuantity = this.totalItemDetails(itemdetails.data)
- await StockOut.edit(this.$route.params.id, this.stockOut)
- }
- if(result.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Data barang telah Dihapus',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'StockOutWtV3Management.draft', params: { id: this.$route.params.id } })
- location.reload()
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- saveDraft: async function() {
- try {
- this.stockOut.DeliveryStatus = "Final"
- await StockOut.edit(this.$route.params.id, this.stockOut)
- this.$router.push({ name: 'StockOutWtV3Management.detail', params: { id: this.$route.params.id } })
- location.reload()
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- save: async function() {
- // Fungsi Save Data
- for(var i = 0; i < this.stockOut.ItemCollection.length; i++) {
- let historyData = {
- ItemId: this.stockOut.ItemCollection[i].Id,
- EmployeeId: this.userData.EmployeeId,
- SupplierId: this.stockOut.ItemCollection[i].SupplierId,
- BuyingPrice: 0,
- TotalQuantity: this.stockOut.ItemCollection[i].BundleTotalQuantity,
- SellingPrice: this.stockOut.ItemCollection[i].Price100,
- LegalEntityId: this.stockOut.LegalEntityId,
- BranchId: this.stockOut.BranchId,
- SellingQuantity: this.stockOut.ItemQuantity
- }
- await Inventories.setHistory(historyData)
- }
- this.stockOut.Type = "Transaction Warehouse"
- this.stockOut.ItemCollection = JSON.stringify(this.stockOut.ItemCollection)
- this.stockOut.Properties = this.selectedSchedules
- console.log(this.stockOut)
- try {
- let result
- if(this.$route.params.id) {
- result = await StockOut.edit(this.$route.params.id, this.stockOut)
- }
- if(!this.$route.params.id) {
- // await Bill.create(this.stockOut)
- // console.log(this.stockOut)
- result = await StockOut.create(this.stockOut)
- }
- if(result.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Input Data Sukses',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'StockOutV3Management.index' })
- location.reload()
- } else {
- this.$fire({
- title: 'Error',
- text: 'Input Data Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- totalItemDetails: function (json) {
- let total = 0;
- if(json.length > 0) {
- for(var i = 0; i < json.length; i++) {
- total = parseInt(total)
- + parseInt(json[i].Quantity100)
- + parseInt(json[i].Quantity90)
- + parseInt(json[i].Quantity60)
- + parseInt(json[i].Quantity30)
- console.log(total)
- }
- }
- console.log(total)
- return total
- },
- totalPriceItemDetails: function(json) {
- let total = 0;
- for(var i = 0; i < json.length; i++) {
- total = parseInt(total)
- + parseInt(parseInt(json[i].Quantity100) * parseInt(json[i].Price100))
- + parseInt(parseInt(json[i].Quantity90) * parseInt(json[i].Price90))
- + parseInt(parseInt(json[i].Quantity60) * parseInt(json[i].Price60))
- + parseInt(parseInt(json[i].Quantity30) * parseInt(json[i].Price30))
- console.log(total)
- }
- console.log(total)
- return total
- },
- itemLookup: function (json) {
- let data = []
- for(var i = 0; i< json.length; i++) {
- data[json[i].Id] = json[i]
- }
- return data
- },
- lookupData (json, id) {
- let data = []
- for(var i = 0; i < json.length; i++) {
- data[json[i].Id] = json[i]
- }
- return data[id]
- },
- formatDate(time) {
- var formattedTime = moment(time).format('DD MMMM YYYY HH:mm')
- if(formattedTime == 'Invalid date') {
- formattedTime = '-'
- }
- return formattedTime
- },
- add: function () {
- this.stockOut.Total = parseInt(this.stockOut.Total) + parseInt(
- parseInt(this.item.Price100) +
- parseInt(this.item.Price90) +
- parseInt(this.item.Price60)
- )
- this.stockOut.ItemQuantity = parseInt(this.stockOut.ItemQuantity) + parseInt(
- parseInt(this.item.BundleQuantity100)
- + parseInt(this.item.BundleQuantity90)
- + parseInt(this.item.BundleQuantity60)
- + parseInt(this.item.BundleQuantity30)
- )
- let addeditem = this.item
- this.stockOut.ItemCollection.push(addeditem)
- this.selectedInventory = null
- },
- del: function (index) {
- this.stockOut.Total = parseInt(this.stockOut.Total) - parseInt(
- parseInt(this.stockOut.ItemCollection[index].Price100) +
- parseInt(this.stockOut.ItemCollection[index].Price90) +
- parseInt(this.stockOut.ItemCollection[index].Price60)
- )
- this.stockOut.ItemQuantity = parseInt(this.stockOut.ItemQuantity) - parseInt(
- parseInt(this.stockOut.ItemCollection[index].BundleQuantity100)
- + parseInt(this.stockOut.ItemCollection[index].BundleQuantity90)
- + parseInt(this.stockOut.ItemCollection[index].BundleQuantity60)
- + parseInt(this.stockOut.ItemCollection[index].BundleQuantity30)
- )
- this.$delete(this.stockOut.ItemCollection, index)
- },
- changeImage1(file) {
- this.stockOut.Picture1 = file.base64
- },
- changeImage2(file) {
- this.stockOut.Picture2 = file.base64
- },
- changeImage3(file) {
- this.stockOut.Picture3 = file.base64
- },
- changeImage4(file) {
- this.stockOut.Picture4 = file.base64
- },
- changeSignatureDO1(file) {
- this.deliveryOrder.Picture1 = file.base64
- },
- changeSignatureDO2(file) {
- this.deliveryOrder.Picture2 = file.base64
- },
- changeSignaturereceipt(file) {
- this.receipt.Picture1 = file.base64
- },
- addWaterMarkDeliveryOrder(doc) {
- var totalPages = doc.internal.getNumberOfPages();
- for (var i = 1; i <= totalPages; i++) {
- doc.setPage(i);
- //doc.addImage(imgData, 'PNG', 40, 40, 75, 75);
- // doc.setTextColor(150);
- // doc.text('Test', 130, 10);
- //Header
- doc.setFontSize(20)
- doc.text("Surat Jalan", 130, 10)
- doc.setFontSize(10)
- doc.text("Nomor : " + this.stockOut.DeliveryOrderCode, 30, 20)
- doc.text("Penerima : " + this.stockOut.ReceiverName, 30, 30)
- if(this.stockOut.DriverId != null) {
- doc.text("Driver : " + this.stockOut.employee_driver.Name, 30, 40)
- } else {
- doc.text("Driver : - " , 30, 40)
- }
- if(this.stockOut.CoDriverId != null) {
- doc.text("Co Driver : " + this.stockOut.employee_co_driver.Name, 30, 50)
- } else {
- doc.text("Co Driver : - ", 30, 50)
- }
- doc.text("Tanggal : " + this.stockOut.created_at, 190, 20)
- doc.text("Pengirim : " + this.stockOut.SenderName, 190, 30)
- if(this.stockOut.ExpeditionName != null) {
- doc.text("Ekspedisi : " + this.stockOut.ExpeditionName, 190, 40)
- } else {
- doc.text("Ekspedisi : - ", 190, 40)
- }
- if(this.stockOut.ExpeditionReceipt != null) {
- doc.text("Nomor Resi : " + this.stockOut.ExpeditionReceipt, 190, 50)
- } else {
- doc.text("Nomor Resi : - ", 190, 50)
- }
- doc.text("======================================================================================================================================", 10, 60)
- var pageSize = doc.internal.pageSize;
- var pageHeight = pageSize.height ? pageSize.height : pageSize.getHeight();
- doc.text('Admin,', 15, pageHeight - 40);
- doc.text("" + this.stockOut.updated_at, 15, pageHeight - 10)
- doc.text('Diperiksa,', 70, pageHeight - 40);
- doc.text('Diterima,', 120, pageHeight - 40);
- doc.text("" + this.stockOut.ReceiverName, 120, pageHeight - 10)
- doc.text("=====================================", 200, pageHeight - 40)
- doc.text("Total Barang : " + this.stockOut.ItemQuantity, 200, pageHeight - 35)
- }
- return doc;
- },
- addWaterMarkReceipt(doc) {
- var totalPages = doc.internal.getNumberOfPages();
- for (var i = 1; i <= totalPages; i++) {
- doc.setPage(i);
- //doc.addImage(imgData, 'PNG', 40, 40, 75, 75);
- // doc.setTextColor(150);
- // doc.text('Test', 130, 10);
- //Header
- doc.setFontSize(20)
- doc.text("Faktur", 130, 10)
- doc.setFontSize(10)
- doc.text("Nomor : " + this.stockOut.ReceiptCode, 30, 20)
- doc.text("Penerima : " + this.stockOut.ReceiverName, 30, 30)
- if(this.stockOut.DriverId != null) {
- doc.text("Driver : " + this.stockOut.employee_driver.Name, 30, 40)
- } else {
- doc.text("Driver : - " , 30, 40)
- }
- if(this.stockOut.CoDriverId != null) {
- doc.text("Co Driver : " + this.stockOut.employee_co_driver.Name, 30, 50)
- } else {
- doc.text("Co Driver : - ", 30, 50)
- }
- doc.text("Tanggal : " + this.stockOut.created_at, 190, 20)
- doc.text("Pengirim : " + this.stockOut.SenderName, 190, 30)
- if(this.stockOut.ExpeditionName != null) {
- doc.text("Ekspedisi : " + this.stockOut.ExpeditionName, 190, 40)
- } else {
- doc.text("Ekspedisi : - ", 190, 40)
- }
- if(this.stockOut.ExpeditionReceipt != null) {
- doc.text("Nomor Resi : " + this.stockOut.ExpeditionReceipt, 190, 50)
- } else {
- doc.text("Nomor Resi : - ", 190, 50)
- }
- doc.text("======================================================================================================================================", 10, 60)
- var pageSize = doc.internal.pageSize;
- var pageHeight = pageSize.height ? pageSize.height : pageSize.getHeight();
- doc.text('Admin,', 15, pageHeight - 40);
- doc.text("" + this.stockOut.updated_at, 15, pageHeight - 10)
- doc.text('Diperiksa,', 70, pageHeight - 40);
- doc.text('Diterima,', 120, pageHeight - 40);
- doc.text("" + this.stockOut.ReceiverName, 120, pageHeight - 10)
- doc.text("=====================================", 200, pageHeight - 40)
- doc.text("Total Barang : " + this.stockOut.ItemQuantity.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."), 200, pageHeight - 35)
- doc.text("Total Harga : " + "Rp" + this.stockOut.Total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 30)
- doc.text("Diskon Harga : " + "Rp" + "0.00", 200, pageHeight - 25)
- doc.text("Jenis Pembayaran : " + this.stockOut.PaymentStatus, 200, pageHeight - 20)
- doc.text("Nominal Pembayaran : " + "Rp" + this.stockOut.Nominal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 15)
- doc.text("Sisa Pembayaran : " + "Rp" + this.stockOut.Sisa.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 10)
- }
- return doc;
- },
- downloadSuratJalan() {
- const doc = new jsPDF({
- orientation: 'landscape'
- });
- doc.autoTable({
- startY: 70,
- html: '#stockOutDeliveryOrder',
- margin: {
- bottom: 40, //this decides how big your footer area will be
- top: 70 //this decides how big your header area will be.
- }
- })
- //Footer here
- this.doc = this.addWaterMarkDeliveryOrder(doc)
- doc.save("Surat Jalan - " + this.stockOut.DeliveryOrderCode + ".pdf");
- },
- downloadKwitansi() {
- const doc = new jsPDF({
- orientation: 'landscape'
- });
- doc.autoTable({
- startY: 70,
- html: '#stockOutReceipt',
- margin: {
- bottom: 40, //this decides how big your footer area will be
- top: 70 //this decides how big your header area will be.
- }
- })
- //Footer here
- this.doc = this.addWaterMarkReceipt(doc)
- doc.save("Faktur - " + this.stockOut.ReceiptCode +".pdf");
- },
- }
- }
- </script>
Add Comment
Please, Sign In to add comment