Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化cnc程序和检测文件
This commit is contained in:
@@ -59,6 +59,7 @@ $(function (){
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function customRequired() {
|
||||
let timer = null
|
||||
let timer_count = 0
|
||||
@@ -93,13 +94,59 @@ $(function (){
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
|
||||
function setRequired(dom = {label: [], table: []}) {
|
||||
let domTimer = null
|
||||
let timer_count = 0
|
||||
clearInterval(domTimer)
|
||||
domTimer = setInterval(() => {
|
||||
timer_count++
|
||||
const lint = $('.o_form_view_container')
|
||||
if (lint.length) {
|
||||
clearInterval(domTimer)
|
||||
const {label, table} = dom
|
||||
if (label.length) {
|
||||
$(dom.label.join(',')).each(function () {
|
||||
let t = $(this).html()
|
||||
if (t.indexOf('c*') < 0) {
|
||||
t = '<i class="c*" style="color: red;margin-left: -6px;margin-right: 2px">*</i>' + t
|
||||
}
|
||||
$(this).html(t)
|
||||
})
|
||||
}
|
||||
|
||||
if (table.length) {
|
||||
table.forEach(_ => {
|
||||
const th = $(`th[data-name=${_}]`)
|
||||
const t = th.find('span').eq(0).text().replace('*','')
|
||||
th.find('span').eq(0).html('<i style="color: red">*</i>' + t)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
if (timer_count == 20) {
|
||||
clearInterval(domTimer)
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
|
||||
var currentUrl = location.href
|
||||
const customRequiredDom = {
|
||||
label: ['label[for=production_line_id]','label[for=date_approve]','label[for=partner_id]', 'label[for=validity_date]', '.o_horizontal[role=radiogroup]', 'label[for=vat]', 'label[for=phone]', 'label[for=mobile]', 'label[for=email]', 'label[for=category_id]','label[for=date_order]','label[for=picking_type_id]'],
|
||||
table: ['product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty']
|
||||
}
|
||||
const listenerUrl = setInterval(() => {
|
||||
const isChange = currentUrl != location.href
|
||||
if (isChange) {
|
||||
currentUrl = location.href
|
||||
customRequired()
|
||||
setRequired(customRequiredDom)
|
||||
}
|
||||
if($('label[for=production_line_id]')) {
|
||||
setRequired({table: [], label: ['label[for=production_line_id]']})
|
||||
}
|
||||
}, 500)
|
||||
customRequired()
|
||||
setRequired(customRequiredDom)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user