diff --git a/sf_base/models/base.py b/sf_base/models/base.py index f6a945aa..c679ac74 100644 --- a/sf_base/models/base.py +++ b/sf_base/models/base.py @@ -267,7 +267,7 @@ class MachineToolType(models.Model): ('youyagang', '油压缸驱动'), ('chilunjia', '齿轮架驱动') ], string="主轴加高方式", default='sifudianji') - workpiece_load = fields.Char('工件负载') + workpiece_load = fields.Char('工件最大负载(kg)') lead_screw = fields.Char('丝杆') workbench_L = fields.Char('工作台长度(mm)') workbench_W = fields.Char('工作台宽度(mm)') @@ -276,14 +276,16 @@ class MachineToolType(models.Model): machine_tool_W = fields.Char('机床宽度(mm)') machine_tool_H = fields.Char('机床高度(mm)') feed_speed = fields.Char('进给速度(mm/min)') - tool_speed = fields.Char('刀具速度') - distance = fields.Char('主轴端面至工作台面距离(mm)') + tool_speed = fields.Char('刀具速度(m/min)') + distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)') + distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)') taper = fields.Char('主轴锥度(°)') torque = fields.Char('主轴点击扭矩(n/m)') motor_power = fields.Char('主轴电机功率(kw)') - tool_quality_max = fields.Char('刀具最大质量') - tool_long_max = fields.Char('刀具最大长度') - tool_diameter_max = fields.Char('刀具最大刀径') + tool_quality_max = fields.Char('刀具最大质量(kg)') + tool_long_max = fields.Char('刀具最大长度(mm)') + tool_diameter_max = fields.Char('刀具刀径max(mm)') + tool_diameter_min = fields.Char('刀具刀径min(mm)') machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') # 多个型号对应一个机床 @@ -298,7 +300,8 @@ class MachineToolType(models.Model): b_axis = fields.Integer('B轴') c_axis = fields.Integer('C轴') remark = fields.Char('备注') - precision = fields.Float('加工精度') + precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3)) + precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3)) control_system_id = fields.Many2one('sf.machine.control_system', string="控制系统") active = fields.Boolean('有效', default=True) diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss index 32aba96d..bb7d8929 100644 --- a/sf_base/static/src/scss/test.scss +++ b/sf_base/static/src/scss/test.scss @@ -4,4 +4,5 @@ .test_model>.o_form_label { margin-left: 20px; margin-right: 0px !important; + white-space: nowrap; } \ No newline at end of file diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml index eadd81f2..6d10b4e9 100644 --- a/sf_base/views/base_view.xml +++ b/sf_base/views/base_view.xml @@ -87,7 +87,7 @@ tree.sf.machine_tool.type sf.machine_tool.type - + @@ -116,10 +116,10 @@ - + - + - + - + diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index a541185a..6b1d76f4 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -85,7 +85,8 @@ class SfMaintenanceEquipment(models.Model): c_axis = fields.Integer('C轴') remark = fields.Char('备注') is_binding = fields.Boolean('是否绑定机床', default=False) - precision = fields.Float('加工精度') + precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3)) + precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3)) control_system_id = fields.Many2one('sf.machine.control_system', string="控制系统") # 多个机床型号对应一个机床 @@ -102,7 +103,7 @@ class SfMaintenanceEquipment(models.Model): ('youyagang', '油压缸驱动'), ('chilunjia', '齿轮架驱动') ], string="主轴加高方式", default='sifudianji') - workpiece_load = fields.Char('工件负载') + workpiece_load = fields.Char('工件最大负载(kg)') lead_screw = fields.Char('丝杆') workbench_L = fields.Char('工作台长度(mm)') workbench_W = fields.Char('工作台宽度(mm)') @@ -111,14 +112,16 @@ class SfMaintenanceEquipment(models.Model): machine_tool_W = fields.Char('机床宽度(mm)') machine_tool_H = fields.Char('机床高度(mm)') feed_speed = fields.Char('进给速度(mm/min)') - tool_speed = fields.Char('刀具速度') - distance = fields.Char('主轴端面至工作台面距离(mm)') + tool_speed = fields.Char('刀具速度(m/min)') + distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)') + distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)') taper = fields.Char('主轴锥度(°)') torque = fields.Char('主轴点击扭矩(n/m)') motor_power = fields.Char('主轴电机功率(kw)') - tool_quality_max = fields.Char('刀具最大质量') - tool_long_max = fields.Char('刀具最大长度') - tool_diameter_max = fields.Char('刀具最大刀径') + tool_quality_max = fields.Char('刀具最大质量(kg)') + tool_long_max = fields.Char('刀具最大长度(mm)') + tool_diameter_max = fields.Char('刀具刀径max(mm)') + tool_diameter_min = fields.Char('刀具刀径min(mm)') machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') # 一个机床对应一個加工工厂,一个加工工厂对应多个机床 factory_id = fields.Many2one('res.partner', string='所属工厂', @@ -132,20 +135,7 @@ class SfMaintenanceEquipment(models.Model): active = fields.Boolean('有效', default=True) # 多个型号对应一个机床 machine_tool_id = fields.Many2one('sf.machine_tool', '机床') - number_of_axles = fields.Selection( - [("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")], - default="", string="轴数") - # 加工进程 - x_axis = fields.Integer('X轴') - y_axis = fields.Integer('Y轴') - z_axis = fields.Integer('Z轴') - b_axis = fields.Integer('B轴') - c_axis = fields.Integer('C轴') - remark = fields.Char('备注') - precision = fields.Float('加工精度') - control_system_id = fields.Many2one('sf.machine.control_system', - string="控制系统") - active = fields.Boolean('有效', default=True) + def name_get(self): result = [] @@ -208,7 +198,8 @@ class SfMaintenanceEquipment(models.Model): item.number_of_knife_library = item.type_id.number_of_knife_library item.number_of_axles = item.type_id.number_of_axles item.rotate_speed = item.type_id.rotate_speed - item.precision = item.type_id.precision + item.precision_min = item.type_id.precision_min + item.precision_max = item.type_id.precision_max item.control_system_id = item.type_id.control_system_id item.x_axis = item.type_id.x_axis item.y_axis = item.type_id.y_axis @@ -227,13 +218,15 @@ class SfMaintenanceEquipment(models.Model): item.machine_tool_H = item.type_id.machine_tool_H item.feed_speed = item.type_id.feed_speed item.tool_speed = item.type_id.tool_speed - item.distance = item.type_id.distance + item.distance_min = item.type_id.distance_min + item.distance_max = item.type_id.distance_max item.taper = item.type_id.taper item.torque = item.type_id.torque item.motor_power = item.type_id.motor_power item.tool_quality_max = item.type_id.tool_quality_max item.tool_long_max = item.type_id.tool_long_max item.tool_diameter_max = item.type_id.tool_diameter_max + item.tool_diameter_min = item.type_id.tool_diameter_min item.machine_tool_category = item.type_id.machine_tool_category.id item.brand_id = item.type_id.brand_id.id diff --git a/sf_maintenance/models/sf_maintenance_logs.py b/sf_maintenance/models/sf_maintenance_logs.py index f9a514f5..8c12529f 100644 --- a/sf_maintenance/models/sf_maintenance_logs.py +++ b/sf_maintenance/models/sf_maintenance_logs.py @@ -8,8 +8,8 @@ class SfMaintenanceLogs(models.Model): code = fields.Char(string='编码') name = fields.Char(string='名称') type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型') - brand = fields.Char(string='品牌') - model = fields.Char(string='型号') + brand = fields.Many2one('sf.machine.brand', relared='model.brand_id', string='品牌') + model = fields.Many2one('maintenance.equipment', string='设备') code_location = fields.Char(string='编码位置') fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型') fault_code = fields.Char(string='故障代码') diff --git a/sf_maintenance/views/maintenance_logs_views.xml b/sf_maintenance/views/maintenance_logs_views.xml index d5cffdae..14ddd9e0 100644 --- a/sf_maintenance/views/maintenance_logs_views.xml +++ b/sf_maintenance/views/maintenance_logs_views.xml @@ -63,6 +63,9 @@ sf.maintenance.logs + + + diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index 3f23cd24..508325f1 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -38,107 +38,114 @@ - - - - + + + + + + - - - - - - - - - - - - - - - - - - diff --git a/sf_manufacturing/static/src/js/kanban_change.js b/sf_manufacturing/static/src/js/kanban_change.js index 5e2bd5e9..fa692886 100644 --- a/sf_manufacturing/static/src/js/kanban_change.js +++ b/sf_manufacturing/static/src/js/kanban_change.js @@ -1,8 +1,8 @@ /** @odoo-module */ -import { KanbanController } from "@web/views/kanban/kanban_controller"; -import { kanbanView } from "@web/views/kanban/kanban_view"; -import { registry } from "@web/core/registry"; +import {KanbanController} from "@web/views/kanban/kanban_controller"; +import {kanbanView} from "@web/views/kanban/kanban_view"; +import {registry} from "@web/core/registry"; // the controller usually contains the Layout and the renderer. class CustomKanbanController extends KanbanController { @@ -14,7 +14,13 @@ class CustomKanbanController extends KanbanController { console.log('99999999111'); this.workOrders = await this.getAllWorkOrders(); console.log('lines', this.workOrders); -} + var aDiv = document.getElementsByClassName('o_kanban_record') + // for (var i = 0; i < aDiv.length; i++) { + // console.log(aDiv[i]) + // } + console.log(aDiv) + } + buttonClick(ev) { const button = ev.currentTarget; const id = button.getAttribute('data-id'); @@ -27,6 +33,7 @@ class CustomKanbanController extends KanbanController { args: [[], ['id']], kwargs: {} }).then((records) => { + console.log(records) const ids = records.map(record => record.id); const context = {production_line_show: id}; this.env.services.rpc('/web/dataset/call_kw', { @@ -37,20 +44,22 @@ class CustomKanbanController extends KanbanController { }).then((response) => { console.log('response', response); location.reload(); + window.onload = function () { + button.classList.add('choose') + } }); }); - - } - async getAllWorkOrders() { - const response = await this.env.services.rpc('/web/dataset/call_kw',{ + + async getAllWorkOrders() { + const response = await this.env.services.rpc('/web/dataset/call_kw', { model: 'sf.production.line', method: 'search_read', args: [], kwargs: {}, }); // const response1 = await this.env.services.rpc('/web/dataset/call_kw',{ - // model: 'mrp.workcenter', + // model: 'mrp.workcenter', // method: 'search_read', // args: [], // kwargs: {}, diff --git a/sf_manufacturing/static/src/scss/kanban_change.scss b/sf_manufacturing/static/src/scss/kanban_change.scss index 24ae15ad..f77895ab 100644 --- a/sf_manufacturing/static/src/scss/kanban_change.scss +++ b/sf_manufacturing/static/src/scss/kanban_change.scss @@ -2,12 +2,26 @@ display: flex; justify-content: flex-start; align-items: center; - margin-top: 1vw !important; -} - -.choosekanban > button { - width: 4vw !important; - height: 2vw !important; - border: none !important; margin-left: 16px !important; } + + +.choosekanban > button { + padding: 0 2vw !important; + height: 2vw !important; + border: none !important; + border-right: 1px solid #ccc !important; + background-color: #EEEEEE; + color: #989799; + font-weight: bold; +} + +//.o_content > .d-flex { +// display: block !important; +//} + + + + + + diff --git a/sf_manufacturing/static/src/xml/kanban_change.xml b/sf_manufacturing/static/src/xml/kanban_change.xml index ccd8fb21..b3718059 100644 --- a/sf_manufacturing/static/src/xml/kanban_change.xml +++ b/sf_manufacturing/static/src/xml/kanban_change.xml @@ -4,7 +4,7 @@
- + diff --git a/sf_manufacturing/views/mrp_workcenter_views.xml b/sf_manufacturing/views/mrp_workcenter_views.xml index 03a9b8cf..cc3f6015 100644 --- a/sf_manufacturing/views/mrp_workcenter_views.xml +++ b/sf_manufacturing/views/mrp_workcenter_views.xml @@ -94,7 +94,7 @@ - + @@ -102,26 +102,27 @@ - - - - - - - - - - - - - - - mrp.workcenter.kanban.inherit - mrp.workcenter - - - - + + + + + + + + + + + + + + + mrp.workcenter.kanban.inherit + mrp.workcenter + + + + @@ -130,39 +131,48 @@ - + + +
-
- + + +
- - - - - - + + + + + +
@@ -172,7 +182,8 @@
@@ -182,7 +193,8 @@
@@ -192,7 +204,8 @@
@@ -207,22 +220,26 @@
+