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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
| <template>
| <el-dialog title="POS订单详情"
| :visible="dialogVisible"
| :modal-append-to-body="false"
| :close-on-click-modal="false"
| @close="cancal"
| custom-class="comm-dialog"
| center
| width="1150px">
| <div class="list-content">
| <TableList :isAutoIndex="true"
| :isPaddingRight="false"
| :loading="loading"
| :list="records"
| :header="tableList"
| :total="total"
| @doAction="doAction"></TableList>
| </div>
| </el-dialog>
| </template>
| <script>
| /**
| * 返现佣金-客户签约管理查询页面-申请单pos订单列表
| */
|
| import TableList from '@comprehensive/components/TableList';
| import qryHouseholdBagApplyPayRecords from '@comprehensive/model/qryHouseholdBagApplyPayRecords';
| import {
| cancelHouseholdBagApplyPos,
| resetHouseholdBagApplyPos,
| qryHouseholdBagApplyPosResult,
| genHouseAppBagReceipt
| } from '@/api/comprehensiveTransaction';
|
| export default {
| name: 'LoanApply',
| components: {
| TableList,
| },
| props: {
| dialogVisible: {
| type: Boolean,
| default: false,
| },
| serialno: {
| type: String,
| default: '',
| },
| powerControl: {
| type: Object,
| default: () => ({}),
| },
| },
| data() {
| return {
| form: {},
| formList: [],
| tableList: [],
| listModel: null,
| query: {},
| records: [],
| total: 0,
| objectType: '',
| customerID: '',
| loading: false,
| uploading: false,
| // 是否显示所有表单项
| isShowAll: false,
| buttons: [
| { text: '重置', type: '' },
| { text: '搜索' },
| // { type: 'fold', text: '展开' },
| ],
| uploadHeader: {
| 'Content-Type': 'multipart/form-data; boundary=ReaquestHeader',
| },
| };
| },
| watch: {
| dialogVisible(newV) {
| if (newV) {
| this.init();
| }
| },
| },
| methods: {
| // 页面初始化处理
| init() {
| const listModel = qryHouseholdBagApplyPayRecords({});
| this.tableList = listModel.getTableList();
| this.listModel = listModel;
| this.fetch();
| },
| // 获取当前列表数据
| async fetch() {
| try {
| this.loading = true;
| let { listModel, powerControl } = this;
| const res = await listModel.request({ serialno: this.serialno });
| this.loading = false;
| const { list } = res;
| this.records = list.reduce((pre, curr) => {
| let arr = [];
| arr.push({
| id: 1,
| label: '查询交易结果',
| disabled: curr.status != 3,
| });
| arr.push({
| id: 4,
| label: '查看收据',
| disabled: curr.status != 3,
| });
| // arr.push({ id: 2, label: '重置', disabled: curr.status != 1 });
| powerControl.cancelApplyFlowControl && arr.push({ id: 3, label: '取消', disabled: curr.status != 1 });
| pre.push({
| ...curr,
| buttons: [...arr],
| });
|
| return pre;
| }, []);
| // this.records = list;
| } catch (error) {
| this.loading = false;
| }
| },
| cancal() {
| this.$emit('doAction', 'close');
| },
|
| // 表单事件触发
| async doAction(name, item, { id, label }) {
| console.log(name, item, { id, label }, id == 1);
| if (name === 'action') {
| if (id == 1) {
| // 查询交易结果
| qryHouseholdBagApplyPosResult({
| serialno: item.serialno,
| }).then((res) => {
| if (res.code === '00') {
| this.fetch();
| this.$message.success(res.result || '查询交易结果成功!');
| }
| });
| }
| if (id == 4) {
| // 查看收据
| genHouseAppBagReceipt({
| paySerialno: item.serialno,
| serialno: item.houseBagSerialno,
| }).then((res) => {
| if (res.code === '00') {
| const data = res.result
| window.open(
| `${process.env.VUE_APP_API_HOST}server/queryFile/${data.serialno}`,
| 'newwindow',
| 'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
| )
| }
| });
| }
| if (id == 2) {
| // 重置
| this.$confirm('请确认是否重置此交易', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| })
| .then(() => {
| resetHouseholdBagApplyPos({
| serialno: item.serialno,
| }).then((res) => {
| if (res.code === '00') {
| this.fetch();
| this.$message.success('取消成功!');
| }
| });
| })
| .catch(() => {});
| }
| if (id == 3) {
| // 取消
| this.$confirm('请确认是否取消此交易?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| })
| .then(() => {
| cancelHouseholdBagApplyPos({
| serialno: item.serialno,
| }).then((res) => {
| if (res.code === '00') {
| this.fetch();
| this.$message.success('取消成功!');
| }
| });
| })
| .catch(() => {});
| }
| }
| },
| },
| };
| </script>
| <style lang="postcss" scoped>
| .search-form {
| padding-top: 16px;
| }
| .list-content {
| font-size: 14px;
| }
| .export-excle {
| margin: 0 0 20px 0;
| }
| .message {
| font-size: 12px;
| color: #666666;
| padding: 10px 20px;
| background-color: #fafafa;
| }
| .upload-demo {
| display: inline-block;
| margin-left: 10px;
| }
| </style>
|
|