|
|
@@ -1,4 +1,6 @@
|
|
1
|
1
|
<script setup>
|
|
|
2
|
+import { watch, computed } from 'vue'
|
|
|
3
|
+import { Inertia } from '@inertiajs/inertia'
|
|
2
|
4
|
import { optionStatus } from './config'
|
|
3
|
5
|
import { cartTable } from './config'
|
|
4
|
6
|
import Details from './Components/Details.vue'
|
|
|
@@ -11,7 +13,6 @@ import AppInputNumber from '@/components/AppInputNumber.vue'
|
|
11
|
13
|
import AppDropdown from '@/components/AppDropdown.vue'
|
|
12
|
14
|
import AppAutoComplete from '@/components/AppAutoComplete.vue'
|
|
13
|
15
|
import DashboardLayout from '@/layouts/Dashboard/DashboardLayout.vue'
|
|
14
|
|
-import { computed } from '@vue/reactivity'
|
|
15
|
16
|
|
|
16
|
17
|
const props = defineProps({
|
|
17
|
18
|
number: String,
|
|
|
@@ -24,6 +25,7 @@ const props = defineProps({
|
|
24
|
25
|
type: Array,
|
|
25
|
26
|
default: [],
|
|
26
|
27
|
},
|
|
|
28
|
+ historyProductPurchase: Object,
|
|
27
|
29
|
})
|
|
28
|
30
|
|
|
29
|
31
|
const form = useForm({
|
|
|
@@ -58,6 +60,25 @@ const dropdownStatus = computed(() => {
|
|
58
|
60
|
return optionStatus.filter((val) => val.value != 'success')
|
|
59
|
61
|
})
|
|
60
|
62
|
|
|
|
63
|
+watch(
|
|
|
64
|
+ () => form.product,
|
|
|
65
|
+ () => {
|
|
|
66
|
+ if (form.product.id) {
|
|
|
67
|
+ Inertia.reload({
|
|
|
68
|
+ data: {
|
|
|
69
|
+ productNumber: form.product.number,
|
|
|
70
|
+ supplierId: form.supplier.id,
|
|
|
71
|
+ },
|
|
|
72
|
+ only: ['historyProductPurchase'],
|
|
|
73
|
+ })
|
|
|
74
|
+ }
|
|
|
75
|
+ }
|
|
|
76
|
+)
|
|
|
77
|
+
|
|
|
78
|
+const historyProductPrice = computed(() => {
|
|
|
79
|
+ return props.historyProductPurchase?.price
|
|
|
80
|
+})
|
|
|
81
|
+
|
|
61
|
82
|
const {
|
|
62
|
83
|
productCart,
|
|
63
|
84
|
onClearProductCart,
|
|
|
@@ -175,6 +196,17 @@ const { onShowCreateProduct, onShowCreateSupplier } = onShowDialog()
|
|
175
|
196
|
/>
|
|
176
|
197
|
</div>
|
|
177
|
198
|
|
|
|
199
|
+ <div class="col-12 md:col-6">
|
|
|
200
|
+ <AppInputNumber
|
|
|
201
|
+ disabled
|
|
|
202
|
+ label="Harga Sebelumya"
|
|
|
203
|
+ placeholder="harga sebelumnya"
|
|
|
204
|
+ v-model="historyProductPrice"
|
|
|
205
|
+ />
|
|
|
206
|
+ </div>
|
|
|
207
|
+
|
|
|
208
|
+ <Divider type="dashed" />
|
|
|
209
|
+
|
|
178
|
210
|
<div class="col-12 md:col-6">
|
|
179
|
211
|
<AppInputNumber
|
|
180
|
212
|
:disabled="!form.supplier?.id"
|