提交 0226dc4c 编写于 作者: chendeli's avatar chendeli

接口调试

上级 e3e42d99
......@@ -69,7 +69,7 @@
<i class="el-icon-delete"></i>
</div>
</div>
<img class="bg-img" src="../../assets/image/small.png" />
<img class="bg-img" src="../../assets/image/small.png" v-if="fileGoodsList.length <10"/>
<div class="limit-text">
<p>限制大小: 200kb</p>
<p>建议尺寸:750*420</p>
......@@ -781,6 +781,9 @@
},
beforeUploadPic(file) {
if(this.fileGoodsList.length > 10){
return ;
}
let vm = this;
let picTypes = ['image/jpeg','image/png']
......
......@@ -51,39 +51,57 @@
fixed
width="55">
</el-table-column>
<el-table-column prop="id" label="商品ID" width="120" align="center"></el-table-column>
<el-table-column prop="name" label="商品名称" min-width="140" align="center"></el-table-column>
<el-table-column prop="goodsId" label="商品ID" width="120" align="center">
</el-table-column>
<el-table-column prop="goodsName" label="商品名称" width="140" align="center"></el-table-column>
<el-table-column prop="type" label="商品类型" width="100" align="center">
<template slot-scope="scope">
<span>{{ scope.row.type | dynamicFlagStatus }}</span>
<span>{{ scope.row.goodsType | rangeType }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="商品状态" width="100" align="center">
<template slot-scope="scope">
<span>{{ scope.row.status | rangeStatus }}</span>
<span>{{ scope.row.goodsStatus | rangeStatus }}</span>
</template>
</el-table-column>
<el-table-column prop="num" label="销量" width="120" align="center">
111
</el-table-column>
<el-table-column prop="num" label="规格" width="120" align="center">
111
<el-table-column prop="quantityOfSale" label="销量" width="120" align="center">
</el-table-column>
<el-table-column prop="num" label="价格" width="120" align="center">
111
<el-table-column prop="size" label="规格" width="100" align="center">
</el-table-column>
<el-table-column prop="createdTime" label="发布时间" width="150" align="center">
<el-table-column prop="costPrice" label="价格" width="120" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createdTime | liveDateFilter }}</span>
<span>{{scope.row.costPrice | rangePrice}}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="370" align="center" fixed="right">
<el-table-column prop="createTime" label="发布时间" width="150" align="center">
</el-table-column>
<el-table-column label="操作" width="200" align="center" fixed="right">
<template slot-scope="scope">
<div>
<div v-if="scope.row.goodsStatus == 0">
<el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="shelfOpt(scope.row,2)" type="text" size="small">上架销售</el-button>
<!-- <el-button @click="shelfOpt(scope.row,3)" type="text" size="small">删除</el-button> -->
</div>
<div v-if="scope.row.goodsStatus == 1">
<el-button @click="shelfOpt(scope.row,1)" type="text" size="small">下架</el-button>
</div>
<div v-if="scope.row.goodsStatus == 2">
<!-- <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button> -->
<el-button @click="shelfOpt(scope.row,2)" type="text" size="small">上架销售</el-button>
<!-- <el-button @click="shelfOpt(scope.row,3)" type="text" size="small">删除</el-button> -->
</div>
<div v-if="scope.row.goodsStatus == 3">
<!-- <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="shelfOpt(scope.row,1)" type="text" size="small">下架</el-button>
<el-button @click="shelfOpt(scope.row,2)" type="text" size="small">上架销售</el-button>
<el-button @click="shelfOpt(scope.row,3)" type="text" size="small">删除</el-button>
<el-button @click="shelfOpt(scope.row,3)" type="text" size="small">删除</el-button> -->
</div>
</template>
</el-table-column>
......@@ -145,6 +163,22 @@
import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus} from "../../utils/yqrange/yqrangeApi";
import { getGoodsList,batchOnOff} from '@/utils/goods';
var typeList = [{
categoryName: "短信额度",
id: 1,
}, {
categoryName: "学习卡",
id: 2,
}, {
categoryName: "职称考卡",
id: 3,
},{
categoryName: "医疗器械",
id: 4,
},{
categoryName: "药品",
id: 5,
}]
export default {
components: {
BreadCrumb
......@@ -158,7 +192,7 @@
searchForm: {
goodsIdList:[],
goodsName :'',
goodsType :0,
goodsType :'',
pageNo:1,
pageSize: 10,
......@@ -173,26 +207,45 @@
},
fileList:[],
totalRows: 0,
tableData: [
{}
],
tableData: [],
goodsTypes:[],
typeList: [{
label: '药品',
value: '1',
}, {
label: '药品器械',
value: '2',
}, {
label: '其他',
value: '3',
}]
typeList: []
}
},
created() {
this.getLists()
this.getLever()
},
filters:{
rangeType(type){
let name = ''
for(let i=0;i<typeList.length;i++){
if(type == typeList[i].id){
name = typeList[i].categoryName;
break;
}
}
return name
},
rangeStatus(status){
let str = ''//0待上架,1已上架,2已下架,3定时上架
if(status == 1){
str = '已上架'
}else if(status == 0){
str = '待上架'
}else if(status == 2){
str = '已下架'
}else if(status == 3){
str = '定时上架'
}
return str
},
rangePrice(price){
let str = '¥'
str += price/100
return str
}
},
methods: {
handlePreview(){},
handleRemove(){},
......@@ -209,10 +262,34 @@
});
},
getLists(){
openLoading(this);
getGoodsList(this.searchForm).then((res)=>{
if(res.code != '000000'){
return this.$message({
message: res.message,
type: 'error'
});
}
closeLoading(this);
if(res.data == null){
return this.$message({
message: '分页数据加载失败',
type: 'error'
});
}
this.tableData = res.data.goodsList
this.totalRows = res.data.totalCount
})
},
//获取商品id
getIdsByArr(d){
let a = []
for(let i=0;i<d.length;i++){
a.push(d[i].goodsId)
}
return a;
},
//批量 上下架操作
batchOpt(type){
if(type == 3){//批量导入
......@@ -225,7 +302,7 @@
});
}
this.batchParm.onOff = type
this.batchParm.batchUpdateSaleStatusReq.goodsIdList =[1] || this.selectList
this.batchParm.batchUpdateSaleStatusReq.goodsIdList = this.getIdsByArr(this.selectList)
batchOnOff(this.batchParm).then((res)=>{
if(res.code == '000000'){
this.selectList = []
......@@ -255,9 +332,11 @@
if(type == 1){
str = `确定下架商品吗?<br/>下架后将不再出售`
btn1 = '下架'
}else if(type == 2){
str = `确定上架商品吗?<br/>上架后将开始出售`
btn1 = '上架'
}else if(type == 3){
str = `确定删除商品吗?<br/>删除后商品信息将都不保留`
btn1 = '删除'
......@@ -271,6 +350,17 @@
}).then(() => {
// confirm
// this.updateStatus(row.id, "30");
if(type != 3){
this.batchParm.onOff = type == 1 ? 'off' : 'on'
this.batchParm.batchUpdateSaleStatusReq.goodsIdList = [row.goodsId]
batchOnOff(this.batchParm).then((res)=>{
if(res.code == '000000'){
this.getLists()
}
})
}
}).catch(() => {
// cancel
// this.$message.error("上线失败");
......@@ -331,7 +421,7 @@
},
handleNumChange(val) {
this.searchForm.pageNo = val;
this.searchList();
this.getLists();
},
},
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册