9b01bbd3
wuxw
开发完成发票相关功能
|
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
|
<div class="owner-apply-invoice-container">
<el-card>
<div slot="header" class="clearfix flex justify-between">
<h3>{{ $t('ownerApplyInvoice.title') }}</h3>
<div class="header-actions">
<el-button type="primary" size="small" @click="goBack">
{{ $t('ownerApplyInvoice.back') }}
</el-button>
</div>
</div>
<el-form ref="form" :model="formData" label-width="150px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item :label="$t('ownerApplyInvoice.invoiceTitle')" required>
<el-input v-model="formData.invoiceName" :placeholder="$t('ownerApplyInvoice.chooseInvoiceTitle')"
disabled />
</el-form-item>
</el-col>
<el-col :span="4" class="text-left">
<el-button type="primary" size="small" style="margin-left: 150px; margin-bottom: 20px"
@click="openSelectOwner">
{{ $t('ownerApplyInvoice.select') }}
</el-button></el-col>
<el-col :span="12">
<el-form-item :label="$t('ownerApplyInvoice.taxpayerId')" required>
<el-input v-model="formData.invoiceNum" :placeholder="$t('ownerApplyInvoice.chooseTaxId')" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('ownerApplyInvoice.invoiceType')" required>
<el-select v-model="formData.invoiceType" :placeholder="$t('ownerApplyInvoice.chooseInvoiceType')"
style="width:100%">
<el-option :label="$t('ownerApplyInvoice.personal')" value="1001" />
<el-option :label="$t('ownerApplyInvoice.enterprise')" value="2002" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('ownerApplyInvoice.addressPhone')" required>
<el-input v-model="formData.invoiceAddress" :placeholder="$t('ownerApplyInvoice.chooseAddressPhone')" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('ownerApplyInvoice.owner')" required>
<el-input v-model="formData.ownerName" :placeholder="$t('ownerApplyInvoice.chooseContent')" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('ownerApplyInvoice.content')" required>
<el-select v-model="formData.invoiceFlag" :placeholder="$t('ownerApplyInvoice.chooseContent')"
style="width:100%" @change="handleContentChange">
<el-option :label="$t('ownerApplyInvoice.paidFees')" value="FEE" />
<el-option :label="$t('ownerApplyInvoice.accountDeposit')" value="ACCT" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<!-- 已缴费费用 -->
<el-card v-if="formData.invoiceFlag === 'FEE'" class="mt-20">
<div slot="header" class="flex justify-between">
<h3>{{ $t('ownerApplyInvoice.paidFees') }}</h3>
</div>
<el-table :data="feeDetails" border style="width: 100%">
|
9b01bbd3
wuxw
开发完成发票相关功能
|
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
<el-table-column prop="acctName" :label="$t('ownerApplyInvoice.accountName')" align="center" />
<el-table-column prop="acctTypeName" :label="$t('ownerApplyInvoice.accountType')" align="center" />
<el-table-column prop="ownerName" :label="$t('ownerApplyInvoice.owner')" align="center" />
<el-table-column prop="receivedAmount" :label="$t('ownerApplyInvoice.depositAmount')" align="center" />
<el-table-column prop="primeRateName" :label="$t('ownerApplyInvoice.depositMethod')" align="center" />
<el-table-column prop="amount" :label="$t('ownerApplyInvoice.totalAmount')" align="center" />
<el-table-column prop="createTime" :label="$t('ownerApplyInvoice.depositTime')" align="center" />
</el-table>
</el-card>
<div class="mt-20 text-right">
<el-button type="primary" @click="handleSubmit">
{{ $t('ownerApplyInvoice.submit') }}
</el-button>
</div>
<search-owner-invoice ref="searchOwnerInvoice" :visible.sync="showSearchDialog" @select="handleOwnerSelect" />
</div>
</template>
<script>
import { queryFeeDetail, listAccountReceipt, saveInvoiceApply } from '@/api/fee/ownerApplyInvoiceApi'
import SearchOwnerInvoice from '@/components/fee/searchOwnerInvoice'
import { formatDate } from '@/utils/dateUtil'
export default {
name: 'OwnerApplyInvoiceList',
components: {
SearchOwnerInvoice
},
data() {
return {
showSearchDialog: false,
formData: {
oiId: '',
ownerId: '',
ownerName: '',
invoiceType: '',
invoiceName: '',
invoiceAddress: '',
invoiceNum: '',
detailIds: [],
feeDetails: [],
invoiceFlag: 'FEE',
arIds: [],
acctDetails: []
},
feeDetails: [],
acctDetails: []
}
},
methods: {
formatDate,
goBack() {
this.$router.go(-1)
},
openSelectOwner() {
this.showSearchDialog = true
this.$nextTick(() => {
this.$refs.searchOwnerInvoice.open()
})
},
handleOwnerSelect(owner) {
Object.assign(this.formData, owner)
this.formData.detailIds = []
this.formData.arIds = []
if (this.formData.invoiceFlag === 'FEE') {
this.loadFeeDetails()
} else {
this.loadAcctDetails()
}
},
async loadFeeDetails() {
try {
const params = {
page: 1,
row: 50,
ownerId: this.formData.ownerId,
openInvoice: 'N'
}
const res = await queryFeeDetail(params)
this.feeDetails = res.feeDetails || []
// 默认全选
this.formData.detailIds = this.feeDetails.map(item => item.detailId)
} catch (error) {
console.error('Failed to load fee details:', error)
this.$message.error(this.$t('common.loadFailed'))
}
},
async loadAcctDetails() {
try {
const params = {
page: 1,
row: 50,
ownerId: this.formData.ownerId
}
const res = await listAccountReceipt(params)
this.acctDetails = res.data || []
// 默认全选
this.formData.arIds = this.acctDetails.map(item => item.arId)
} catch (error) {
console.error('Failed to load account details:', error)
this.$message.error(this.$t('common.loadFailed'))
}
},
handleContentChange() {
if (!this.formData.ownerId) return
this.formData.detailIds = []
this.formData.arIds = []
if (this.formData.invoiceFlag === 'FEE') {
this.loadFeeDetails()
} else {
this.loadAcctDetails()
}
},
|
9b01bbd3
wuxw
开发完成发票相关功能
|
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
return
}
if (this.formData.invoiceFlag === 'FEE' && !this.formData.detailIds.length) {
this.$message.warning(this.$t('ownerApplyInvoice.noFeeSelected'))
return
}
if (this.formData.invoiceFlag === 'ACCT' && !this.formData.arIds.length) {
this.$message.warning(this.$t('ownerApplyInvoice.noDepositSelected'))
return
}
// 准备提交数据
const submitData = {
...this.formData,
detailIds: this.formData.invoiceFlag === 'FEE' ? this.formData.detailIds : [],
arIds: this.formData.invoiceFlag === 'ACCT' ? this.formData.arIds : []
}
// 调用API
await saveInvoiceApply(submitData)
|