新增服务类目选择从第二级类目开始,默认一级类目为服务商城
This commit is contained in:
parent
eaaf2586e6
commit
e8e13a4154
|
|
@ -21,7 +21,7 @@
|
||||||
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
|
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
|
||||||
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
||||||
<input disabled class="line-input radius-input"
|
<input disabled class="line-input radius-input"
|
||||||
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
|
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName : ''"
|
||||||
placeholder="请选择类目"></input>
|
placeholder="请选择类目"></input>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
videoList: []
|
videoList: []
|
||||||
},
|
},
|
||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryMultiIndex: [0, 0, 0],
|
categoryMultiIndex: [0, 0],
|
||||||
regionList: [],
|
regionList: [],
|
||||||
regionMultiIndex: [0, 0],
|
regionMultiIndex: [0, 0],
|
||||||
isShowAllSpecs: false,
|
isShowAllSpecs: false,
|
||||||
|
|
@ -348,19 +348,23 @@
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async loadCategoryList(idArr) {
|
async loadCategoryList(idArr) {
|
||||||
let typeList = await this.$request.listByStep();
|
let typeList = await this.$request.listByStep({
|
||||||
|
type: 1
|
||||||
|
});
|
||||||
typeList = typeList.data;
|
typeList = typeList.data;
|
||||||
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
|
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
|
||||||
let subTypeList = await this.$request.listByStep({
|
let subTypeList = await this.$request.listByStep({
|
||||||
|
type: 1,
|
||||||
goodsCategoryId: col1Id
|
goodsCategoryId: col1Id
|
||||||
});
|
});
|
||||||
subTypeList = subTypeList.data;
|
subTypeList = subTypeList.data;
|
||||||
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
|
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
|
||||||
let subSubTypeList = await this.$request.listByStep({
|
let subSubTypeList = await this.$request.listByStep({
|
||||||
|
type: 1,
|
||||||
goodsCategoryId: col2Id
|
goodsCategoryId: col2Id
|
||||||
});
|
});
|
||||||
subSubTypeList = subSubTypeList.data;
|
subSubTypeList = subSubTypeList.data;
|
||||||
this.categoryList.push(typeList);
|
// this.categoryList.push(typeList);
|
||||||
this.categoryList.push(subTypeList);
|
this.categoryList.push(subTypeList);
|
||||||
this.categoryList.push(subSubTypeList);
|
this.categoryList.push(subSubTypeList);
|
||||||
},
|
},
|
||||||
|
|
@ -386,37 +390,42 @@
|
||||||
this.formData.category = chosenCategory;
|
this.formData.category = chosenCategory;
|
||||||
|
|
||||||
// 查询最后一级品类
|
// 查询最后一级品类
|
||||||
let res = await this.$request.listByStep({
|
let res = await this.$request.listByStep({
|
||||||
goodsCategoryId: chosenCategory[2].goodsCategoryId
|
type: 1,
|
||||||
|
goodsCategoryId: chosenCategory[chosenCategory.length - 1].goodsCategoryId
|
||||||
});
|
});
|
||||||
this.formData.specsList = res.data;
|
this.formData.specsList = res.data;
|
||||||
},
|
},
|
||||||
async categoryColChange(e) {
|
async categoryColChange(e) {
|
||||||
let colObj = e.detail;
|
let colObj = e.detail;
|
||||||
|
// if (colObj.column == 0) {
|
||||||
|
// // 通过一级查询二级,通过二级查三级
|
||||||
|
// let subTypeList = await this.$request.listByStep({
|
||||||
|
// type: 1,
|
||||||
|
// goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
|
||||||
|
// });
|
||||||
|
// subTypeList = subTypeList.data;
|
||||||
|
// let subSubTypeList = await this.$request.listByStep({
|
||||||
|
// type: 1,
|
||||||
|
// goodsCategoryId: subTypeList[0].goodsCategoryId
|
||||||
|
// });
|
||||||
|
// subSubTypeList = subSubTypeList.data;
|
||||||
|
// this.categoryList.pop();
|
||||||
|
// this.categoryList.pop();
|
||||||
|
// this.categoryList.push(subTypeList);
|
||||||
|
// this.categoryList.push(subSubTypeList);
|
||||||
|
// this.categoryMultiIndex = [colObj.value, 0, 0];
|
||||||
|
// } else
|
||||||
if (colObj.column == 0) {
|
if (colObj.column == 0) {
|
||||||
// 通过一级查询二级,通过二级查三级
|
// 通过二级查三级
|
||||||
let subTypeList = await this.$request.listByStep({
|
let subSubTypeList = await this.$request.listByStep({
|
||||||
|
type: 1,
|
||||||
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
|
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
|
||||||
});
|
});
|
||||||
subTypeList = subTypeList.data;
|
|
||||||
let subSubTypeList = await this.$request.listByStep({
|
|
||||||
goodsCategoryId: subTypeList[0].goodsCategoryId
|
|
||||||
});
|
|
||||||
subSubTypeList = subSubTypeList.data;
|
|
||||||
this.categoryList.pop();
|
|
||||||
this.categoryList.pop();
|
|
||||||
this.categoryList.push(subTypeList);
|
|
||||||
this.categoryList.push(subSubTypeList);
|
|
||||||
this.categoryMultiIndex = [colObj.value, 0, 0];
|
|
||||||
} else if (colObj.column == 1) {
|
|
||||||
// 通过二级查三级
|
|
||||||
let subSubTypeList = await this.$request.listByStep({
|
|
||||||
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
|
|
||||||
});
|
|
||||||
subSubTypeList = subSubTypeList.data;
|
subSubTypeList = subSubTypeList.data;
|
||||||
this.categoryList.pop();
|
this.categoryList.pop();
|
||||||
this.categoryList.push(subSubTypeList);
|
this.categoryList.push(subSubTypeList);
|
||||||
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
|
this.categoryMultiIndex = [colObj.value, 0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async regionChange(e) {
|
async regionChange(e) {
|
||||||
|
|
@ -638,7 +647,7 @@
|
||||||
goodsName: this.formData.servName,
|
goodsName: this.formData.servName,
|
||||||
goodsDesc: this.formData.servDesc,
|
goodsDesc: this.formData.servDesc,
|
||||||
goodsUnit: this.formData.goodsUnit,
|
goodsUnit: this.formData.goodsUnit,
|
||||||
deptGoodsCategoryId: this.formData.category[2].goodsCategoryId,
|
deptGoodsCategoryId: this.formData.category[this.formData.category.length - 1].goodsCategoryId,
|
||||||
goodsStandardList: goodsStandardList,
|
goodsStandardList: goodsStandardList,
|
||||||
goodsAreaList: goodsAreaList,
|
goodsAreaList: goodsAreaList,
|
||||||
goodsImgUrl: this.formData.coverImgList[0],
|
goodsImgUrl: this.formData.coverImgList[0],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue