Commit b16a738b by hewei

静态交易优化

parent 46adaf9c
......@@ -12,8 +12,8 @@ export function add(data) {
return Api.post("/manager/atp/add", data)
}
export function queryCod(cod) {
return Api.post(`/manager/atp/queryCod?cod=${cod}`)
export function hasCod(cod) {
return Api.post(`/manager/atp/hasCod?cod=${cod}`)
}
export function edit(data) {
......
......@@ -12,8 +12,8 @@ export function add(data) {
return Api.post("/manager/cty/add", data)
}
export function queryCod(cod) {
return Api.post(`/manager/cty/queryCod?cod=${cod}`)
export function hasCod(cod) {
return Api.post(`/manager/cty/hasCod?cod=${cod}`)
}
export function edit(data) {
......
......@@ -12,8 +12,8 @@ export function add(data) {
return Api.post("/manager/cur/add", data)
}
export function queryCod(cod) {
return Api.post(`/manager/cur/queryCod?cod=${cod}`)
export function hasCod(cod) {
return Api.post(`/manager/cur/hasCod?cod=${cod}`)
}
export function edit(data) {
......
......@@ -88,7 +88,8 @@ export const Pattern = {
{ "max": 1, "message": "最大长度1个字符", "trigger": "blur" }
],
"dealtim": [
{"required": true, "message": "无法保存数据"}
{"required": true, "message": "无法保存数据"},
{"max": 5, "message": "不能大于两位数"}
],
}
......
......@@ -53,7 +53,7 @@ import Atp, { Pattern } from "./Atp.js";
import AtpInfo from "./AtpInfo.vue";
import { queryById, add, edit, deleteById, queryCod } from "~/service/test/atp.js";
import { queryById, add, edit, deleteById, hasCod } from "~/service/test/atp.js";
export default {
name: "StaticsDbiatp",
......@@ -103,7 +103,7 @@ export default {
commitAdd() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
queryCod(this.model.cod)
hasCod(this.model.cod)
.then((res) => {
console.log("res" + res)
if (!res) {
......@@ -128,13 +128,13 @@ export default {
this.$refs.modelForm.validate((validated) => {
if (validated) {
edit(this.model)
.then((res) => {
this.$message.success("修改成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("修改失败!");
});
.then((res) => {
this.$message.success("修改成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("修改失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
......
......@@ -59,7 +59,7 @@ import Cty, { Pattern } from "./Cty.js";
import CtyInfo from "./CtyInfo.vue";
import BopctyInfo from "./BopctyInfo.vue";
import { queryById, add, edit, deleteById, editBopctyData, deleteBopctyById, queryCod} from "~/service/test/cty.js";
import { queryById, add, edit, deleteById, editBopctyData, deleteBopctyById, hasCod} from "~/service/test/cty.js";
export default {
name: "StaticsDbicty",
......@@ -112,7 +112,7 @@ export default {
this.$refs.modelForm.validate((validated) => {
if (validated) {
this.model.codBopcty=this.model.bopcod;
queryCod(this.model.cod)
hasCod(this.model.cod)
.then((res) => {
if (!res) {
add(this.model)
......@@ -125,7 +125,7 @@ export default {
});
}
else {
this.$message.error("国家代码重复")
return this.$message.error("国家代码重复")
}
})
......@@ -138,23 +138,23 @@ export default {
this.$refs.modelForm.validate((validated) => {
if (validated) {
if(this.tabPosition===`tab-cty`){
edit(this.model)
.then((res) => {
this.$message.success("国家地区信息保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("国家地区信息保存失败!");
});}else{
editBopctyData(this.model.inr,this.model)
.then((res) => {
this.$message.success("收支申报国家代码表保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("收支申报国家代码表保存失败!");
});
}
edit(this.model)
.then((res) => {
this.$message.success("国家地区信息保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("国家地区信息保存失败!");
});}else{
editBopctyData(this.model.inr,this.model)
.then((res) => {
this.$message.success("收支申报国家代码表保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("收支申报国家代码表保存失败!");
});
}
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
......
......@@ -23,7 +23,7 @@ import Cur, { Pattern } from "../Infcur/Cur.js";
import Currency from "./Currency.vue";
import { curInfo, add, edit, deleteById,queryCod } from "~/service/test/cur.js";
import { curInfo, add, edit, deleteById,hasCod } from "~/service/test/cur.js";
export default {
name: "StaticsDbicur",
......@@ -75,7 +75,7 @@ export default {
commitAdd() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
queryCod(this.model.cod)
hasCod(this.model.cod)
.then(((res) => {
if (!res) {
add(this.model)
......@@ -87,7 +87,7 @@ export default {
this.$message.error("保存失败!");
});
} else {
this.$message.error("货币种类重复")
return this.$message.error("货币种类重复")
}
}))
......@@ -100,13 +100,13 @@ export default {
this.$refs.modelForm.validate((validated) => {
if (validated) {
edit(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
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