Commit 83e237f5 by 赵永成

shang chuantupian

parent 943c094b
......@@ -45,3 +45,18 @@ export function del_spec_step(query) {
})
}
// 查询sku list
export function list_sku_byGoodsId(id) {
return request({
url: '/system/goods/sku/list/'+id,
method: 'get'
})
}
// 查询详细
export function getSpu(id) {
return request({
url: "/system/goods/" + id,
method: "get",
});
}
\ No newline at end of file
......@@ -40,7 +40,7 @@
</div>
</template>
<script>
import { list_machine_model,list_step,add_spec_step,list_data_spec_step,del_spec_step } from "@/api/system/specification.js";
import { list_machine_model,list_step,add_spec_step,list_data_spec_step,del_spec_step,list_sku_byGoodsId } from "@/api/system/specification.js";
import { stringify } from "querystring";
export default {
props: {
......@@ -90,7 +90,10 @@ export default {
this.goods = pgoods;
},
/**打开规格详情配置,并初始化显示内容 */
showSpecial(isShow,pgoods){
async showSpecial(isShow,pgoods){
console.log("111 ");
await this.getSkuByGoodsId(this.goods.id);
console.log("333 ");
// 样例
// {
// "goods_code":"G169",
......@@ -193,8 +196,36 @@ export default {
},
/** 规格详情配置窗体初始化数据,如果已经有配置数据则获取*/
initAll(){
this.get_step_data();
},
/**获取商品对应的sku list 组装数据结构供页面显示,*/
// getSkuByGoodsId(goodsId){
// list_sku_byGoodsId(goodsId).then((response) => {
// console.log("getSkuByGoodsId response",response);
// console.log("222 ");
// }).catch((response) => {
// console.log("getSkuByGoodsId error",response);
// console.log("222 e");
// });
// },
getSkuByGoodsId(goodsId){
return new Promise((resolve,reject)=>{
list_sku_byGoodsId(goodsId).then((response) => {
console.log("getSkuByGoodsId response",response);
console.log("222 ");
resolve(response);
}).catch((response) => {
console.log("getSkuByGoodsId error",response);
console.log("222 e");
reject(response);
});
});
},
/**获取已保存的步骤数据 */
get_step_data(){
console.log("get_step_data goods",this.goods);
......@@ -365,6 +396,7 @@ export default {
return cat
})
}
}
}
......
......@@ -251,9 +251,9 @@ export default {
this.$refs.Specification.setSpecGoods(prow);
this.$nextTick(
this.$refs.Specification.showSpecial(true,prow)
);
this.$refs.Specification.showSpecial(true,prow)
//this.$refs.Specification.initAll();
......
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