Преглед изворни кода

提交1017开发

trunk1017
douzhuo пре 1 година
родитељ
комит
c3b51ca704
3 измењених фајлова са 53 додато и 50 уклоњено
  1. +1
    -1
      manifest.json
  2. +14
    -13
      pages/center/consumer/edit.vue
  3. +38
    -36
      pages/mine/calibration.vue

+ 1
- 1
manifest.json Прегледај датотеку

@@ -1,5 +1,5 @@
{
"name" : "数智工牌",
"name" : "智控管家",
"appid" : "__UNI__7A1611D",
"description" : "去房智控管家",
"versionName" : "1.1.0",


+ 14
- 13
pages/center/consumer/edit.vue Прегледај датотеку

@@ -346,22 +346,23 @@
}
let isPass = false // 默认通过
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) {
console.log(item, item1)
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({
title: `${checkArr.name}为必选项~`,
title: `${e.message}为必选项~`,
icon: 'none',
duration: 2000
})


+ 38
- 36
pages/mine/calibration.vue Прегледај датотеку

@@ -5,7 +5,8 @@
<view class="conmsg-msg">
<view v-for="(item,index) in allList" :key="index">
<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">
{{item.name}}
</view>
@@ -36,35 +37,35 @@
export default {
data() {
return {
allList:[],
customerId:''
allList: [],
customerId: ''
}
},
onLoad(e) {
this.customerId=e.id;
this.customerId = e.id;
this.getListByType()
},
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() {
this.$u.get("/matchKeywords/findManualCalibration", {
customerId: this.customerId,
type:2
type: 2
})
.then(res => {
res.forEach(item1 => {
item1.children.map(item => {
if (item.isInterval == 0) {
item.label = item.name + item.unit + '-' + item.endName + item
.unit;
.unit;
} else {
item.label = item.name
}
@@ -77,51 +78,52 @@
// 提交
submit() {
let param = {
keywordIds:'',
keywordIds: '',
id: this.customerId,
projectId: uni.getStorageSync('buildingID').id,
}
let str = []
let isPass = false // 默认通过
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({
title: `${checkArr.name}为必选项~`,
title: `${e.message}为必选项~`,
icon: 'none',
duration: 2000
})
return
}
str = str.join(',')
param.keywordIds = str
param.keywordIds = str
this.$u.post("matchKeywords/updateManualCalibration", param).then(res => {
uni.showToast({
title: '操作成功',
icon: 'none',
success: () => {
let sdd={
let sdd = {
keywordIds: 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()
}
@@ -167,7 +169,7 @@
color: #333333;
border-bottom: 1px solid #E0E0E0;
line-height: 102rpx;
&.mustSe::before {
content: '*';
color: red;


Loading…
Откажи
Сачувај