1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<template>
<div class="eibs-tab">
<!-- ----------左 ---------->
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="货币种类" prop="cod">
<c-input v-model="model.cod" placeholder="请输入货币种类" style="width: 100%">
</c-input>
</el-form-item>
</c-col>
</c-col>
<!------------- 右 ---------->
<c-col :span="12" class="col-right">
<c-col :span="24">
<el-form-item label="货币描述" prop="cod">
<c-select v-model="model.seanam" placeholder="请输入货币描述" style="width: 100%">
</c-select>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24" style="text-align: right; height: 36.8px">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="onSearch()">查询
</el-button>
</c-col>
<c-col :span="24" style="margin-top: 10px">
<c-button class="medium_bcs" size="medium" style="margin-left: 0px" type="primary" @click="toBbacur">添加货币</c-button>
</c-col>
<c-col :span="24">
<c-paging-table :data="curData" :columns="curColumns" :pageNumber="model.pageNum" :pageSize="model.pageSize"
:total="model.total" 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="curInfo(scope.$index, scope.row)">详情</c-button>
<c-button style="margin-left: 5px" size="small" type="primary" @click="curEdit(scope.$index, scope.row)">修改
</c-button>
<c-button size="small" style="margin-left: 5px" @click="curDelete(scope.$index, scope.row)">删除</c-button>
<!-- <el-popover placement="top-start" width="50" trigger="click">
<ul class="table-button-item-list">
<li>
<c-button size="small" style="margin-left: 0">指派</c-button>
</li>
<li>
<c-button size="small" style="margin-left: 0">删除</c-button>
</li>
</ul>
<a slot="reference" href="javascript:void(0)" style="margin-left: 5px">
<i class="el-icon-more"></i>
</a>
</el-popover> -->
</template>
</c-table-column>
</c-paging-table>
</c-col>
</div>
</template>
<script>
import codes from "~/config/CodeTable";
import { queryByPage, deleteById } from "~/service/test/cur.js";
export default {
name: "",
props: ["model"],
inject: ["root"],
data() {
return {
curData: [],
curColumns: [
{ label: '货币', prop: 'cod', width: 'auto' },
{ label: '描述', prop: 'seanam', width: 'auto' },
],
};
},
activated() {
const { update } = this.$route.params
if (update) {
this.onSearch();
}
},
methods: {
toBbacur(){
this.$router.push("/statics/dbacur");
},
// handleReset() {
// this.root.$refs.modelForm.resetFields();
// },
async handleReset() {
this.model.cod = ""
this.model.seanam = ""
},
onSearch() {
this.model.pageSize = 5;
this.model.pageNum = 1;
this.onInfcurSearch();
},
onInfcurSearch() {
queryByPage(this.model).then(res => {
/**
* pageNumber: 0
* pageSize: 0
* total: 69
* totalPage: 0
*/
const list = res.list
this.curData = list
this.model.pageNum = res.pageNumber
this.model.pageSize = res.pageSize
this.model.total = res.total
})
},
// async onInfbutSearow() {
// let rtnmsg = await this.executeRule("infbut.searow")
// if (rtnmsg.respCode == SUCCESS) {
// console.log(rtnmsg.data);
// //TODO 处理数据逻辑
// this.updateModel(rtnmsg.data);
// this.stmData.data = rtnmsg.data.infbut_dspstm.rows;
// }
// else {
// this.$notify.error({ title: '错误', message: '服务请求失败!' });
// }
// },
queryFunc(pageNumber, pageSize) {
this.model.pageNum = pageNumber
this.model.pageSize = pageSize
// console.log(this.model);
this.onInfcurSearch()
},
// curtypeChange(val) {
// this.model.curtyp = val;
// },
getCodesByKey(key) {
return codes[key] ?? [];
},
curInfo(index, row) {
// console.log(row);
this.$router.push(`/statics/dbicur/${row.inr}`)
},
curEdit(index, row) {
this.$router.push(`/statics/dbecur/${row.inr}`);
},
// curDelete(index, row) {
// this.$router.push(`/statics/dbdcur/${row.inr}`)
// },
//进行删除统一化
curDelete(idx, row) {
this.$router.push(`/statics/dbdcur/${row.inr}`)
},
// curDelete(idx, row) {
// this.$confirm("是否确认删除?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// let paramsData = { };
// paramsData.inr = row.inr;
// deleteById(paramsData)
// .then((res) => {
// console.log(res);
// this.$message.success("删除成功!");
// this.onInfcurSearch();
// // this.onSearch();
// // this.goBack(true)
// })
// .catch((err) => {
// console.log(err);
// this.$message.error("删除失败!");
// });
// }).catch(() => {
// this.$message({
// type: "info",
// message: "已取消删除",
// });
// });
// },
goBack(update) {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInfcur", params: { update } });
},
},
};
</script>
<style scoped>
.table-button-item-list {
padding: 0;
margin: 0;
}
.table-button-item-list li {
list-style: none;
padding: 5px 0;
text-align: center;
color: #606266;
cursor: pointer;
}
</style>