feature: po pay downpayment
This commit is contained in:
@@ -8,18 +8,19 @@
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="mb-2 pa-2" style="border: 1px solid black;">
|
||||
<input
|
||||
type="file" id="files" ref="files" multiple
|
||||
<input
|
||||
type="file" id="files" ref="files" multiple
|
||||
accept="image/*" v-on:change="addAttach($event)"
|
||||
v-show="!viewonlymode"
|
||||
>
|
||||
</v-flex>
|
||||
<v-flex
|
||||
<v-flex
|
||||
v-for="(docs) in prview_attachment"
|
||||
xs4 class="pa-2" :key="docs.attach_id"
|
||||
>
|
||||
<div style="position: relative; padding-bottom: 35px;">
|
||||
<v-img
|
||||
:src="makeImageUrl(docs)" aspect-ratio="1" contain
|
||||
:src="makeImageUrl(docs)" aspect-ratio="1" contain
|
||||
class="grey lighten-2" @click="fullview(docs, -1)"
|
||||
></v-img>
|
||||
</div>
|
||||
@@ -33,9 +34,9 @@
|
||||
:src="url" aspect-ratio="1" contain
|
||||
class="grey lighten-2" @click="fullview(url, index)"
|
||||
></v-img>
|
||||
<v-icon
|
||||
<v-icon
|
||||
style="position: absolute; top: 5px; right: 5px; z-index: 1; cursor: pointer;"
|
||||
@click="removedocs(index)" color="red"
|
||||
@click="removedocs(index)" color="red"
|
||||
>close</v-icon>
|
||||
</div>
|
||||
</v-flex>
|
||||
@@ -44,7 +45,7 @@
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="cancel_file()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="save_file()" color="primary" class="white--text">Simpan</v-btn>
|
||||
<v-btn v-show="!viewonlymode" @click="save_file()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -90,25 +91,28 @@ module.exports = {
|
||||
computed: {
|
||||
dialog_attachment: {
|
||||
get() {
|
||||
return this.$store.state.poasset.dialog_attachment
|
||||
return this.$store.state.common.dialog_attachment
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("poasset/update_dialog_attachment", val)
|
||||
this.$store.commit("common/update_dialog_attachment", val)
|
||||
}
|
||||
},
|
||||
selected_orderaset: {
|
||||
get() {
|
||||
return this.$store.state.poasset.selected_orderaset
|
||||
return this.$store.state.common.selected_orderaset
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("poasset/update_selected_orderaset", val)
|
||||
this.$store.commit("common/update_selected_orderaset", val)
|
||||
}
|
||||
},
|
||||
prview_attachment() {
|
||||
return this.$store.state.poasset.prview_attachment
|
||||
return this.$store.state.common.assets_attachment
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.poasset.loading_process
|
||||
return this.$store.state.common.loading_process
|
||||
},
|
||||
viewonlymode() {
|
||||
return this.$store.state.common.viewonlymode;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -128,7 +132,7 @@ module.exports = {
|
||||
},
|
||||
makeImageUrl(docs) {
|
||||
const year = new Date(docs.created).getFullYear();
|
||||
const baseURL = BASE_URL + `/one-media/order-aset/${year}`;
|
||||
const baseURL = BASE_URL + `/one-media/order-asset/${year}/`;
|
||||
return baseURL + docs.img_url;
|
||||
},
|
||||
fullview(docs, index) {
|
||||
@@ -150,6 +154,7 @@ module.exports = {
|
||||
cancel_file() {
|
||||
this.tempdocs_file = [];
|
||||
this.tempdocs_view = [];
|
||||
this.$store.commit("common/update_viewonlymode", false);
|
||||
this.dialog_attachment = false;
|
||||
},
|
||||
save_file() {
|
||||
@@ -163,15 +168,16 @@ module.exports = {
|
||||
form_data.append(`files[${index}]`, file);
|
||||
}
|
||||
|
||||
form_data.append('KontrakAsetID', orderaset.T_KontrakAsetID);
|
||||
form_data.append('POrderID', orderaset.PurchaseOrderID);
|
||||
form_data.append('POnumber', orderaset.PurchaseOrderNumber);
|
||||
form_data.append('contractID', orderaset.contractID);
|
||||
form_data.append('poID', orderaset.PurchaseOrderID);
|
||||
form_data.append('ponumber', orderaset.PurchaseOrderNumber);
|
||||
form_data.append('contractDate', orderaset.contractDate);
|
||||
form_data.append('token', one_token());
|
||||
|
||||
this.$store.dispatch('poasset/');
|
||||
this.$store.dispatch('common/uploadAttachment', form_data);
|
||||
} else {
|
||||
const snac = { color: 'warning', msg: 'proses sedang berjalan', state: true };
|
||||
this.$store.commit('poasset/update_snackbar', snac);
|
||||
this.$store.commit('common/update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -190,4 +196,4 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user