Commit ee955bab by 赵永成

spec

parent 670c4d03
...@@ -114,6 +114,8 @@ export default { ...@@ -114,6 +114,8 @@ export default {
t_skuList.push(skuObj); t_skuList.push(skuObj);
} }
this.skuList = t_skuList; this.skuList = t_skuList;
}).catch((res)=>{
console.log("getSkuByGoodsId 123",res);
}); });
console.log("333 "); console.log("333 ");
console.log("this.skuList ",this.skuList ); console.log("this.skuList ",this.skuList );
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" > <el-table-column label="操作" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="spec_ShowBtn('set_sku',scope.row)" @click="specal_set(scope.$index,scope.row,'view_step')" type="text" size="small"> 配置制作步骤 </el-button> <el-button v-if="spec_ShowBtn('set_sku',scope.row)" @click="specal_set(scope.row)" type="text" size="small"> 配置制作步骤 </el-button>
<el-button v-if="spec_ShowBtn('del_sku',scope.row)" @click.native.prevent="sku_del(scope.row)" type="text" size="small"> 删除当前sku </el-button> <el-button v-if="spec_ShowBtn('del_sku',scope.row)" @click.native.prevent="sku_del(scope.row)" type="text" size="small"> 删除当前sku </el-button>
<el-button v-if="spec_ShowBtn('rec_sku',scope.row)" @click.native.prevent="sku_rec(scope.row)" type="text" size="small"> 恢复当前sku </el-button> <el-button v-if="spec_ShowBtn('rec_sku',scope.row)" @click.native.prevent="sku_rec(scope.row)" type="text" size="small"> 恢复当前sku </el-button>
</template> </template>
...@@ -36,12 +36,15 @@ ...@@ -36,12 +36,15 @@
<el-button type="primary" @click="closeSpecial('confim');">确 定</el-button> <el-button type="primary" @click="closeSpecial('confim');">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<SpecSetting ref="SpecSetting"></SpecSetting>
</div> </div>
</template> </template>
<script> <script>
import { list_machine_model,list_step,add_spec_step,list_data_spec_step,del_spec_step,list_sku_byGoodsId,del_sku_bySkuId,rec_sku_bySkuId } from "@/api/system/specification.js"; import { list_machine_model,list_step,add_spec_step,list_data_spec_step,del_spec_step,list_sku_byGoodsId,del_sku_bySkuId,rec_sku_bySkuId } from "@/api/system/specification.js";
import { stringify } from "querystring"; import SpecSetting from './SpecSetting.vue';
export default { export default {
components: { SpecSetting},
props: { props: {
}, },
data() { data() {
...@@ -156,6 +159,86 @@ export default { ...@@ -156,6 +159,86 @@ export default {
} }
this.special_tb_data = t_special_tb_data;
console.log("this.special_tb_data ",this.special_tb_data);
console.log("666 ");
//回显历史数据
//this.get_step_data();
//显示窗体
this.open = isShow
},
/**打开规格详情配置,并初始化显示内容 */
async showSpecial_bak(isShow,p_goods){
console.log("111 ");
/** 根据商品获取sku list; 按原型组装数据*/
await this.getSkuByGoodsId(this.goods.id).then((res)=>{
console.log("getSkuByGoodsId response 123",res);
let t_skuList = [];
for(let i=0;i<res.data.length;i++){
let sku = res.data[i];
//现在的sku状态字段为isDeleted 有两个值:0-未删除 1-已删除,2-手动删除
//如果状态是(1-已删除)的这里暂不显示
if(sku.isDeleted==1) continue;
let skuObj_ary = [];
let ruleList = JSON.parse(sku.ruleList);
for(let j=0;j<ruleList.length;j++){
let sku_spec_Obj = {};
let rule = ruleList[j];
let specName = this.findSpecNameById(rule.specId);
let spec_RuleName = rule.name;
sku_spec_Obj.specName=specName;
sku_spec_Obj.spec_RuleName = spec_RuleName;
skuObj_ary.push(sku_spec_Obj);
}
let skuObj = {};
skuObj.sku_id=sku.id;
skuObj.isDeleted = sku.isDeleted;
skuObj.skuAry = skuObj_ary;
t_skuList.push(skuObj);
}
this.skuList = t_skuList;
});
console.log("333 ");
console.log("this.skuList ",this.skuList );
console.log("mach_model_list ",this.mach_model_list );
// sku,和机器型号可能的数据放到一个数组里,后续只循环一个数组即可,也为方法抽取提供条件;
let t_special_tb_data=[]
for(let i=0;i<this.skuList.length;i++){
let skuObj = this.skuList[i];
for(let j=0;j<this.mach_model_list.length;j++){
let mach_mode = this.mach_model_list[j];
let tb_data_item = {};
tb_data_item.mach_mode=mach_mode;
tb_data_item.sku = skuObj;
let strName = this.buildSkuSpecName(skuObj.skuAry);
let sku_spec_model = {
"goods_code":p_goods.code,
"goods_name":p_goods.name,
"sku_id":skuObj.sku_id,
"sku_spec_name":strName,
"model_name":mach_mode.model_name,
"model_id":mach_mode.id,
"sku_isDeleted":skuObj.isDeleted,
"tb_steps":[{
"step_lab":"步骤1",
"step_akv":[]
}],
"step_opts":[]
}
sku_spec_model.mach_mode=mach_mode;
sku_spec_model.sku = skuObj;
t_special_tb_data.push(sku_spec_model);
}
}
/** sku,和机器型号 获取可能的步骤*/ /** sku,和机器型号 获取可能的步骤*/
for(let i=0;i<t_special_tb_data.length;i++){ for(let i=0;i<t_special_tb_data.length;i++){
...@@ -433,7 +516,13 @@ export default { ...@@ -433,7 +516,13 @@ export default {
return cat return cat
}) })
}, },
specal_set(){ specal_set(skuRow){
console.log("specal_set skuRow",skuRow);
this.$refs.SpecSetting.setSpecGoods(this.goods);
this.$refs['SpecSetting'].showSpecial(true,this.goods);
//this.$parent.setGoodsConfig_skuStep(this.goods);
}, },
/**删除sku*/ /**删除sku*/
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
@pagination="getList" /> @pagination="getList" />
<Form ref="Form" :getList="getList"/> <Form ref="Form" :getList="getList"/>
<Specification ref="Specification"></Specification> <Specification ref="Specification"></Specification>
<!-- <SpecSetting ref="SpecSetting"></SpecSetting> -->
</div> </div>
</template> </template>
...@@ -99,9 +100,11 @@ import Form from "./components/Form.vue"; ...@@ -99,9 +100,11 @@ import Form from "./components/Form.vue";
import SelectCategory from "@/components/SelectCategory"; import SelectCategory from "@/components/SelectCategory";
import SpecsSelect from '../spec/SpecsSelect.vue'; import SpecsSelect from '../spec/SpecsSelect.vue';
import Specification from './components/Specification.vue'; import Specification from './components/Specification.vue';
import SpecSetting from './components/SpecSetting.vue';
export default { export default {
name: "Spu", name: "Spu",
components: { Form, PutShopOffShop ,SelectCategory, SpecsSelect,Specification}, components: { Form, PutShopOffShop ,SelectCategory, SpecsSelect,Specification},
// components: { Form, PutShopOffShop ,SelectCategory, SpecsSelect,Specification,SpecSetting},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -250,15 +253,13 @@ export default { ...@@ -250,15 +253,13 @@ export default {
}) })
}, },
setGoodsConfig(prow){ setGoodsConfig(prow){
this.$refs.Specification.setSpecGoods(prow); this.$refs.Specification.setSpecGoods(prow);
this.$refs.Specification.showSpecial(true,prow) this.$refs.Specification.showSpecial(true,prow)
},
// setGoodsConfig_skuStep(skuRow){
// this.$refs.SpecSetting.setSpecGoods(skuRow);
} // this.$refs['SpecSetting'].showSpecial(true,skuRow);
// }
}, },
}; };
</script> </script>
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