From 9093770ce1bc7d5d3da4693e1fc429124acc99b1 Mon Sep 17 00:00:00 2001 From: hyyy <123@qq.com> Date: Wed, 19 Mar 2025 14:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=96=E6=B6=88=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=87=BA=E5=8E=82=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/js/custom_form_status_indicator.js | 32 +++++++++++++++---- .../static/src/scss/quality_dashboard.scss | 8 +++++ .../views/quality.check.measures.line.xml | 4 +-- .../wizard/sale_order_cancel_views.xml | 2 +- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index 3296b127..8f5ffae7 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -119,12 +119,10 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { this.listherHeaderBodyNum() }) const treeModifiers = this.getFieldModifiers(this.props.archInfo.__rawArch); - // console.log('treeModifiers', treeModifiers); if(treeModifiers) { this.props.merge_key = treeModifiers.merge_key; this.props.merge_fields = treeModifiers.merge_fields.split(','); const data = this.setColumns(this.props.merge_key); - console.log('data', data); owl.onMounted(() => { this.mergeColumns(this.props.merge_fields, data) }) @@ -176,19 +174,28 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { } }, setColumns( merge_key) { + merge_key = merge_key.split(',') const data = this.props.list.records let sourceIndex = 0; - let sourceValue = '' + let sourceValue = merge_key.reduce((acc, key) => { + acc[key] = ''; + return acc; + }, {}); + data.forEach((item, index) => { if(!item.colspan) { item.colspan = 1; } - if(item.data[merge_key] === sourceValue) { + const itemValue = merge_key.reduce((acc, key) => { + acc[key] = item.data[key]; + return acc; + }, {}); + if(JSON.stringify(itemValue) == JSON.stringify(sourceValue)) { data[sourceIndex].colspan ++ ; item.colspan = 0; } else { sourceIndex = index; - sourceValue = item.data[merge_key]; + sourceValue = itemValue; } }) return data @@ -211,14 +218,25 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { const dom = this.tableRef.el const thead = $(dom).children('thead') const tbody = $(dom).children('tbody') + let row_no = 0 tbody.children('tr.o_data_row').each(function () { const tr = $(this) const td = tr.children('td') const index = $(this).index() + const col = data[index].colspan + row_no ++ + if(col == 0) { + row_no -- + } + td.eq(0).text(row_no).attr('rowspan', col) + + if(col == 0) { + td.eq(0).remove() + } td.each(function () { if(merge_fields.indexOf($(this).attr('name')) >= 0) { - $(this).attr('rowspan', data[index].colspan) - if(data[index].colspan == 0) { + $(this).attr('rowspan', col) + if(col == 0) { $(this).remove() } } diff --git a/quality_control/static/src/scss/quality_dashboard.scss b/quality_control/static/src/scss/quality_dashboard.scss index 3668bce7..3a3dea62 100644 --- a/quality_control/static/src/scss/quality_dashboard.scss +++ b/quality_control/static/src/scss/quality_dashboard.scss @@ -4,3 +4,11 @@ min-height: 250px; } } + +.measureTableSequence { + width: 58px; +} + +.measureTable .o_list_table_ungrouped { + min-width: auto; +} \ No newline at end of file diff --git a/quality_control/views/quality.check.measures.line.xml b/quality_control/views/quality.check.measures.line.xml index 68cc4249..7134e86e 100644 --- a/quality_control/views/quality.check.measures.line.xml +++ b/quality_control/views/quality.check.measures.line.xml @@ -4,8 +4,8 @@ quality.check.measure.line.tree quality.check.measure.line - - + + diff --git a/sf_manufacturing/wizard/sale_order_cancel_views.xml b/sf_manufacturing/wizard/sale_order_cancel_views.xml index 6848faf6..034c0de2 100644 --- a/sf_manufacturing/wizard/sale_order_cancel_views.xml +++ b/sf_manufacturing/wizard/sale_order_cancel_views.xml @@ -13,7 +13,7 @@ - +