Commit 9f5ba20f by lixiaomin

修改页面

parent e00b0a87
......@@ -36,7 +36,18 @@
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="商品数量" align="center" prop="goodsCount" />
<el-table-column label="排序"/>
<el-table-column label="排序">
<template slot-scope="scope">
<div style="display: flex;">
<div>
<el-button v-show="scope.$index!=0" size="mini" round icon="el-icon-arrow-up" @click="upClick(scope.row,'up')"></el-button>
</div>
<div>
<el-button v-show="scope.$index+1!=total" size="mini" round icon="el-icon-arrow-down" @click="downClick(scope.row,'down')"></el-button>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="state">
<template slot-scope="scope">
<span v-if="scope.row.state == 1">启用</span>
......@@ -137,6 +148,14 @@ export default {
this.getList();
},
methods: {
downClick(row,tag){
},
upClick(row,tag){
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -161,7 +161,7 @@ export default {
}
};
var validateDiscount = (rule, value, callback) => {
var regular=/(^[+]{0,1}([1-9]+)$)|(^[+]{0,1}([1-9]+)[\.]{1}[0-9]{1,2}$)/; //正数(保留2位小数)
var regular=/(^[+]{0,1}([0-9]+)$)|(^[+]{0,1}([0-9]+)[\.]{1}[0-9]{1,2}$)/; //正数(保留2位小数)
if (value == undefined || value === '') {
callback(new Error('不能为空'));
}else if(!regular.test(value)){
......@@ -178,7 +178,7 @@ export default {
};
var validatePrice = (rule, value, callback) => {
//let regular = /(^[+]{0,1}([1-9]+)$)|(^[+]{0,1}(\d+\.\d{1,2})$)/ //正数(保留2位小数)
var regular=/(^[+]{0,1}([1-9]+)$)|(^[+]{0,1}([1-9]+)[\.]{1}[0-9]{1,2}$)/; //正数 ,小数可有可无,最多2位
var regular=/(^[+]{0,1}([0-9]+)$)|(^[+]{0,1}([0-9]+)[\.]{1}[0-9]{1,2}$)/; //正数 ,小数可有可无,最多2位
if (value == undefined || value === '') {
callback(new Error('不能为空'));
}else if(!regular.test(value)){
......@@ -270,19 +270,9 @@ export default {
this.form = {
pics: {},
id: null,
spuName: null,
productionTime: null,
discountPrice: null,
originalPrice: null,
label: null,
desc: null,
remark: null,
createTime: null,
updateTime: null,
createUserId: null,
updateUserId: null,
shelfTime: null,
status: "1",
remark: null
};
this.resetForm("form");
},
......
......@@ -52,7 +52,7 @@
<el-table-column label="售价" align="center" prop="price" />
<el-table-column label="总销量" align="center" prop="salesVolume" width="150" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="150" />
<el-table-column label="上架时间" align="center" prop="shelfat" width="150" />
<el-table-column label="上架时间" align="center" prop="shelfAt" width="150" />
<el-table-column label="状态" align="center" prop="state" width="150">
<template slot-scope="scope">
<span v-if="scope.row.state == 1">已创建</span>
......@@ -64,9 +64,8 @@
</el-table-column>
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:category:edit']">修改</el-button> -->
<el-button size="mini" type="text" @click="handleUpdateState(scope.row)"
v-if="authBtn(['1'], scope.row.state)" >已完成编程</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-if="authBtn(['1', '2', '3', '4'], scope.row.state)">删除</el-button>
<el-button size="mini" type="text" v-if="authBtn(['2', '4'], scope.row.state)"
......@@ -186,6 +185,14 @@ export default {
handleUpdate(row) {
this.$refs.Form.handleUpdate(row.id);
},
handleUpdateState(row){
updateSpu({id:row.id,state:'2'}).then((response) => {
if(response.code=="200"){
this.$modal.msgSuccess("已完成编程成功!");
this.getList();
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
......
......@@ -2,10 +2,20 @@
<div>
<el-table v-loading="loading" :data="orderList">
<el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="缩略图" align="center" prop="" width="150">
<template slot-scope="scope">
<div class="image-tmp">
<el-image style="width: 100px; height: 100px" :src="getPicsList(scope.row.pics)" :preview-src-list="getPicsBigList(scope.row.pics)">
<div slot="error" class="image-slot"></div>
</el-image>
</div>
</template>
</el-table-column>
<el-table-column label="商品分类" align="center" prop="categoryName" width="100" />
<el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="原价" align="center" prop="price" />
<el-table-column label="销售总量" align="center" prop="salesVolume" />
<el-table-column label="推荐时间" align="center" prop="recDate" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
......@@ -46,6 +56,16 @@ export default {
//this.getList()
},
methods: {
getPicsList(str){
let picObj = JSON.parse(str);
return picObj.thumbnail
},
getPicsBigList(str){
let list=[];
let picObj = JSON.parse(str);
list.push(picObj.thumbnail)
return list;
},
getList() {
this.loading = true;
recommendList({ ...this.queryParams, shopId: this.shopId, type: 1 }).then(response => {
......
......@@ -77,8 +77,10 @@
<el-button size="mini" type="text" v-if="authBtn(['1'], scope.row.state)"
@click="setShopState(scope.row, 2, 'setState')">
暂停营业</el-button>
<el-button size="mini" type="text" v-if="authBtn(['2', '3'], scope.row.state)"
<el-button size="mini" type="text" v-if="authBtn(['2'], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')">开始营业</el-button>
<el-button size="mini" type="text" v-if="authBtn(['3'], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')">恢复营业</el-button>
<el-button v-show="scope.row.isDefault=='0'" size="mini" type="text" @click="setShopState(scope.row)">设为默认</el-button>
</template>
</el-table-column>
......@@ -229,7 +231,10 @@ export default {
params.isDefault = 1
}
updateShop(params).then(res => {
this.getList()
if(res.code="200"){
this.getList();
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment