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
225
226
227
228
229
230
231
232
233
<template>
<div class="eibs-tab">
<c-col :span="24">
<c-table style="text-align: center" highlight-current-row @row-click="handleInvrepRowClick" :row-class-name="tableInvrepRowClassName" :list="model.recpan.danlst" :paginationShow="true" :border="true" :total="model.recpan.danlst.length">
<el-table-column label="进口企业名称" prop="clinam" width="auto">
</el-table-column>
<el-table-column label="发票号" prop="ineref" width="auto">
</el-table-column>
<el-table-column label="发票金额" prop="ineamt" width="auto">
</el-table-column>
<el-table-column label="报关单编号" prop="cusref" width="auto">
</el-table-column>
<el-table-column label="关单币种" prop="cur" width="auto">
</el-table-column>
<el-table-column label="报关单占用金额" prop="cusamt" width="auto">
</el-table-column>
<el-table-column label="使用情况" prop="usesta" width="auto">
</el-table-column>
<el-table-column label="核验情况" prop="chksta" width="auto">
</el-table-column>
<el-table-column label="核验结果" prop="chkret" width="auto">
</el-table-column>
<el-table-column label="" prop="det" width="150px" fixed="right">
<template slot-scope="scope" slot="header">
<c-button circle style="padding: 4px" class="el-icon-plus" size="mini" @click="handleEdit()">
</c-button>
<c-button style="padding: 4px" circle class="el-icon-minus" size="mini" @click="removeRowDanlst(scope)">
</c-button>
</template>
<template slot-scope="scoped">
<c-button style="margin-left: 0" size="small" type="primary" icon="el-icon-info" @click="handleEdit(scoped.row)"></c-button>
</template>
</el-table-column>
</c-table>
</c-col>
<el-dialog title="单据信息详情" :visible.sync="dialogVisible" :modal-append-to-body="false" :close-on-click-modal="false" destroy-on-close width="75%" center>
<el-form :model="dialog" label-width="100px">
<c-col :span="12" style="padding-right: 20px;">
<c-col :span="24">
<el-form-item label="进口企业名称" label-width="150px" prop="clinam">
<c-input v-model="dialog.clinam" style="width: 100%"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="发票号" label-width="150px" prop="ineref">
<c-input v-model="dialog.ineref" style="width: 100%"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="发票金额" label-width="150px" prop="ineamt">
<c-input-currency v-model="dialog.ineamt" style="width: 100%"></c-input-currency>
</el-form-item>
</c-col>
</c-col>
<c-col :span="12" style="padding-right: 20px;">
<c-col :span="24">
<el-form-item label="报关单编号" label-width="150px" prop="cusref">
<c-input v-model="dialog.cusref" style="width: 100%"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="关单币种" label-width="150px" prop="cur">
<c-select disabled v-model="dialog.cur" dbCode="curtxt" style="width: 100%">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="报关单占用金额" label-width="150px" prop="cusamt">
<c-input-currency v-model="dialog.cusamt" style="width: 100%"></c-input-currency>
</el-form-item>
</c-col>
</c-col>
</el-form>
<span slot="footer" class="dialog-footer">
<c-button type="primary" @click="saveDialog">确 定</c-button>
<c-button @click="dialogVisible = false">取 消</c-button>
</span>
</el-dialog>
<c-col :span="24" style="margin-top: 50px;">
<c-col :span="12" style="padding-right: 20px">
<c-col :span="24" style="display: flex;align-item: center;justify-content: flex-start;">
<div style="width: 100%;">
<el-form-item label="发票数量" prop="recgrp.rec.inenum">
<c-input disabled v-model="model.recgrp.rec.inenum" placeholder="请输入发票数量"></c-input>
</el-form-item>
</div>
<div style="margin-left: 10px;">
<span style="height:32px;line-height:32px">条</span>
</div>
</c-col>
<c-col :span="24" style="display: flex;align-item: center;justify-content: flex-start;">
<div style="width: 100%;">
<el-form-item label="报关单数量" prop="recgrp.rec.cusnum">
<c-input disabled v-model="model.recgrp.rec.cusnum" placeholder="请输入报关单数量"></c-input>
</el-form-item>
</div>
<div style="margin-left: 10px;">
<span style="height:32px;line-height:32px">条</span>
</div>
</c-col>
</c-col>
<c-col :span="12" style="padding-left: 20px">
<c-col :span="24">
<c-form-item label="发票总金额" prop="recpan.totamt">
<c-input-currency disabled v-model="model.recpan.totamt" placeholder="请输入发票总金额"></c-input-currency>
</c-form-item>
</c-col>
<c-col :span="24">
<c-form-item label="报关单总金额" prop="recpan.bgdamt">
<c-input-currency disabled v-model="model.recpan.bgdamt" placeholder="请输入报关单总金额"></c-input-currency>
</c-form-item>
</c-col>
</c-col>
</c-col>
</div>
</template>
<script>
import event from "../event";
import Default from "../model/default";
export default {
inject: ["root"],
props: ["model", "codes"],
mixins: [event, Default],
data() {
return {
danlstIndex: -1,
dialogVisible: false,
tableData: [],
pagination: {
pageNum: 1,
pageSize: 10,
total: 0
},
dialog: {
clinam: "",
cur: "",
cusamt: "",
cusref: "",
ineamt: "",
ineref: ""
},
newdialog: {
clinam: "",
cur: "",
cusamt: "",
cusref: "",
ineamt: "",
ineref: ""
}
};
},
methods: {
handleEdit(row) {
this.dialogVisible = true;
this.opeTyp = "ADD";
this.dialog = {
clinam: "",
cur: this.model.recgrp.rec.rcvtotcur,
cusamt: "",
cusref: "",
ineamt: "",
ineref: ""
};
if (row) {
this.opeTyp = "EDIT";
Object.assign(this.dialog, row);
}
},
addRowDanlst() {
let newRow = { ...this.newdialog };
let start = 0;
if (this.model.recpan.danlst) {
start = this.model.recpan.danlst.length;
}
this.model.recpan.danlst.splice(start, 0, newRow);
this.danlstIndex = this.model.recpan.danlst.length - 1;
},
removeRowDanlst() {
console.log("选中的他行下标", this.danlstIndex);
if (this.danlstIndex === -1) {
this.$notify.error({
title: "错误",
message: "请选择一条数据删除!"
});
return;
}
this.model.recpan.danlst.splice(this.danlstIndex, 1);
this.danlstIndex = -1;
this.refreshLnelstAndCuslst();
},
tableInvrepRowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
handleInvrepRowClick(row) {
this.danlstIndex = row.index;
},
saveDialog() {
if (this.opeTyp == "ADD") {
this.addRowDanlst();
}
this.opeTyp = "";
this.dialogVisible = false;
this.model.recpan.danlst.splice(this.danlstIndex, 1, this.dialog);
this.refreshLnelstAndCuslst();
},
mounted() {},
computed: {},
watch: {},
created: function() {}
}
};
</script>
<style scoped>
</style>