|
|
@@ -248,8 +248,50 @@
|
|
|
// }
|
|
|
|
|
|
function removeLine(obj) {
|
|
|
+ if ($(obj).parent().parent().siblings().length < 1) {
|
|
|
+ $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
|
|
|
+ } else {
|
|
|
+ let canChecked = false
|
|
|
+ $(obj).parent().parent().siblings().each(function(index,item){
|
|
|
+ if($(this).children('.td_material').children('.consultation')[0].attr(value!='')) {
|
|
|
+ canChecked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
|
|
|
+ }
|
|
|
$(obj).parent().parent().remove();
|
|
|
}
|
|
|
+ $(document).ready(function(){
|
|
|
+ $('input[name^="consultationList"]').blur(function(){
|
|
|
+ console.log('blur事件触发')
|
|
|
+ $('input[name^="consultationList"]').each(function(index,item){
|
|
|
+ if (item.value) {
|
|
|
+ console.log('输入框内有值')
|
|
|
+ $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = true
|
|
|
+ // let defaultIndex = 'defaultList[' + item.name.split('.')[0].split('')[item.name.split('.')[0].split('').length-2] + ']'
|
|
|
+ // $('input[name^="defaultList"]').each(function(vindex,vitem){
|
|
|
+ // if (vitem.name == defaultIndex) {
|
|
|
+ // vitem.checked = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ } else {
|
|
|
+ if ($(this).parent().parent().siblings().length < 1) {
|
|
|
+ console.log('同级元素少于一个')
|
|
|
+ $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
|
|
|
+ } else {
|
|
|
+ console.log('同级元素大于一个要判断是否为空')
|
|
|
+ let canChecked = false
|
|
|
+ $(this).parent().parent().siblings().each(function(index,item){
|
|
|
+ if($(this).children('.td_material').children('.consultation')[0].attr(value!='')) {
|
|
|
+ canChecked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|