diff --git a/static/js/app.js b/static/js/app.js index 0ab319f..20ff566 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -27835,7 +27835,7 @@ window.showProductDetail = function(productCode) {
${bomMaterials.length > 0 - ? '' + bomHtml + '
\u7269\u6599\u7f16\u53f7\u7269\u6599\u540d\u79f0\u53ef\u7528\u5e93\u5b58\u751f\u4ea7\u5728\u9014\u91c7\u8d2d\u5728\u9014\u5355\u4ef7
' + ? '' + bomHtml + '
\u7269\u6599\u7f16\u53f7\u7269\u6599\u540d\u79f0\u4f9b\u5e94\u5546\u53ef\u7528\u5e93\u5b58\u751f\u4ea7\u5728\u9014\u91c7\u8d2d\u5728\u9014\u5355\u4ef7
' : '
\u6682\u65e0BOM\u7269\u6599\u6e05\u5355
' }
@@ -28064,7 +28064,7 @@ window.showBomProductDetail = function(productCode) {
${bomMaterials.length > 0 - ? '' + bomHtml + '
\u7269\u6599\u7f16\u53f7\u7269\u6599\u540d\u79f0\u53ef\u7528\u5e93\u5b58\u751f\u4ea7\u5728\u9014\u91c7\u8d2d\u5728\u9014\u5355\u4ef7
' + ? '' + bomHtml + '
\u7269\u6599\u7f16\u53f7\u7269\u6599\u540d\u79f0\u4f9b\u5e94\u5546\u53ef\u7528\u5e93\u5b58\u751f\u4ea7\u5728\u9014\u91c7\u8d2d\u5728\u9014\u5355\u4ef7
' : '
\u6682\u65e0BOM\u7269\u6599\u6e05\u5355
' }
diff --git a/tests/test_planning_bom_popup_columns.py b/tests/test_planning_bom_popup_columns.py new file mode 100644 index 0000000..e9a62b6 --- /dev/null +++ b/tests/test_planning_bom_popup_columns.py @@ -0,0 +1,30 @@ +"""计划预测 SKU 详情弹窗 BOM 列对齐回归测试。""" + +import unittest +from pathlib import Path + + +APP_JS = (Path(__file__).resolve().parents[1] / 'static/js/app.js').read_text(encoding='utf-8') + + +class PlanningBomPopupColumnsTest(unittest.TestCase): + def test_bom_headers_include_supplier_between_name_and_inventory(self): + header_sequence = ( + '\\u7269\\u6599\\u540d\\u79f0' + '\\u4f9b\\u5e94\\u5546' + '\\u53ef\\u7528\\u5e93\\u5b58' + ) + self.assertGreaterEqual(APP_JS.count(header_sequence), 2) + + def test_bom_rows_render_supplier_before_inventory(self): + row_sequence = ( + "escHtml(m.material_name) + '' +\n" + " '' + " + "(bomCanSupplier ? escHtml(m.material_supplier || '-') : '-') + '' +\n" + " '' + m.available_qty.toLocaleString()" + ) + self.assertGreaterEqual(APP_JS.count(row_sequence), 2) + + +if __name__ == '__main__': + unittest.main()