Commit ac32d32a authored by 吴春's avatar 吴春

1

parent 6b967c80
...@@ -82,21 +82,34 @@ ...@@ -82,21 +82,34 @@
</style> </style>
<template> <template>
<div class="flexOne"> <div class="flexOne">
<div style="text-align:right;padding:10px"> <div class="query-box">
<ul>
<li> <span><em>{{$t('objFill.nianfen')}}</em>
<YearLimit :clearable="false" :dateTime="year" @change="getTime"></YearLimit>
</span></li>
<li> <div style="text-align:right;">
<input type="button" class="hollowFixedBtn" name="" id="" :value="$t('pub.searchBtn')" @click="getList()" />
<input type="button" class="hollowFixedBtn" :value="$t('pub.addBtn')" @click="add"/> <input type="button" class="hollowFixedBtn" :value="$t('pub.addBtn')" @click="add"/>
</div> </div></li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading='loading'> <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading='loading'>
<tr> <tr>
<th>{{$t('fnc.jine')}}</th> <th>{{$t('fnc.jine')}}</th>
<th>{{$t('restaurant.res_commissionColumn')}}</th> <th>{{$t('restaurant.res_commissionColumn')}}</th>
<th>{{$t('objFill.nianfen')}}</th>
<th>{{$t('objFill.v101.Rest.chaozrxinm')}}</th> <th>{{$t('objFill.v101.Rest.chaozrxinm')}}</th>
<th>{{$t('hotel.table_operattime')}}</th> <th>{{$t('hotel.table_operattime')}}</th>
<th>{{$t('system.table_operation')}}</th> <th>{{$t('system.table_operation')}}</th>
</tr> </tr>
<tr v-for="(item,index) in DataList" :key="index+500"> <tr v-for="(item,index) in DataList" :key="index+500">
<td>{{item.Money}}</td> <td>{{item.Money}} <当前年份交易额<= {{item.MaxMoney}}</td>
<td>{{item.Ratio}}</td> <td>{{item.Ratio}}</td>
<td>{{item.Year}}</td>
<td>{{item.UpdateByName}}</td> <td>{{item.UpdateByName}}</td>
<td>{{item.UpdateTime}}</td> <td>{{item.UpdateTime}}</td>
<td> <td>
...@@ -127,19 +140,28 @@ ...@@ -127,19 +140,28 @@
<td colspan="6" align="center">{{$t('system.content_noData')}}</td> <td colspan="6" align="center">{{$t('system.content_noData')}}</td>
</tr> </tr>
</table> </table>
<!-- <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total>
</el-pagination> -->
<el-dialog <el-dialog
:title="$t('tips.tips')" :title="$t('tips.tips')"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="400px"> width="400px">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item :label="$t('fnc.jine')" prop="Money"> <el-form-item :label="$t('objFill.jinefanwei')" required>
<el-input v-model="ruleForm.Money" @keyup.native="checkPrice(ruleForm,'Money')"></el-input> <el-col :span="11">
<el-form-item prop="Money">
<el-input v-model="ruleForm.Money" size="mini" @keyup.native="checkPrice(ruleForm,'Money')" type="number"></el-input>
</el-form-item>
</el-col>
<el-col style="text-align:center;" :span="2"> -</el-col>
<el-col :span="11">
<el-form-item prop="MaxMoney">
<el-input v-model="ruleForm.MaxMoney" size="mini" @keyup.native="checkPrice(ruleForm,'MaxMoney')" type="number"></el-input>
</el-form-item>
</el-col>
</el-form-item> </el-form-item>
<el-form-item :label="$t('restaurant.res_commissionColumn')+'(‰)'" prop="Ratio"> <el-form-item :label="$t('restaurant.res_commissionColumn')+'(‰)'" prop="Ratio">
<el-input v-model="ruleForm.Ratio" @keyup.native="checkPrice(ruleForm,'Ratio')"></el-input> <el-input v-model="ruleForm.Ratio" @keyup.native="checkPrice(ruleForm,'Ratio')" type="number"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -152,21 +174,70 @@ ...@@ -152,21 +174,70 @@
</template> </template>
<script> <script>
import YearLimit from '../public/YearLimit.vue';
export default { export default {
components: {YearLimit},
data() { data() {
// 自定义验证规则
const validatePriceMoney = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rule.qsrjine')));
}
if (Number(value) >= Number(this.ruleForm.MaxMoney)) {
callback(new Error('必须小于'+this.ruleForm.MaxMoney));
} else {
callback();
}
};
const validatePriceMaxMoney = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rule.qsrjine')));
}
if (Number(value) <= Number(this.ruleForm.Money)) {
callback(new Error('必须大于'+this.ruleForm.Money));
} else {
callback();
}
};
return { return {
dialogVisible:false, dialogVisible:false,
loading: true, loading: true,
//分页 //分页
total: 0, total: 0,
pageSize: '', pageSize: '',
year:"",
currentPage:1, currentPage:1,
DataList:[], DataList:[],
dateList:[], dateList:[],
yearList:[],
Msg:{Year:0,},
rules: { rules: {
Money: [ Money: [
{ required: true, message: this.$t('rule.qsrjine'), trigger: 'blur' }, { required: true, message: this.$t('rule.qsrjine'), trigger: 'blur' },
], { validator: validatePriceMoney, trigger: 'blur' }
// { validator: (rule, value, callback) => {
// if (value > this.ruleForm.MaxMoney) {
// callback(new Error('必须小于'+this.ruleForm.MaxMoney));
// } else {
// callback();
// }
// }, trigger: 'blur' }
],
MaxMoney: [
{ required: true, message: this.$t('rule.qsrjine'), trigger: 'blur' },
{ validator: validatePriceMaxMoney, trigger: 'blur' }
// { validator: (rule, value, callback) => {
// if (value <= this.ruleForm.Money) {
// callback(new Error('必须大于'+this.ruleForm.Money));
// } else {
// callback();
// }
// }, trigger: 'blur' }
],
// [
// { required: true, message: this.$t('rule.qsrjine'), trigger: 'blur' },
// ],
Ratio: [ Ratio: [
{ required: true, message: this.$t('objFill.v101.Rest.qingshurfybl'), trigger: 'blur' }, { required: true, message: this.$t('objFill.v101.Rest.qingshurfybl'), trigger: 'blur' },
], ],
...@@ -174,18 +245,37 @@ ...@@ -174,18 +245,37 @@
ruleForm:{ ruleForm:{
Id:0, Id:0,
Money:"", Money:"",
MaxMoney:"",
Year:"",
Ratio:"", Ratio:"",
}, },
} }
}, },
created(){ created(){
var nowTime=new Date();
if (this.$route.query.year) {
this.year = this.$route.query.year;
this.Msg.Year= this.year;
this.ruleForm.Year=this.year;
} else {
this.year = nowTime.getFullYear().toString();
this.Msg.Year=this.year;
this.ruleForm.Year=this.year;
}
console.log("this.ruleForm.Year",this.ruleForm.Year);
}, },
mounted() { mounted() {
let userInfo = this.getLocalStorage(); let userInfo = this.getLocalStorage();
this.getList(); this.getList();
}, },
methods: { methods: {
getTime(Date){
this.Msg.Year=Date
this.ruleForm.Year=Date
this.year=Date
this.getList();
},
Delete(item){ Delete(item){
this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), { this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'), confirmButtonText: this.$t('pub.sureBtn'),
...@@ -211,6 +301,7 @@ ...@@ -211,6 +301,7 @@
this.ruleForm={ this.ruleForm={
Id:item.Id, Id:item.Id,
Money:item.Money, Money:item.Money,
MaxMoney:item.MaxMoney,
Ratio:item.Ratio, Ratio:item.Ratio,
} }
this.dialogVisible=true; this.dialogVisible=true;
...@@ -219,6 +310,7 @@ ...@@ -219,6 +310,7 @@
this.ruleForm={ this.ruleForm={
Id:0, Id:0,
Money:"", Money:"",
MaxMoney:"",
Ratio:"", Ratio:"",
} }
this.dialogVisible=true; this.dialogVisible=true;
...@@ -227,12 +319,14 @@ ...@@ -227,12 +319,14 @@
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.ruleForm.Year=this.year;
this.apipost('customer_post_SetCustomerCommissionRatio', this.ruleForm, res => { this.apipost('customer_post_SetCustomerCommissionRatio', this.ruleForm, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.getList(); this.getList();
this.dialogVisible=false; this.dialogVisible=false;
this.$refs["ruleForm"].resetFields(); this.$refs["ruleForm"].resetFields();
} else { } else {
this.Error(res.data.message)
} }
}, err => { }, err => {
}) })
...@@ -241,9 +335,10 @@ ...@@ -241,9 +335,10 @@
} }
}); });
}, },
getList() { //获取数据 getList() { //获取数据
this.loading = true; this.loading = true;
this.apipost('customer_post_GetCustomerCommissionRatioList', {}, res => { this.apipost('customer_post_GetCustomerCommissionRatioList', this.Msg, res => {
this.loading = false this.loading = false
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.DataList = res.data.data; this.DataList = res.data.data;
......
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