Commit c20499f6 authored by zhengke's avatar zhengke

修改

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