Commit efa01e1a by 赵永成

spec

parent 5f6766b1
......@@ -56,7 +56,8 @@ export default {
steps:[],
queryParams:{},
mach_model_list:[],
skuList:[]
skuList:[],
psku:null,
}
},
mounted:function(){
......@@ -64,8 +65,10 @@ export default {
},
methods: {
/**提前将商品信息传入 */
setSpecGoods(p_goods){
setSpecGoods(p_goods,p_sku){
this.goods = p_goods;
this.psku = p_sku;
console.log("setSpecGoods",p_sku);
},
findSpecNameById(p_specId){
let specList = JSON.parse(this.goods.spec);
......@@ -93,7 +96,10 @@ export default {
console.log("getSkuByGoodsId response 123",res);
let t_skuList = [];
for(let i=0;i<res.data.length;i++){
let sku = res.data[i];
let sku = res.data[i];
//只显示当前sku的数据进行配置,不一致的先跳过;
if(this.psku.sku_id != sku.id) continue;
let skuObj_ary = [];
let ruleList = JSON.parse(sku.ruleList);
for(let j=0;j<ruleList.length;j++){
......@@ -162,7 +168,7 @@ export default {
* 先调试完成,再试试异步加载数据是否可行 / 或者如果数据都一样是不是用一份即可!!!
*/
//这个判断是先用一份数据
if(this.steps.length==0){
// if(this.steps.length==0){
await this.getStepListByMidAndSkuId(queryParams).then((res)=>{
console.log("res",res);
let step_opts = [];
......@@ -188,9 +194,17 @@ export default {
console.log("step_opts",step_opts);
this.steps = step_opts;
});
}else{
}
// list_step(queryParams).then((res) => {
// }).catch((res) => {
// });
// }else{
// }
//还是要每个个对象里面加上可选步骤,以后即时改动,也不用调整页面模板,只需要调整js脚本
spec_sku_item.step_opts = this.steps;
}
......
......@@ -167,7 +167,7 @@ export default {
},
specal_set(skuRow){
this.$refs.SpecSetting.setSpecGoods(this.goods);
this.$refs.SpecSetting.setSpecGoods(this.goods,skuRow);
this.$refs['SpecSetting'].showSpecial(true,this.goods);
},
/**删除sku*/
......
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