Commit ebd45eda by 肖翔宇

12.13

parent 09c3a80c
......@@ -4,6 +4,7 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://192.168.0.13:9001/sharePiano"',
BASE_API: '"http://gxgqs.com/sharePiano"',
})
//http://gxgqs.com/sharePiano
//http://192.168.10.105:9001/sharePiano
......@@ -10,7 +10,7 @@
<!-- built files will be auto injected -->
<script src=<%= htmlWebpackPlugin.options.path %>/tinymce4.7.5/tinymce.min.js></script>
<!--<script src=/static/tinymce4.7.5/tinymce.min.js></script>-->
<script src=/static/tinymce4.7.5/tinymce.min.js></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=SL1ilmqO3HZRau61M1oCfhN1FV42kY6F"></script>
</body>
</html>
......@@ -10,32 +10,32 @@
style='width: 650px; margin-left:50px;'>
<el-form-item label="活动名称" prop="activityName">
<el-input type="text" placeholder="请输入活动名称"
v-model.trim="temp.activityName">
v-model.trim="temp.activityName" :maxlength="25">
</el-input>
</el-form-item>
<el-form-item label="活动天数" prop="activityDay">
<el-input type="text" placeholder="请输入活动天数"
v-model.trim="temp.activityDay">
v-model.number="temp.activityDay" :maxlength="3">
</el-input>
</el-form-item>
<el-form-item label="参与人数" prop="numberOfParticipants">
<el-input type="text" placeholder="请输入参与人数"
v-model.trim="temp.numberOfParticipants">
v-model.number="temp.numberOfParticipants" :maxlength="4">
</el-input>
</el-form-item>
<el-form-item label="原价" prop="originalPrice">
<el-input type="text" placeholder="请输入原价"
v-model.trim="temp.originalPrice">
v-model.number="temp.originalPrice" :maxlength="12">
</el-input>
</el-form-item>
<el-form-item label="活动价格" prop="activityPrice">
<el-input type="text" placeholder="请输入活动价格"
v-model.trim="temp.activityPrice">
v-model.number="temp.activityPrice" :maxlength="12">
</el-input>
</el-form-item>
<el-form-item label="实际可砍价金额" prop="actualAmountAvailable">
<el-form-item label="可砍价金额" prop="actualAmountAvailable">
<el-input type="text" placeholder="请输入实际可砍价金额"
v-model.trim="temp.actualAmountAvailable">
v-model.number="temp.actualAmountAvailable" :maxlength="12">
</el-input>
</el-form-item>
<el-form-item label="封面图" prop="picture">
......@@ -94,23 +94,23 @@ export default {
],
activityDay: [
{ required: true, message: '活动天数不能为空', trigger: 'blur' },
//{ type: 'number', message: '只允许输入数字', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
],
numberOfParticipants: [
{ required: true, message: '参与人数不能为空', trigger: 'blur' },
//{ type: 'number', message: '只允许输入数字', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
],
originalPrice: [
{ required: true, message: '原价不能为空', trigger: 'blur' },
//{ type: 'number', message: '只允许输入数字', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
],
activityPrice: [
{ required: true, message: '活动价格不能为空', trigger: 'blur' },
//{ type: 'number', message: '只允许输入数字', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
],
actualAmountAvailable: [
{ required: true, message: '实际可砍价金额不能为空', trigger: 'blur' },
//{ type: 'number', message: '只允许输入数字', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
],
picture: [{ required: true, message: '图片不能为空', trigger: 'blur' }],
},
......
......@@ -28,7 +28,7 @@
<el-button @click.native.prevent="openShowBargain(scope.row)" type="primary" icon="el-icon-edit" size="mini"
round></el-button>
<el-button type="danger" icon="el-icon-delete"
@click.native.prevent="handleDeleteStage(scope.row)" size="mini" round></el-button>
@click.native.prevent="handleDeleteBargain(scope.row)" size="mini" round></el-button>
</template>
</el-table-column>
</el-table>
......@@ -40,12 +40,12 @@
style='width: 350px; margin-left:50px;margin-top:50px;'>
<el-form-item label="阶段人数" prop="totalNumber">
<el-input type="text" placeholder="请输入阶段人数"
v-model.trim="types.totalNumber">
v-model.number="types.totalNumber" :maxlength="4">
</el-input>
</el-form-item>
<el-form-item label="金额范围" prop="totalAmount">
<el-input type="text" placeholder="请输入金额范围"
v-model.trim="types.totalAmount">
v-model.number="types.totalAmount" :maxlength="12">
</el-input>
</el-form-item>
</el-form>
......@@ -111,7 +111,7 @@
<el-button type="danger" icon="el-icon-delete"
@click.native.prevent="handleDelete(scope.row)" size="mini" round></el-button>
<el-button @click.native.prevent="openShowLog(scope.row)" type="primary" icon="el-icon-plus" size="mini"
round>
round>阶段
</el-button>
</template>
</el-table-column>
......@@ -185,13 +185,20 @@
},
// 表单验证的规则
rules: {
courseName: [
{ required: true, message: '课程名称不能为空', trigger: 'blur' },
{ type: 'string', max: 20, message: '课程名称不允许大于20位数', trigger: 'blur' }
]
totalAmount:[
{ required: true, message: '总人数不能为空', trigger: 'blur' },
{ type: 'number', message: '只允许输入数字'}
],
totalNumber:[
{ required: true, message: '阶段人数不能为空', trigger: 'blur' },
{ type: 'number', message: '只允许输入数字'}
],
},
bannerTypes: [],
bargainStage: []
bargainStage: [],
currentIndex:-1,
currentNumber:0,
currentAmount:0
}
},
created() {
......@@ -220,13 +227,19 @@
methods: {
closeThis(){
this.isShowLog=false;
this.currentNumber=0;
this.currentAmount=0;
},
openShowLog(row){
console.log(row.id)
this.$fetch.sysBargainStage.query({sysBargainListId:row.id}).then(({ data }) => {
console.log(data);
this.types.sysBargainListId=row.id
this.bargainStage = data;
for(var i in data){
this.currentNumber+=data[i].totalNumber;
this.currentAmount+=data[i].totalAmount
}
this.currentIndex = this.list.indexOf(row)
const params = this.$route.params;
this.isShowLog=true;
})
......@@ -239,6 +252,8 @@
},
closeBargain(){
this.isShowBargain=false;
this.types.totalAmount=undefined;
this.types.totalNumber=undefined;
},
getList() {
// 初始化数据 开始加载数据
......@@ -248,6 +263,7 @@
.then(({ data, total }) => {
// 赋值数据
this.list = data;
this.total = Number(total)
// 数据加载完成
this.listLoading = false
})
......@@ -389,6 +405,15 @@
}
this.$refs['dataForm'].validate(valid => {
if (valid) {
console.log(this.list[this.currentIndex].numberOfParticipants,this.currentNumber,this.types.totalNumber)
if(this.list[this.currentIndex].numberOfParticipants-this.currentNumber<this.types.totalNumber){
this.$message("人数已达上限");
return;
}
if(this.list[this.currentIndex].actualAmountAvailable-this.currentAmount<this.types.totalAmount){
this.$message("金额已达上限");
return;
}
const tempData = Object.assign({}, this.types)
if (!tempData.id) {
this.$fetch.sysBargainStage.insert(tempData).then(() => {
......@@ -399,6 +424,9 @@
this.types.totalAmount=undefined;
this.types.totalNumber=undefined;
this.isShowLog=false;
this.isShowBargain=false;
this.currentNumber=0;
this.currentAmount=0;
this.back()
})
} else {
......@@ -408,6 +436,9 @@
type: 'success'
})
this.isShowLog=false;
this.isShowBargain=false;
this.currentNumber=0;
this.currentAmount=0;
this.back()
})
}
......
......@@ -2,19 +2,30 @@
<div class="app-container">
<div class="filter-container">
<el-button class="filter-item" style="margin-left: 10px;" v-waves type="primary" icon="el-icon-plus" @click.native.prevent="shengcheng()">生成二维码
<el-button class="filter-item" style="margin-left: 10px;" v-waves type="primary" icon="el-icon-plus" @click.native.prevent="openShowCode()">生成二维码
</el-button>
<modal @on-close="closeThis()" :is-show='isShowLog'>
<el-form :rules="rules" ref="dataForm" :model="types" label-position="left" label-width="100px"
style='width: 350px; margin-left:50px;'>
<el-form-item label="商家信息" prop="pianoBrand">
<el-input type="text" placeholder="请输入商家信息"
v-model.trim="temp.pianoBrand">
<el-form-item label="钢琴品牌" prop="pianoBrand">
<el-input type="text" placeholder="请输入钢琴品牌"
v-model.trim="temp.pianoBrand" :maxlength="25">
</el-input>
</el-form-item>
</el-form>
<el-button type="primary" @click="saveData">保存</el-button>
</modal>
</modal>
<modal @on-close="closeCode()" :is-show='isShowCode'>
<el-form :rules="rules" ref="dataForm" :model="types" label-position="left" label-width="100px"
style='width: 350px; margin-left:50px;'>
<el-form-item label="生成数量" prop="count">
<el-input type="text" placeholder="请输入要生成的二维码数量"
v-model.number="count" :maxlength="3">
</el-input>
</el-form-item>
</el-form>
<el-button type="primary" @click="shengcheng">生成</el-button>
</modal>
<el-tooltip class="item" effect="dark" content="刷新" placement="top-start" :hide-after="toolTipTime">
<el-button class="filter-item" style="margin-left: 10px;" v-waves @click="refresh" type="success"
icon="el-icon-refresh" size="medium" circle></el-button>
......@@ -75,6 +86,7 @@
return {
isShowLog: false,
isShowBargain: false,
isShowCode: false,
tableKey: 0,
// 是否加载
listLoading: true,
......@@ -85,6 +97,7 @@
name: undefined,
code: undefined
},
count:undefined,
// 表格的数据
list: null,
// 总数量
......@@ -111,9 +124,9 @@
},
// 表单验证的规则
rules: {
courseName: [
count: [
{ required: true, message: '课程名称不能为空', trigger: 'blur' },
{ type: 'string', max: 20, message: '课程名称不允许大于20位数', trigger: 'blur' }
{ type: 'number', message: '只允许输入数字'}
]
},
bannerTypes: [],
......@@ -149,13 +162,20 @@
},
openShowLog(row){
this.isShowLog=true;
this.temp=this.list[row.id-1]
const index = this.list.indexOf(row)
this.temp=this.list[index];
},
openShowCode(row){
this.isShowCode=true;
},
closeCode(){
this.isShowCode=false;
},
shengcheng(){
this.$fetch.sysCodeForPaino.fileUpload({id:2}).then(({data}) => {
this.$fetch.sysCodeForPaino.fileUpload({id:this.count}).then(({data}) => {
// 赋值数据
this.list = data;
console.log(this.list)
console.log(this.list);
})
},
openShowBargain(data){
......@@ -174,8 +194,9 @@
.pageList(this.listQuery)
.then(({ data, total }) => {
// 赋值数据
this.list = data;
console.log(this.list)
this.total = Number(total);
// 数据加载完成
this.listLoading = false
})
......
......@@ -10,7 +10,7 @@
style='width: 650px; margin-left:50px;'>
<el-form-item label="名称" prop="title">
<el-input type="text" placeholder="请标题名称"
v-model.trim="temp.title">
v-model.trim="temp.title" :maxlength="25">
</el-input>
</el-form-item>
<el-form-item label="课程类型" prop="curriculumType">
......
......@@ -28,7 +28,7 @@
</template>
</el-table-column>
</el-table>
<el-button @click.native.prevent="openShowCourse()" class="filter-item" style="margin-left: 10px;" v-waves type="primary" icon="el-icon-plus">添加选集
<el-button @click.native.prevent="openShowCourse()" class="filter-item" style="margin-left: 10px;" v-waves type="primary" icon="el-icon-plus">添加类型
</el-button>
</modal>
<modal @on-close="closeCourse()":is-show='isShowCourse'>
......@@ -36,7 +36,7 @@
style='width: 350px; margin-left:50px;margin-top:40px;'>
<el-form-item label="课程类型" prop="courseName">
<el-input type="text" placeholder="请输入课程类型"
v-model.trim="types.courseName">
v-model.trim="types.courseName":maxlength="25">
</el-input>
</el-form-item>
</el-form>
......@@ -127,11 +127,6 @@
<span>{{scope.row.createDate}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="table.numberOrder">
<template slot-scope="scope">
<span>{{scope.row.numberOrder}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200">
<template slot-scope="scope">
<router-link :to="{name:'courseEdit',params:{id:scope.row}}">
......@@ -271,6 +266,9 @@
openShowCourse(data){
if(data){
this.types=data;
}else{
this.types.id=undefined;
this.types.courseName=undefined;
}
this.isShowCourse=true;
},
......@@ -345,6 +343,7 @@
.then(({ data, total }) => {
// 赋值数据
this.list = data;
this.total = Number(total)
// 数据加载完成
this.listLoading = false
})
......@@ -419,6 +418,13 @@
},
// 删除
handleDeleteCourse(row) {
for(var i in this.list){
console.log()
if(this.list[i].curriculumType==row.courseName){
this.$message('当前类型还存在课程,无法删除');
return;
}
}
if (!row.id) {
this.$message('请刷新后再试')
return
......@@ -544,6 +550,12 @@
saveData() {
this.$refs['dataForm'].validate(valid => {
if (valid) {
for(var i in this.courseTypes){
if(this.courseTypes[i].courseName==this.types.courseName){
this.$message("该课程类型已存在");
return;
}
}
const tempData = Object.assign({}, this.types)
if (!tempData.id) {
this.$fetch.sysCourseType.insert(tempData).then(() => {
......
......@@ -101,7 +101,7 @@
data() {
return {
logo: require('../../assets/ic_gxgq_selected.png'),
bannerType: [1,2,3,4],
bannerType: [],
// 临时的表单值
temp: {
id: undefined,
......@@ -170,19 +170,23 @@
// 赋值数据
console.log(data)
for(var item in data){
this.bannerType.push(item);
this.bannerType.push(data[item]);
}
})
},
// 返回
saveId(){
console.log(this.temp.sysCodeForPianoId)
saveId(e){
console.log(e);
var index=this.bannerType.indexOf(this.painoId);
this.bannerType.splice(index,1);
this.temp.sysCodeForPianoId.push(this.painoId);
this.painoId=0;
},
deleteId(id){
console.log(id);
var index=this.temp.sysCodeForPianoId.indexOf(id);
this.temp.sysCodeForPianoId.splice(index,1);
this.bannerType.push(id)
},
backList() {
this.$confirm('是否放弃当前编辑信息?', '提示', {
......
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 sign in to comment