This commit is contained in:
lb 2023-03-17 14:14:31 +08:00
parent f9cfdacf30
commit 58f6737adb
3 changed files with 10 additions and 7 deletions

View File

@ -60,8 +60,8 @@
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null">
<div v-if="col.forceDisabled" class="force-disabled">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null" v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)">
<div v-if="col.forceDisabled && dataForm.id" class="force-disabled">
<el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
</div>
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
@ -715,8 +715,9 @@ export default {
extraIds[key] = value;
});
}
//
this.btnLoading = true
this.$http({
url: this.urls.base,
method,
@ -726,7 +727,7 @@ export default {
},
})
.then(({ data: res }) => {
this.btnLoading = true
this.btnLoading = false
this.loadingStatus = false;
console.log("[add&update] res is: ", res);
if (res.code === 0) {
@ -761,13 +762,15 @@ export default {
type: "error",
duration: 2000,
});
if (this.btnLoading) this.btnLoading = false
}
})
.catch((errMsg) => {
this.$message.error("参数错误:" + errMsg);
if (this.loadingStatus) this.loadingStatus = false;
if (this.btnLoading) this.btnLoading = false
});
} else {
} else {
this.$message.error("请核查字段信息");
}
});

View File

@ -292,7 +292,7 @@ export default {
break;
}
case "view-recipe": {
this.openDialog(data, false, { key: "attr" });
this.openDialog(data, true, { key: "attr" });
break;
}
case "copy": {

View File

@ -109,7 +109,7 @@ export default function () {
input: true,
label: "版本号",
prop: "externalCode",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入版本号" },
},
{ input: true, label: "物料销售文本(短)", prop: "shortDesc", elparams: { placeholder: "物料销售文本" } }