This commit is contained in:
2021-07-02 19:00:46 +00:00
parent 31f3f4a535
commit de650d373f

View File

@@ -419,10 +419,13 @@
$ay.t("Cancel") $ay.t("Cancel")
}}</v-btn> }}</v-btn>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<!-- :disabled="selectedPartAssembly == null" --> <v-btn
<v-btn color="primary" text @click="addSelectedSerials()">{{ :disabled="selectedSerials.length == 0"
$ay.t("Add") color="primary"
}}</v-btn> text
@click="addSelectedSerials()"
>{{ $ay.t("Add") }}</v-btn
>
</v-card-title> </v-card-title>
<v-card-text> <v-card-text>
<v-select <v-select
@@ -430,19 +433,8 @@
:items="availableSerials" :items="availableSerials"
:label="$ay.t('PartSerialNumbersAvailable')" :label="$ay.t('PartSerialNumbersAvailable')"
multiple multiple
></v-select> ></v-select>
</v-card-text> </v-card-text>
<!-- <v-card-actions>
<v-btn text @click="serialDialog = false" color="primary">{{
$ay.t("Cancel")
}}</v-btn>
<v-spacer></v-spacer>
<v-btn color="primary" text @click="addSelectedSerials()">{{
$ay.t("Add")
}}</v-btn>
</v-card-actions> -->
</v-card> </v-card>
</v-dialog> </v-dialog>
</v-row> </v-row>
@@ -528,6 +520,9 @@ export default {
when done sb able to view current available serials not selected, quickly pick them off and then add en-masse when done sb able to view current available serials not selected, quickly pick them off and then add en-masse
*/ */
this.availableSerials.splice(0);
this.selectedSerials.splice(0);
const partId = this.value.items[this.activeWoItemIndex].parts[ const partId = this.value.items[this.activeWoItemIndex].parts[
this.activeItemIndex this.activeItemIndex
].partId; ].partId;
@@ -542,16 +537,25 @@ export default {
); );
} else { } else {
this.availableSerials = res.data; this.availableSerials = res.data;
for (let a = 0; a < 1000; a++) {
this.availableSerials.push(`serial-${a}`);
}
this.serialDialog = true; this.serialDialog = true;
} }
}, },
addSelectedSerials() { addSelectedSerials() {
console.log(this.selectedSerials); let serials = this.value.items[this.activeWoItemIndex].parts[
this.activeItemIndex
].serials;
serials = serials.trim();
if (!window.$gz.util.stringIsNullOrEmpty(serials)) {
serials += ",";
}
serials += this.selectedSerials.join(",");
this.value.items[this.activeWoItemIndex].parts[
this.activeItemIndex
].serials = serials;
}, },
async addPartAssembly() { async addPartAssembly() {
let res = await window.$gz.api.get( let res = await window.$gz.api.get(