This commit is contained in:
tx 2024-12-03 10:22:28 +08:00
parent 105269a62e
commit 0507a412d4

View File

@ -237,7 +237,11 @@
~ ~
</el-col> </el-col>
<el-col :span="2"> <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>
<el-col :span="2.5" style="line-height: 32px;"> <el-col :span="2.5" style="line-height: 32px;">
{{ timeUnit }} 之间 {{ timeUnit }} 之间
@ -356,23 +360,23 @@ export default {
'form.deptId': function(deptId) { 'form.deptId': function(deptId) {
this.getAreaListByDeptId(deptId); this.getAreaListByDeptId(deptId);
}, },
'rule': { // 'rule': {
handler(newVal) { // handler(newVal) {
newVal.forEach((interval, index) => { // newVal.forEach((interval, index) => {
// // //
if (index > 0) { // if (index > 0) {
interval.start = newVal[index - 1].end || ''; // start // interval.start = newVal[index - 1].end || ''; // start
} // }
}); // });
// more.start end // // more.start end
if (newVal.length > 0) { // if (newVal.length > 0) {
this.more.start = newVal[newVal.length - 1].end || ''; // more.start // this.more.start = newVal[newVal.length - 1].end || ''; // more.start
} // }
}, // },
deep: true, // // deep: true, //
immediate: true // // immediate: true //
} // }
}, },
props: { props: {
// id // id
@ -738,6 +742,16 @@ export default {
this.title = "修改收费方式"; 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() { submitForm() {
if(!this.validateRules()){ if(!this.validateRules()){
return return