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

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

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