Commit 6301d6a4 by tianxinyu

index修改

parent 928f3714
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:validate-on-rule-change="false" :validate-on-rule-change="false"
:disabled="isDisabled" :disabled="isDisabled"
> >
<c-tabs v-model="tabVal" ref="elment" type="card"> <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="changePosition">
<el-tab-pane label="费率信息" name="fec"> <el-tab-pane label="费率信息" name="fec">
<c-content> <c-content>
<m-fec-info :model="model" /> <m-fec-info :model="model" />
...@@ -59,7 +59,7 @@ import Fec, { Pattern } from "./Fec.js"; ...@@ -59,7 +59,7 @@ import Fec, { Pattern } from "./Fec.js";
import FecInfo from "./FecInfo.vue"; import FecInfo from "./FecInfo.vue";
import FeeInfo from "./FeeInfo.vue"; import FeeInfo from "./FeeInfo.vue";
import { queryDetailById, add, edit, deleteById } from "~/service/test/fec.js"; import { queryDetailById, add, edit, deleteById,editFeeData,deleteFeeData } from "~/service/test/fec.js";
export default { export default {
name: "StaticsDbifec", name: "StaticsDbifec",
...@@ -87,6 +87,7 @@ export default { ...@@ -87,6 +87,7 @@ export default {
model: new Fec().data, model: new Fec().data,
tabVal: "fec", tabVal: "fec",
rules: Pattern, rules: Pattern,
tabPosition:"tab-fec",
}; };
}, },
computed: { computed: {
...@@ -126,14 +127,24 @@ export default { ...@@ -126,14 +127,24 @@ export default {
commitEdit() { commitEdit() {
this.$refs.modelForm.validate((validated) => { this.$refs.modelForm.validate((validated) => {
if (validated) { if (validated) {
if(this.tabPosition===`tab-fec`){
edit(this.model) edit(this.model)
.then((res) => { .then((res) => {
this.$message.success("保存成功!"); this.$message.success("费率修改保存成功!");
this.goBack() this.goBack()
}) })
.catch((err) => { .catch((err) => {
this.$message.error("保存失败!"); this.$message.error("费率修改保存失败!");
});}else{
editFeeData(this.model.inr,this.model)
.then((res) => {
this.$message.success("费用代码修改保存成功!");
this.goBack()
})
.catch((err) => {
this.$message.error("费用代码修改保存失败!");
}); });
}
} else { } else {
Utils.formValidateTips(this.$refs.modelForm.fields) Utils.formValidateTips(this.$refs.modelForm.fields)
} }
...@@ -146,14 +157,24 @@ export default { ...@@ -146,14 +157,24 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
if(this.tabPosition===`tab-fec`){
deleteById(this.model.inr) deleteById(this.model.inr)
.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{
deleteFeeData(this.model)
.then((res) => {
this.$message.success("费用代码删除成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("费用代码删除失败!");
})
};
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
...@@ -169,7 +190,10 @@ export default { ...@@ -169,7 +190,10 @@ export default {
this.$store.dispatch("TagsView/delView", this.$route); this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInffec", params: { update } }); this.$router.push({ name: "StaticsInffec", params: { update } });
}, },
changePosition(tab,event){
this.tabPosition=event.target.getAttribute('id');
console.log(this.tabPosition)
},
}, },
}; };
</script> </script>
......
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