修改需求计划模块需求与bug
This commit is contained in:
@@ -521,11 +521,6 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置表格横向滚动
|
|
||||||
.o_list_renderer.o_renderer {
|
|
||||||
max-width: 100%;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置表单页面label文本不换行
|
// 设置表单页面label文本不换行
|
||||||
.o_form_view .o_group .o_wrap_label .o_form_label {
|
.o_form_view .o_group .o_wrap_label .o_form_label {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ odoo.define('sf_demand.print_demand', function (require) {
|
|||||||
this.getParent()?.$buttons.hide();
|
this.getParent()?.$buttons.hide();
|
||||||
|
|
||||||
return this._super.apply(this, arguments).then(function () {
|
return this._super.apply(this, arguments).then(function () {
|
||||||
|
if(!self.state.data || !self.state.data.length) return
|
||||||
// 添加图片预览容器到页面左侧
|
// 添加图片预览容器到页面左侧
|
||||||
if (!$('.table-image-preview-container').length) {
|
if (!$('.table-image-preview-container').length) {
|
||||||
self.$el.parent().addClass('custom-table-image-container')
|
self.$el.parent().addClass('custom-table-image-container')
|
||||||
@@ -22,29 +23,45 @@ odoo.define('sf_demand.print_demand', function (require) {
|
|||||||
<iframe class="table-image-preview-container" src=""/>
|
<iframe class="table-image-preview-container" src=""/>
|
||||||
</div>`
|
</div>`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!$('.denmand_set').length) {
|
||||||
self.$el.prepend(`
|
self.$el.prepend(`
|
||||||
<div class="print-button-container" style="margin-bottom:10px;">
|
<form class="denmand_set">
|
||||||
<button class="btn btn-primary o_print_custom">
|
<span>更多设置:</span>
|
||||||
<i class="fa fa-print"></i> 打印
|
<input type="radio" id="male" name="set" value="图纸">
|
||||||
</button>
|
<label for="male">图纸</label>
|
||||||
<button class="btn btn-secondary o_cancel_custom">
|
<input type="radio" id="female" name="set" value="程序单">
|
||||||
取消
|
<label for="female">程序单</label>
|
||||||
</button>
|
<input type="radio" id="other" name="set" value="" checked>
|
||||||
</div>
|
<label for="other">图纸/程序单</label>
|
||||||
`);
|
</form>
|
||||||
|
`)
|
||||||
|
self.$el.prepend(`
|
||||||
|
<div class="print-button-container" style="margin-bottom:10px;">
|
||||||
|
<button class="btn btn-primary o_print_custom">
|
||||||
|
<i class="fa fa-print"></i> 打印
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-secondary o_cancel_custom">
|
||||||
|
取消
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$el.find('.o_data_row').eq(0).trigger('click')
|
this.$el.find('.o_data_row').eq(0).trigger('click')
|
||||||
|
this.getParent().$el?.find('.o_cp_top_right,.o_cp_bottom').hide()
|
||||||
}, 500);
|
}, 500);
|
||||||
return this._super();
|
return this._super();
|
||||||
},
|
},
|
||||||
events: _.extend({}, ListRenderer.prototype.events, {
|
events: _.extend({}, ListRenderer.prototype.events, {
|
||||||
'click .o_data_row': '_onCustomRowClick',
|
'click .o_data_row': '_onCustomRowClick',
|
||||||
'click .o_print_custom': '_onPrintClick',
|
'click .o_print_custom': '_onPrintClick',
|
||||||
'click .o_cancel_custom': '_onCancelClick'
|
'click .o_cancel_custom': '_onCancelClick',
|
||||||
|
'click .denmand_set': '_onDenmandChange',
|
||||||
}),
|
}),
|
||||||
_onCancelClick() {
|
_onCancelClick() {
|
||||||
this.getParent()?.getParent()?.dialogs.closeAll()
|
this.getParent()?.getParent()?.dialogs.closeAll()
|
||||||
@@ -95,8 +112,6 @@ odoo.define('sf_demand.print_demand', function (require) {
|
|||||||
},
|
},
|
||||||
_onPrintClick(e) {
|
_onPrintClick(e) {
|
||||||
var print_ids = this.getSelectedIds();
|
var print_ids = this.getSelectedIds();
|
||||||
|
|
||||||
|
|
||||||
this._rpc({
|
this._rpc({
|
||||||
model: 'sf.demand.plan.print.wizard',
|
model: 'sf.demand.plan.print.wizard',
|
||||||
method: 'demand_plan_print',
|
method: 'demand_plan_print',
|
||||||
@@ -118,6 +133,16 @@ odoo.define('sf_demand.print_demand', function (require) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
_onDenmandChange(e) {
|
||||||
|
const isChecked = $(e.currentTarget).find('input:checked').val()
|
||||||
|
this.$el.find('tbody').find('.o_data_row').show()
|
||||||
|
if(!isChecked) return
|
||||||
|
this.$el.find('tbody').children().each(function() {
|
||||||
|
if($(this).find('td[name=type]').text() != isChecked) {
|
||||||
|
$(this).hide()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getFileUrl(attachment_type, data, key) {
|
getFileUrl(attachment_type, data, key) {
|
||||||
let fileUrl
|
let fileUrl
|
||||||
switch (attachment_type) {
|
switch (attachment_type) {
|
||||||
|
|||||||
@@ -63,4 +63,22 @@
|
|||||||
.o_print_custom {
|
.o_print_custom {
|
||||||
right: 66px;
|
right: 66px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.denmand_set {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 50px;
|
||||||
|
> span {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
input,label {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user