mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-14 00:33:19 +03:30
fix: edit values
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user