This commit is contained in:
2021-07-06 19:37:12 +00:00
parent 1c0f30b73f
commit 8f8e633290
2 changed files with 30 additions and 37 deletions

View File

@@ -233,7 +233,7 @@
<v-row justify="center">
<v-dialog persistent max-width="600px" v-model="bulkUnitsDialog">
<v-card>
<v-card-title> </v-card-title>
<v-card-title>{{ $ay.t("AddMultipleUnits") }}</v-card-title>
<v-card-text>
<gz-tag-picker v-model="selectedBulkUnitTags"></gz-tag-picker>
<gz-pick-list
@@ -246,25 +246,17 @@
<v-data-table
dense
v-model="selectedBulkUnits"
:headers="bulkUnitTableHeaders"
:items="availableBulkUnits"
class="elevation-4"
:disable-pagination="true"
:disable-filtering="true"
hide-default-footer
hide-default-header
:no-data-text="$ay.t('NoData')"
show-select
item-key="unitId"
>
</v-data-table>
<!-- <v-select
item-text="name"
item-value="id"
:disabled="availableBulkUnits.length == 0"
v-model="selectedBulkUnits"
:items="availableBulkUnits"
:label="$ay.t('UnitList')"
multiple
></v-select> -->
</v-card-text>
<v-card-actions>
<v-btn text @click="bulkUnitsDialog = false" color="primary">{{
@@ -389,37 +381,37 @@ export default {
},
addSelectedBulkUnits() {
if (res.data && res.data.items) {
let newIndex = this.value.items[this.activeWoItemIndex].parts.length;
if (this.selectedBulkUnits.length > 0) {
let newIndex = this.value.items[this.activeWoItemIndex].units.length;
res.data.items.forEach(z => {
newIndex++;
this.value.items[this.activeWoItemIndex].parts.push({
id: 0,
concurrency: 0,
userId: null,
description: null,
serials: null,
partId: z.partId,
partWarehouseId: this.selectedPartWarehouse,
quantity: z.quantity,
taxPartSaleId: null,
price: 0,
priceOverride: null,
cost: 0,
listPrice: 0,
isDirty: true,
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
uid: Date.now(),
partWarehouseViz: null,
partViz: z.partViz,
taxCodeViz: null
});
// this.value.items[this.activeWoItemIndex].parts.push({
// id: 0,
// concurrency: 0,
// userId: null,
// description: null,
// serials: null,
// partId: z.partId,
// partWarehouseId: this.selectedPartWarehouse,
// quantity: z.quantity,
// taxPartSaleId: null,
// price: 0,
// priceOverride: null,
// cost: 0,
// listPrice: 0,
// isDirty: true,
// workOrderItemId: this.value.items[this.activeWoItemIndex].id,
// uid: Date.now(),
// partWarehouseViz: null,
// partViz: z.partViz,
// taxCodeViz: null
// });
});
this.$emit("change");
this.selectedRow = [{ index: newIndex }];
this.activeItemIndex = newIndex;
}
this.partAssemblyDialog = false;
this.bulkUnitsDialog = false;
},
unitChange(newName) {
this.value.items[this.activeWoItemIndex].units[

View File

@@ -2137,7 +2137,8 @@ async function fetchTranslatedText(vm) {
"Name",
"PartAssemblyList",
"PartAssembly",
"PartSerialNumbersAvailable"
"PartSerialNumbersAvailable",
"AddMultipleUnits"
]);
}