提交 97e43f06 authored 作者: 王天霸's avatar 王天霸

丢失精度以及导入商品问题

上级 496ae5c6
...@@ -652,10 +652,10 @@ debugger ...@@ -652,10 +652,10 @@ debugger
// 价格数字需要 乘以100 // 价格数字需要 乘以100
if(this.goodsAllData.specs_group && this.goodsAllData.specs_group.length > 0) { if(this.goodsAllData.specs_group && this.goodsAllData.specs_group.length > 0) {
this.goodsAllData.specs_group.forEach((item)=> { this.goodsAllData.specs_group.forEach((item)=> {
item.js_price = Number(item.js_price) * 100; item.js_price = (Number(item.js_price) * 1000)/10;
item.price = Number(item.price) * 100; item.price = (Number(item.price) * 1000)/10;
item.sc_price = Number(item.sc_price) * 100; item.sc_price = (Number(item.sc_price) * 1000)/10;
item.sl_price = Number(item.sl_price) * 100; item.sl_price = (Number(item.sl_price) * 1000)/10;
item.stock = Number(item.stock); item.stock = Number(item.stock);
}) })
delete this.goodsAllData.js_price; delete this.goodsAllData.js_price;
...@@ -665,10 +665,10 @@ debugger ...@@ -665,10 +665,10 @@ debugger
delete this.goodsAllData.stock; delete this.goodsAllData.stock;
delete this.goodsAllData.weight; delete this.goodsAllData.weight;
}else { }else {
this.goodsAllData.js_price = Number(this.goodsAllData.js_price) * 100 this.goodsAllData.js_price = (Number(this.goodsAllData.js_price) * 1000)/10
this.goodsAllData.price = Number(this.goodsAllData.price) * 100 this.goodsAllData.price = (Number(this.goodsAllData.price) * 1000)/10
this.goodsAllData.sc_price = Number(this.goodsAllData.sc_price) * 100 this.goodsAllData.sc_price = (Number(this.goodsAllData.sc_price) * 1000)/10
this.goodsAllData.sl_price = Number(this.goodsAllData.sl_price) * 100 this.goodsAllData.sl_price = (Number(this.goodsAllData.sl_price) * 1000)/10
this.goodsAllData.stock = Number(this.goodsAllData.stock); this.goodsAllData.stock = Number(this.goodsAllData.stock);
delete this.goodsAllData.specs; delete this.goodsAllData.specs;
delete this.goodsAllData.specs_group; delete this.goodsAllData.specs_group;
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
import { MessageBox } from 'element-ui'; import { MessageBox } from 'element-ui';
import {getShopInf} from "@/api/module/entry" import {getShopInf} from "@/api/module/entry"
import { goodsjdAddress,goodsimport} from "@/api/module/goodsgement"; import { goodsjdAddress,goodsimport} from "@/api/module/goodsgement";
import { NewGetCategoryData } from '@/api/module/goods';
import { dateFormat } from "@/utils"; import { dateFormat } from "@/utils";
export default { export default {
...@@ -69,11 +70,12 @@ export default { ...@@ -69,11 +70,12 @@ export default {
el_value: [], //地址 el_value: [], //地址
options: [], options: [],
props: { props: {
checkStrictly: false, expandTrigger: 'click',
expandTrigger: "click", lazy: true,
emitPath: true, lazyLoad: this.lazyLoad,
value: "id", value: "id",
label: "label", label: 'title',
leaf: 'leaf'
}, },
}; };
}, },
...@@ -188,13 +190,46 @@ export default { ...@@ -188,13 +190,46 @@ export default {
elvalueclick() { elvalueclick() {
// this.goodsonly() // this.goodsonly()
}, },
getData() { lazyLoad(node, resolve) {
goodsjdAddress().then((res) => { this.SSQList = [];
if (res.code == 1) { this.SSQStr = '';
this.options = res.data; this.getArea(node, resolve);
if(this.SSQList && this.SSQList.length > 0) {
this.isNextStep = false
}else {
this.isNextStep = true
} }
}); },
}, getArea(node, resolve) {
debugger
const level = node.level;
let limboNode = {};
if(level === 0) {
limboNode = {parent_id: 0}
}
if(level > 0) {
limboNode = { parent_id: node.value };
}
NewGetCategoryData(limboNode).then(res => {
let result = {};
result = res.data
result.forEach(item => {
item.value = item.id;
item.label = item.label;
item.children = [];
item.leaf = level>=2;
// 可以控制 是否有下级 值为true都不行,必须等于0
})
resolve(result)
});
},
}, //methods结束 }, //methods结束
}; };
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论