| | |
| | | </el-col> |
| | | <el-col :span="7"> |
| | | <div style="display: flex;align-items: center;justify-content: flex-end;" class="btns"> |
| | | <el-button type="primary" size="small" @click="addList(allBandList)" :disabled="state>1">添加频段</el-button> |
| | | <el-button type="primary" size="small" @click="addList(allBandList,'频段')" :disabled="state>1">添加频段</el-button> |
| | | <el-button size="small" @click="deleteList(allBandList.length-1,allBandList,'删除频段')" :disabled="state>1">删除频段</el-button> |
| | | <el-button type="primary" size="small" @click="addList(angleList)" :disabled="state>1">添加角度</el-button> |
| | | <el-button size="small" @click="deleteList(angleList.length-1,angleList)" :disabled="state>1">删除角度</el-button> |
| | |
| | | message: '不能删除最后一个互调' |
| | | }); |
| | | }else{ |
| | | if(list[index].frequency){ |
| | | this.$confirm(`是否确定删除 ${list[index].often} 频点数据?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$axios.post(this.$api.insOrderPlan.deleteInsContext2, { |
| | | frequency:list[index].frequency, |
| | | productId:list[index].id, |
| | | often:list[index].often |
| | | }).then(res => { |
| | | if (res.code === 201) { |
| | | this.$message.error('删除失败') |
| | | return |
| | | } |
| | | this.$message.success('已删除') |
| | | list.splice(index, 1) |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }).catch(() => {}) |
| | | }else{ |
| | | list.splice(index, 1) |
| | | } |
| | | list.splice(index, 1) |
| | | } |
| | | }else if(type=='删除频段'){ |
| | | this.$confirm(`是否确定删除 ${list[index].band} 频段数据?`, "提示", { |
| | |
| | | index = i; |
| | | } |
| | | }) |
| | | obj.often = '' |
| | | obj.result = '' |
| | | let num0 = obj.value.length |
| | | let num1 = obj.value[0].length |
| | | delete obj.value |
| | | obj.value = [] |
| | | for(let i = 0;i<num0;i++){ |
| | | obj.value.push([]) |
| | | for(let j = 0;j<num1;j++){ |
| | | obj.value[i].push('') |
| | | } |
| | | } |
| | | list.splice(index+1, 0, obj) |
| | | }else if(type=='频段'){ |
| | | let obj = JSON.parse(JSON.stringify(list[0])); |
| | | console.log(2222,obj) |
| | | obj.band = '' |
| | | obj.projectList.forEach(item=>{ |
| | | item.often = '' |
| | | item.result = '' |
| | | item.frequency = '' |
| | | let num0 = item.value.length |
| | | let num1 = item.value[0].length |
| | | delete item.value |
| | | item.value = [] |
| | | for(let i = 0;i<num0;i++){ |
| | | item.value.push([]) |
| | | for(let j = 0;j<num1;j++){ |
| | | item.value[i].push('') |
| | | } |
| | | } |
| | | }) |
| | | list.push(obj) |
| | | }else{ |
| | | let obj = JSON.parse(JSON.stringify(list[0])); |
| | | list.push(obj) |