Commit fd5835ba by hewei

cod不允许重复值优化

parent 45907c24
...@@ -12,6 +12,10 @@ export function add(data) { ...@@ -12,6 +12,10 @@ export function add(data) {
return Api.post("/manager/atp/add", data) return Api.post("/manager/atp/add", data)
} }
export function queryCod(cod) {
return Api.post(`/manager/atp/queryCod?cod=${cod}`)
}
export function edit(data) { export function edit(data) {
return Api.post("/manager/atp/edit", data) return Api.post("/manager/atp/edit", data)
} }
......
...@@ -12,6 +12,10 @@ export function add(data) { ...@@ -12,6 +12,10 @@ export function add(data) {
return Api.post("/manager/cty/add", data) return Api.post("/manager/cty/add", data)
} }
export function queryCod(cod) {
return Api.post(`/manager/cty/queryCod?cod=${cod}`)
}
export function edit(data) { export function edit(data) {
return Api.post("/manager/cty/edit", data) return Api.post("/manager/cty/edit", data)
} }
......
...@@ -12,6 +12,10 @@ export function add(data) { ...@@ -12,6 +12,10 @@ export function add(data) {
return Api.post("/manager/cur/add", data) return Api.post("/manager/cur/add", data)
} }
export function queryCod(cod) {
return Api.post(`/manager/cur/queryCod?cod=${cod}`)
}
export function edit(data) { export function edit(data) {
return Api.post("/manager/cur/edit", data) return Api.post("/manager/cur/edit", data)
} }
......
...@@ -267,8 +267,11 @@ export default { ...@@ -267,8 +267,11 @@ export default {
if (this.isInDisplay) { if (this.isInDisplay) {
this.restoreDisplay(); this.restoreDisplay();
} }
// this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.toggleRowSelection(this.model.liaall.tenstm.rows[0], true); //多选表格,选择某一行的选中状态,第二个参数设置选中与否,true为选中
this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.toggleAllSelection(); if (this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.data.length > 0) {
this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.toggleRowSelection(this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.data[0], true);
}
// this.$refs.ovwp.$refs.setp.$refs.table.$refs.table.toggleAllSelection();
// this.$refs.setp.$refs.table.$refs.table.toggleAllSelection(); // this.$refs.setp.$refs.table.$refs.table.toggleAllSelection();
}else{ }else{
this.$notify.error({title: '错误',message: '服务请求失败!'}); this.$notify.error({title: '错误',message: '服务请求失败!'});
......
...@@ -53,7 +53,7 @@ import Atp, { Pattern } from "./Atp.js"; ...@@ -53,7 +53,7 @@ import Atp, { Pattern } from "./Atp.js";
import AtpInfo from "./AtpInfo.vue"; import AtpInfo from "./AtpInfo.vue";
import { queryById, add, edit, deleteById } from "~/service/test/atp.js"; import { queryById, add, edit, deleteById, queryCod } from "~/service/test/atp.js";
export default { export default {
name: "StaticsDbiatp", name: "StaticsDbiatp",
...@@ -103,6 +103,10 @@ export default { ...@@ -103,6 +103,10 @@ export default {
commitAdd() { commitAdd() {
this.$refs.modelForm.validate((validated) => { this.$refs.modelForm.validate((validated) => {
if (validated) { if (validated) {
queryCod(this.model.cod)
.then((res) => {
console.log("res" + res)
if (!res) {
add(this.model) add(this.model)
.then((res) => { .then((res) => {
this.$message.success("添加成功!"); this.$message.success("添加成功!");
...@@ -112,6 +116,10 @@ export default { ...@@ -112,6 +116,10 @@ export default {
this.$message.error("添加失败!"); this.$message.error("添加失败!");
}); });
} else { } else {
return this.$message.error('交易配置信息代码重复');
}
})
} else {
Utils.formValidateTips(this.$refs.modelForm.fields) Utils.formValidateTips(this.$refs.modelForm.fields)
} }
}); });
......
...@@ -59,7 +59,7 @@ import Cty, { Pattern } from "./Cty.js"; ...@@ -59,7 +59,7 @@ import Cty, { Pattern } from "./Cty.js";
import CtyInfo from "./CtyInfo.vue"; import CtyInfo from "./CtyInfo.vue";
import BopctyInfo from "./BopctyInfo.vue"; import BopctyInfo from "./BopctyInfo.vue";
import { queryById, add, edit, deleteById, editBopctyData, deleteBopctyById} from "~/service/test/cty.js"; import { queryById, add, edit, deleteById, editBopctyData, deleteBopctyById, queryCod} from "~/service/test/cty.js";
export default { export default {
name: "StaticsDbicty", name: "StaticsDbicty",
...@@ -112,6 +112,9 @@ export default { ...@@ -112,6 +112,9 @@ export default {
this.$refs.modelForm.validate((validated) => { this.$refs.modelForm.validate((validated) => {
if (validated) { if (validated) {
this.model.codBopcty=this.model.bopcod; this.model.codBopcty=this.model.bopcod;
queryCod(this.model.cod)
.then((res) => {
if (!res) {
add(this.model) add(this.model)
.then((res) => { .then((res) => {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
...@@ -120,6 +123,12 @@ export default { ...@@ -120,6 +123,12 @@ export default {
.catch((err) => { .catch((err) => {
this.$message.error("保存失败!"); this.$message.error("保存失败!");
}); });
}
else {
this.$message.error("国家代码重复")
}
})
} else { } else {
Utils.formValidateTips(this.$refs.modelForm.fields) Utils.formValidateTips(this.$refs.modelForm.fields)
} }
......
...@@ -23,7 +23,7 @@ import Cur, { Pattern } from "../Infcur/Cur.js"; ...@@ -23,7 +23,7 @@ import Cur, { Pattern } from "../Infcur/Cur.js";
import Currency from "./Currency.vue"; import Currency from "./Currency.vue";
import { curInfo, add, edit, deleteById } from "~/service/test/cur.js"; import { curInfo, add, edit, deleteById,queryCod } from "~/service/test/cur.js";
export default { export default {
name: "StaticsDbicur", name: "StaticsDbicur",
...@@ -75,6 +75,9 @@ export default { ...@@ -75,6 +75,9 @@ export default {
commitAdd() { commitAdd() {
this.$refs.modelForm.validate((validated) => { this.$refs.modelForm.validate((validated) => {
if (validated) { if (validated) {
queryCod(this.model.cod)
.then(((res) => {
if (!res) {
add(this.model) add(this.model)
.then((res) => { .then((res) => {
this.$message.success("保存成功!"); this.$message.success("保存成功!");
...@@ -84,6 +87,11 @@ export default { ...@@ -84,6 +87,11 @@ export default {
this.$message.error("保存失败!"); this.$message.error("保存失败!");
}); });
} else { } else {
this.$message.error("货币种类重复")
}
}))
} else {
Utils.formValidateTips(this.$refs.modelForm.fields) Utils.formValidateTips(this.$refs.modelForm.fields)
} }
}); });
......
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