Commit 62cb9e7d by lixiaomin

修改商铺

parent 0c2339ca
......@@ -121,3 +121,21 @@ export function offGoods(data) {
data: data
});
}
// 查询商品排序列表
export function turnList(query) {
return request({
url: "/system/shop/turn",
method: "get",
params: query,
});
}
// 查询推荐、特惠排序列表
export function turnRecommendList(query) {
return request({
url: "/system/recommend/turn",
method: "get",
params: query,
});
}
......@@ -73,6 +73,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- <OrderDetial ref="orderDetial"></OrderDetial> -->
<!-- 详情对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleClick">
......@@ -190,16 +191,18 @@
<el-button v-show="refundTag" type="danger" @click="refundSubmit">退款</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</el-dialog>
</div>
</template>
<script>
import { listOrder, getOrder,getLogList,refund } from "@/api/system/order";
import { listShop} from "@/api/system/shop";
import OrderDetial from '@/components/order/orderDetial.vue';
import piovince from '@/utils/piovince';
export default {
name: "Order",
components: { OrderDetial},
data() {
var validateRefundAmount = (rule, value, callback) => {
var regular=/(^[+]{0,1}([0-9]+)$)|(^[+]{0,1}([0-9]+)[\.]{1}[0-9]{1,2}$)/; //正数 ,小数可有可无,最多2位
......@@ -443,6 +446,7 @@ export default {
},
/** 详情按钮操作 */
handleUpdate(row) {
//this.$refs.orderDetial.handleUpdate(row);
this.refundTag=false;
this.goodsList=[];
this.orderId= row.id;
......
......@@ -14,8 +14,20 @@
<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="salesVolume" />
<el-table-column label="推荐时间" align="center" prop="recDate" />
<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="turnClick(scope.row,'1')"></el-button>
</div>
<div>
<el-button v-show="scope.$index+1!=total" size="mini" round icon="el-icon-arrow-down" @click="turnClick(scope.row,'2')"></el-button>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
......@@ -32,7 +44,7 @@
</template>
<script>
import { recommendList, removeRecommend } from '@/api/system/shop'
import { recommendList, removeRecommend ,turnRecommendList} from '@/api/system/shop'
export default {
props: ['shopId'],
data() {
......@@ -56,6 +68,13 @@ export default {
//this.getList()
},
methods: {
turnClick(row,tag){
turnRecommendList({"shopId":this.shopId,"goodsId": row.id,"pointer":tag,"type": 2}).then((response) => {
if(response.code=="200"){
this.getList();
}
});
},
getList() {
this.loading = true;
recommendList({ ...this.queryParams, shopId: this.shopId, type: 2 }).then(response => {
......
......@@ -17,7 +17,7 @@
<el-form-item label="简述" prop="desc">
<el-input v-model="form.desc" placeholder="请输入店铺地址" />
</el-form-item>
<el-form-item label="推荐图" prop="remarks">
<el-form-item label="推荐图" prop="pic">
<ImageUpload :value="form.pic" v-model="form.pic" :limit="1" />
</el-form-item>
</el-form>
......@@ -34,17 +34,21 @@ export default {
props: ['shopId'],
data() {
return {
form: {},
form: {
name:"",
desc:"",
pic:""
},
open: false,
rules: {
name: [
{ required: true, message: "不能为空", trigger: "change" },
{ required: true, message: "不能为空", trigger: "blur" },
],
desc: [
{ required: true, message: "不能为空", trigger: "change" },
{ required: true, message: "不能为空", trigger: "blur" },
],
pic: [
{ required: true, message: "不能为空", trigger: "change" },
{ required: true, message: "不能为空", trigger: "blur" },
],
},
......@@ -56,8 +60,12 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
addRecommend(this.form).then((res) => {
this.$modal.msgSuccess("推荐成功");
this.open = false;
if(res.code=="200"){
this.$emit("getList");
this.$modal.msgSuccess("推荐成功");
this.open = false;
}
});
}
});
......@@ -73,14 +81,16 @@ export default {
this.resetForm("form");
},
openModal(data) {
this.form.name=null;
this.form.desc=null;
this.form.pic=null;
this.form.goodsName = data.name
this.form.price = data.price
this.form.discount = data.discount
this.form.shopId = this.shopId
this.form.goodsId = data.id
this.form.type = 1
this.open = true
this.open = true
}
}
......
<template>
<div>
<SelectGoods ref="selectGoods" @callback="selectGoos" />
<AddRecommend :shopId="shopId" ref="addRecommend" />
<AddRecommend :shopId="shopId" ref="addRecommend" @getList="getList"/>
<Preferential :shopId="shopId" ref="preferential" />
<el-row :gutter="10" class="mb8">
......@@ -51,8 +51,18 @@
<span v-if="scope.row.state == 2">告罄</span>
</template>
</el-table-column>
<el-table-column label="排序" align="center">
</el-table-column>
<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="turnClick(scope.row,'1')"></el-button>
</div>
<div>
<el-button v-show="scope.$index+1!=total" size="mini" round icon="el-icon-arrow-down" @click="turnClick(scope.row,'2')"></el-button>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" @click="addRecommend(scope.row)" type="text">
......@@ -68,7 +78,7 @@
</template>
<script>
import { getCategoryGoods, addGoods ,offGoods} from "@/api/system/shop";
import { getCategoryGoods, addGoods ,offGoods,turnList} from "@/api/system/shop";
import SelectGoods from '@/components/SelectGoods';
import AddRecommend from './addRecommend.vue'
import Preferential from './preferential.vue';
......@@ -90,13 +100,21 @@ export default {
list: [],
options: [],
btnId: '',
outIds: ''
outIds: '',
total: null
}
},
mounted() {
//this.getList()
},
methods: {
turnClick(row,tag){
turnList({"shopId":this.shopId,"goodsId": row.id,"pointer":tag}).then((response) => {
if(response.code=="200"){
this.getList();
}
});
},
getPicsList(str){
let picObj = JSON.parse(str);
return picObj.thumbnail
......@@ -115,17 +133,29 @@ export default {
},
setData(data) {
this.list = data.goodsList;
this.btnId = data.id
this.btnId = data.id;
this.total=this.list.length;
},
getList() {
if (!this.shopId) return;
this.list=[];
getCategoryGoods(this.shopId).then(({ data }) => {
getCategoryGoods(this.shopId).then(({ data }) => {
if (data && data.length > 0) {
this.options = data;
this.list = data[0].goodsList;
this.btnId = data[0].id
}
this.options = data;
if(this.btnId==''){
this.list = data[0].goodsList;
this.btnId = data[0].id;
}else{
for(let i=0;i<data.length;i++){
if(this.btnId==data[i].id){
this.list = data[i].goodsList;
}
}
}
this.total=this.list.length;
}else{
this.options=[];
}
})
},
// 多选框选中数据
......@@ -133,7 +163,8 @@ export default {
this.outIds = selection.map((item) => item.id);
},
soldOutGoos(){
if(!this.outIds){
console.log("this.outIds",this.outIds)
if(this.outIds.length==0){
this.$message.error('请选择所需下架的商品!');
return;
}
......
......@@ -14,8 +14,20 @@
<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="salesVolume" />
<el-table-column label="推荐时间" align="center" prop="recDate" />
<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="turnClick(scope.row,'1')"></el-button>
</div>
<div>
<el-button v-show="scope.$index+1!=total" size="mini" round icon="el-icon-arrow-down" @click="turnClick(scope.row,'2')"></el-button>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
......@@ -32,7 +44,7 @@
</template>
<script>
import { recommendList, removeRecommend } from '@/api/system/shop'
import { recommendList, removeRecommend,turnRecommendList } from '@/api/system/shop'
export default {
props: ['shopId'],
data() {
......@@ -56,6 +68,13 @@ export default {
//this.getList()
},
methods: {
turnClick(row,tag){
turnRecommendList({"shopId":this.shopId,"goodsId": row.id,"pointer":tag,"type": 1}).then((response) => {
if(response.code=="200"){
this.getList();
}
});
},
getPicsList(str){
let picObj = JSON.parse(str);
return picObj.thumbnail
......
......@@ -43,6 +43,7 @@ export default {
this.$refs.Machine.getList()
}
if (value == 'third') {
this.$refs.Commodity.btnId='';
this.$refs.Commodity.getList()
}
if (value == 'fourth') {
......
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