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 de50eddc..35f0f3e2 100644
--- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js
+++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js
@@ -131,6 +131,22 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
dom.addClass('addRequired')
}
})
+ try {
+ const dom = this.tableRef.el
+ if(dom ) {
+ const tfoot = $(dom).children('tfoot')
+ const tbooy = $(dom).children('tbody')
+ if(tfoot.length) {
+ const tfoot_tr = tfoot.children().eq(0)
+ const tbody_tr = tbooy.children().eq(0)
+ if(tfoot_tr.children().length < tbody_tr.children().length) {
+ tfoot_tr.prepend('
')
+ }
+ }
+ }
+ } catch (e) {
+ console.log(e)
+ }
}
})
diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss
index 3c106665..d3a44da4 100644
--- a/jikimo_frontend/static/src/scss/custom_style.scss
+++ b/jikimo_frontend/static/src/scss/custom_style.scss
@@ -488,4 +488,7 @@ div:has(.o_required_modifier) > label::before {
left: 0;
top: 50%;
transform: translateY(-50%);
+}
+.o_list_renderer .o_list_table tfoot .o_list_number {
+ text-align: left;
}
\ No newline at end of file
diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py
index 532971ee..2cb6c2df 100644
--- a/sf_manufacturing/controllers/controllers.py
+++ b/sf_manufacturing/controllers/controllers.py
@@ -496,3 +496,35 @@ class Manufacturing_Connect(http.Controller):
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
logging.info('AGVDownProduct error:%s' % e)
return json.JSONEncoder().encode(res)
+
+ @http.route('/AutoDeviceApi/EquipmentBaseCoordinate', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
+ cors="*")
+ def PutEquipmentBaseCoordinate(self, **kw):
+ """
+ 获取机床基坐标
+ :param kw:
+ :return:
+ """
+ logging.info('PutEquipmentBaseCoordinate:%s' % kw)
+ try:
+ res = {'Succeed': True}
+ datas = request.httprequest.data
+ ret = json.loads(datas)
+ if 'DeviceId' in ret:
+ equipment = request.env['maintenance.equipment'].sudo().search('name', '=', ret['DeviceId'])
+ if equipment:
+ equipment.sudo().write({
+ 'base_coordinate_fixture_model_id': ret['base_coordinate_fixture_model_id'],
+ 'base_coordinate_g_coordinate': ret['base_coordinate_g_coordinate'],
+ 'base_coordinate_x': ret['base_coordinate_x'],
+ 'base_coordinate_y': ret['base_coordinate_y'],
+ 'base_coordinate_z': ret['base_coordinate_z'],
+ })
+ else:
+ res = {'Succeed': False, 'ErrorCode': 203, 'Error': 'DeviceId为%s的设备不存在!' % ret['DeviceId']}
+ else:
+ res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传DeviceId字段'}
+ except Exception as e:
+ res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
+ logging.info('AGVDownProduct error:%s' % e)
+ return json.JSONEncoder().encode(res)
diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py
index 0bb27fcb..d766629c 100644
--- a/sf_manufacturing/models/product_template.py
+++ b/sf_manufacturing/models/product_template.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import logging
+import requests
import base64
import hashlib
import os
@@ -892,6 +893,33 @@ class SfMaintenanceEquipmentAndProductTemplate(models.Model):
vals.append(res)
return vals[0]
+ base_coordinate_fixture_model_id = fields.Many2one('sf.fixture.model', '基坐标卡盘型号',
+ domain=[('fixture_material_id', '=', '零点卡盘')])
+ base_coordinate_g_coordinate = fields.Char('G坐标')
+ base_coordinate_x = fields.Float('x轴', digits=(12, 3))
+ base_coordinate_y = fields.Float('y轴', digits=(12, 3))
+ base_coordinate_z = fields.Float('z轴', digits=(12, 3))
+
+ # ==========获取机床基坐标接口==========
+ def get_equipment_base_coordinate(self):
+ headers = {'Authorization': 'Ba F2CF5DCC-1A00-4234-9E95-65603F70CC8A'}
+ crea_url = "https://x24467i973.zicp.fun/AutoDeviceApi/EquipmentBaseCoordinate"
+ params = {"DeviceId": self.name}
+ r = requests.get(crea_url, params=params, headers=headers)
+ ret = r.json()
+ logging.info('register_equipment_tool:%s' % ret)
+ self.write({
+ 'base_coordinate_fixture_model_id': ret['base_coordinate_fixture_model_id'],
+ 'base_coordinate_g_coordinate': ret['base_coordinate_g_coordinate'],
+ 'base_coordinate_x': ret['base_coordinate_x'],
+ 'base_coordinate_y': ret['base_coordinate_y'],
+ 'base_coordinate_z': ret['base_coordinate_z'],
+ })
+ if ret['Succeed']:
+ return "机床基坐标获取成功"
+ else:
+ raise ValidationError("机床基坐标获取失败")
+
class SfMaintenanceEquipmentTool(models.Model):
_name = 'maintenance.equipment.tool'
diff --git a/sf_manufacturing/views/sf_maintenance_equipment.xml b/sf_manufacturing/views/sf_maintenance_equipment.xml
index b398f994..5ddf59b0 100644
--- a/sf_manufacturing/views/sf_maintenance_equipment.xml
+++ b/sf_manufacturing/views/sf_maintenance_equipment.xml
@@ -1,23 +1,38 @@
- 设备增加刀具库位table
+
sf_manufacturing_equipment.form
maintenance.equipment
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index 01c3de46..83b4b550 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -422,11 +422,12 @@ class FunctionalToolAssembly(models.Model):
@api.depends('integral_freight_barcode')
def _compute_integral_product_id(self):
for item in self:
- location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.integral_freight_barcode)])
- if location:
- item.integral_product_id = location.product_id.id
- else:
- item.integral_product_id = False
+ if item.integral_freight_barcode:
+ location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.integral_freight_barcode)])
+ if location:
+ item.integral_product_id = location.product_id.id
+ else:
+ item.integral_product_id = False
# =================刀片型号=============
blade_freight_barcode = fields.Char('刀片货位')
@@ -441,11 +442,12 @@ class FunctionalToolAssembly(models.Model):
@api.depends('blade_freight_barcode')
def _compute_blade_product_id(self):
for item in self:
- location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.blade_freight_barcode)])
- if location:
- item.blade_product_id = location.product_id.id
- else:
- item.blade_product_id = False
+ if item.integral_freight_barcode:
+ location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.blade_freight_barcode)])
+ if location:
+ item.blade_product_id = location.product_id.id
+ else:
+ item.blade_product_id = False
# ==============刀杆型号================
bar_freight_barcode = fields.Char('刀杆货位')
@@ -460,11 +462,12 @@ class FunctionalToolAssembly(models.Model):
@api.depends('bar_freight_barcode')
def _compute_bar_product_id(self):
for item in self:
- location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.bar_freight_barcode)])
- if location:
- item.bar_product_id = location.product_id.id
- else:
- item.bar_product_id = False
+ if item.integral_freight_barcode:
+ location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.bar_freight_barcode)])
+ if location:
+ item.bar_product_id = location.product_id.id
+ else:
+ item.bar_product_id = False
# =============刀盘型号================
pad_freight_barcode = fields.Char('刀盘货位')
@@ -479,11 +482,12 @@ class FunctionalToolAssembly(models.Model):
@api.depends('pad_freight_barcode')
def _compute_pad_product_id(self):
for item in self:
- location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.pad_freight_barcode)])
- if location:
- item.pad_product_id = location.product_id.id
- else:
- item.pad_product_id = False
+ if item.integral_freight_barcode:
+ location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.pad_freight_barcode)])
+ if location:
+ item.pad_product_id = location.product_id.id
+ else:
+ item.pad_product_id = False
# ==============刀柄型号==============
handle_freight_rfid = fields.Char('刀柄Rfid', compute='_compute_handle_product_id', store=True)
@@ -519,11 +523,12 @@ class FunctionalToolAssembly(models.Model):
@api.depends('chuck_freight_barcode')
def _compute_chuck_product_id(self):
for item in self:
- location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.chuck_freight_barcode)])
- if location:
- item.chuck_product_id = location.product_id.id
- else:
- item.chuck_product_id = False
+ if item.integral_freight_barcode:
+ location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.chuck_freight_barcode)])
+ if location:
+ item.chuck_product_id = location.product_id.id
+ else:
+ item.chuck_product_id = False
# ==================待删除字段==================
blade_name = fields.Char('')
diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml
index a0e1a5c1..90783fca 100644
--- a/sf_warehouse/views/shelf_location.xml
+++ b/sf_warehouse/views/shelf_location.xml
@@ -129,16 +129,16 @@
|