diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index a588f293..0e23defc 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -55,16 +55,6 @@ {{ fields[field] ? fields[field].label : field }} - - - - {{ key }} - {{ field.value }} - - - - - @@ -256,8 +246,24 @@ export default defineComponent({ return alert.present(); }, selectAll() { - this.selectedData = JSON.parse(JSON.stringify(this.fieldMapping)) - this.selectedFieldMappings = JSON.parse(JSON.stringify(this.fieldMapping)) + const fields = JSON.parse(JSON.stringify(this.fieldMapping)) + + const unselectedFields = Object.keys(fields).reduce((unselectedFields: any, field) => { + if(!this.selectedFieldMappings[field]) { + unselectedFields[field] = fields[field] + } + + return unselectedFields + }, {}) + + this.selectedData = { + ...this.selectedFieldMappings, + ...unselectedFields + } + this.selectedFieldMappings = { + ...this.selectedFieldMappings, + ...unselectedFields + } }, async addFieldMapping() { let mappings: any = {};