提交 7d280236 authored 作者: huaxinzhu's avatar huaxinzhu

bug修复

上级 0a38c105
...@@ -69,7 +69,25 @@ Vue.component('Pagination', Pagination) ...@@ -69,7 +69,25 @@ Vue.component('Pagination', Pagination)
Vue.use(permission) Vue.use(permission)
//
const preventReClick = Vue.directive('preventReClick', {
inserted: function (el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 3000)
}
console.log(el.disabled)
})
}
});
export {
preventReClick
}
/** /**
* If you don't want to use mock-server * If you don't want to use mock-server
......
...@@ -68,10 +68,10 @@ ...@@ -68,10 +68,10 @@
} }
} }
}, },
// 禁止粘贴图片 // // 禁止粘贴图片
// clipboard: { clipboard: {
// //matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]] matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
// } }
} }
}, },
index: 0, index: 0,
...@@ -88,22 +88,32 @@ ...@@ -88,22 +88,32 @@
this.goodsDeForm = this.imgdata; this.goodsDeForm = this.imgdata;
} }
}, },
watch: {}, watch: {
'goodsDeForm.description': {
handler: function() {
// console.log(99,this.goodsDetailsImgFileList);
// console.log(100,this.goodsDeForm.description);
},
deep: true
}
},
methods: { methods: {
// handleCustomMatcher(node, Delta) { handleCustomMatcher(node, Delta) {
// let ops = [] let ops = []
// console.log(123); Delta.ops.forEach(op => {
// debugger // 如果粘贴了图片,这里会是一个对象,所以可以这样处理
// Delta.ops.forEach(op => { if (op.insert && typeof op.insert === 'object' && op.insert.image.indexOf('base64') > -1) {
// if (op.insert && typeof op.insert === 'string') {// 如果粘贴了图片,这里会是一个对象,所以可以这样处理 ops.push({
// ops.push({ insert: ''
// insert: op.insert, })
// }) Delta.ops = ops;
// } // console.log('我是粘贴的');
// }) }
// Delta.ops = ops })
// return Delta //
// }, //console.log(113,Delta);
return Delta
},
/** 初始化 商品详情 */ /** 初始化 商品详情 */
initInfo() { initInfo() {
......
...@@ -214,14 +214,21 @@ export default { ...@@ -214,14 +214,21 @@ export default {
'parameterdata': function(val) { 'parameterdata': function(val) {
//debugger //debugger
this.orgGoodsPam = val; this.orgGoodsPam = val;
//console.log("监听",this.orgGoodsPam); console.log("监听",this.orgGoodsPam);
}, },
// "orgGoodsPam": {
// handler: function(val) {
// console.log(222,val);
//
// },
// deep: true
// }
}, },
created() { created() {
//this.orgGoodsPam = this.parameterdata; //this.orgGoodsPam = this.parameterdata;
}, },
mounted() { mounted() {
console.log("加载后,",this.parameterdata); //console.log("加载后,",this.parameterdata);
if(this.parameterdata.pamTableList && this.parameterdata.pamTableList.length > 0) { if(this.parameterdata.pamTableList && this.parameterdata.pamTableList.length > 0) {
this.orgGoodsPam = this.parameterdata; this.orgGoodsPam = this.parameterdata;
}else { }else {
......
...@@ -303,6 +303,10 @@ export default { ...@@ -303,6 +303,10 @@ export default {
specCalcResult() { specCalcResult() {
// 商品规格原始数据 // 商品规格原始数据
let orgSpeData = this.deepClone(this.speData); let orgSpeData = this.deepClone(this.speData);
// let hhxz = this.$
//
// console.log(333333,this.speData);
// 进行数据处理后的数据, // 进行数据处理后的数据,
let proSpeData = this.processData(orgSpeData); let proSpeData = this.processData(orgSpeData);
// 需要将 所有规格名称,提出一个数组集合, // 需要将 所有规格名称,提出一个数组集合,
...@@ -342,6 +346,7 @@ export default { ...@@ -342,6 +346,7 @@ export default {
}; };
goodsPam.pamNameList = this.speNameList; goodsPam.pamNameList = this.speNameList;
goodsPam.pamDataList = goodsParametersList; goodsPam.pamDataList = goodsParametersList;
goodsParametersList.forEach((item)=> { goodsParametersList.forEach((item)=> {
let prePamTable = [ let prePamTable = [
{ js_price:'', sl_price:'', price:'', sc_price:'', stock:'', weight:'', thumb:'',spec_values: [] } { js_price:'', sl_price:'', price:'', sc_price:'', stock:'', weight:'', thumb:'',spec_values: [] }
......
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
<div class="floor-item"> <div class="floor-item">
<div class="floor-item-box"> <div class="floor-item-box">
<p class="card-header-title floor-item-box-title"><span class="blue-block-goods blue-block-goods-title"></span>商品售价</p> <p class="card-header-title floor-item-box-title"><span class="blue-block-goods blue-block-goods-title"></span>商品售价</p>
<GoodsParameter ref="goodsparameter" :parameterdata="parameterdata" /> <!-- <keep-alive>-->
<GoodsParameter ref="goodsparameter" :parameterdata="parameterdata" />
<!-- </keep-alive>-->
</div> </div>
</div> </div>
<!-- 商品详情 --> <!-- 商品详情 -->
...@@ -68,7 +70,7 @@ ...@@ -68,7 +70,7 @@
</div> </div>
<div class="submit-cont"> <div class="submit-cont">
<el-button type="primary" style="padding: 10px 30px;" @click="save">提 交</el-button> <el-button type="primary" style="padding: 10px 30px;" @click="save" v-preventReClick>提 交</el-button>
</div> </div>
</el-card> </el-card>
<!-- 添加商品 end --> <!-- 添加商品 end -->
...@@ -270,6 +272,10 @@ ...@@ -270,6 +272,10 @@
methods: { methods: {
// 规格子组件,传给父组件的数据 // 规格子组件,传给父组件的数据
calcSpeTable(data) { calcSpeTable(data) {
// 第一步,获取原来的值
let spsjData2 = this.$refs.goodsparameter.orgGoodsPam;
// 第二步,重新渲染dom
if(data.pamTableList.length > 0) { if(data.pamTableList.length > 0) {
data.pamTableList.forEach((item, index) => { data.pamTableList.forEach((item, index) => {
if( Array.isArray(data.pamDataList[index]) ) { if( Array.isArray(data.pamDataList[index]) ) {
...@@ -279,8 +285,22 @@ ...@@ -279,8 +285,22 @@
} }
}) })
} }
// console.log(153,data);
// console.log(222,spsjData2);
// 第三步,重新赋值
if(data.pamTableList.length > 0 && spsjData2.pamTableList.length > 0) {
for(let i = 0; i < data.pamTableList.length; i++) {
for(let j = 0; j < spsjData2.pamTableList.length; j++) {
if( data.pamTableList[i][0].spec_values[0] === spsjData2.pamTableList[j][0].spec_values[0] ) {
data.pamTableList[i] = spsjData2.pamTableList[j];
}
}
}
}
this.parameterdata = data; this.parameterdata = data;
//console.log(153,this.parameterdata);
}, },
// 只有点击完最后一级,才会有值 // 只有点击完最后一级,才会有值
SSQChange() { SSQChange() {
...@@ -404,13 +424,13 @@ ...@@ -404,13 +424,13 @@
isGoodsPrice = false; isGoodsPrice = false;
break break
} else { } else {
// 所有校验通过,对价格进行处理,*100 // // 所有校验通过,对价格进行处理,*100
if ( itemKey === 'js_price' || itemKey === 'sl_price' || itemKey === 'price' || itemKey === 'sc_price') { // if ( itemKey === 'js_price' || itemKey === 'sl_price' || itemKey === 'price' || itemKey === 'sc_price') {
itemObj[itemKey] = itemObj[itemKey] * 100; // itemObj[itemKey] = itemObj[itemKey] * 100;
} // }
if( itemKey === 'stock') { // if( itemKey === 'stock') {
itemObj[itemKey] = Number(itemObj[itemKey]); // itemObj[itemKey] = Number(itemObj[itemKey]);
} // }
isGoodsPrice = true; isGoodsPrice = true;
} }
// --------------- // ---------------
...@@ -428,12 +448,12 @@ ...@@ -428,12 +448,12 @@
break break
} else { } else {
// 所有校验通过,对价格进行处理,*100 // 所有校验通过,对价格进行处理,*100
if ( key === 'js_price' || key === 'sl_price' || key === 'price' || key === 'sc_price') { // if ( key === 'js_price' || key === 'sl_price' || key === 'price' || key === 'sc_price') {
slingleSpeObj[key] = slingleSpeObj[key] * 100; // slingleSpeObj[key] = slingleSpeObj[key] * 100;
} // }
if ( key === 'stock') { // if ( key === 'stock') {
slingleSpeObj[key] = Number(slingleSpeObj[key]); // slingleSpeObj[key] = Number(slingleSpeObj[key]);
} // }
isGoodsPrice = true; isGoodsPrice = true;
} }
} }
...@@ -508,17 +528,37 @@ ...@@ -508,17 +528,37 @@
this.goodsAllData.stags = this.goodsAllData.stags.toString(); this.goodsAllData.stags = this.goodsAllData.stags.toString();
} }
// let msg = res.data.Apply.content;
// this.$router.push({
// name: 'reviewFail',
// params: { msg: msg }
// });
// if(this.$route.params.msg) { debugger
// this.msg = this.$route.params.msg; // 价格数字需要 乘以100
// } if(this.goodsAllData.specs_group && this.goodsAllData.specs_group.length > 0) {
// freight 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.stock = Number(item.stock);
})
delete this.goodsAllData.js_price;
delete this.goodsAllData.price;
delete this.goodsAllData.sc_price;
delete this.goodsAllData.sl_price;
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.stock = Number(this.goodsAllData.stock);
delete this.goodsAllData.specs;
delete this.goodsAllData.specs_group;
}
// stock 库存需要转为 int
// console.log(531,this.goodsAllData)
// return
// 商品id 不为 0 是修改 // 商品id 不为 0 是修改
if( this.goodsAllData.goods_id ) { if( this.goodsAllData.goods_id ) {
// 商品id 为 0 是新增 // 商品id 为 0 是新增
...@@ -701,9 +741,9 @@ ...@@ -701,9 +741,9 @@
.blue-block-goods { .blue-block-goods {
width: 5px; width: 5px;
height: 24px; height: 24px;
background: #3A84FF; /*background: #3A84FF;*/
margin: 0 7px 0 0; /*margin: 0 7px 0 0;*/
border-radius: 2px; /*border-radius: 2px;*/
} }
/* el-card title hxz 样式统一 end */ /* el-card title hxz 样式统一 end */
.goods-type-tip { .goods-type-tip {
...@@ -807,6 +847,7 @@ ...@@ -807,6 +847,7 @@
.submit-type-con { .submit-type-con {
width: 236px; width: 236px;
margin: 0 auto 20px; margin: 0 auto 20px;
padding: 0 0 20px;
} }
.submit-cont { .submit-cont {
width: calc(100% + 40px); width: calc(100% + 40px);
...@@ -817,6 +858,6 @@ ...@@ -817,6 +858,6 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
/*align-content: center;*/ /*align-content: center;*/
box-shadow: 0px -8px 9px 1px rgba(51, 51, 51, 0.06); box-shadow: 0 -8px 9px 1px rgba(51, 51, 51, 0.06);
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论