fix: srule 修复 that 未定义并完善排班规则交互
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ddc8ef889d
commit
8230773736
|
|
@ -35,8 +35,9 @@
|
|||
</div>
|
||||
<div style="margin-top: 6px" v-if="form.rule_display.length > 0">
|
||||
<span v-for="(item, index) in form.rule_display" :key="index">
|
||||
{{ item }} ->
|
||||
{{ item }}<span v-if="index < form.rule_display.length - 1"> -> </span>
|
||||
</span>
|
||||
<el-button link size="small" type="danger" style="margin-left: 8px" @click="removeLast">撤销</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
|
@ -84,17 +85,29 @@ export default {
|
|||
this.form.rule.push(item.id);
|
||||
this.form.rule_display.push(item.name);
|
||||
},
|
||||
removeLast() {
|
||||
this.form.rule.pop();
|
||||
this.form.rule_display.pop();
|
||||
},
|
||||
save() {
|
||||
if (!this.form.belong_dept) {
|
||||
this.$message.warning("请选择所属部门");
|
||||
return;
|
||||
}
|
||||
if (this.form.rule.length === 0) {
|
||||
this.$message.warning("请至少添加一个班组");
|
||||
return;
|
||||
}
|
||||
this.$API.mtm.srule.create.req(this.form).then(res => {
|
||||
this.$refs.table.refresh();
|
||||
this.dialogVisible = false;
|
||||
that.$message.success("操作成功");
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
},
|
||||
table_del(row, index) {
|
||||
this.$API.mtm.srule.delete.req(row.id).then(res => {
|
||||
this.$refs.table.refresh();
|
||||
that.$message.success("操作成功");
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue