Add support for editing catalog cost in receiving batch, per new theme

had to add several "under the hood" features to make this work, to
embed a Vue component within grid `<td>` cells, etc.
This commit is contained in:
Lance Edgar 2022-12-05 14:03:03 -06:00
parent ec71f532a1
commit 2e3823364c
7 changed files with 296 additions and 27 deletions

View file

@ -221,8 +221,14 @@
% if grid.is_searchable(column['field']):
searchable
% endif
cell-class="${column['field']}"
% if grid.has_click_handler(column['field']):
@click.native="${grid.click_handlers[column['field']]}"
% endif
:visible="${json.dumps(column['visible'])}">
% if grid.is_linked(column['field']):
% if column['field'] in grid.raw_renderers:
${grid.raw_renderers[column['field']]()}
% elif grid.is_linked(column['field']):
<a :href="props.row._action_url_view" v-html="props.row.${column['field']}"></a>
% else:
<span v-html="props.row.${column['field']}"></span>
@ -349,6 +355,18 @@
methods: {
addRowClass(index, className) {
// TODO: this may add duplicated name to class string
// (not a serious problem i think, but could be improved)
this.rowStatusMap[index] = (this.rowStatusMap[index] || '')
+ ' ' + className
// nb. for some reason b-table does not always "notice"
// when we update status; so we force it to refresh
this.$forceUpdate()
},
getRowClass(row, index) {
return this.rowStatusMap[index]
},