Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template v-if="userData.RoleDetails.IsCreateStockInProcurement || userData.RoleDetails.IsUpdateStockInProcurement || userData.RoleDetails.IsReadStockInProcurement">
- <b-tabs pills card>
- <b-tab title="Pengadaan Pusat" active>
- <div class="row">
- <div v-if="loading" class="col-lg-12 d-flex justify-content-center mb-3">
- <b-spinner label="Loading..."></b-spinner>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-12 button-back-div">
- <router-link :to="{ name: 'StockInV3Management.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 Penerima</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 Penerima</label>
- <vue-select disabled v-model="selectedBranch" class="vue-select2" name="role" :options="branch" label="Name"></vue-select>
- </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="stockIn.SenderName" name="SupplierContact" required 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="stockIn.ReceiverName" name="SupplierContact" required 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="stockIn.created_at" name="Date" class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- 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 Masuk</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="stockIn.Code" required 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="stockIn.Name" placeholder="Ketik nama" />
- <label v-if="$v.stockIn.Name.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Nomor Surat Jalan field -->
- <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="!$route.name.includes('.create')" placeholder="Ketik nomor surat jalan..." type="text" v-model="stockIn.DeliveryOrderCode" name="DeliveryOrderID" required class="validate form-control" style="border: 1px solid black;">
- <label v-if="$v.stockIn.DeliveryOrderCode.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Nomor Receipt field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label for="deliveryOrderID" class="form-label" style="color: black;">Nomor Faktur</label>
- <input :disabled="!$route.name.includes('.create')" placeholder="Ketik nomor faktur..." type="text" v-model="stockIn.ReceiptCode" name="DeliveryOrderID" required class="validate form-control" style="border: 1px solid black;">
- <label v-if="$v.stockIn.ReceiptCode.$invalid" class="form-label" style="color: red;">*Wajib diisi</label>
- </div>
- </div>
- <!-- Opsi Pengadaan Field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="carNumber" class="form-label" style="color: black;">Sumber Barang Masuk</label>
- <vue-select :disabled="$route.name.includes('.detail')" v-model="stockIn.Properties" class="vue-select2" name="role" :options="properties" label="Name">
- </vue-select>
- </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 (Penerima)</label>
- <vue-select :disabled="$route.name.includes('.detail')" v-model="selectedLicensePlateNumberR" 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="stockIn.LicensePlateNumber" name="CarNumber" required 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 (Pengirim)</label>
- <input :disabled="$route.name.includes('.detail')" placeholder="Ketik nomor polisi kendaraan..." type="text" v-model="stockIn.LicensePlateNumber" name="CarNumber" required 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')" 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')" 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="stockIn.ExpeditionName" type="text" name="CarNumber" required 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="stockIn.ExpeditionReceipt" type="text" name="CarNumber" required 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="stockIn.Description" type="text" name="CarNumber" required class="validate form-control" style="border: 1px solid black;"></textarea>
- </div>
- </div>
- </div>
- </div>
- <div style="padding-left: 30px;"><button :disabled="$v.stockIn.DeliveryOrderCode.$invalid || $v.stockIn.Name.$invalid" v-if="$route.name.includes('.create')" @click="tambahBarang()" class="btn btn-primary" style="margin-top: 30px;">Tambah Barang</button></div>
- </div>
- <hr />
- <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">
- <!-- Kode Barang Masuk field -->
- <div class="col-lg-12">
- <div class="form-group form-float">
- <label for="date" class="form-label" style="color: black;">Kode Pembelian</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="selectedInventory" class="vue-select2" name="role" :options="purchase" label="Code">
- <template v-slot:option="option">
- {{ option.Code }} - {{ option.Name }}
- </template>
- </vue-select>
- <label v-if="$v.selectedInventory.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- <!-- Nama Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties != 'Pemesanan Terjadwal'">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Nama Pengadaan</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.Name" name="PengadaanTotal" required class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Kode Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties != 'Pemesanan Terjadwal'">
- <div class="form-group form-float">
- <label for="productNumber" class="form-label" style="color: black;">Kode Pengadaan</label>
- <input disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.Code" name="ProductName" required class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Nama Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties != 'Pemesanan Terjadwal'">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Nama Barang</label>
- <input v-if="selectedInventory.inventory_branch !== undefined" disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.inventory_branch.inventory.Name" name="PengadaanTotal" required class="validate form-control" style="border: 1px solid black;">
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Nama Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties == 'Pemesanan Terjadwal'">
- <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 class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Kode Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties != 'Pemesanan Terjadwal'">
- <div class="form-group form-float">
- <label for="productNumber" class="form-label" style="color: black;">Kode Barang</label>
- <input v-if="selectedInventory.inventory_branch !== undefined" disabled placeholder="Auto generate..." type="text" v-model="selectedInventory.inventory_branch.inventory.Code" name="ProductName" required class="validate form-control" style="border: 1px solid black;">
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Kode Barang field -->
- <div class="col-lg-6" v-if="stockIn.Properties == 'Pemesanan Terjadwal'">
- <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 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 class="validate form-control" style="border: 1px solid black;">
- </div>
- </div>
- <!-- Perlu dirakit field -->
- <div class="col-lg-6">
- <div class="form-group form-float">
- <label for="productName" class="form-label" style="color: black;">Perlu dirakit?</label>
- <!-- <select class="form-control" v-model="tmpitem.BundleIsAssembly">
- <option value="0">Tidak</option>
- <option value="1">Ya</option>
- </select> -->
- <vue-select v-model="selectedAssembly" class="vue-select2" name="role" :options="isAssembly" label="Name"></vue-select>
- <label v-if="$v.selectedAssembly.$invalid" class="form-label" style="color: red;">*Wajib dipilih</label>
- </div>
- </div>
- </div>
- <div class="row" v-if="stockIn.Properties != 'Pemesanan Terjadwal'">
- <!-- 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>
- <div v-if="selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.Quantity100 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 100% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 100% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement) && selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.inventory_branch.inventory.BuyingPrice100 | currency }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></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>
- <div v-if="selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.Quantity90 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 90% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 90% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement) && selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.inventory_branch.inventory.BuyingPrice90 | currency }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></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>
- <div v-if="selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.Quantity60 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 60% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 60% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement) && selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.inventory_branch.inventory.BuyingPrice60 | currency }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></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 dibawah 30%</label>
- <div v-if="selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.Quantity30 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 60% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 30% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement) && selectedInventory.inventory_branch !== undefined" class="form-control disabled-field">{{ selectedInventory.inventory_branch.inventory.BuyingPrice30 | currency }}</div>
- <div v-if="selectedInventory.inventory_branch === undefined" class="form-control disabled-field"></div>
- </div>
- </div>
- </div>
- <div class="row" v-if="stockIn.Properties == 'Pemesanan Terjadwal'">
- <!-- 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>
- <div class="form-control disabled-field">{{ selectedInventory.AlocationQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 100% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 100% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement)" class="form-control disabled-field">{{ selectedInventory.BuyingPrice100 | 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>
- <div class="form-control disabled-field">{{ selectedInventory.Quantity90 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 90% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 90% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement) " class="form-control disabled-field">{{ selectedInventory.BuyingPrice90 | 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>
- <div class="form-control disabled-field">{{ selectedInventory.Quantity60 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 60% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 60% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement)" class="form-control disabled-field">{{ selectedInventory.BuyingPrice60 | 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 dibawah 30%</label>
- <div class="form-control disabled-field">{{ selectedInventory.Quantity30 | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- <!-- Harga Beli Kondisi 60% field -->
- <div class="col-lg-6" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <div class="form-group form-float">
- <label v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" for="pengadaanTotal" class="form-label" style="color: black;">Harga Beli Kondisi 30% (Rp)</label>
- <div v-if="(userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement)" class="form-control disabled-field">{{ selectedInventory.BuyingPrice30 | currency }}</div>
- </div>
- </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-12">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Seluruh Pengadaan</label>
- <div class="form-control disabled-field">{{ stockIn.ItemQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- </div>
- <div class="row" v-show="userData.RoleDetails.IsReadBuyingPriceStockInProcurement">
- <!-- 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 :disabled="$route.name.includes('.detail')" v-model="stockIn.PaymentStatus" 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 Pengadaan (Rp)</label>
- <div class="form-control disabled-field">{{ stockIn.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')" placeholder="Ketik nominal pembayaran..." type="text" v-model="stockIn.Nominal" class="validate form-control" style="border: 1px solid black;"></money>
- <div v-if="$route.name.includes('.detail')" class="form-control disabled-field">{{ stockIn.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">{{ stockIn.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,' + stockIn.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,' + stockIn.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,' + stockIn.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,' + stockIn.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 class="row" v-if="$route.name.includes('.draft') || $route.name.includes('.edit')">
- <div class="col-lg-2" style="padding-left: 30px; margin-bottom: 30px;">
- <button :disabled="$v.selectedInventory.$invalid || $v.selectedAssembly.$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 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-12">
- <div class="form-group form-float">
- <label for="pengadaanTotal" class="form-label" style="color: black;">Jumlah Seluruh Pengadaan</label>
- <div class="form-control disabled-field">{{ stockIn.ItemQuantity | currency({ symbol: '', thousandsSeparator: '.', fractionCount: '', fractionSeparator: '', symbolPosition: '', symbolSpacing: '' }) }}</div>
- </div>
- </div>
- </div>
- <div class="row">
- <!-- 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="stockIn.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 Pengadaan (Rp)</label>
- <div class="form-control disabled-field">{{ stockIn.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')" placeholder="Ketik nominal pembayaran..." type="text" v-model="stockIn.Nominal" class="validate form-control" style="border: 1px solid black;"></money>
- <div v-if="$route.name.includes('.detail')" class="form-control disabled-field">{{ stockIn.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">{{ stockIn.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,' + stockIn.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,' + stockIn.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,' + stockIn.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,' + stockIn.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('.edit') || $route.name.includes('.draft') || $route.name.includes('.detail')"/>
- <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="stockInItemCollection"
- :items="itemdetails"
- :fields="itemCollectionField"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-if="!$route.name.includes('.detail')" 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(ItemCode)="data">
- <span v-if="stockIn.Properties != 'Pemesanan Terjadwal'">{{ data.item.inventory_branch.inventory.Code}}</span>
- <span v-if="stockIn.Properties == 'Pemesanan Terjadwal'">{{ data.item.Code}}</span>
- </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-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" 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(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="stockInDeliveryOrder"
- :items="itemdetails"
- :fields="deliveryOrderField"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-if="$route.name.includes('.detail')" 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(ItemCode)="data">
- {{ data.item.inventory_branch.inventory.Code}}
- </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-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" 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(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="stockInReceipt"
- :items="itemdetails"
- :fields="receiptField"
- class="table table-hover table-striped"
- style="margin-top: 10px;">
- <template v-if="$route.name.includes('.detail')" 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(ItemCode)="data">
- {{ data.item.inventory_branch.inventory.Code}}
- </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-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price100)="data">
- {{ data.item.Price100 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price90)="data">
- {{ data.item.Price90 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" v-slot:cell(Price60)="data">
- {{ data.item.Price60 | currency }}
- </template>
- <template v-if="userData.RoleDetails.IsReadBuyingPriceStockInProcurement || userData.RoleDetails.IsUpdateBuyingPriceStockInProcurement" 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(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: 'StockInV3Management.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: 'StockInV3Management.index' }" class="btn btn-default">Batal</router-link>
- </div>
- </div>
- </b-tab>
- </b-tabs>
- </template>
- <style>
- .table-div-append {
- height: 100%;
- padding-left: 15px;
- margin-left: 0px !important;
- overflow-x: auto;
- overflow-y: auto;
- }
- .card-header {
- width: 1620px;
- 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;
- }
- .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 Supplier from '@/services/Inventories/Supplier'
- import Purchases from '@/services/Transactions/Purchases'
- import LegalEntities from '@/services/Companies/LegalEntities'
- import Branches from '@/services/Companies/Branches'
- import StockIn from '@/services/Inventories/StockInV3'
- import ItemDetails from '@/services/Inventories/ItemDetails'
- // import Bill from '@/services/Accounting/BillV2'
- import Bundles from '@/services/Inventories/Bundle'
- import OrderPlans from '@/services/Inventories/OrderPlan'
- 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: 'StockInCPV3Management.create',
- components: {
- VueSelect,
- // VueNumeric,
- Base64Upload
- },
- data () {
- return {
- //Loading
- loading: true,
- exportData: [],
- userData: {},
- employee: [],
- orderPlan: [],
- properties: ['Pembelian oleh Admin', 'Pemesanan Terjadwal'],
- selectedDriver: {},
- selectedCoDriver: {},
- selectedEmployee: {},
- selectedLegalEntity: {},
- selectedPurchaseCode: [],
- selectedBranch: {},
- selectedSupplier: {},
- selectedInventory: [],
- selectedAssembly: {},
- selectedLicensePlateNumber: {},
- selectedLicensePlateNumberR: {},
- paymentStatus: ['Lunas','Kredit','Pembayaran Ditunda'],
- isAssembly: ['Ya','Tidak'],
- inventory: [],
- inventoryLookup: [],
- purchase: [],
- supplier: [],
- legalEntity: [],
- branch: [],
- adding: false,
- itemdetails: {},
- item: {},
- stockIn: {
- Total: 0,
- Nominal: 0,
- Sisa: 0,
- ItemQuantity: 0,
- ItemCollection: []
- },
- itemCollectionField: [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'ItemCode', label: 'Kode Barang', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'SupplierId', label: 'Supplier', sortable: true },
- { key: 'IsAssembly', label: 'Perlu Dirakit', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah 100%', sortable: true },
- { key: 'Price100', label: 'Harga Beli Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Price90', label: 'Harga Beli Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Price60', label: 'Harga Beli Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- { key: 'Price30', label: 'Harga Beli Kondisi dibawah 30%', sortable: true },
- { key: 'Delete', label: '' },
- ],
- deliveryOrderField: [
- { key: 'Id', label: 'Id', sortable: true },
- { key: 'Code', label: 'Kode', sortable: true },
- { key: 'ItemCode', label: 'Kode Barang', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'SupplierId', label: 'Supplier', sortable: true },
- { key: 'IsAssembly', label: 'Perlu Dirakit', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah 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 Barang', sortable: true },
- { key: 'ItemCode', label: 'Kode', sortable: true },
- { key: 'Name', label: 'Nama', sortable: true },
- { key: 'Category', label: 'Kategori', sortable: true },
- { key: 'SupplierId', label: 'Supplier', sortable: true },
- { key: 'IsAssembly', label: 'Perlu Dirakit', sortable: true },
- { key: 'TotalQuantity', label: 'Jumlah Keseluruhan', sortable: true },
- { key: 'Quantity100', label: 'Jumlah 100%', sortable: true },
- { key: 'Price100', label: 'Harga Beli Kondisi 100%', sortable: true },
- { key: 'Quantity90', label: 'Jumlah Barang Kondisi 90%', sortable: true },
- { key: 'Price90', label: 'Harga Beli Kondisi 90%', sortable: true },
- { key: 'Quantity60', label: 'Jumlah Barang Kondisi 60%', sortable: true },
- { key: 'Price60', label: 'Harga Beli Kondisi 60%', sortable: true },
- { key: 'Quantity30', label: 'Jumlah Barang Kondisi dibawah 30%', sortable: true },
- { key: 'Price30', label: 'Harga Beli Kondisi dibawah 30%', sortable: true },
- ]
- }
- },
- validations: {
- stockIn: {
- Name: {
- required
- },
- DeliveryOrderCode: {
- required
- },
- ReceiptCode: {
- required
- }
- },
- selectedInventory: {
- required
- },
- selectedAssembly: {
- required
- }
- },
- beforeUpdate: function () {
- this.stockIn.DriverId = this.selectedDriver.Id
- this.stockIn.CoDriverId = this.selectedCoDriver.Id
- this.stockIn.LicensePlateNumberR = this.selectedLicensePlateNumberR.LicencePlateNumber
- this.stockIn.ReceiverName = this.selectedLegalEntity.Name + " - " + this.selectedBranch.Name
- // this.stockIn.Total = this.totalPriceItemDetails(this.itemdetails)
- this.stockIn.PaymentStatus = this.selectedInventory.PaymentStatus
- this.stockIn.Nominal = this.selectedInventory.Nominal
- this.stockIn.SenderName = this.supplier[this.itemdetails[0].SupplierId].Name
- // this.stockIn.Sisa = parseInt(this.stockIn.Total) - parseInt(this.stockIn.Nominal)
- },
- 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 inventory = await Inventories.index()
- let legalEntity = await LegalEntities.detail(1)
- let branch = await Branches.detail(1)
- let employee = await Employees.index()
- let supplier = await Supplier.index()
- this.inventory = inventory.data
- this.legalEntity = legalEntity.data
- this.branch = branch.data
- this.employee = employee.data
- this.supplier = this.itemLookup(supplier.data)
- this.inventoryLookup = this.itemLookup(inventory.data)
- this.selectedLegalEntity = legalEntity.data
- this.selectedBranch = branch.data
- this.loading = false
- this.stockIn.LegalEntityIdR = 1
- this.stockIn.BranchIdR = 1
- this.stockIn.LegalEntityId = this.userData.LegalEntityId
- this.stockIn.BranchId = this.userData.BranchId
- if(this.$route.params.id) {
- let edit = await StockIn.detail(this.$route.params.id)
- let itemdetails = await ItemDetails.findbymodule('Central Procurement', this.$route.params.id)
- this.stockIn = edit.data
- this.itemdetails = itemdetails.data
- this.selectedDriver = this.lookupData(employee.data, edit.data.DriverId)
- this.selectedCoDriver = this.lookupData(employee.data, edit.data.CoDriverId)
- this.selectedLicensePlateNumberR = [edit.data.LicensePlateNumberR]
- this.stockIn.Total = this.totalPriceItemDetails(this.itemdetails)
- this.stockIn.Sisa = parseInt(this.stockIn.Total) - parseInt(this.stockIn.Nominal)
- console.log(this.stockIn.Sisa)
- if(this.stockIn.Properties == 'Pembelian oleh Admin') {
- let purchase = await Purchases.index()
- this.purchase = this.extractSupplierItem(purchase.data)
- }
- if(this.stockIn.Properties == 'Pemesanan Terjadwal') {
- let orderPlan = await OrderPlans.detail(1)
- this.purchase = orderPlan.data.OrderPlanDropdown.filter(x => x != null && x.Lot != null)
- }
- }
- },
- tambahBarang: async function() {
- this.stockIn.Type = "Central Procurement"
- this.stockIn.DeliveryStatus = "Draft"
- this.stockIn.ItemCollection = "[]"
- this.stockIn.Source = "Central Procurement"
- this.stockIn.SourceId = null
- this.stockIn.TransferType = "StockIn"
- console.log(this.stockIn)
- try {
- this.stockIn.Code = 'MPP/' + 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')
- let result = await StockIn.create(this.stockIn)
- 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: 'StockInCPV3Management.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)
- }
- },
- totalItemDetails: function (json) {
- console.log(json)
- let total = 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(json[i].Quantity100)
- 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)
- }
- return total
- },
- saveDraft: async function() {
- try {
- await StockIn.edit(this.$route.params.id, this.stockIn)
- this.$router.push({ name: 'StockInCPV3Management.detail', params: { id: this.$route.params.id } })
- location.reload()
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- save: async function() {
- this.stockIn.EditorId = this.userData.EmployeeId
- console.log(this.stockIn)
- try {
- let result
- let modals = []
- if(this.$route.params.id) {
- result = await StockIn.edit(this.$route.params.id, this.stockIn)
- }
- if(result.status == 200) {
- modals.push({
- title: 'Sukses',
- text: 'Input Data Barang Masuk Sukses',
- icon: 'info',
- showConfirmButton: false
- })
- } else {
- modals.push({
- title: 'Error',
- position: 'top',
- text: 'Input Data Barang Masuk Gagal',
- icon: 'error',
- showConfirmButton: false
- })
- console.log(result)
- }
- this.$swal.queue(modals)
- this.$router.push({ name: 'StockInV3Management.index' })
- location.reload()
- } catch (error) {
- alert("Error : " + error.response.data.message)
- }
- },
- 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]
- },
- paidPurchase (json) {
- let data = []
- for(var i = 0; i < json.length; i++) {
- if(json[i].Paid == 1) {
- data[i] = json[i]
- }
- }
- return data
- },
- approvedProcurement (json) {
- let data = []
- for(var i = 0; i < json.length; i++) {
- if(json[i].ApprovalCentral == 1) {
- data[i] = json[i]
- }
- }
- return data
- },
- formatDate(time) {
- var formattedTime = moment(time).format('DD MMMM YYYY HH:mm')
- if(formattedTime == 'Invalid date') {
- formattedTime = '-'
- }
- return formattedTime
- },
- extractSupplierItem: function (json) {
- let result = []
- let data = json.filter(x => x.Approval == 1).filter(y => y.IsEqual != 1)
- for(var i = 0; i < data.length; i++) {
- if(data[i].Approval == 1) {
- if(data[i].inventory_branch.inventory.IsBundle == 1) {
- // cek bundle id
- let itemBranchId = data[i].inventory_branch.Id
- // get bundle id dr item branch id
- Bundles.searchByItemId(itemBranchId).then(function (bundleData) {
- // extract item details
- ItemDetails.findbymodule("Bundle", bundleData.data.Id).then(function (itemdetailsrequest) {
- let itemdetails = itemdetailsrequest.data
- // kasih tag IsBundle = 1 di setiap item hasil extractnya
- for(var j = 0; j < itemdetails.length; j++) {
- let itemextrackan = itemdetails[j]
- console.log(data[i]) // Ada anomali disini, ga bisa ambil data
- // push isi item details
- // samain format dulu sebelum dimasukin
- let purchaseItem = {
- Approval: 1,
- BranchId: itemextrackan.BranchId,
- Cancel: 0,
- Category: "Bundle - Barang Recahan",
- // Code: data[i].Code + "-" + itemextrackan.Code,
- Code: "RCH -" + itemextrackan.Code,
- Credit: itemextrackan.Price,
- CustomerId: null,
- Debit: 0,
- DeliveryOrderCode: null,
- DeliveryStatus: null,
- DriverId: null,
- EmployeeId: null,
- ExpeditionName: null,
- ExpeditionReceipt: null,
- GroupId: null,
- Id: j,
- ItemId: itemextrackan.ItemId,
- ItemQuantity: itemextrackan.TotalQuantity,
- LegalEntityId: itemextrackan.LegalEntityId,
- Name: itemextrackan.Name,
- Nominal: itemextrackan.Price,
- OrderStatus: null,
- Paid: 1,
- PaymentStatus: "Lunas",
- Picture1: null,
- Picture2: null,
- Picture3: null,
- Picture4: null,
- Price30: itemextrackan.Price30,
- Price60: itemextrackan.Price60,
- Price90: itemextrackan.Price90,
- Price100: itemextrackan.Price100,
- Quantity30: itemextrackan.Quantity30 * data[i].ItemQuantity,
- Quantity60: itemextrackan.Quantity60 * data[i].ItemQuantity,
- Quantity90: itemextrackan.Quantity90 * data[i].ItemQuantity,
- Quantity100: itemextrackan.Quantity100 * data[i].ItemQuantity,
- Sisa: 0,
- Source: "Bundle",
- SourceId: null,
- SupplierId: itemextrackan.SupplierId,
- Tags: "Kas Kecil",
- Total: itemextrackan.Price,
- TransactionType: "Purchases",
- Type: "Pembelian",
- inventory_branch: {
- Id: itemextrackan.ItemId,
- inventory: {
- Code: itemextrackan.Code,
- Name: itemextrackan.Name
- }
- }
- }
- console.log("7:"+ JSON.stringify(purchaseItem))
- // masukin datanya
- result.push(purchaseItem)
- }
- })
- })
- } else {
- result.push(data[i])
- }
- }
- }
- console.log(result)
- return result
- },
- tambah: async function () {
- let items = this.selectedInventory
- if(this.stockIn.Properties == 'Pemesanan Terjadwal') {
- items.ItemId = items.itembranch[0].Id
- items.Quantity100 = items.AlocationQuantity
- items.Quantity90 = 0
- items.Quantity60 = 0
- items.Quantity30 = 0
- }
- // let items = this.item
- items.Position = "Masuk"
- items.Source = "Central Procurement"
- items.SourceId = this.$route.params.id
- items.Reason = ''
- items.EmployeeId = this.userData.EmployeeId
- items.LegalEntityId = 1
- items.BranchId = 1
- /**
- * Tester
- */
- // items.TotalQuantity = parseInt(items.Quantity100) + parseInt(items.Quantity90) + parseInt(items.Quantity60) + parseInt(items.Quantity30)
- // items.BuyingPrice100 = items.inventory_branch.inventory.BuyingPrice100
- // items.BuyingPrice90 = items.inventory_branch.inventory.BuyingPrice90
- // items.BuyingPrice60 = items.inventory_branch.inventory.BuyingPrice60
- // items.BuyingPrice30 = items.inventory_branch.inventory.BuyingPrice30
- /**
- * Base
- */
- items.Quantity100 = this.selectedInventory.Quantity100
- items.Quantity90 = this.selectedInventory.Quantity90
- items.Quantity60 = this.selectedInventory.Quantity60
- items.Quantity30 = this.selectedInventory.Quantity30
- items.TotalQuantity = parseInt(items.Quantity100) + parseInt(items.Quantity90) + parseInt(items.Quantity60) + parseInt(items.Quantity30)
- /**
- * Harga Beli
- */
- items.BuyingPrice100 = this.selectedInventory.BuyingPrice100
- items.BuyingPrice90 = this.selectedInventory.BuyingPrice90
- items.BuyingPrice60 = this.selectedInventory.BuyingPrice60
- items.BuyingPrice30 = this.selectedInventory.BuyingPrice30
- this.stockIn.PaymentStatus = this.selectedInventory.PaymentStatus
- console.log(items)
- if(this.selectedAssembly == 'Ya') {
- items.IsAssembly = 1
- items.UnassemblyQuantity = items.TotalQuantity
- items.Unassembly100 = this.selectedInventory.Quantity100
- items.Unassembly90 = this.selectedInventory.Quantity90
- items.Unassembly60 = this.selectedInventory.Quantity60
- items.Unassembly30 = this.selectedInventory.Quantity30
- items.BuyingPrice100 = this.selectedInventory.BuyingPrice100
- items.BuyingPrice90 = this.selectedInventory.BuyingPrice90
- items.BuyingPrice60 = this.selectedInventory.BuyingPrice60
- items.BuyingPrice30 = this.selectedInventory.BuyingPrice30
- items.AssemblyQuantity = 0
- items.Assembly100 = 0
- items.Assembly90 = 0
- items.Assembly60 = 0
- items.Assembly30 = 0
- items.IsRefurbish = 0
- items.Cancel = 0
- }
- if(this.selectedAssembly == 'Tidak') {
- items.IsAssembly = 0
- items.IsRefurbish = 0
- }
- if(!items.Code.includes('RCH/')) {
- this.stockIn.SenderName = items.supplier.Name
- }
- items.StockInCode = this.stockIn.Code
- try {
- let itemdetailsBefore = await ItemDetails.findbymodule('Central Procurement', this.$route.params.id)
- console.log(itemdetailsBefore.data)
- if(!isNaN(this.totalItemDetails(itemdetailsBefore.data))) {
- console.log(items)
- let result = await ItemDetails.create(items)
- let itemdetails = await ItemDetails.findbymodule('Central Procurement', this.$route.params.id)
- if(itemdetails.status == 200) {
- this.stockIn.ItemQuantity = this.totalItemDetails(itemdetails.data)
- await StockIn.edit(this.$route.params.id, this.stockIn)
- }
- if(result.status == 200) {
- if(!items.IsBundle) {
- items.IsEqual = false
- } else {
- items.IsEqual = true
- }
- if(this.stockIn.Properties != 'Pemesanan Terjadwal') {
- if(!items.Code.includes('RCH/')) {
- await Purchases.edit(items.Id, items)
- }
- }
- this.$fire({
- title: 'Sukses',
- text: 'Data barang telah Disimpan',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'StockInCPV3Management.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)
- }
- },
- hapus: async function(id, json) {
- console.log(json)
- json.EmployeeId = this.userData.EmployeeId
- json.LegalEntityId = this.userData.LegalEntityId
- json.BranchId = this.userData.BranchId
- json.Source = "Central Procurement"
- json.SourceId = this.$route.params.id
- json.Reason = ''
- try {
- let result = await ItemDetails.edit(id, json)
- let itemdetails = await ItemDetails.findbymodule('Central Procurement', this.$route.params.id)
- if(itemdetails.status == 200) {
- this.stockIn.ItemQuantity = this.totalItemDetails(itemdetails.data)
- await StockIn.edit(this.$route.params.id, this.stockIn)
- }
- if(result.status == 200) {
- this.$fire({
- title: 'Sukses',
- text: 'Data barang telah Dihapus',
- icon: 'info',
- showConfirmButton: false
- })
- this.$router.push({ name: 'StockInCPV3Management.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)
- }
- },
- add: function (tmpitem) {
- console.log(tmpitem)
- this.item = tmpitem
- this.item.Id = tmpitem.ItemId
- this.item.BundleQuantity100 = tmpitem.Quantity100
- this.item.BundleQuantity90 = tmpitem.Quantity90
- this.item.BundleQuantity60 = tmpitem.Quantity60
- this.item.BundleQuantity30 = tmpitem.Quantity30
- this.item.BundleItemQuantity = tmpitem.ItemQuantity
- this.stockIn.ItemCollection.push(this.item)
- this.stockIn.Total = parseInt(this.stockIn.Total) + parseInt((parseInt(this.item.BundleQuantity100) * parseInt(this.item.Price100)) + (parseInt(this.item.BundleQuantity90) * parseInt(this.item.Price90)) + (parseInt(this.item.BundleQuantity60) * parseInt(this.item.Price60)))
- this.stockIn.ItemQuantity = parseInt(this.stockIn.ItemQuantity) + parseInt(this.item.BundleItemQuantity)
- },
- del: function (index) {
- console.log(this.stockIn.ItemCollection[index])
- this.stockIn.Total = parseInt(this.stockIn.Total) - parseInt(((parseInt(this.stockIn.ItemCollection[index].BundleQuantity100) * parseInt(this.stockIn.ItemCollection[index].Price100))) + ((parseInt(this.stockIn.ItemCollection[index].BundleQuantity90) * parseInt(this.stockIn.ItemCollection[index].Price90))) + ((parseInt(this.stockIn.ItemCollection[index].BundleQuantity60) * parseInt(this.stockIn.ItemCollection[index].Price60))))
- this.stockIn.ItemQuantity = parseInt(this.stockIn.ItemQuantity) - parseInt(this.stockIn.ItemCollection[index].BundleItemQuantity)
- this.$delete(this.stockIn.ItemCollection, index)
- },
- changeImage1(file) {
- this.stockIn.Picture1 = file.base64
- },
- changeImage2(file) {
- this.stockIn.Picture2 = file.base64
- },
- changeImage3(file) {
- this.stockIn.Picture3 = file.base64
- },
- changeImage4(file) {
- this.stockIn.Picture4 = 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.stockIn.DeliveryOrderCode, 30, 20)
- doc.text("Penerima : " + this.stockIn.ReceiverName, 30, 30)
- if(this.stockIn.DriverId != null) {
- doc.text("Driver : " + this.stockIn.employee_driver.Name, 30, 40)
- } else {
- doc.text("Driver : - " , 30, 40)
- }
- if(this.stockIn.CoDriverId != null) {
- doc.text("Co Driver : " + this.stockIn.employee_co_driver.Name, 30, 50)
- } else {
- doc.text("Co Driver : - ", 30, 50)
- }
- doc.text("Tanggal : " + this.stockIn.created_at, 190, 20)
- doc.text("Pengirim : " + this.stockIn.SenderName, 190, 30)
- if(this.stockIn.ExpeditionName != null) {
- doc.text("Ekspedisi : " + this.stockIn.ExpeditionName, 190, 40)
- } else {
- doc.text("Ekspedisi : - ", 190, 40)
- }
- if(this.stockIn.ExpeditionReceipt != null) {
- doc.text("Nomor Resi : " + this.stockIn.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.stockIn.updated_at, 15, pageHeight - 10)
- doc.text('Diperiksa,', 70, pageHeight - 40);
- doc.text('Diterima,', 120, pageHeight - 40);
- doc.text("" + this.stockIn.ReceiverName, 120, pageHeight - 10)
- doc.text("=====================================", 200, pageHeight - 40)
- doc.text("Total Barang : " + this.stockIn.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.stockIn.ReceiptCode, 30, 20)
- doc.text("Penerima : " + this.stockIn.ReceiverName, 30, 30)
- if(this.stockIn.DriverId != null) {
- doc.text("Driver : " + this.stockIn.employee_driver.Name, 30, 40)
- } else {
- doc.text("Driver : - " , 30, 40)
- }
- if(this.stockIn.CoDriverId != null) {
- doc.text("Co Driver : " + this.stockIn.employee_co_driver.Name, 30, 50)
- } else {
- doc.text("Co Driver : - ", 30, 50)
- }
- doc.text("Tanggal : " + this.stockIn.created_at, 190, 20)
- doc.text("Pengirim : " + this.stockIn.SenderName, 190, 30)
- if(this.stockIn.ExpeditionName != null) {
- doc.text("Ekspedisi : " + this.stockIn.ExpeditionName, 190, 40)
- } else {
- doc.text("Ekspedisi : - ", 190, 40)
- }
- if(this.stockIn.ExpeditionReceipt != null) {
- doc.text("Nomor Resi : " + this.stockIn.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.stockIn.updated_at, 15, pageHeight - 10)
- doc.text('Diperiksa,', 70, pageHeight - 40);
- doc.text('Diterima,', 120, pageHeight - 40);
- doc.text("" + this.stockIn.ReceiverName, 120, pageHeight - 10)
- doc.text("=====================================", 200, pageHeight - 40)
- doc.text("Total Barang : " + this.stockIn.ItemQuantity.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."), 200, pageHeight - 35)
- doc.text("Total Harga : " + "Rp" + this.stockIn.Total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 30)
- doc.text("Jenis Pembayaran : " + this.stockIn.PaymentStatus, 200, pageHeight - 25)
- doc.text("Nominal Pembayaran : " + "Rp" + parseInt(this.stockIn.Nominal).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 20)
- doc.text("Sisa Pembayaran : " + "Rp" + parseInt(this.stockIn.Sisa).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ".00", 200, pageHeight - 15)
- }
- return doc;
- },
- downloadSuratJalan() {
- const doc = new jsPDF({
- orientation: 'landscape'
- });
- doc.autoTable({
- startY: 70,
- html: '#stockInDeliveryOrder',
- margin: {
- bottom: 40, //this decides how big your footer area will be
- top: 70 //this decides how big your header area will be.
- }
- })
- this.doc = this.addWaterMarkDeliveryOrder(doc)
- doc.save("Surat Jalan - " + this.stockIn.DeliveryOrderCode + ".pdf");
- },
- downloadKwitansi() {
- const doc = new jsPDF({
- orientation: 'landscape'
- });
- doc.autoTable({
- startY: 70,
- html: '#stockInReceipt',
- margin: {
- bottom: 40, //this decides how big your footer area will be
- top: 70 //this decides how big your header area will be.
- }
- })
- this.doc = this.addWaterMarkReceipt(doc)
- doc.save("Kwitansi - " + this.stockIn.ReceiptCode +".pdf");
- },
- }
- }
- </script>
Add Comment
Please, Sign In to add comment