Commit 8452a17d authored by zhengke's avatar zhengke

xiugai

parent c8e91451
......@@ -11,7 +11,7 @@ export default {
</script>
<style>
@import "//at.alicdn.com/t/font_1769104_t7ngfhl994d.css";
@import "//at.alicdn.com/t/font_1769104_3piwls5qg15.css";
@import "./assets/css/common.css";
@import "./assets/css/zkcss.css";
html,
......
......@@ -5,7 +5,6 @@
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px" style="width:50%">
<el-form-item label="商品名称" prop="GoodsName" class="is-required" size="small">
<el-input v-model="addMsg.GoodsName" placeholder="请输入商品名称" class="w400"/>
</el-form-item>
......@@ -20,7 +19,6 @@
<el-form-item label="赠送点数" prop="GivePonit" class="is-required" size="small">
<el-input v-model="addMsg.GivePonit" placeholder="请输入赠送点数" class="w400" type="number" :min="0"/>
</el-form-item>
</el-form>
</div>
<div style="margin-top:20px">
......@@ -45,8 +43,6 @@
PonitNum:0,
GivePonit:0,
SellingPrice:0,
},
rules: {
GoodsName: [{
......@@ -85,7 +81,6 @@
Save(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.addMsg.SellingPrice==0){
this.Error('售价大于0')
return false
......@@ -94,8 +89,7 @@
this.Error('点数大于0')
return false
}
this.addMsg.GivePonit = parseInt(this.addMsg.GivePonit);
this.apipost("/api/Point/SetPointGoods", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.CommonJump('pointList');
......@@ -109,23 +103,20 @@
}
});
},
getData(ID) {
this.loading = true;
this.apipost("/api/Point/GetPointGoodsModel", {
ID: ID
}, res => {
this.loading = false;
this.addMsg = res.data.data;
var tempDate = res.data.data;
this.addMsg.ID = tempDate.ID;
this.addMsg.GoodsName = tempDate.GoodsName;
this.addMsg.PonitNum = tempDate.PonitNum;
this.addMsg.GivePonit = tempDate.GivePonit;
this.addMsg.SellingPrice = tempDate.SellingPrice;
})
},
},
mounted() {
}
......
......@@ -6,76 +6,40 @@
<el-button type="primary" class="el-button--small" @click="addRecharge">新增</el-button>
</div>
</div>
<div style="padding: 20px;background: #fff;margin-top: 20px">
<el-table
:data="tableData"
header-cell-class-name="headClass"
style="width: 100%"
border
>
<el-table-column
prop="ID"
label="ID"
width="100">
<el-table :data="tableData" header-cell-class-name="headClass" style="width: 100%" border>
<el-table-column prop="ID" label="ID" width="100">
</el-table-column>
<el-table-column
prop="GoodsName"
label="产品名称">
<el-table-column prop="GoodsName" label="产品名称">
</el-table-column>
<el-table-column
prop="SellingPrice"
label="售价"
>
<el-table-column prop="SellingPrice" label="售价">
<template slot-scope="scope">
<span>
{{scope.row.SellingPrice.toFixed(2)}}
</span>
</template>
</el-table-column>
<el-table-column
prop="PonitNum"
label="点数">
<el-table-column prop="PonitNum" label="点数">
</el-table-column>
<el-table-column
prop="IsGive"
label="是否赠送点数">
<el-table-column prop="IsGive" label="是否赠送点数">
<template slot-scope="scope">
<el-tag v-if="scope.row.IsGive==0" type="info">不赠送</el-tag>
<el-tag v-if="scope.row.IsGive>0" type="warning">赠送{{scope.row.GivePonit}}点数</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="180"
>
<el-table-column fixed="right" label="操作" width="180">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top" >
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img src="../../assets/img/setup/edit.png" alt="" class="imgstyle" @click="Edit(scope.row)">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top" >
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../assets/img/setup/del.png" alt="" class="imgstyle" @click="delete_b(scope.row)">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:current-page.sync="msg.pageIndex"
:total="count">
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
layout="prev, pager, next" :current-page.sync="msg.pageIndex" :total="count">
</el-pagination>
</div>
</div>
......@@ -84,61 +48,62 @@
<script>
export default {
name: "pointList",
data(){
return{
msg:{
pageIndex:1,
pageSize:15,
data() {
return {
msg: {
pageIndex: 1,
pageSize: 15,
},
changeState:false,
dateList:[],
tableData:[],
count:0,
loading:false,
EnableMsg:{
Ids:'',
TeacherStatus:0,
changeState: false,
dateList: [],
tableData: [],
count: 0,
loading: false,
EnableMsg: {
Ids: '',
TeacherStatus: 0,
},
}
},
created(){
this.getDateList();//获取老师分页
created() {
this.getDateList(); //获取老师分页
},
methods:{
getDateList(){
this.loading=true;
methods: {
getDateList() {
this.loading = true;
this.apipost("/api/Point/GetPointGoodsPageList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.loading = false;
if (res.data.resultCode == 1) {
this.tableData = res.data.data.pageData;
this.count = res.data.data.count;
}else {
} else {
this.Info(res.data.message);
}
})
},
addRecharge(){
addRecharge() {
this.$router.push('/addpoint');
},
Edit(row){
Edit(row) {
this.$router.push({
name: 'addpoint',
query: {
ID:row.ID,
ID: row.ID,
blank: "y"
}
});
},
delete_b(row){
let that=this;
delete_b(row) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/Point/DeletePointGoods",
{Id:row.ID},
"/api/Point/DeletePointGoods", {
Id: row.ID
},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
......@@ -150,7 +115,7 @@
);
});
},
getList(){
getList() {
this.msg.pageIndex = 1
this.getDateList()
},
......@@ -160,10 +125,11 @@
},
},
}
</script>
<style >
.pointList .el-card__header{
<style>
.pointList .el-card__header {
display: flex;
flex-direction: row;
align-items: center;
......@@ -171,41 +137,50 @@
background: #fff;
}
.pointList .el-button--small{
.pointList .el-button--small {
padding: 9px 15px;
}
.pointList .content .searchInput{
.pointList .content .searchInput {
border: 1px solid #DCDFE6;
border-radius: 4px;
/*margin-left: 10px;*/
}
.pointList .content .searchInput .el-input__inner{
border:none;outline:none;
.pointList .content .searchInput .el-input__inner {
border: none;
outline: none;
height: 30px;
line-height: 30px;
}
.pointList .content .searchInput{
.pointList .content .searchInput {
line-height: normal;
display: inline-table;
border-collapse: separate;
border-spacing: 0;
width:250px;
width: 250px;
}
.pointList .content{
.pointList .content {
background: #fff;
margin-top:10px;
margin-top: 10px;
padding: 15px;
box-sizing: border-box;
}
.pointList .el-tag{
.pointList .el-tag {
margin-right: 5px;
}
.pointList .app-image{
.pointList .app-image {
background-position: center center;
width: 50px;
height: 50px;
border-radius:0%;
border-radius: 0%;
float: left;
margin-right: 8px;
}
</style>
This diff is collapsed.
This diff is collapsed.
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