Commit df202ffb authored by 邓春圆's avatar 邓春圆

弹窗关闭报错

parent a1557bd0
...@@ -303,7 +303,9 @@ ...@@ -303,7 +303,9 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的港服务')"> <el-form-item :label="$t('目的港服务')">
<el-checkbox-group v-model="lineform.otherService"> <el-checkbox-group v-model="lineform.otherService">
<el-checkbox @click.native="changeOtherService(item.id)" :checked="lineform.otherService.includes(item.id)" v-for="item in endServiceGroup" :label="item.id " :key="item.id" :value="item.id" v-show="isShowError(item)"> {{item.text}}</el-checkbox> <template v-for="item in endServiceGroup" >
<el-checkbox @click.native="changeOtherService(item.id)" :checked="checkedFn(item.id)" :label="item.id " :key="item.id" :value="item.id" v-if="isShowError(item)"> {{item.text}}</el-checkbox>
</template>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item v-if="['3','4'].includes(lineform.transportType)" label="空运提单制作节点"> <el-form-item v-if="['3','4'].includes(lineform.transportType)" label="空运提单制作节点">
...@@ -582,6 +584,11 @@ export default { ...@@ -582,6 +584,11 @@ export default {
}, },
computed: { computed: {
checkedFn(){
return (val)=>{
return (Array.isArray(this.lineform.otherService) ? this.lineform.otherService : []).includes(val)
}
},
DICT_TYPE() { DICT_TYPE() {
return DICT_TYPE return DICT_TYPE
}, },
...@@ -592,7 +599,7 @@ export default { ...@@ -592,7 +599,7 @@ export default {
return (item) => { return (item) => {
if(item.id !== '5' && item.id !== '10') return true; if(item.id !== '5' && item.id !== '10') return true;
const { otherService } = this.lineform; const { otherService } = this.lineform;
if(otherService.includes('2')) return true; if((Array.isArray(otherService) ? otherService : []).includes('2')) return true;
return false; return false;
} }
}, },
...@@ -685,11 +692,9 @@ export default { ...@@ -685,11 +692,9 @@ export default {
}, },
methods: { methods: {
changeOtherService(val){ changeOtherService(val){
console.log(val,'val') if(val === '2' && !( Array.isArray(this.lineform.otherService) ? this.lineform.otherService :[]).includes('10')){
if(val === '2' && !this.lineform.otherService.includes('10')){
this.lineform.otherService.push('10'); this.lineform.otherService.push('10');
} }
}, },
getDictDatas, getDictDatas,
getDictDataLabel, getDictDataLabel,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment