Commit 62cb9e7d by lixiaomin

修改商铺

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