Commit a3ed7192 by yuanliang

txm前端添加规则校验,错误判断

parent 4c1d2dd2
......@@ -17,4 +17,8 @@ export const Pattern = {
{ required: true, message: "必输项", type: "string", trigger: "blur" },
{ max: 8, message: "最大长度8个字符", trigger: "blur" },
],
extkey: [{ max: 17, message: "最大长度17个字符", trigger: "blur" }],
nam: [{ max: 40, message: "最大长度40个字符", trigger: "blur" }],
uil: [{ max: 2, message: "最大长度2个字符", trigger: "blur" }],
etgextkey: [{ max: 8, message: "最大长度8个字符", trigger: "blur" }],
};
......@@ -2,7 +2,7 @@
<div class="eibs-tab">
<c-col :span="12" class="col-left">
<el-form-item label="INR" prop="inr" v-if="type !== 'add'">
<c-input v-model="model.inr" placeholder="请输入主键">
<c-input v-model="model.inr" placeholder="请输入主键" :disabled="type === 'edit'">
</c-input>
</el-form-item>
<el-form-item label="名称" prop="nam">
......@@ -47,7 +47,7 @@ import codes from "~/config/CodeTable";
export default {
name: "",
entyGrp: [],
props: ["model","type"],
props: ["model", "type"],
data() {
return {};
},
......
......@@ -6,7 +6,7 @@
<c-tabs v-model="tabVal" ref="elment" type="card">
<el-tab-pane label="固定格式文本信息" name="txm">
<c-content>
<m-txm-info :model="model" :type="type"/>
<m-txm-info :model="model" :type="type" />
</c-content>
</el-tab-pane>
</c-tabs>
......@@ -96,8 +96,12 @@ export default {
if (validated) {
edit(this.model)
.then((res) => {
this.$message.success("修改成功!");
this.goBack(true)
if (res.inr) {
this.$message.success("修改成功!");
this.goBack(true)
} else {
this.$message.error("修改失败!");
}
})
.catch((err) => {
this.$message.error("修改失败!");
......@@ -116,8 +120,12 @@ export default {
.then(() => {
deleteById(this.model.inr)
.then((res) => {
this.$message.success("删除成功!");
this.goBack(true)
if (res === true) {
this.$message.success("删除成功!");
this.goBack(true)
} else {
this.$message.error("删除失败,请刷新后再试");
}
})
.catch((err) => {
this.$message.error("删除失败!");
......
......@@ -99,9 +99,13 @@ export default {
this.model.pageNum = 1;
this.onInftxmSearch();
},
langValue(key) {
return this.lang.filter(item => item.value === key)[0]?.label;
},
onInftxmSearch() {
queryByPage(this.model).then((res) => {
const list = res.list;
const list = res.list ?? [];
list.map(item => item.uil = this.langValue(item.uil) ?? item.uil);
this.txmData = list;
this.model.pageNum = res.pageNumber;
this.model.pageSize = res.pageSize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment