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

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

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