提交 5f3e90ea authored 作者: huaxinzhu's avatar huaxinzhu

商品,bug修复04

上级 bd48310b
...@@ -27,13 +27,6 @@ export function NewGetCategory(query) { ...@@ -27,13 +27,6 @@ export function NewGetCategory(query) {
}) })
} }
// 查询运费模板 // 查询运费模板
// export function GetFreight(query) {
// return request({
// url: '/system/goods/getFreight',
// method: 'get',
// params: query
// })
// }
export function GetFreight(query) { export function GetFreight(query) {
return request({ return request({
url: '/system/freightNew/getFreight', url: '/system/freightNew/getFreight',
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-form-item label="邮费模板:" prop="freight_id"> <el-form-item label="邮费模板:" prop="freight_id">
<el-select v-model="goodsAfterSaleForm.freight_id" placeholder="请选择邮费模板" style="width:400px;"> <el-select v-model="goodsAfterSaleForm.freight_id" placeholder="请选择邮费模板" style="width:400px;">
<el-option v-for="item in freightOptions" :key="item.Id" :label="item.Name" :value="item.Id"></el-option> <el-option v-for="item in freightOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <div style="width: 100%;height: 1000px;">我很高</div>-->
</el-form> </el-form>
</div> </div>
</template> </template>
...@@ -92,7 +90,6 @@ ...@@ -92,7 +90,6 @@
}, },
// 运费模板 // 运费模板
getFreightData() { getFreightData() {
// let query = { page: 1, limit: 50 };
GetFreight().then(res => { GetFreight().then(res => {
if(res.data) { if(res.data) {
this.freightOptions = res.data; this.freightOptions = res.data;
......
...@@ -80,8 +80,13 @@ ...@@ -80,8 +80,13 @@
}, },
components: {}, components: {},
mounted() { mounted() {
this.goodsDeForm = this.imgdata; this.$refs.myTextEditor.quill.enable(false);
//console.log("详情:",this.imgdata); setTimeout(() => {
this.$refs.myTextEditor.quill.enable(true) //两秒后点击可获取焦点
}, 1000)
if( this.imgdata ) {
this.goodsDeForm = this.imgdata;
}
}, },
watch: {}, watch: {},
methods: { methods: {
......
...@@ -92,19 +92,19 @@ ...@@ -92,19 +92,19 @@
</el-form> </el-form>
<!-- 修改 商品分类目录 --> <!-- 修改 商品分类目录 -->
<!-- <el-cascader-panel v-model="SSQList" :props='props' @change="SSQChange" ref="ssqCascader"></el-cascader-panel>-->
<el-dialog <el-dialog
v-loading="loadingSSQ" v-loading="loadingSSQ"
class="add-workorder-dialog" class="add-workorder-dialog"
title="修改商品分类" title="修改商品分类"
:visible.sync="editGoodsTypeDialog" :visible.sync="editGoodsTypeDialog"
:destroy-on-close="true"
:before-close="cancelType" :before-close="cancelType"
width="60%" width="60%"
append-to-body
center center
> >
<!-- <p>当前所选类目:<span></span></p>--> <!-- <p>当前所选类目:<span></span></p>-->
<el-cascader-panel v-show="editGoodsTypeDialog" v-model="SSQGoodsList" :props='goodsprops' @change="SSQGoodsChange" ref="ssqGoodsCascader"></el-cascader-panel> <!-- <el-cascader-panel v-show="editGoodsTypeDialog" v-model="SSQGoodsList" :props='goodsprops' @change="SSQGoodsChange" ref="ssqGoodsCascader"></el-cascader-panel>-->
<el-cascader-panel v-show="editGoodsTypeDialog" v-model="SSQGoodsList" :props='goodsprops' :options="fuckoptions" @change="SSQGoodsChange" ref="ssqGoodsCascader"></el-cascader-panel>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="cancelType" size="mini">取 消</el-button> <el-button @click="cancelType" size="mini">取 消</el-button>
<el-button type="primary" @click="saveType" size="mini">确 定</el-button> <el-button type="primary" @click="saveType" size="mini">确 定</el-button>
...@@ -197,18 +197,37 @@ ...@@ -197,18 +197,37 @@
SSQGoodsList: [], // 省市区 子组件goods的 SSQGoodsList: [], // 省市区 子组件goods的
goodsprops: { goodsprops: {
expandTrigger: 'click', expandTrigger: 'click',
lazy: true, // lazy: true,
lazyLoad: this.lazyLoad, // lazyLoad: this.lazyLoad,
value: "id", value: "id",
label: 'label', label: 'label',
leaf: 'leaf' // leaf: 'leaf',
children: 'children',
// checkStrictly: true
}, },
fuckoptions: [],
} // return end } // return end
}, },
components: {}, components: {},
watch: {}, watch: {
created() {}, // selectCity(arr){
// //处理回显问题
// setTimeout(()=>{
// this.$refs.ssqGoodsCascader.presentText = arr[0] +"/" + arr[1];// 首次手动复制
// },1000)
// }
},
created() {
// 获取 省
this.getArea();
// 获取 商品品牌
this.getBrands();
this.getSSQArea();
// fuckoptions
},
mounted() { mounted() {
//深拷贝一份最开始的数据,为初始化准备 //深拷贝一份最开始的数据,为初始化准备
//this.goodsInfoDataClone = this.deepClone(this.goodsinfodata); //this.goodsInfoDataClone = this.deepClone(this.goodsinfodata);
...@@ -225,10 +244,6 @@ ...@@ -225,10 +244,6 @@
this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr; this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr;
this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList; this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList;
} }
// 获取 省
this.getArea();
// 获取 商品品牌
this.getBrands();
}, },
methods: { methods: {
// 数据初始化 // 数据初始化
...@@ -252,11 +267,26 @@ ...@@ -252,11 +267,26 @@
// 获取 商品品牌 // 获取 商品品牌
getBrands() { getBrands() {
getBrandsInf().then( res => { getBrandsInf().then( res => {
// debugger
// console.log(297,this.goodsInfoForm.goods_brand);
if(res.data) { if(res.data) {
this.brandOptions = res.data.data; this.brandOptions = res.data.data;
}else { }else {
this.brandOptions = []; this.brandOptions = [];
} }
//
//console.log(308,this.goodsInfoForm.goods_brand);
let num_goods_brand = Number(this.goodsInfoForm.goods_brand);
//debugger
if( this.goodsInfoForm.goods_brand !== '') {
let result = this.brandOptions.find( item => {
return item.id === num_goods_brand;
});
//console.log(315,result)
if( result == undefined) {
this.goodsInfoForm.goods_brand = '';
}
}
}); });
}, },
/* 修改 商品分类 类目 */ /* 修改 商品分类 类目 */
...@@ -264,27 +294,30 @@ ...@@ -264,27 +294,30 @@
this.SSQGoodsList = []; this.SSQGoodsList = [];
this.editGoodsTypeDialog = true; this.editGoodsTypeDialog = true;
this.SSQGoodsList = this.goodsInfoForm.categoryList this.SSQGoodsList = this.goodsInfoForm.categoryList
//this.options = this.goodsInfoForm.categoryList
// this.options = [{
// id: 175,
// lable: '电脑附件',
// children: [{
// id: 192,
// lable: '各种线缆',
// children: [{
// id: 304,
// lable: '音视频线',
// children: []
// }]
// }]
// }];
console.log('点击修改类目数据:',this.SSQGoodsList); console.log('点击修改类目数据:',this.SSQGoodsList);
}, },
lazyLoad(node, resolve) { // lazyLoad(node, resolve) {
//debugger // // debugger
this.getSSQArea(node, resolve); // this.getSSQArea(node, resolve);
}, // },
getSSQArea(node, resolve) { getSSQArea(node, resolve) {
const level = node.level; let limboNode = {id: 0};
let limboNode = {};
if(level === 0) {
limboNode = {id: 0}
}
if(level === 1) {
limboNode = { id: node.value };
}
if(level === 2) {
limboNode = { id: node.value };
}
//this.loading = true;
NewGetCategory(limboNode).then(res => { NewGetCategory(limboNode).then(res => {
this.fuckoptions = res.data;
let result = {}; let result = {};
//debugger //debugger
if (level === 0) { if (level === 0) {
...@@ -297,41 +330,51 @@ ...@@ -297,41 +330,51 @@
}) })
} }
if (level === 1) { // if (level === 1) {
for(let i = 0; i < res.data.length; i++) { // for(let i = 0; i < res.data.length; i++) {
if( limboNode.id === res.data[i].id ) { // if( limboNode.id === res.data[i].id ) {
result = res.data[i].children; // result = res.data[i].children;
break; // break;
} // }
} // }
result.forEach(item => { // result.forEach(item => {
item.value = item.id; // item.value = item.id;
item.label = item.label // item.label = item.label
item.children=[]; // item.children=[];
//这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上 // //这句代码表示当点击最后一级的时候 label后面不会转圈圈 并把相关值赋值到选择器上
item.leaf = 0 // item.leaf = 0
}) // })
} // }
//
if (level === 2) { // if (level === 2) {
for(let i = 0; i < res.data.length; i++) { // for(let i = 0; i < res.data.length; i++) {
if( res.data[i].children.length > 0) { // if( res.data[i].children.length > 0) {
for(let j = 0; j < res.data[i].children.length; j++) { // for(let j = 0; j < res.data[i].children.length; j++) {
if( limboNode.id === res.data[i].children[j].id ) { // if( limboNode.id === res.data[i].children[j].id ) {
result = res.data[i].children[j].children; // result = res.data[i].children[j].children;
break; // break;
} // }
} // }
} // }
} // }
// result.forEach(item => {
result.forEach(item => { // item.value = item.id;
item.value = item.id; // item.label = item.label;
item.label = item.label // //item.children = [];
item.leaf = 1; // item.leaf = 0;
}) // })
} // }
//
// if( level === 3 ) {
// result = [{
// id: 34444,
// label: '测试',
// leaf: 1
// }]
//
// }
//
// console.log(357,result);
resolve(result) resolve(result)
//this.loading = false; //this.loading = false;
}); });
...@@ -507,4 +550,8 @@ ...@@ -507,4 +550,8 @@
/deep/.el-form-item { /deep/.el-form-item {
margin-bottom: 20px; margin-bottom: 20px;
} }
/deep/.el-cascader-menu {
height:600px;
}
</style> </style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-card> </el-card>
<!-- 选择商品类目 end --> <!-- 选择商品类目 end -->
<!-- 添加商品 start --> <!-- 添加商品 start -->
<el-card class="box-card good-details-body" v-if="isShowGoodsDetails"> <el-card class="box-card good-details-body" v-if="isShowGoodsDetails" v-loading="goodsLoading">
<div class="floor-nav" id="floorNavList"> <div class="floor-nav" id="floorNavList">
<ul class="nav-list"> <ul class="nav-list">
<li class="nav-list-item" :class="{'floor-item-active': isFIActive === index}" v-for="(item, index) in floorNav" :key="item.id" @click="setFloorNavMountClick(index)">{{ item.name }}</li> <li class="nav-list-item" :class="{'floor-item-active': isFIActive === index}" v-for="(item, index) in floorNav" :key="item.id" @click="setFloorNavMountClick(index)">{{ item.name }}</li>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
}, },
data() { data() {
return { return {
loading: false, goodsLoading: false,
SSQList: [], // 省市区 SSQList: [], // 省市区
SSQStr: '', // 省市区 拼接 SSQStr: '', // 省市区 拼接
props: { props: {
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
submit: 0, submit: 0,
}, // 商品所有数据 }, // 商品所有数据
TIMER: null, TIMER: null,
hehe: 0,
} // return end } // return end
}, },
...@@ -175,7 +176,7 @@ ...@@ -175,7 +176,7 @@
producing_area: Number(res.data.producing_area), // 产地 producing_area: Number(res.data.producing_area), // 产地
deliver_area: Number(res.data.deliver_area), // 发货地 deliver_area: Number(res.data.deliver_area), // 发货地
unit: res.data.unit, // 单位 unit: res.data.unit, // 单位
goods_brand: res.data.goods_brand, // 品牌 goods_brand: Number(res.data.goods_brand), // 品牌
web_url: res.data.web_url, // 外部链接 web_url: res.data.web_url, // 外部链接
out_goods_id: res.data.out_goods_id, // 商品编码 out_goods_id: res.data.out_goods_id, // 商品编码
imgs: res.data.imgs // 商品图片 imgs: res.data.imgs // 商品图片
...@@ -184,10 +185,12 @@ ...@@ -184,10 +185,12 @@
// 产地 和 发货地 需要 处理 // 产地 和 发货地 需要 处理
this.goodsinfodata.producing_area = this.goodsinfodata.producing_area === 0 ? '' : this.goodsinfodata.producing_area; this.goodsinfodata.producing_area = this.goodsinfodata.producing_area === 0 ? '' : this.goodsinfodata.producing_area;
this.goodsinfodata.deliver_area = this.goodsinfodata.deliver_area === 0 ? '' : this.goodsinfodata.deliver_area; this.goodsinfodata.deliver_area = this.goodsinfodata.deliver_area === 0 ? '' : this.goodsinfodata.deliver_area;
// 品牌需要 单独处理
// debugger
let arr = []; let arr = [];
arr[0] = res.data.category_first_id; arr[0] = res.data.category_first_id;
arr[0] = res.data.category_second_id; arr[1] = res.data.category_second_id;
arr[0] = res.data.category_three_id; arr[2] = res.data.category_three_id;
this.goodsinfodata.categoryList = arr; this.goodsinfodata.categoryList = arr;
// 商品规格, 售价由规格决定 // 商品规格, 售价由规格决定
...@@ -196,7 +199,6 @@ ...@@ -196,7 +199,6 @@
} }
// 商品售价 // 商品售价
// debugger
if(res.data.specs_group && res.data.specs_group.length > 0) { if(res.data.specs_group && res.data.specs_group.length > 0) {
//this.parameterdata //this.parameterdata
let prePriceArr = []; let prePriceArr = [];
...@@ -260,12 +262,20 @@ ...@@ -260,12 +262,20 @@
} }
} }
}); });
}else {
this.isShowGoodsDetails = false;
} }
}, },
mounted() { mounted() {
// let floor_cont = document.getElementsByClassName('floor-cont')[0];
// let floor_item = document.getElementsByClassName('floor-item')[0].scrollTop;
// console.log(270,floor_cont,floor_item);
// if(this.isShowGoodsDetails) {
// this.$nextTick(()=> {
// console.log(266,this.$refs.scrollview.scrollTop);
// })
// }
}, },
methods: { methods: {
// 规格子组件,传给父组件的数据 // 规格子组件,传给父组件的数据
calcSpeTable(data) { calcSpeTable(data) {
...@@ -379,6 +389,7 @@ ...@@ -379,6 +389,7 @@
// 保存/提交 // 保存/提交
save() { save() {
//this.goodsLoading = true;
//debugger //debugger
// 此处变量 有顺序 校验时,电梯至某处 // 此处变量 有顺序 校验时,电梯至某处
...@@ -516,6 +527,7 @@ ...@@ -516,6 +527,7 @@
// 商品id 不为 0 是修改 // 商品id 不为 0 是修改
if( this.goodsAllData.goods_id ) { if( this.goodsAllData.goods_id ) {
updateGoodsNew(this.goodsAllData).then(res=> { updateGoodsNew(this.goodsAllData).then(res=> {
//this.goodsLoading = false;
if( res.code === 1 ) { if( res.code === 1 ) {
this.$message({type: 'success', message:'编辑成功'}); this.$message({type: 'success', message:'编辑成功'});
this.initAllGoodsInfo(); this.initAllGoodsInfo();
...@@ -529,6 +541,7 @@ ...@@ -529,6 +541,7 @@
}else { }else {
// 商品id 为 0 是新增 // 商品id 为 0 是新增
addGoods( this.goodsAllData ).then( res=> { addGoods( this.goodsAllData ).then( res=> {
// this.goodsLoading = false;
if( res.code === 1 ) { if( res.code === 1 ) {
this.$message({type: 'success', message:'新增成功'}); this.$message({type: 'success', message:'新增成功'});
this.initAllGoodsInfo(); this.initAllGoodsInfo();
...@@ -574,7 +587,7 @@ ...@@ -574,7 +587,7 @@
floor_offsetTop = floor_item[index].offsetTop - floor_item[0].offsetTop, floor_offsetTop = floor_item[index].offsetTop - floor_item[0].offsetTop,
window_scrollTop = _this.$refs.scrollview.scrollTop, window_scrollTop = _this.$refs.scrollview.scrollTop,
// 基本滚动动画配置 // 基本滚动动画配置
timer = { step: 45, times: 20, FLOOR_OFFSETTOP: 0 }; timer = { step: 60, times: 15, FLOOR_OFFSETTOP: 0 };
// floor_cont 可是窗口的 高 // floor_cont 可是窗口的 高
let hxz = 0; let hxz = 0;
......
<template>
<div class="eidt-goods">
<editGood :option="goodsid"></editGood>
</div>
</template>
<script>
import editGood from '@/views/system/goods/add/index'
export default {
name: "EditGoods",
data() {
return {
goodsid: 0,
}
},
components: {
editGood
},
created() {
this.goodsid = Number(this.$route.query.goods_id);
},
mounted() {
},
methods: {
}
}
</script>
<style lang="scss" type="text/stylus" scoped>
.eidt-goods {
height: 100%;
}
.add-workorder-dialog {
height: 100%;
}
/deep/.add-workorder-dialog el-dialog {
height: calc(100% - 15vh);
}
</style>
...@@ -210,9 +210,9 @@ ...@@ -210,9 +210,9 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 商品编辑--> <!-- 商品编辑-->
<el-dialog title="编辑商品" :visible.sync="editisOpen" v-if="editisOpen" width="70%" class="freightTemplate-add"> <!-- <el-dialog title="编辑商品" :visible.sync="editisOpen" v-if="editisOpen" width="70%" class="freightTemplate-add">-->
<editGood :option="goodsid" @closeEditDialog="closeEditGoods"></editGood> <!-- <editGood :option="goodsid" @closeEditDialog="closeEditGoods"></editGood>-->
</el-dialog> <!-- </el-dialog>-->
<el-dialog title="商品详情" :visible.sync="isOpen" center v-if="isOpen" width="70%" class="freightTemplate-add" <el-dialog title="商品详情" :visible.sync="isOpen" center v-if="isOpen" width="70%" class="freightTemplate-add"
:close-on-click-modal="false"> :close-on-click-modal="false">
<goodDetail :goods-id="goodDetails"></goodDetail> <goodDetail :goods-id="goodDetails"></goodDetail>
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
goodDetails: { goodDetails: {
goods_id: '' goods_id: ''
}, },
editisOpen: false,//编辑 // editisOpen: false,//编辑
downsale_count: '',//仓库数量 downsale_count: '',//仓库数量
onsale_count: '',//上架数量 onsale_count: '',//上架数量
del_count: '',//删除数量 del_count: '',//删除数量
...@@ -527,8 +527,17 @@ ...@@ -527,8 +527,17 @@
//cancelOnsale().then(); //cancelOnsale().then();
}, },
editgoods(row) {//商品编辑 editgoods(row) {//商品编辑
this.editisOpen = true // this.editisOpen = true
this.goodsid = Number(row.goods_id); let goodsId = Number(row.goods_id);
// let goodsParam = {
// goods_id: Number(row.goods_id)
// };
this.$router.push({
path: '/system/goods/editgoods',
query: { goods_id : goodsId }
});
//this.$router.push({ path: '/system/goods/editgoods' });
}, },
lookdetail(row) {//预览商品详情 lookdetail(row) {//预览商品详情
this.isOpen = true this.isOpen = true
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</el-form-item> </el-form-item>
<el-form-item label="商品分类:"> <el-form-item label="商品分类:">
<el-cascader <el-cascader
ref="cascaderDom"
v-model="el_value" v-model="el_value"
v-if="el_valuestatus" v-if="el_valuestatus"
@change="elvalueclick" @change="elvalueclick"
...@@ -153,6 +154,7 @@ export default { ...@@ -153,6 +154,7 @@ export default {
} }
this.el_value = [] this.el_value = []
this.$refs.cascaderDom.$refs.panel.activePath = []
this.form.desc = '' this.form.desc = ''
this.info() this.info()
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论