Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/新增上传模型功能
This commit is contained in:
@@ -15,20 +15,27 @@ div:has(.o_required_modifier)>label::before {
|
||||
vertical-align: top !important;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
|
||||
.my-image div {
|
||||
width: 100px !important;
|
||||
height: 130px !important;
|
||||
width: 110px !important;
|
||||
height: 110px !important;
|
||||
}
|
||||
|
||||
.add_flex {
|
||||
padding: 5px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.maintenance_name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_has_image_fill .o_kanban_image_fill_left {
|
||||
flex: unset !important;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||
margin-top: 5px;
|
||||
display: inline !important;
|
||||
@@ -37,3 +44,79 @@ div:has(.o_required_modifier)>label::before {
|
||||
td.o_required_modifier {
|
||||
display: table-cell !important;
|
||||
}
|
||||
|
||||
.show_state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 8px;
|
||||
margin: auto;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.show_state > div {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border: 1px solid #000
|
||||
}
|
||||
|
||||
.show_state > div:nth-child(2) {
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_2 {
|
||||
background-color: #FF4343 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_1 {
|
||||
background-color: #27FEA9 !important;
|
||||
opacity: 0.7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_3 {
|
||||
background-color: rgb(255, 150, 0) !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.my-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.color_1 {
|
||||
background-color: #27FEA9;
|
||||
}
|
||||
|
||||
.color_2 {
|
||||
background-color: #FF4343;
|
||||
}
|
||||
|
||||
.color_3 {
|
||||
background-color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.font_color_1 {
|
||||
color: rgb(0, 183, 0);
|
||||
}
|
||||
|
||||
.font_color_2 {
|
||||
color: #FF4343;
|
||||
}
|
||||
|
||||
.font_color_3 {
|
||||
color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.o_kanban_card_header_title {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.o_kanban_record_bottom {
|
||||
font-family: '华文中宋';
|
||||
//font-weight: bold;
|
||||
}
|
||||
@@ -284,12 +284,11 @@
|
||||
<field name="machine_tool_picture"/>
|
||||
|
||||
</xpath>
|
||||
|
||||
|
||||
<xpath expr="//templates" position="inside">
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click
|
||||
#{record.state.raw_value == '正常' ? 'kanban_color_1' : ''}
|
||||
#{record.state.raw_value == '故障' ? 'kanban_color_2' : ''}
|
||||
#{record.state.raw_value == '不可用' ? 'kanban_color_3' : ''}">
|
||||
<div t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click">
|
||||
|
||||
<field name="machine_tool_picture" class="o_kanban_image_fill_left d-block my-image"
|
||||
preview_image="image_128" widget="image"/>
|
||||
@@ -305,6 +304,12 @@
|
||||
<field name="state_zc"/>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="technician_user_id"/>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc"
|
||||
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
||||
#{record.state.raw_value == '故障' ? 'font_color_2' : ''}
|
||||
#{record.state.raw_value == '不可用' ? 'font_color_3' : ''}">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
<!-- <div class="o_kanban_record_bottom">-->
|
||||
@@ -313,7 +318,12 @@
|
||||
<!-- <field name="supplier_id"/>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="show_state" t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click
|
||||
">
|
||||
<div t-attf-class="#{record.state.raw_value == '正常' ? 'color_1' : ''}"></div>
|
||||
<div t-attf-class="#{record.state.raw_value == '故障' ? 'color_2' : ''}"></div>
|
||||
<div t-attf-class="#{record.state.raw_value == '不可用' ? 'color_3' : ''}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</xpath>
|
||||
|
||||
@@ -9,7 +9,6 @@ class ResWorkcenter(models.Model):
|
||||
|
||||
# 生产线显示
|
||||
production_line_show = fields.Char(string='生产线')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', string='机床')
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
@@ -19,6 +18,12 @@ class ResWorkcenter(models.Model):
|
||||
'maintenance.equipment', string="设备",
|
||||
check_company=True)
|
||||
|
||||
equipment_status = fields.Selection(
|
||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||
string="设备状态", related='equipment_id.state')
|
||||
|
||||
equipment_image = fields.Binary('设备图片', related='equipment_id.machine_tool_picture')
|
||||
|
||||
# 查询工艺外协加工中心
|
||||
def get_process_outsourcing_workcenter(self):
|
||||
outsourcing_workcenter = self.env['mrp.workcenter'].search([('is_process_outsourcing', '=', True)])
|
||||
|
||||
@@ -24,19 +24,28 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">-->
|
||||
<!-- <field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>-->
|
||||
<!-- <field name="model">mrp.workcenter</field>-->
|
||||
<!-- <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <!– Desktop view –>-->
|
||||
<!-- <xpath expr="//div[@name='o_wo']" position="inside">-->
|
||||
<!-- <button class="btn btn-secondary fa fa-desktop" name="action_work_order" type="object"-->
|
||||
<!-- context="{'search_default_ready': 1, 'search_default_progress': 1, 'search_default_pending': 1, 'desktop_list_view': 1, 'search_default_workcenter_id': active_id}"-->
|
||||
<!-- title="Work orders" aria-label="Work orders"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">
|
||||
<field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>
|
||||
<field name="model">mrp.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Desktop view -->
|
||||
<xpath expr='(//field[@name="name"])[1]' position="after">
|
||||
|
||||
<field name="equipment_status" />
|
||||
<field name="equipment_image" />
|
||||
|
||||
|
||||
</xpath>
|
||||
<xpath expr='(//field[@name="name"])[2]' position="after">
|
||||
|
||||
<field name="equipment_status" />
|
||||
<field name="equipment_image" widget="image" />
|
||||
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- override to change the no content image -->
|
||||
<record id="mrp.action_work_orders" model="ir.actions.act_window">
|
||||
@@ -90,6 +99,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="users_ids" widget="many2many_tags" string="可操作用户"/>
|
||||
<field name="equipment_status"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='alternative_workcenter_ids']" position="after">
|
||||
<field name="production_line_id"/>
|
||||
|
||||
@@ -22,6 +22,7 @@ export class StepViewer extends Component {
|
||||
setup() {
|
||||
this.props.url = this.formatUrl();
|
||||
}
|
||||
|
||||
formatUrl() {
|
||||
var url = '';
|
||||
if (this.props.value) {
|
||||
@@ -30,7 +31,8 @@ export class StepViewer extends Component {
|
||||
base_url: session['web.base.url'],
|
||||
model: this.props.record.resModel,
|
||||
id: JSON.stringify(this.props.record.data['id']),
|
||||
field: this.props.name}
|
||||
field: this.props.name
|
||||
}
|
||||
url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true'
|
||||
// url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||
console.log('url111111', url)
|
||||
@@ -45,6 +47,9 @@ export class StepViewer extends Component {
|
||||
// return new_url
|
||||
// url = "web_widget_model_viewer/static/src/images/not_model.png";
|
||||
}
|
||||
} else {
|
||||
var oImg = document.getElementsByClassName('test')[0]
|
||||
console.log(oImg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
<t t-name="web_widget_model_viewer.BinaryField3d" owl="1">
|
||||
|
||||
<t t-if="props.value">
|
||||
<model-viewer
|
||||
t-att-src='props.url'
|
||||
name="3D model"
|
||||
@@ -22,6 +23,10 @@
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
</model-viewer>
|
||||
</t>
|
||||
<t t-if="!props.value">
|
||||
<div style="color:#D23F3A">当前制造订单暂无模型</div>
|
||||
</t>
|
||||
|
||||
<!-- <model-viewer-->
|
||||
<!-- src='/jikimo_model_viewer/static/src/js/3d_viewer/test.glb'-->
|
||||
|
||||
Reference in New Issue
Block a user