fix:工艺路线表单残留问题根治:xtSelect外部清空值时同步清空显示文字(残留主因);画布/右侧新增弹框加key每次打开强制重建实例;route_form编辑时sort不再被count+1覆盖;无routeId不再全量拉辅料

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-23 15:50:32 +08:00
parent ec59a0ac98
commit 205768fbc3
4 changed files with 27 additions and 6 deletions

View File

@ -87,9 +87,10 @@
</div>
</div>
<!-- 复用现有单步表单新增/编辑一条 Route -->
<!-- 复用现有单步表单新增/编辑一条 Routekey 随每次打开递增强制重建实例杜绝上次内容残留 -->
<route-form
v-if="dialogVisible"
:key="dialogSeq"
ref="routeForm"
:count="count"
:routepack="routepack"
@ -141,6 +142,7 @@ export default {
edges: [],
count: 0,
dialogVisible: false,
dialogSeq: 0,
//
matType: "30",
matKeyword: "",
@ -479,6 +481,7 @@ export default {
/** 打开单步表单prefill 为 null 表示纯新增 */
openForm(mode, prefill) {
this.dialogSeq += 1;
this.dialogVisible = true;
this.$nextTick(() => {
const inst = this.$refs.routeForm.open(mode);

View File

@ -123,8 +123,18 @@ onMounted(() => {
const init = () => {
if (props.label) {
selectLabel.value = props.label;
} else {
if (props.multiple) {
return;
}
// (/)
const emptyVal =
props.modelValue == null ||
props.modelValue === "" ||
(Array.isArray(props.modelValue) && props.modelValue.length === 0);
if (emptyVal) {
selectLabel.value = "";
return;
}
if (props.multiple) {
if (isFixOptions.value) {
selectLabel.value = props.options
.filter((item) =>
@ -149,7 +159,6 @@ const init = () => {
selectLabel.value = props.obj[props.labelField];
}
}
}
}
const isFixOptions = ref(false);

View File

@ -397,6 +397,11 @@ export default {
},
getroutemats(){
let that = this;
// routeId(线)
if (!that.routeId) {
that.routemats = [];
return;
}
that.$API.mtm.routemat.list.req({ route: that.routeId,page: 0}).then((res) => {
that.routemats = res;
});
@ -500,7 +505,8 @@ export default {
that.resetForm();
that.visible = true;
that.$nextTick(() => {
if(that.count){
// setData sort
if(that.count && mode === "add"){
that.form.sort = that.count+1;
}
that.$refs.dialogForm && that.$refs.dialogForm.clearValidate();

View File

@ -184,6 +184,7 @@
</el-container>
<save-dialog
v-if="dialog.save"
:key="dialogSeq"
ref="saveDialog"
:count = "count"
:routepack="routepack"
@ -217,6 +218,7 @@ export default {
dialog: {
save: false,
},
dialogSeq: 0,
fileList:[],
form: {
name: "",
@ -341,13 +343,14 @@ export default {
table_add() {
let that = this;
that.count = this.$refs.tables.tableData.length;
console.log("count",that.count);
this.dialogSeq += 1;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
table_edit(row) {
this.dialogSeq += 1;
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);