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
<template>
<div class="eibs-tab">
<div class="m-table-search">
<el-row>
<c-col :span="12" style="padding-right: 20px">
<c-col :span="24">
<el-form-item label="参数类型">
<c-select :disabled="isFenh" v-model="model.sefgrp.rec.pratyp" :code="codes.csleix" style="width:100%" placeholder="请输入" @change="searchPtapChange">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="优惠类型">
<c-select disabled v-model="model.sefgrp.rec.rattyp" :code="codes.yhleix" style="width:100%" placeholder="请输入">
</c-select>
</el-form-item>
</c-col>
</c-col>
<c-col :span="12" style="padding-left: 20px">
<c-col :span="24" v-if="model.sefgrp.rec.pratyp == '2'">
<m-ptap :model="model" :disabled="true" :noEditNameAndAddress="true" :isAdrblk="false" :haveAdrLabel="true" :noRef="true" :isAdrVisible="false" chooseLanguage="CN" :argadr="{ title: '申请人', grp: 'sefgrp', rol: 'apl' }" ptytyp="C">
</m-ptap>
</c-col>
<c-col :span="24">
<span style="float: right">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询
</el-button>
</span>
</c-col>
</c-col>
</el-row>
</div>
<el-row>
<el-col :span="24">
<c-button @click="handleAdd" class="medium_bcs" size="medium" style="margin-left: 0" type="primary">添加
</c-button>
</el-col>
</el-row>
<div style="height: 90%">
<c-col :span="24">
<el-tabs class="y-tabs">
<el-table :data="this.model.stmData.data" :columns="this.model.stmData.columns" :showButtonFlg="true" :highlight-current-row="true" @selection-change="handleSelectionChange">
<!-- <el-table-column :selectable="selectableFn" type="selection" width="55">
</el-table-column> -->
<el-table-column prop="sefheptyp" label="优惠类型" width="120px" :formatter="formatSefheptyp">
</el-table-column>
<el-table-column v-for="(item, key) in this.model.stmData.columns" :key="key" :label="item.label" :prop="item.prop" :min-width="item.width"></el-table-column>
<!-- 自定义组件里加了最右边的一列”操作“ -->
<el-table-column fixed="right" prop="op" label="操作" width="140px">
<template slot-scope="scope">
<c-button style="margin-right: 7px" size="small" type="primary" @click="handleEdit(scope.row)">编辑
</c-button>
<c-button style="margin-left: 0px" size="small" @click="handleDetails(scope.row)" slot="reference">详情
</c-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-box">
<el-pagination style="margin-right: 30px;" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="model.pagination.pageIndex" :page-sizes="[10, 20, 50, 100, 500]" :page-size="model.pagination.pageSize" layout="sizes, prev, pager, next" :total="model.pagination.total">
</el-pagination>
</div>
</el-tabs>
</c-col>
<el-dialog v-if="this.model.initdialog" :visible.sync="model.initdialog" title="新增" append-to-body width="60%">
<el-form ref="addForm" :rules="rules" :model="model" :validate-on-rule-change="false" label-width="95px">
<c-content>
<m-ovwp1 :model="model" :codes="codes" />
</c-content>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="isFenh&&this.model.dialogData.sigflg != '0'" @click="saveSefrat">保存</el-button>
<el-button type="text" @click="closeDialog">取消</el-button>
</span>
</el-dialog>
<el-dialog v-if="this.model.editdialog" :visible.sync="model.editdialog" title="编辑" append-to-body width="60%">
<el-form ref="editForm" :rules="rules" :model="model" :validate-on-rule-change="false" label-width="95px">
<c-content>
<m-ovwp1 :model="model" :codes="codes" />
</c-content>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="isFenh&&this.model.dialogData.sigflg != '0'" @click="saveEdit">保存</el-button>
<el-button type="text" @click="closeEditDialog">取消</el-button>
</span>
</el-dialog>
<el-dialog v-if="this.model.detaildialog" :visible.sync="model.detaildialog" title="详情" append-to-body width="60%">
<el-form :rules="rules" :validate-on-rule-change="false" :model="model" label-width="95px">
<c-content>
<m-ovwp1 :model="model" :codes="codes" />
</c-content>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="text" @click="closeDetailDialog">取消</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Check from "../model/check";
import event from "../event";
import Pts from "~/components/business/commonModel/Pts";
import Ovwp1 from "./Ovwp1";
import Rskmgt from "./Rskmgt";
import Mptap from "./Ptap";
export default {
name: "Ovwp",
components: {
"m-ovwp1": Ovwp1,
"m-rskmgt": Rskmgt,
"m-ptap": Mptap
},
inject: ["root"],
props: ["model", "codes", "rules"],
mixins: [event],
data() {
return {
activeNames: ["ovwp1", "rskmgt"],
multipleSelection: [],
multipleSelectionObj: [],
multipleStatusSelection: [],
multipleSelectionRow: {},
codeMap: {
'1': "固定点数优惠",
'2': "按比例优惠",
'': "无优惠",
}
};
},
computed: {
isFenh() {
return JSON.parse(window.sessionStorage.currentOrg).level != "0";
}
},
methods: {
searchPtapChange() {
this.model.sefgrp.apl = {
pts: new Pts().data,
namelc: "", // 名称 .jsdgrp.apl.namelc
adrelc: "", // 地址 .jsdgrp.apl.adrelc
dbfadrblkcn: "" // Chinese address .jsdgrp.apl.dbfadrblkcn
};
}
},
created() {
let bchLev = JSON.parse(window.sessionStorage.currentOrg).level;
if (bchLev != "0") {
this.model.sefgrp.rec.pratyp = "2";
} else {
this.model.sefgrp.rec.pratyp = "0";
}
this.handleSearch();
}
};
</script>
<style>
.pagination-box {
width: 100%;
height: 30px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 10px;
background: #fff;
margin-top: 5px;
}
.btn-group-wrap {
max-height: 200px;
width: 100%;
overflow-y: auto;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-wrap: wrap;
}
.btn-item {
margin-bottom: 10px;
margin-right: 10px;
}
.medium_bcs {
border-radius: 5px;
}
</style>