diff --git a/CHANGELOG.md b/CHANGELOG.md index 7281886..16f0bb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,36 @@ All notable changes to 'byjove' will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## Unreleased + +## [0.1.26] - 2024-06-03 +### Changed +- Optionally allow decimal quantities for receiving. + +## [0.1.25] - 2024-05-29 +### Changed +- Show actual error text if applicable, for receiving failure. + +## [0.1.24] - 2024-03-26 +### Changed +- Add delay when fetching rows data for model CRUD component. + +## [0.1.23] - 2023-12-26 +### Changed +- Improve focus behavior for inventory count view. +- Keep row filters "raw" until encoding for actual request. + +## [0.1.22] - 2023-10-23 +### Changed +- Use columns instead of table, for row receiving quantities. +- Show invoice number when receiving row. +- Center receiving buttons; add "12 EA" quick receive button. + +## [0.1.21] - 2023-10-06 +### Changed +- Auto-trim username field in login form. +- Auto-focus case/unit field when showing inventory count page. + ## [0.1.20] - 2023-09-17 ### Changed - Validate amount when adding receiving quantity. diff --git a/package-lock.json b/package-lock.json index 7d39356..afb3f25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byjove", - "version": "0.1.20", + "version": "0.1.26", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "byjove", - "version": "0.1.20", + "version": "0.1.26", "license": "GPL-3.0-or-later", "dependencies": { "vue": "^2.7.14" diff --git a/package.json b/package.json index 36853f5..6a78ccf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "byjove", - "version": "0.1.20", + "version": "0.1.26", "description": "Generic-ish app components for Vue.js frontend to Tailbone API backend", "keywords": [ "rattail", diff --git a/src/components/inventory/ByjoveInventory.vue b/src/components/inventory/ByjoveInventory.vue index dd5aa22..b6201c7 100644 --- a/src/components/inventory/ByjoveInventory.vue +++ b/src/components/inventory/ByjoveInventory.vue @@ -44,13 +44,15 @@ + step="any" + ref="units"> @@ -81,6 +83,10 @@ export default { type: Boolean, default: true, }, + focusCases: { + type: Boolean, + default: false, + }, allowEdit: { type: Boolean, default: false, @@ -90,6 +96,7 @@ export default { default: false, }, }, + data() { return { row: {}, @@ -153,6 +160,14 @@ export default { if (this.row.batch_executed || this.row.batch_complete) { // cannot edit this row, so view it instead this.$router.push(this.getViewUrl()) + } else { + this.$nextTick(() => { + if (this.shouldAllowCases() && this.focusCases) { + this.$refs.cases.focus() + } else { + this.$refs.units.focus() + } + }) } }, response => { if (response.status == 403) { // forbidden; redirect to model index diff --git a/src/components/login/ByjoveLogin.vue b/src/components/login/ByjoveLogin.vue index 218c17e..398ee05 100644 --- a/src/components/login/ByjoveLogin.vue +++ b/src/components/login/ByjoveLogin.vue @@ -6,7 +6,7 @@ - + diff --git a/src/components/model-crud/ByjoveModelCrud.vue b/src/components/model-crud/ByjoveModelCrud.vue index 20f223f..25068f0 100644 --- a/src/components/model-crud/ByjoveModelCrud.vue +++ b/src/components/model-crud/ByjoveModelCrud.vue @@ -189,10 +189,10 @@ export default { rowFilters: { type: Function, default: (uuid) => { - return JSON.stringify([ + return [ {field: 'batch_uuid', op: 'eq', value: uuid}, {field: 'removed', op: 'eq', value: false}, - ]) + ] }, }, rowOrderBy: { @@ -511,7 +511,14 @@ export default { this.record = response.data.data this.$emit('refresh', this.record) if (this.hasRows) { - this.fetchRows(uuid) + // TODO: was seeing occasional errors when a batch + // view was loaded, and it tried to fetch rows but + // somehow the uuid was not passed along and + // server failed to build a query filter. so + // hoping the nextTick() delay fixes it..? + this.$nextTick(() => { + this.fetchRows(uuid) + }) } }, response => { if (response.status == 403) { // forbidden @@ -538,7 +545,7 @@ export default { fetchRows(uuid) { let params = { - filters: this.rowFilters(uuid), + filters: JSON.stringify(this.rowFilters(uuid)), orderBy: this.rowOrderBy, ascending: this.rowOrderAscending ? 1 : 0, } diff --git a/src/components/numeric-input/NumericInput.vue b/src/components/numeric-input/NumericInput.vue new file mode 100644 index 0000000..7bdef1b --- /dev/null +++ b/src/components/numeric-input/NumericInput.vue @@ -0,0 +1,152 @@ + + + diff --git a/src/components/numeric-input/index.js b/src/components/numeric-input/index.js new file mode 100644 index 0000000..fa116e7 --- /dev/null +++ b/src/components/numeric-input/index.js @@ -0,0 +1,28 @@ +// Import vue component +import NumericInput from './NumericInput.vue' + +// Declare install function executed by Vue.use() +export function install(Vue) { + if (install.installed) return; + install.installed = true; + Vue.component('NumericInput', NumericInput); +} + +// Create module definition for Vue.use() +const plugin = { + install, +}; + +// Auto-install when vue is found (eg. in browser via