|
@@ -5,7 +5,8 @@ |
|
|
<view class="conmsg-msg"> |
|
|
<view class="conmsg-msg"> |
|
|
<view v-for="(item,index) in allList" :key="index"> |
|
|
<view v-for="(item,index) in allList" :key="index"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class="conmsg-msg-lab" :class="{mustSe: item.level == 1 && item.mustSelected == 0 }" style="border: none;"> |
|
|
|
|
|
|
|
|
<view class="conmsg-msg-lab" :class="{mustSe: item.level == 1 && item.mustSelected == 0 }" |
|
|
|
|
|
style="border: none;"> |
|
|
<view class="conmsg-msg-lab-1"> |
|
|
<view class="conmsg-msg-lab-1"> |
|
|
{{item.name}} |
|
|
{{item.name}} |
|
|
</view> |
|
|
</view> |
|
@@ -36,35 +37,35 @@ |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
allList:[], |
|
|
|
|
|
customerId:'' |
|
|
|
|
|
|
|
|
allList: [], |
|
|
|
|
|
customerId: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(e) { |
|
|
onLoad(e) { |
|
|
this.customerId=e.id; |
|
|
|
|
|
|
|
|
this.customerId = e.id; |
|
|
this.getListByType() |
|
|
this.getListByType() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
Edittag(item,item1,index,i){ |
|
|
|
|
|
if(this.allList[index].children[i].selected==0){ |
|
|
|
|
|
this.allList[index].children[i].selected=1; |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.allList[index].children[i].selected=0; |
|
|
|
|
|
|
|
|
Edittag(item, item1, index, i) { |
|
|
|
|
|
if (this.allList[index].children[i].selected == 0) { |
|
|
|
|
|
this.allList[index].children[i].selected = 1; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.allList[index].children[i].selected = 0; |
|
|
} |
|
|
} |
|
|
this.$forceUpdate() |
|
|
|
|
|
|
|
|
this.$forceUpdate() |
|
|
}, |
|
|
}, |
|
|
// 字典表接口 |
|
|
// 字典表接口 |
|
|
getListByType() { |
|
|
getListByType() { |
|
|
this.$u.get("/matchKeywords/findManualCalibration", { |
|
|
this.$u.get("/matchKeywords/findManualCalibration", { |
|
|
customerId: this.customerId, |
|
|
customerId: this.customerId, |
|
|
type:2 |
|
|
|
|
|
|
|
|
type: 2 |
|
|
}) |
|
|
}) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
res.forEach(item1 => { |
|
|
res.forEach(item1 => { |
|
|
item1.children.map(item => { |
|
|
item1.children.map(item => { |
|
|
if (item.isInterval == 0) { |
|
|
if (item.isInterval == 0) { |
|
|
item.label = item.name + item.unit + '-' + item.endName + item |
|
|
item.label = item.name + item.unit + '-' + item.endName + item |
|
|
.unit; |
|
|
|
|
|
|
|
|
.unit; |
|
|
} else { |
|
|
} else { |
|
|
item.label = item.name |
|
|
item.label = item.name |
|
|
} |
|
|
} |
|
@@ -77,51 +78,52 @@ |
|
|
// 提交 |
|
|
// 提交 |
|
|
submit() { |
|
|
submit() { |
|
|
let param = { |
|
|
let param = { |
|
|
keywordIds:'', |
|
|
|
|
|
|
|
|
keywordIds: '', |
|
|
id: this.customerId, |
|
|
id: this.customerId, |
|
|
projectId: uni.getStorageSync('buildingID').id, |
|
|
projectId: uni.getStorageSync('buildingID').id, |
|
|
} |
|
|
} |
|
|
let str = [] |
|
|
let str = [] |
|
|
let isPass = false // 默认通过 |
|
|
|
|
|
let indexs = 0; // |
|
|
let indexs = 0; // |
|
|
let checkArr = {} |
|
|
|
|
|
this.allList.map(item => { |
|
|
|
|
|
checkArr = this.allList.find(item => item.mustSelected == 0) |
|
|
|
|
|
isPass = checkArr.children.findIndex(item => item.selected == 0) == -1 |
|
|
|
|
|
if (isPass) return; |
|
|
|
|
|
item.children.map(item1 => { |
|
|
|
|
|
if (item1.selected == 0) { |
|
|
|
|
|
str.push(item1.keywordsId) |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
this.allList.forEach(item => { |
|
|
|
|
|
if (item.mustSelected == 0) { |
|
|
|
|
|
if (item.children.findIndex(item => item.selected == 0) == -1) { |
|
|
|
|
|
throw new Error(item.name) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
item.children.map(item1 => { |
|
|
|
|
|
if (item1.selected == 0) { |
|
|
|
|
|
str.push(item1.keywordsId) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (isPass) { |
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
console.log(e) |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: `${checkArr.name}为必选项~`, |
|
|
|
|
|
|
|
|
title: `${e.message}为必选项~`, |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str = str.join(',') |
|
|
str = str.join(',') |
|
|
param.keywordIds = str |
|
|
|
|
|
|
|
|
param.keywordIds = str |
|
|
this.$u.post("matchKeywords/updateManualCalibration", param).then(res => { |
|
|
this.$u.post("matchKeywords/updateManualCalibration", param).then(res => { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '操作成功', |
|
|
title: '操作成功', |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
success: () => { |
|
|
success: () => { |
|
|
let sdd={ |
|
|
|
|
|
|
|
|
let sdd = { |
|
|
keywordIds: this.customerId, |
|
|
keywordIds: this.customerId, |
|
|
id: this.customerId, |
|
|
id: this.customerId, |
|
|
bg:0, |
|
|
|
|
|
speaker:0 |
|
|
|
|
|
|
|
|
bg: 0, |
|
|
|
|
|
speaker: 0 |
|
|
} |
|
|
} |
|
|
let pages = getCurrentPages() //获取当前页面栈的信息 |
|
|
|
|
|
let prevPage = pages[pages.length - 2] //获取上一个页面 |
|
|
|
|
|
prevPage.setData({ //把需要回传的值保存到上一个页面 |
|
|
|
|
|
info: sdd |
|
|
|
|
|
|
|
|
let pages = getCurrentPages() //获取当前页面栈的信息 |
|
|
|
|
|
let prevPage = pages[pages.length - 2] //获取上一个页面 |
|
|
|
|
|
prevPage.setData({ //把需要回传的值保存到上一个页面 |
|
|
|
|
|
info: sdd |
|
|
}); |
|
|
}); |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
} |
|
|
} |
|
@@ -167,7 +169,7 @@ |
|
|
color: #333333; |
|
|
color: #333333; |
|
|
border-bottom: 1px solid #E0E0E0; |
|
|
border-bottom: 1px solid #E0E0E0; |
|
|
line-height: 102rpx; |
|
|
line-height: 102rpx; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&.mustSe::before { |
|
|
&.mustSe::before { |
|
|
content: '*'; |
|
|
content: '*'; |
|
|
color: red; |
|
|
color: red; |
|
|