fix: edit values

This commit is contained in:
zeinab.ashrafi
2025-04-19 09:51:58 +03:30
parent 2e98810cf0
commit b599301477
3 changed files with 25 additions and 28 deletions
+8 -6
View File
@@ -104,19 +104,15 @@ export default {
items: [],
rules: {
required: value => !!value || "Required.",
counter: value =>
!value ||
value.length == 0 ||
value.length >= 5 ||
"Min 5 characters"
counter: value => !value || value.length == 0 || value.length >= 5 || "Min 5 characters"
}
};
},
created() {
this.loadItems();
if (this.$route.params.label) {
this.load(this.$route.params.label);
}
this.loadItems();
},
computed: {
lotNumber() {
@@ -138,6 +134,12 @@ export default {
const result = await ApiService.get(urls.editLabel(id));
if (result && result.status == 200) {
this.formData = result.data.data;
const existingIds = this.items.map(i => i.id);
if (!existingIds.includes(this.formData.package_id)) {
this.items.push(this.formData.package);
}
console.log()
}
},
async loadItems() {