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

View File

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

View File

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