提交 a75507b0 authored 作者: huaxinzhu's avatar huaxinzhu

1、商品,bug修复、优化;

上级 db571502
......@@ -93,7 +93,6 @@ export default {
<style scoped>
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
......
......@@ -40,6 +40,11 @@ export const constantRoutes = [
}
]
},
{
path: '/setpsd',
component: (resolve) => require(['@/views/system/settings/setpsd'], resolve),
hidden: true
},
{
path: '/platformlogin',
component: (resolve) => require(['@/views/platformlogin'], resolve),
......@@ -183,32 +188,32 @@ export const constantRoutes = [
]
},
/* 正式上线需要 注释 */
{
path: '/brand',
component: Layout,
hidden: true,
children: [
{
path: 'fields',
component: (resolve) => require(['@/views/system/shop/brand'], resolve),
name: 'modelFields',
meta: { title: '品牌管理' }
}
]
},
{
path: '/address',
component: Layout,
hidden: true,
children: [
{
path: 'fields',
component: (resolve) => require(['@/views/system/retreat/address'], resolve),
name: 'modelFields',
meta: { title: '售后地址' }
}
]
},
// {
// path: '/brand',
// component: Layout,
// hidden: true,
// children: [
// {
// path: 'fields',
// component: (resolve) => require(['@/views/system/shop/brand'], resolve),
// name: 'modelFields',
// meta: { title: '品牌管理' }
// }
// ]
// },
// {
// path: '/address',
// component: Layout,
// hidden: true,
// children: [
// {
// path: 'fields',
// component: (resolve) => require(['@/views/system/retreat/address'], resolve),
// name: 'modelFields',
// meta: { title: '售后地址' }
// }
// ]
// },
/**/
]
......
......@@ -127,11 +127,11 @@
<el-checkbox v-for="item in tags" :label="item.id" true-label :key="item.id" :disabled="item.isdc" @change="serviceSingleChange(item.id)">{{item.tag}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="详情描述" style="height:600px; margin-bottom: 0;" prop="description">
<el-form-item label="详情描述" style="height:580px; margin-bottom: 0;" prop="description">
<quill-editor ref="myTextEditor" v-model="content" :options="editorOption" @change="onEditorChange" style="height:500px;"></quill-editor>
</el-form-item>
<el-form-item>
<el-button @click="resetGoodsInfForm('ruleForm')">重置</el-button>
<el-form-item style="margin-bottom: 0;">
<el-button @click="resetGoodsInfForm('ruleForm')"> </el-button>
</el-form-item>
</el-form>
</div>
......@@ -392,19 +392,12 @@
}
</script>
<style scoped>
ul,
li {
ul, li {
list-style: none;
/*margin: 0;*/
/*padding: 0;*/
}
/*.ullist {*/
/* border: 1px solid #e7eaec;*/
/* padding: 10px;*/
/* margin-bottom: 10px;*/
/*}*/
.el-input-group {
width: calc(100% - 60px);
}
......
......@@ -108,7 +108,7 @@ export default {
.app-container{
width:100%;
height:100%;
background: #f8f8f8;
background: #f8f8f8;
}
ul,li{
list-style: none;
......
......@@ -176,9 +176,9 @@
<el-input placeholder="" v-model="scope.row.scPrice"></el-input>
</template>
</el-table-column>
<el-table-column prop="moany" label="销售价" align="center">
<el-table-column prop="moany" label="指导价" align="center">
<template slot="header" slot-scope="scope">
<p class="table_p">销售</p>
<p class="table_p">指导</p>
<el-input placeholder="" v-model="price"
><el-button
slot="append"
......@@ -241,7 +241,7 @@
</el-table-column>
</el-table>
<el-button ></el-button>
<el-button style="margin-top: 20px;"></el-button>
</div>
</div>
</div>
......@@ -272,10 +272,10 @@ export default {
shopTypes: [],
newList: [],
newData: [],
tableData7: [],
tableData7: [], // 规格列表表格
goodsNowStock: "",
jsPrice: "", //协议价
price: "", //销售
price: "", //指导
scPrice: "", //市场价
weight: "",
spanArr: [],
......@@ -309,8 +309,8 @@ export default {
watch:{
tableData7:{
handler(val, oldVal){
let arrlist = JSON.stringify(val); //可以将json对象转换成json对符串
let listarr = JSON.parse(arrlist); //可以将json字符串转换成json对象
let arrlist = JSON.stringify(val);
let listarr = JSON.parse(arrlist);
this.processguidelist(listarr);
this.$emit('guideclicks',this.arrtdall,this.shopType)
......@@ -318,18 +318,20 @@ export default {
},
deep:true
},
// 父组件传给 子组件的 值
guidedata(curVal,oldVal){
if(curVal){
if(curVal.goodsSpec){
this.checked = true
this.checked = true;
}else {
this.checked = false;
}
// 规格
this.shopType = curVal.specName;
if(this.shopType) {
if(curVal.specName && curVal.specName.length > 0) {
this.shopType = curVal.specName;
this.shopType.forEach((item, index) => {
this.shopType[index]['specValue'] = []
if(curVal.specValue) {
curVal.specValue.forEach((itemName, nindex) => {
if(itemName.specNameId == item.id){
......@@ -337,13 +339,22 @@ export default {
}
})
}
})
this.clgoodspace(curVal);
//笛卡尔积值
this.tableData7 = curVal.specOption;
}
this.clgoodspace(curVal);
//笛卡尔积值
this.tableData7 = curVal.specOption;
}
},
},
......@@ -392,20 +403,23 @@ export default {
processguidelist(obj) {
let arrtdall = []
obj.forEach((item, index) => {
let objtd = {}
let arrtd = []
for(let key in item){
if(key=='goodsNowStock'||key=='jsPrice'||key=='price'||key=='scPrice'||key=='wlPrice'||key=='pywlPrice'||key=='weight'){
objtd[key] = item[key]
}else{
arrtd.push(item[key])
objtd['specValues'] = arrtd
}
}
arrtdall.push(objtd)
if(obj) {
obj.forEach((item, index) => {
let objtd = {}
let arrtd = []
for(let key in item){
if(key=='goodsNowStock'||key=='jsPrice'||key=='price'||key=='scPrice'||key=='wlPrice'||key=='pywlPrice'||key=='weight'){
objtd[key] = item[key]
}else{
arrtd.push(item[key])
objtd['specValues'] = arrtd
}
}
arrtdall.push(objtd)
});
}
});
this.arrtdall = arrtdall
},
deletearrinput(index) {
......@@ -453,6 +467,7 @@ export default {
this.$set(this.shopType[index].specValue,this.shopType[index].specValue.length,childlist);
this.$forceUpdate()
},
// 添加新规格
addguild() {
let arrchild = {
specName: "",
......@@ -493,14 +508,9 @@ export default {
// let date={
// imgData:this.getBase64Img(image)
// }
// onlodaimg(date).then(res=>{
// })
// };
this.getBase64(file).then((res) => {
var result = res.split(",");
let Base64img = result[1];
......@@ -568,16 +578,19 @@ export default {
this.newData = [];
this.tablearr = [];
this.shopTypes = JSON.parse(JSON.stringify(this.shopType));
for (let i = 0; i < this.shopTypes.length; i++) {
var newlist = [];
for (
let index = 0;
index < this.shopTypes[i].specValue.length;
index++
) {
newlist.push(this.shopTypes[i].specValue[index].value);
if(this.shopTypes && this.shopTypes.length > 0) {
for (let i = 0; i < this.shopTypes.length; i++) {
var newlist = [];
for (
let index = 0;
index < this.shopTypes[i].specValue.length;
index++
) {
newlist.push(this.shopTypes[i].specValue[index].value);
}
this.newData.push(newlist);
}
this.newData.push(newlist);
}
this.getList();
},
......@@ -586,17 +599,13 @@ export default {
this.tableData7 = [];
this.newList = this.descartes(this.newData);
for (let i = 0; i < this.shopTypes.length; i++) {
this.tablearr.push(this.shopTypes[i].specName);
if(this.shopTypes && this.shopTypes.length > 0) {
for (let i = 0; i < this.shopTypes.length; i++) {
this.tablearr.push(this.shopTypes[i].specName);
}
}
for (let index = 0; index < this.newList.length; index++) {
// this.tableData7.push({
// color: this.newList[index][0],
// cailiao: this.newList[index][1],
// chima: this.newList[index][2],
// kucun: "",
// moany: ""
// });
var listobj = {};
for (let i = 0; i < this.shopTypes.length; i++) {
if(this.shopTypes.length>1){
......@@ -609,8 +618,6 @@ export default {
listobj["jsPrice"] = "";
listobj["price"] = "";
listobj["scPrice"] = "";
// listobj["wlPrice"] = "";
// listobj["pywlPrice"] = "";
listobj["weight"] = "";
}
this.tableData7.push(listobj);
......@@ -627,23 +634,26 @@ export default {
this.pos = "";
this.spanArr1 = [];
this.pos1 = "";
for (let s = 0; s < this.shopTypes.length; s++) {
this.spanArrS["spanArr" + s] = [];
for (var i = 0; i < data.length; i++) {
if (i === 0) {
this.spanArrS["spanArr" + s].push(1);
this.posS["pos" + s] = 0;
} else {
// 判断当前元素与上一个元素是否相同
if (
data[i][this.shopTypes[s].specName] ==
data[i - 1][this.shopTypes[s].specName]
) {
this.spanArrS["spanArr" + s][this.posS["pos" + s]] += 1;
this.spanArrS["spanArr" + s].push(0);
} else {
if(this.shopTypes && this.shopTypes.length > 0) {
for (let s = 0; s < this.shopTypes.length; s++) {
this.spanArrS["spanArr" + s] = [];
for (var i = 0; i < data.length; i++) {
if (i === 0) {
this.spanArrS["spanArr" + s].push(1);
this.posS["pos" + s] = i;
this.posS["pos" + s] = 0;
} else {
// 判断当前元素与上一个元素是否相同
if (
data[i][this.shopTypes[s].specName] ==
data[i - 1][this.shopTypes[s].specName]
) {
this.spanArrS["spanArr" + s][this.posS["pos" + s]] += 1;
this.spanArrS["spanArr" + s].push(0);
} else {
this.spanArrS["spanArr" + s].push(1);
this.posS["pos" + s] = i;
}
}
}
}
......@@ -667,17 +677,21 @@ export default {
},
// 合并行数
objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
for (let s = 0; s < this.shopTypes.length; s++) {
if (columnIndex == s) {
const _row = this.spanArrS["spanArr" + s][rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
};
// columnIndex === 1 找到第二列,合并他的列数
if(this.shopTypes && this.shopTypes.length > 0) {
for (let s = 0; s < this.shopTypes.length; s++) {
if (columnIndex == s) {
const _row = this.spanArrS["spanArr" + s][rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
};
// columnIndex === 1 找到第二列,合并他的列数
}
}
}
// columnIndex === 0 找到第一列,实现合并随机出现的行数
// if (columnIndex === 0) {
// const _row = this.spanArr[rowIndex];
......
......@@ -2,10 +2,10 @@
<div class="app-container goods" v-loading="loading">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{title}}</span>
<el-button style="float: right; margin:0 20px;" size="mini" type="info" plain @click="submitForm(0)">保 存 草 稿
<span style="font-size: 18px; float:left;margin-top: 4px;">{{title}}</span>
<el-button style="float: right; margin: 0 10px 0 20px;" size="mini" type="info" plain @click="submitForm(0)">保 存 草 稿
</el-button>
<el-button style="float: right; " size="mini" type="primary" @click="submitForm(1)">提 交 上 架
<el-button style="float: right;" size="mini" type="primary" @click="submitForm(1)">提 交 上 架
</el-button>
</div>
<el-tabs type="border-card">
......@@ -181,13 +181,13 @@
if(this.params.specs && this.params.specs.length > 0) {
for(let i = 0; i < this.params.specs.length; i++) {
if(this.params.specs[i].jsPrice ) {
this.params.specs[i].jsPrice = this.params.specs[i].jsPrice * 100;
this.params.specs[i].jsPrice = parseInt(this.params.specs[i].jsPrice * 100);
}
if(this.params.specs[i].price ) {
this.params.specs[i].price = this.params.specs[i].price * 100;
this.params.specs[i].price = parseInt(this.params.specs[i].price * 100);
}
if(this.params.specs[i].scPrice ) {
this.params.specs[i].scPrice = this.params.specs[i].scPrice * 100;
this.params.specs[i].scPrice = parseInt(this.params.specs[i].scPrice * 100);
}
}
}
......@@ -340,11 +340,7 @@
}
}
</script>
<style scoped>
.el-tabs {
height: calc(100% - 60px);
}
<style scoped lang="scss" type="text/stylus">
ul, li {
list-style: none;
margin: 0;
......@@ -365,30 +361,21 @@
background-color: #5bc0de !important;
color: #fff !important;
border-radius: 0 4px 4px 0;
}
.app-container {
height: 100%;
}
.box-card {
height: 100%;
}
.box-card /deep/ .el-card__body {
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
/deep/.el-card__body {
height: calc(100% - 50px);
overflow: hidden;
}
.el-tabs {
height: calc(100% - 35px);
}
height: 100%;
overflow: hidden;
.el-tabs /deep/ .el-tabs__content {
height: calc(100% - 39px);
overflow-y: scroll;
/deep/.el-tabs__content {
height: calc(100% - 50px);
overflow-y: scroll;
}
}
.eldelbtn {
......
......@@ -2,38 +2,39 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span></span>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleOnsale"
>申请上架
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
</el-row>
<el-form :inline="true" class="queryFormInline">
<el-row :span="24" type="flex" align="middle" justify="space-between">
<el-col :span="18">
<p style="font-size: 18px; float:left;">下架商品列表</p>
</el-col>
<el-col :span="6">
<el-form-item style="float: right">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleOnsale"
>申请上架
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品ID" prop="goods_id">
......@@ -45,16 +46,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> -->
<el-table v-loading="loading" :data="goodsList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="" align="center" width="100" prop="defaultImage">
<el-table-column label="商品主图" align="center" width="100" prop="defaultImage">
<template slot-scope="scope">
<el-image
style="width: 60px; height: 50px"
......@@ -67,8 +66,6 @@
<el-table-column label="协议价" align="center" :formatter="formatePrice" prop="jsPrice"/>
<el-table-column label="物流运费" align="center" :formatter="formatePrice" prop="wlPrice"/>
<el-table-column label="市场售价" align="center" :formatter="formatePrice" prop="scPrice"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -110,9 +107,8 @@
name: "goods",
data() {
return {
fullHeight: '',
// 遮罩层
tableHeight: 500,
fullHeight: 0,
tableHeight: 0,
loading: true,
// 选中数组
ids: [],
......@@ -155,9 +151,9 @@
},
watch: {
fullHeight(val, oldval) {
// console.log(val)
this.tableHeight = val - 150
fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 100;
}
},
methods: {
......@@ -221,9 +217,9 @@
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加goods";
this.$router.push({
path: '/system/goods/add'
});
},
/** 修改按钮操作 */
handleUpdate(row) {
......
......@@ -2,78 +2,62 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-row :gutter="10">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-col :span="4">
<el-form-item label="商品Id" prop="goodsId">
<el-input
size="small"
placeholder="请输入商品Id"
v-model="queryParams.goodsId"
></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="商品名称" prop="goodsName">
<el-input
size="small"
placeholder="请输入商品名称"
v-model="queryParams.goodsName"
></el-input>
</el-form-item>
</el-col>
<el-col :span="1.5">
<el-button
size="mini"
type="primary"
icon="el-icon-search"
class="button-mgtop3"
@click="handleQuery"
>搜索</el-button>
</el-col>
<el-col :span="1.5">
<el-button
size="mini"
icon="el-icon-refresh"
class="button-mgtop3"
@click="resetQuery('queryForm')"
>重置</el-button>
</el-col>
<el-form :model="queryParams" ref="queryForm" :inline="true" class="queryFormInline">
<el-row :span="24" type="flex" align="middle" justify="space-between">
<el-col :span="20">
<el-form-item label="商品Id" prop="goodsId">
<el-input
size="small"
placeholder="请输入商品Id"
v-model="queryParams.goodsId"
></el-input>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-input
size="small"
placeholder="请输入商品名称"
v-model="queryParams.goodsName"
></el-input>
</el-form-item>
<el-form-item>
<el-button
size="mini"
type="primary"
icon="el-icon-search"
@click="handleQuery"
>搜索</el-button>
<el-button
size="mini"
icon="el-icon-refresh"
@click="resetQuery('queryForm')"
>重置</el-button>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item style="float: right">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
<el-button
type="success"
icon=""
size="mini"
@click="handleOffGoods"
>商品下架
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-row>
<el-row :gutter="10">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleOnsale"
>修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="success"
icon=""
size="mini"
@click="handleOffGoods"
>商品下架
</el-button>
</el-col>
</el-row>
</div>
<el-table v-loading="loading" :data="goodsList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="" align="center" width="100" prop="defaultImage">
<el-table-column label="商品主图" align="center" width="100" prop="defaultImage">
<template slot-scope="scope">
<el-image
style="width: 60px; height: 50px"
......@@ -127,8 +111,8 @@
name: "goods",
data() {
return {
fullHeight: '',
tableHeight: null,
fullHeight: 0,
tableHeight: 0,
// 遮罩层
loading: true,
// 选中数组
......@@ -171,11 +155,11 @@
this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
})
},
watch: {
fullHeight(val, oldval) {
this.tableHeight = val - 150
fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 100;
}
},
methods: {
......@@ -196,7 +180,9 @@
}).then(() => {
this.getList();
this.msgSuccess("下架成功");
})
}).catch(() => {
});
},
//格式化价格
formatePrice(row, s, value, i) {
......@@ -323,7 +309,4 @@
.el-table {
height: calc(100% - 120px);
}
/deep/.button-mgtop3 {
margin-top: 3px;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论