|
|
@@ -3,9 +3,9 @@
|
|
|
<div class="div-border" v-for="(item,rowIndex) in ruleList" :key="rowIndex">
|
|
|
<el-row :gutter="20" style="margin-top: 10px;margin-left: 10px">
|
|
|
<el-col style="margin-bottom: 10px">
|
|
|
- <el-button type="primary" icon="el-icon-delete" style="float: right;margin-right: 10px" :disabled="!disabled" v-if="index !== rowIndex && ruleList.length > 1" @click="onDel(item)"></el-button>
|
|
|
- <el-button type="primary" icon="el-icon-edit" style="float: right;margin-right: 10px" v-if="index !== rowIndex" :disabled="!disabled" @click="onEdit(rowIndex)"></el-button>
|
|
|
- <el-button type="warning" icon="el-icon-circle-check" style="float: right;margin-right: 10px" v-if="isSave && index === rowIndex" :disabled="!disabled" @click="onSave(item,rowIndex)"></el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-delete" style="float: right;margin-right: 10px" :disabled="!disabled" v-if="index !== rowIndex && ruleList.length > 1 && tool.checkAuth($route.name,'delete')" @click="onDel(item)"></el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-edit" style="float: right;margin-right: 10px" v-if="index !== rowIndex && tool.checkAuth($route.name,'update')" :disabled="!disabled" @click="onEdit(rowIndex)"></el-button>
|
|
|
+ <el-button type="warning" icon="el-icon-circle-check" style="float: right;margin-right: 10px" v-if="isSave && index === rowIndex && tool.checkAuth($route.name,'update')" :disabled="!disabled" @click="onSave(item,rowIndex)"></el-button>
|
|
|
</el-col>
|
|
|
<el-form :model="item" :rules="rules" ref="form" label-width="120px" label-position="right" size="mini" :disabled="!disabled || !isSave || index !== rowIndex">
|
|
|
<el-col :span="20">
|
|
|
@@ -37,33 +37,33 @@
|
|
|
<el-form-item label="最少人数:" label-width="107px"
|
|
|
:prop="'paymentrules.' + ruleIndex + '.min'"
|
|
|
:rules="{required: true, message: '人数不能为空', trigger: 'blur'}">
|
|
|
- <el-input v-model="ruleItem.min" placeholder="请填写人数" ></el-input>
|
|
|
+ <el-input v-model="ruleItem.min" placeholder="请填写人数" type="number"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="7">
|
|
|
<el-form-item label="最多人数:" label-width="90px"
|
|
|
:prop="'paymentrules.' + ruleIndex + '.max'"
|
|
|
:rules="{required: true, message: '人数不能为空', trigger: 'blur'}">
|
|
|
- <el-input v-model="ruleItem.max" placeholder="请填写人数" ></el-input>
|
|
|
+ <el-input v-model="ruleItem.max" placeholder="请填写人数" type="number"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="7">
|
|
|
<el-form-item label="定价(元):" label-width="90px"
|
|
|
:prop="'paymentrules.' + ruleIndex + '.price'"
|
|
|
- :rules="{required: true, message: '定价不能为空', trigger: 'blur'}">
|
|
|
- <el-input v-model="ruleItem.price" placeholder="请填写金额(元)" ></el-input>
|
|
|
+ :rules="{required: true,pattern:/^\d+(.\d{1,2})?$/, message: '只能输入数字且最多2位小数', trigger: 'blur'}">
|
|
|
+ <el-input v-model="ruleItem.price" placeholder="请填写金额(元)" type="number"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
- <el-button type="primary" icon="el-icon-plus" circle v-if="ruleIndex === item.paymentrules.length -1" class="inline-16" @click="addPrice(rowIndex)"></el-button>
|
|
|
- <el-button type="info" icon="el-icon-close" circle v-if="item.paymentrules.length >1" @click="delPrice(ruleIndex)"></el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" circle v-if="ruleIndex === item.paymentrules.length -1 && tool.checkAuth($route.name,'insert')" class="inline-16" @click="addPrice(rowIndex)"></el-button>
|
|
|
+ <el-button type="info" icon="el-icon-close" circle v-if="item.paymentrules.length >1 && tool.checkAuth($route.name,'update')" @click="delPrice(ruleIndex,rowIndex)"></el-button>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<div class="div-button">
|
|
|
- <el-button style="border: none;" :disabled="!disabled" icon="el-icon-plus" class="btn-block" @click="addRule">添 加</el-button>
|
|
|
+ <el-button style="border: none;" :disabled="!disabled" icon="el-icon-plus" class="btn-block" @click="addRule" v-if="tool.checkAuth($route.name,'insert')">添 加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -96,7 +96,8 @@ export default {
|
|
|
],
|
|
|
sys_site_systempartitionid: [
|
|
|
{ required: true, message: '请选择版本', trigger: 'change' },
|
|
|
- ]
|
|
|
+ ],
|
|
|
+
|
|
|
},
|
|
|
isSave:false,
|
|
|
accountType:[
|
|
|
@@ -182,8 +183,10 @@ export default {
|
|
|
"price": ''
|
|
|
})
|
|
|
},
|
|
|
- delPrice(val) {
|
|
|
- this.form.paymentrules.splice(val,1)
|
|
|
+ delPrice(val,rowIndex) {
|
|
|
+ console.log(val,'删除价格')
|
|
|
+ console.log(this.ruleList)
|
|
|
+ this.ruleList[rowIndex].paymentrules.splice(val,1)
|
|
|
},
|
|
|
onEdit(val){
|
|
|
this.index = val
|
|
|
@@ -289,4 +292,4 @@ export default {
|
|
|
padding-top: 10px;
|
|
|
}
|
|
|
|
|
|
-</style>
|
|
|
+</style>
|