Commit f64eb050 by 闫泽浩

infpts更新

parent 9f5e238f
import Api from "~/service/Api"
export function queryById(data) {
return Api.post("/manager/pts/queryById", data)
// export function queryById(data) {
// return Api.post("/manager/pts/queryById", data)
// }
export function queryById(extkey) {
return Api.post("/manager/pts/queryById", {extkey})
}
export function queryByPage(data) {
return Api.post("/manager/pts/queryByPage", data)
......
<template>
<m-pts ref="pts" title="dbepts" type="edit"></m-pts>
</template>
<script>
import Dbipts from "~/views/Statics/Dbipts";
export default {
name: "StaticsDbepts",
components: {
"m-pts": Dbipts
},
data() {
return {
rules:{required:false}
};
},
};
</script>
<style>
</style>
\ No newline at end of file
export default class Pts {
constructor() {
this.data = {
extkey: "",
nam: "",
branch: "",
bchname: "",
}
}
}
export const Pattern = {
"extkey": [
{ "type": "string", "trigger": "blur" },
{ "max": 16, "message": "最大长度16个字符", "trigger": "blur" }
],
"nam": [
{ "type": "string", "trigger": "blur" },
{ "max": 40, "message": "最大长度40个字符", "trigger": "blur" }
],
"branch": [
{ "type": "string", "trigger": "blur" },
{ "max": 144, "message": "最大长度144个字符", "trigger": "blur" }
],
"bchname": [
{ "type": "string", "trigger": "blur" },
{ "max": 40, "message": "最大长度40个字符", "trigger": "blur" }
],
}
<template>
<div class="eibs-tab">
<c-row>
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="客户号" prop="extkey">
<c-input
v-model="model.extkey"
placeholder="请输入extkey"
></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="客户名称" prop="nam">
<c-input
v-model="model.nam"
placeholder="请输入nam"
></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="机构号" prop="branch">
<c-input
v-model="model.branch"
placeholder="branch"
></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="机构号" prop="bchname">
<c-input
v-model="model.bchname"
placeholder="bchname"
></c-input>
</el-form-item>
</c-col>
</c-col>
</c-row>
<!-- <c-col :span="24">-->
<!-- </c-col>-->
</div>
</template>
<script>
import codes from "~/config/CodeTable";
export default {
name: "",
props: ["model"],
data() {
return {};
},
methods: {
getCodesByKey(key) {
return codes[key] ?? [];
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eContainer">
<c-page :title="title">
<el-form
ref="modelForm"
label-width="180px"
size="small"
label-position="right"
:model="model"
:rules="rules"
:validate-on-rule-change="false"
:disabled="isDisabled"
>
<c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="changePosition">
<el-tab-pane label="基本信息" name="info">
<c-content>
<m-pts-info :model="model" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
<div style="text-align: center">
<c-button
type="primary"
style="margin-right: 10px"
@click="commitUpdate"
>提 交</c-button
>
<c-button type="primary" @click="goBack">返 回</c-button>
</div>
</c-page>
</div>
</template>
<script>
import Utils from "~/utils";
import Pts, { Pattern } from "./Pts.js";
import PtsInfo from "./PtsInfo.vue";
import { add, update, deleteById,queryById } from "~/service/test/pts.js";
export default {
name: "StaticsDbipts",
components: {
"m-pts-info": PtsInfo,
},
provide() {
return {
root: this,
};
},
props: {
type: {
type: String,
default: "info"
},
title: {
type: String,
default: "dbipts"
}
},
data() {
return {
tabVal: "infsea",
model: new Pts().data,
tabVal: "pts",
rules: Pattern,
tabPosition:"tab-pts",
extkey:"",
nam:"",
branch:"",
bchname:"",
};
},
computed: {
isDisabled() {
return this.type === "info" || this.type === "delete";
},
},
created() {
if (this.type !== "add") {
const extkey = this.$route.params.extkey;
window.console.log(this.type)
queryById(extkey).then((res)=> {
if (res.extkey) {
this.model = res;
} else {
this.$message.error("客户不存在")
}
});
}
},
methods: {
commitUpdate() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
if(this.tabPosition===`tab-pts`){
update(this.model)
.then((res) => {
this.$message.success("代码修改保存成功!");
this.goBack()
})
.catch((err) => {
this.$message.error("代码修改保存失败!");
});}
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
goBack(update) {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInfpts", params: { update } });
},
changePosition(tab,event){
this.tabPosition=event.target.getAttribute('id');
console.log(this.tabPosition)
},
},
};
</script>
<style>
</style>
\ No newline at end of file
......@@ -118,7 +118,7 @@ export default {
created() {
if (this.type !== "add") {
const inr = this.$route.params.inr;
queryDetailById(inr).then((res)=> {queryById(this.model)
queryDetailById(inr).then((res)=> {
if (res.inr) {
this.model = res;
} else {
......
......@@ -41,6 +41,23 @@
v-on:queryFunc="queryFunc"
:border="true"
>
<c-table-column fixed="right" prop="op" label="操作" width="240px">
<template slot-scope="{ scope }">
<c-button
style="margin-left: 0"
size="small"
@click="infptsInfo(scope.$index, scope.row)"
>详情</c-button
>
<c-button
style="margin-left: 5px"
size="small"
type="primary"
@click="infptsUpdate(scope.$index, scope.row)"
>修改</c-button
>
</template>
</c-table-column>
</c-paging-table>
<c-paging-table
:data="ptaData"
......@@ -85,7 +102,7 @@ export default {
ptyColumns: [
{ label: "客户号", prop: "extkey", width: "auto" },
{ label: "客户名称", prop: "nam", width: "auto" },
{ label: "机构", prop: "branch", width: "auto" },
{ label: "机构", prop: "branch", width: "auto" },
{ label: "机构名称", prop: "bchname", width: "auto" },
],
ptaData: [],
......@@ -133,6 +150,9 @@ export default {
})
},
infptsUpdate(index, row) {
this.$router.push(`/statics/dbepts/${row.extkey}`)
},
onInfptsSearch2() {
queryByPage2(this.model).then(res => {
/**
......@@ -147,6 +167,9 @@ export default {
})
},
infptsInfo(index, row) {
this.$router.push(`/statics/dbipts/${row.extkey}`)
},
queryFunc(pageNumber, pageSize) {
......
......@@ -142,6 +142,7 @@ import Dbicod from './Dbicod'
import Dbacod from './Dbacod'
import Dbecod from './Dbecod'
import Dbdcod from './Dbdcod'
import Dbipts from "./Dbipts";
const StaticsRouter = [
{ path: 'dbiptm/:inr', component:Dbiptm, name: 'StaticsDbiptm', meta: { title: (tag) => { return '客户详情: ' + tag.params.inr } } },
......@@ -266,6 +267,8 @@ const StaticsRouter = [
{ path: 'infbtb', component: InfBtb, name: 'StaticsInfbtb', meta: { title: '查询清算代理行' } },
{ path: 'dbibtb/:inr', component: DbiBtb, name: 'StaticsDbibtb', meta: { title: (tag) => { return '清算代理行详情: ' + tag.params.inr } } },
{ path: 'Infpts', component: Infpts, name: 'StaticsDbaatx', meta: { title: '客户管户机构管理' } },
{ path: 'dbipts/:extkey', component: Dbipts, name: 'StaticsDbipts', meta: { title: (tag) => { return '客户更新详情: ' + tag.params.extkey } } },
{ path: 'dbepts/:extkey', component: Dbipts, name: 'StaticsDbepts', meta: { title: (tag) => { return '客户信息修改: ' + tag.params.extkey } } },
{ path: 'infswm', component: Infswm, name: 'StaticsInfswm', meta: { title: '报文栏位映射信息查询' } },
// { path: 'dbaswm', component: Dbaswm, name: 'StaticsDbaswm', meta: { title: '报文栏位映射信息新增' } },
......@@ -293,6 +296,7 @@ const StaticsRouter = [
{ path: 'dbicod/:inr', component: Dbicod, name: 'StaticsDbicod', meta: { title: (tag) => { return '收支申报码表详情: ' + tag.params.inr } } },
{ path: 'dbecod/:inr', component: Dbecod, name: 'StaticsDbecod', meta: { title: (tag) => { return '收支申报码表修改: ' + tag.params.inr } } },
{ path: 'dbdcod/:inr', component: Dbdcod, name: 'StaticsDbdcod', meta: { title: (tag) => { return '收支申报码表删除: ' + tag.params.inr } } },
]
......
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