提交 6c816807 authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'dev_hxz' into test

......@@ -23,13 +23,13 @@ router.beforeEach((to, from, next) => {
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
debugger
//debugger
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(res => {
// return false
// 拉取user_info
const roles = res.data.roles
debugger
//debugger
store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => {
// 测试 默认静态页面
// store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
......@@ -40,6 +40,7 @@ router.beforeEach((to, from, next) => {
}).catch(err => {
store.dispatch('FedLogOut').then(() => {
Message.error(err)
//debugger
next({ path: '/home/index' })
})
})
......@@ -62,6 +63,7 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
//debugger
next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
// next(`/newyuncang?redirect=${to.path}`) // 否则全部重定向到登录页
NProgress.done()
......
......@@ -67,7 +67,7 @@ const user = {
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
debugger
//debugger
const user = res.data.user
// const avatar = user.avatar == "" ? require("@/assets/image/login-background.jpg") : process.env.VUE_APP_BASE_API +"/"+ user.avatar;
const avatar = require("@/assets/image/login-background.jpg")
......@@ -94,6 +94,7 @@ const user = {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
removeToken()
var ssa = window.location.host
// setTimeout(function (){
......
......@@ -96,6 +96,7 @@ service.interceptors.response.use(res => {
})
return Promise.reject('error')
store.dispatch('LogOut').then(() => {
//debugger
var ssa = window.location.host;
if (ssa == 'localhost:1024') {
......
......@@ -280,12 +280,12 @@
toRegister() {
store.dispatch('LogOut').then(() => {
var ssa = window.location.host;
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + window.location.host + '/platformlogin'
window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin'
})
},
// 去登录
toLogin() {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + window.location.host + '/platformlogin'
window.location.href = 'http://sso.jxhh.com/login?redirect=http://' + window.location.host + '/platformlogin'
//http://sso.jxhh.com/logout?redirect=http://' + ssa + '/login
}
......
......@@ -17,7 +17,7 @@
// 获取客户是否有审核信息
getShopInf().then(res => {
if(res.code === 1) {
debugger
//debugger
switch(res.data.state) {
case 0:
switch(res.data.status){
......
......@@ -20,7 +20,6 @@
</el-table-column>
<el-table-column align="center" prop="sl_price" label="结算价">
<template slot-scope="scope">
<!-- <el-input size="mini" style="width:90%" v-model="scope.row.sl_price" :disabled="true" placeholder="根据结算价自动计算"></el-input>-->
<span
class="sl-price-span-input">{{ scope.row.sl_price = scope.row.js_price ? scope.row.js_price : '' }}</span>
</template>
......@@ -216,19 +215,11 @@ export default {
this.orgGoodsPam = val;
console.log("监听",this.orgGoodsPam);
},
// "orgGoodsPam": {
// handler: function(val) {
// console.log(222,val);
//
// },
// deep: true
// }
},
created() {
//this.orgGoodsPam = this.parameterdata;
},
mounted() {
//console.log("加载后,",this.parameterdata);
if(this.parameterdata.pamTableList && this.parameterdata.pamTableList.length > 0) {
this.orgGoodsPam = this.parameterdata;
}else {
......@@ -253,14 +244,11 @@ export default {
},
// 上传 无规格组合 的图片
upLoadSingleSpecImg(param) {
// this.loading = true;
//debugger
this.getBase64(param.file).then((res) => {
let result = res.split(",");
this.Base64img = result[1];
let data = {"img_data": this.Base64img}
UploadImg(data).then(res => {
// this.loading = false;
if (res && res.code == 1) {
this.singleSpecImgList.push({ url: res.data.image_url });
this.singleSpecTable[0].imgs9 = [];
......@@ -329,8 +317,38 @@ export default {
})
});
//console.log(3333,file);
},
// 如果保存失败,将乘以100的价格还原
priceReduce() {
if(this.parameterdata.pamTableList && this.parameterdata.pamTableList.length > 0) {
this.parameterdata.pamTableList.forEach((item)=> {
if(item.js_price) {
item.js_price = item.js_price / 100;
}
if(item.price) {
item.price = item.price / 100;
}
if(item.sc_price) {
item.sc_price = item.sc_price / 100;
}
if(item.sl_price) {
item.sl_price = item.sl_price / 100;
}
})
}else {
if(this.singleSpecTable[0].js_price) {
this.singleSpecTable[0].js_price = this.singleSpecTable[0].js_price / 100
}
if(this.singleSpecTable[0].price) {
this.singleSpecTable[0].price = this.singleSpecTable[0].price / 100
}
if(this.singleSpecTable[0].sc_price) {
this.singleSpecTable[0].sc_price = this.singleSpecTable[0].sc_price / 100
}
if(this.singleSpecTable[0].sl_price) {
this.singleSpecTable[0].sl_price = this.singleSpecTable[0].sl_price / 100
}
}
},
// 删除 单个规格的图片
......
......@@ -9,7 +9,7 @@
<div>
<p class="goods-type-tip">为商品设置正确的类目,能让商品快速的被搜索到</p>
</div>
<div class="goods-type-options" v-loading="loading">
<div class="goods-type-options">
<el-cascader-panel v-model="SSQList" :props='props' @change="SSQChange" ref="ssqCascader"></el-cascader-panel>
</div>
<el-button type="primary" class="next-step" :disabled="isNextStep" @click="nextStep">下一步</el-button>
......@@ -272,6 +272,11 @@
methods: {
// 规格子组件,传给父组件的数据
calcSpeTable(data) {
//debugger
// let hax = "-1g";
// console.log( Number(hax));
// return
// 第一步,获取原来的值
let spsjData2 = this.$refs.goodsparameter.orgGoodsPam;
......@@ -285,8 +290,6 @@
}
})
}
// console.log(153,data);
// console.log(222,spsjData2);
// 第三步,重新赋值
if(data.pamTableList.length > 0 && spsjData2.pamTableList.length > 0) {
......@@ -314,7 +317,6 @@
lazyLoad(node, resolve) {
this.SSQList = [];
this.SSQStr = '';
//debugger
this.getArea(node, resolve);
if(this.SSQList && this.SSQList.length > 0) {
this.isNextStep = false
......@@ -334,11 +336,12 @@
if(level === 2) {
limboNode = { id: node.value };
}
//this.loading = true;
NewGetCategory(limboNode).then(res => {
let result = {};
//debugger
if (level === 0) {
result = res.data
result.forEach(item => {
......@@ -385,7 +388,7 @@
}
resolve(result)
//this.loading = false;
});
},
// 添加商品后,下一步 操作
......@@ -395,11 +398,13 @@
this.goodsinfodata.categoryList = this.SSQList;
this.goodsinfodata.categoryStr = ssqLabelList[0] + '/' + ssqLabelList[1] + '/' + ssqLabelList[2];
this.isShowGoodsDetails = true;
// console.log(232,this.goodsinfodata.categoryStr,this.goodsinfodata.categoryList);
},
// 保存/提交
save() {
// console.log(401,)
//
// return;
//debugger
// 此处变量 有顺序 校验时,电梯至某处
......@@ -418,22 +423,15 @@
for(let i = 0; i < spsjData2.pamTableList.length; i++) {
let itemObj = spsjData2.pamTableList[i][0];
for (let itemKey in itemObj) {
//----------------
// 有多余字段,可能为空,需要对有效字段单独判断
if ( (itemObj['js_price'] === '') || (itemObj['sl_price'] === '') || (itemObj['price'] === '') || (itemObj['sc_price'] === '') || (itemObj['stock'] === '') || (itemObj['weight'] === '') ) {
isGoodsPrice = false;
break
} else {
// // 所有校验通过,对价格进行处理,*100
// if ( itemKey === 'js_price' || itemKey === 'sl_price' || itemKey === 'price' || itemKey === 'sc_price') {
// itemObj[itemKey] = itemObj[itemKey] * 100;
// }
// if( itemKey === 'stock') {
// itemObj[itemKey] = Number(itemObj[itemKey]);
// }
isGoodsPrice = true;
}
// ---------------
}
if (!isGoodsPrice) {
break
......@@ -520,6 +518,7 @@
// 售后服务 数据
let ssffData = this.$refs.goodsaftersale.goodsAfterSaleForm;
// 所有数据合并
Object.assign( this.goodsAllData, spxxData, spsjData, spxqData, ssffData);
// 经营类目,服务标签,需要单独处理数据格式
......@@ -529,7 +528,6 @@
}
debugger
// 价格数字需要 乘以100
if(this.goodsAllData.specs_group && this.goodsAllData.specs_group.length > 0) {
this.goodsAllData.specs_group.forEach((item)=> {
......@@ -555,10 +553,6 @@
delete this.goodsAllData.specs_group;
}
// stock 库存需要转为 int
// console.log(531,this.goodsAllData)
// return
// 商品id 不为 0 是修改
if( this.goodsAllData.goods_id ) {
// 商品id 为 0 是新增
......@@ -569,7 +563,6 @@
goodsStatus = 3;
}
updateGoodsNew(this.goodsAllData).then(res=> {
//this.goodsLoading = false;
if( res.code === 1 ) {
this.$message({type: 'success', message:'编辑成功'});
this.initAllGoodsInfo();
......@@ -579,6 +572,7 @@
});
}
if(res.code === 0) {
this.$refs.goodsparameter.priceReduce()
let msg = res.message ? res.message : '编辑失败'
this.$message({type: 'error', message: msg});
}
......@@ -592,7 +586,6 @@
goodsStatus = 3;
}
addGoods( this.goodsAllData ).then( res=> {
// this.goodsLoading = false;
if( res.code === 1 ) {
this.$message({type: 'success', message:'新增成功'});
this.initAllGoodsInfo();
......@@ -602,6 +595,8 @@
});
}
if(res.code === 0) {
// 如果保存失败,将价格还原
this.$refs.goodsparameter.priceReduce()
let msg = res.message ? res.message : '新增失败'
this.$message({type: 'error', message: msg});
}
......@@ -610,7 +605,6 @@
},
/*-----------------------*/
// 初始化 商品所有数据
initAllGoodsInfo() {
// 初始化 商品信息 数据
......@@ -699,9 +693,6 @@
}
}, timer.times)
},
} // methods end
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论