|
@@ -38,8 +38,9 @@
|
|
|
<el-table-column label="二级代理价(元)" align="center" prop="secondLevelPrice" v-if="isAdmin==3"></el-table-column>
|
|
|
<el-table-column label="二级代理价(元)" align="center" v-else>
|
|
|
<template slot-scope="scope">
|
|
|
- <span class="edit" v-if="scope.row.isEdit === false"
|
|
|
- @click="toggleEdit(scope.row)">{{ scope.row.secondLevelPrice }}</span>
|
|
|
+ <el-tooltip class="item" v-if="scope.row.isEdit === false" effect="dark" content="单击编辑" placement="left">
|
|
|
+ <span class="edit" @click="toggleEdit(scope.row)">{{ scope.row.secondLevelPrice }}</span>
|
|
|
+ </el-tooltip>
|
|
|
<el-input v-else v-model="editInput" size="small" oninput="value=value.replace(/[^\d.]/g,'')" style="width: 200px;" @blur="saveEdit(scope.row)">
|
|
|
<i slot="suffix" size="small" class="el-icon-check" @click="confrimEdit(scope.row)"></i>
|
|
|
<i slot="suffix" size="small" class="el-icon-close" @click="cancelEdit(scope.row)"></i>
|
|
@@ -103,23 +104,21 @@ export default {
|
|
|
},
|
|
|
confrimEdit(row) {
|
|
|
if (this.editInput >= row.platformPrice) {
|
|
|
- return this.$message.error('分销价格必须小于平台价格');
|
|
|
+ return this.$message.error('价格必须小于平台价格');
|
|
|
}
|
|
|
if (this.editInput <= row.firstLevelPrice) {
|
|
|
- return this.$message.error('二级代理价不能小于一级代理价');
|
|
|
+ return this.$message.error('不能小于一级代理价');
|
|
|
+ }
|
|
|
+ if(this.editInput<=0){
|
|
|
+ return this.$message.error('价格不能小于0');
|
|
|
}
|
|
|
row.secondLevelPrice = this.editInput
|
|
|
row.isEdit = false
|
|
|
this.currentEditingRow = null;
|
|
|
},
|
|
|
cancelEdit(row) {
|
|
|
- if (row.firstLevelPrice >= row.platformPrice) {
|
|
|
- return this.$message.error('分销价格必须小于平台价格');
|
|
|
- }
|
|
|
- if (row.secondLevelPrice <= row.firstLevelPrice) {
|
|
|
- return this.$message.error('二级代理价不能小于一级代理价');
|
|
|
- }
|
|
|
row.isEdit = false
|
|
|
+ this.editInput =0;
|
|
|
this.currentEditingRow = null;
|
|
|
},
|
|
|
saveEdit(row) {
|