Commit b16a738b by hewei

静态交易优化

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