111
This commit is contained in:
parent
105269a62e
commit
0507a412d4
|
@ -237,7 +237,11 @@
|
|||
~
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-input v-model="interval.end" :placeholder="'请输入'" />
|
||||
<el-input
|
||||
v-model="interval.end"
|
||||
:placeholder="'请输入'"
|
||||
@input="handleIntervalEndChange(index)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="2.5" style="line-height: 32px;">
|
||||
{{ timeUnit }} 之间,
|
||||
|
@ -356,23 +360,23 @@ export default {
|
|||
'form.deptId': function(deptId) {
|
||||
this.getAreaListByDeptId(deptId);
|
||||
},
|
||||
'rule': {
|
||||
handler(newVal) {
|
||||
newVal.forEach((interval, index) => {
|
||||
// 跳过第一条,从第二条开始更新
|
||||
if (index > 0) {
|
||||
interval.start = newVal[index - 1].end || ''; // 动态更新 start
|
||||
}
|
||||
});
|
||||
// 'rule': {
|
||||
// handler(newVal) {
|
||||
// newVal.forEach((interval, index) => {
|
||||
// // 跳过第一条,从第二条开始更新
|
||||
// if (index > 0) {
|
||||
// interval.start = newVal[index - 1].end || ''; // 动态更新 start
|
||||
// }
|
||||
// });
|
||||
|
||||
// 更新 more.start 的值为新数组最后一条的 end 值
|
||||
if (newVal.length > 0) {
|
||||
this.more.start = newVal[newVal.length - 1].end || ''; // 设置 more.start
|
||||
}
|
||||
},
|
||||
deep: true, // 深度监听
|
||||
immediate: true // 初始化立即执行
|
||||
}
|
||||
// // 更新 more.start 的值为新数组最后一条的 end 值
|
||||
// if (newVal.length > 0) {
|
||||
// this.more.start = newVal[newVal.length - 1].end || ''; // 设置 more.start
|
||||
// }
|
||||
// },
|
||||
// deep: true, // 深度监听
|
||||
// immediate: true // 初始化立即执行
|
||||
// }
|
||||
},
|
||||
props: {
|
||||
// 用户id
|
||||
|
@ -738,6 +742,16 @@ export default {
|
|||
this.title = "修改收费方式";
|
||||
});
|
||||
},
|
||||
handleIntervalEndChange(index) {
|
||||
// 更新下一个区间的开始值
|
||||
if (index < this.rule.length - 1) {
|
||||
this.rule[index + 1].start = this.rule[index].end;
|
||||
}
|
||||
// 更新 more.start 的值
|
||||
if (index === this.rule.length - 1) {
|
||||
this.more.start = this.rule[index].end;
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
if(!this.validateRules()){
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user