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

View File

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