Commit 6301d6a4 by tianxinyu

index修改

parent 928f3714
......@@ -11,7 +11,7 @@
:validate-on-rule-change="false"
: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">
<c-content>
<m-fec-info :model="model" />
......@@ -59,7 +59,7 @@ import Fec, { Pattern } from "./Fec.js";
import FecInfo from "./FecInfo.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 {
name: "StaticsDbifec",
......@@ -87,6 +87,7 @@ export default {
model: new Fec().data,
tabVal: "fec",
rules: Pattern,
tabPosition:"tab-fec",
};
},
computed: {
......@@ -126,14 +127,24 @@ export default {
commitEdit() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
if(this.tabPosition===`tab-fec`){
edit(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.$message.success("费率修改保存成功!");
this.goBack()
})
.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 {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
......@@ -146,14 +157,24 @@ export default {
type: "warning",
})
.then(() => {
if(this.tabPosition===`tab-fec`){
deleteById(this.model.inr)
.then((res) => {
this.$message.success("删除成功!");
this.$message.success("费率信息删除成功!");
this.goBack(true)
})
.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(() => {
this.$message({
......@@ -169,7 +190,10 @@ export default {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInffec", params: { update } });
},
changePosition(tab,event){
this.tabPosition=event.target.getAttribute('id');
console.log(this.tabPosition)
},
},
};
</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