Commit c20499f6 authored by zhengke's avatar zhengke

修改

parent b249dd3e
......@@ -337,19 +337,16 @@
}
}
}
console.log(ProductList, 'ProductList');
this.AppointList = ProductList
},
//删除对应商品类型
deleteProduct(item, index) {
console.log(item, 'item');
this.AppointList.splice(index, 1)
for (let i = 0; i < this.checkedkeys.length; i++) {
if (this.checkedkeys[i] == item.ProductId) {
this.checkedkeys.splice(i, 1)
}
}
console.log(this.AppointList, 'this.AppointList');
},
addcommoditybtn() {
this.addcommodity = true;
......@@ -494,7 +491,6 @@
this.apipost("/api/MContent/GetStoresList", {}, res => {
if (res.data.resultCode == 1) {
this.StoreList = res.data.data;
console.log(res, '下拉数据');
} else {
this.Error(res.data.message);
}
......@@ -519,7 +515,6 @@
}
this.addMsg.ProductList = ProductList
}
console.log(this.addMsg);
this.apipost("/api/Reserve/AddOrUpdateServicePersonal", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
......@@ -535,19 +530,21 @@
ID: this.addMsg.ID
}, res => {
if (res.data.resultCode == 1) {
console.log(res, '获取数据');
this.addMsg = res.data.data;
if (res.data.data.ServiceType == 1) {
let ProductList = res.data.data.ProductList;
let newData = []
this.AppointList = []
this.getProductCategoryTreeList();
console.log(this.ProductCategoryTreeList, 'ProductCategoryTreeList');
for (let i = 0; i < ProductList.length; i++) {
this.checkedkeys.push(ProductList[i].ProductId)
console.log(this.getObjById(this.ProductCategoryTreeList,ProductList[i].ProductId),'阿萨德');
var objList = this.getObjById(this.ProductCategoryTreeList,ProductList[i].ProductId);
if(objList){
this.AppointList.push({
ProductId:objList.Id,
Name:objList.Name
})
}
}
// console.log(newData, 'newData');
// this.AppointList = this.AppointList2.concat(newData)
}
if (res.data.data.ServiceType == 2) {
let ProductList = res.data.data.ProductList;
......@@ -567,7 +564,6 @@
if (res.data.resultCode == 1) {
let pageData = res.data.data.pageData;
newData.push(pageData[0])
}
})
}
......@@ -579,22 +575,18 @@
})
},
getObjById(list,id) {
console.log(list,'list');
console.log(id,'idddd');
if (!list instanceof Array) {
return null
}
//遍历数组
for (let i in list) {
let item = list[i]
console.log(item,'itemmmmmm');
if (item.Id === id) {
console.log(item,'item');
return item
} else {
//查不到继续遍历
if (item.ChildList) {
let value = getObjById(item.ChildList, id)
let value = this.getObjById(item.ChildList,id)
//查询到直接返回
if (value) {
return value
......
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