f584c37d by lttnew

开票

1 parent daf1a72d
...@@ -205,12 +205,12 @@ ...@@ -205,12 +205,12 @@
205 <text class="value ">{{ item.orderName || '——' }}</text> 205 <text class="value ">{{ item.orderName || '——' }}</text>
206 </view> 206 </view>
207 <text :class="{ 207 <text :class="{
208 'status-wait': item.auditStatus == 0, 208 'status-wait': item.payStatus == 3,
209 'status-pending': item.auditStatus == 1, 209 'status-pending': item.payStatus == 0,
210 'status-success': item.auditStatus == 2, 210 'status-success': item.payStatus == 1,
211 'status-danger': item.auditStatus == 3 211 'status-danger': item.payStatus == 2
212 }" 212 }"
213 class="status-tag ">{{ getAuditStatusText(item.auditStatus) }} 213 class="status-tag ">{{ getStatusText(item.payStatus) }}
214 </text> 214 </text>
215 </view> 215 </view>
216 </view> 216 </view>
...@@ -228,7 +228,6 @@ ...@@ -228,7 +228,6 @@
228 <view class="date"> 228 <view class="date">
229 <view class="data-header"> 229 <view class="data-header">
230 <text class="value"> 230 <text class="value">
231 <text class="tradeNo">缴费编号:</text>
232 {{ item.wfCode || '——' }} 231 {{ item.wfCode || '——' }}
233 </text> 232 </text>
234 </view> 233 </view>
...@@ -297,7 +296,7 @@ ...@@ -297,7 +296,7 @@
297 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0"> 296 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0">
298 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" 297 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice"
299 @click.stop="makeInvoiceFN(item)"> 298 @click.stop="makeInvoiceFN(item)">
300 申请票据 299 申请开票
301 </button> 300 </button>
302 </template> 301 </template>
303 <!-- 已申请票据:查看票据 --> 302 <!-- 已申请票据:查看票据 -->
...@@ -718,12 +717,15 @@ const makeInvoiceFN = (item) => { ...@@ -718,12 +717,15 @@ const makeInvoiceFN = (item) => {
718 needRefresh.value = true; 717 needRefresh.value = true;
719 // 根据tab类型决定跳转页面:个人/单位会员开非税票,级位/段位/越段考试开增值税票 718 // 根据tab类型决定跳转页面:个人/单位会员开非税票,级位/段位/越段考试开增值税票
720 let url = ''; 719 let url = '';
720 const ziZhangBu = item.ziZhangBu ? '&ziZhangBu=1' : '';
721 if (currentTab.value === '0' || currentTab.value === '1') { 721 if (currentTab.value === '0' || currentTab.value === '1') {
722 // 个人/单位会员 - 非税开票 722 // 个人/单位会员 - 非税开票
723 url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}`; 723 // 如果是對公转账(ziZhangBu有值),只能开企业发票
724
725 url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}${ziZhangBu}`;
724 } else { 726 } else {
725 // 级位/段位/越段考试 - 增值税开票 727 // 级位/段位/越段考试 - 增值税开票
726 url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}`; 728 url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}${ziZhangBu}`;
727 } 729 }
728 uni.navigateTo({ url }); 730 uni.navigateTo({ url });
729 }; 731 };
......
1 <template> 1 <template>
2 <view class="invoice-apply"> 2 <view class="invoice-apply">
3 <!-- 成功确认弹框 -->
4 <view class="success-modal" v-if="showSuccessModal">
5 <view class="success-mask" @click="closeSuccessModal"></view>
6 <view class="success-content">
7 <view class="success-icon"></view>
8 <view class="success-title">发票申请提交成功!</view>
9 <view class="success-desc">您的发票申请已成功提交,我们将在1-7个工作日内为您处理。</view>
10 <button class="success-btn" @click="closeSuccessModal">确定</button>
11 </view>
12 </view>
13
3 <view class="content"> 14 <view class="content">
4 <!-- 发票信息标题 --> 15 <!-- 发票信息标题 -->
5 <view class="section-header"> 16 <view class="section-header">
...@@ -24,6 +35,7 @@ ...@@ -24,6 +35,7 @@
24 </view> 35 </view>
25 </view> 36 </view>
26 <view 37 <view
38 v-if="showIndividualType"
27 :class="{ active: form.type === '1' }" 39 :class="{ active: form.type === '1' }"
28 class="type-option" 40 class="type-option"
29 @click="form.type = '1'" 41 @click="form.type = '1'"
...@@ -45,6 +57,7 @@ ...@@ -45,6 +57,7 @@
45 <input 57 <input
46 v-model="form.name" 58 v-model="form.name"
47 class="input" 59 class="input"
60 :disabled="!showIndividualType"
48 :placeholder="form.type === '0' ? '请输入公司全称' : '请输入发票抬头'" 61 :placeholder="form.type === '0' ? '请输入公司全称' : '请输入发票抬头'"
49 /> 62 />
50 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致</text> 63 <text class="hint">请确保发票抬头与公司营业执照或个人身份证上的名称一致</text>
...@@ -58,6 +71,7 @@ ...@@ -58,6 +71,7 @@
58 class="input" 71 class="input"
59 maxlength="20" 72 maxlength="20"
60 placeholder="请输入纳税人识别号" 73 placeholder="请输入纳税人识别号"
74 :disabled="!showIndividualType"
61 /> 75 />
62 <text class="hint">企业税务登记证上的号码,一般为 15、18 或 20 位</text> 76 <text class="hint">企业税务登记证上的号码,一般为 15、18 或 20 位</text>
63 </view> 77 </view>
...@@ -82,8 +96,12 @@ ...@@ -82,8 +96,12 @@
82 import {ref, reactive} from 'vue'; 96 import {ref, reactive} from 'vue';
83 import {onLoad} from '@dcloudio/uni-app'; 97 import {onLoad} from '@dcloudio/uni-app';
84 import {outputInvoiceNoFeisui} from '@/common/api.js'; 98 import {outputInvoiceNoFeisui} from '@/common/api.js';
99 import customModal from '@/components/custom-modal.vue';
85 100
101 const app = getApp();
86 const submitting = ref(false); 102 const submitting = ref(false);
103 const showSuccessModal = ref(false);
104 const showIndividualType = ref(true);
87 105
88 // 表单数据 106 // 表单数据
89 const form = reactive({ 107 const form = reactive({
...@@ -100,6 +118,23 @@ onLoad((options) => { ...@@ -100,6 +118,23 @@ onLoad((options) => {
100 form.id = options.id || options.orderId; 118 form.id = options.id || options.orderId;
101 form.amount = options.amount || 0; 119 form.amount = options.amount || 0;
102 } 120 }
121
122 // 自动填充发票抬头和纳税人识别号(与PC端一致)
123 const memberInfo = app.globalData.memberInfo
124
125
126 // 如果是对公转账(ziZhangBu有值),默认只能开企业发票,隐藏个人选项
127 if (options.ziZhangBu == '1') {
128 form.type = '0'
129 showIndividualType.value = false
130 } else {
131 showIndividualType.value = true
132 }
133 if (memberInfo && options.ziZhangBu == '1') {
134 form.name = memberInfo.companyName || ''
135 form.taxno = memberInfo.creditCode || ''
136 }
137
103 console.log('非税开票参数:', options) 138 console.log('非税开票参数:', options)
104 }); 139 });
105 140
...@@ -122,7 +157,7 @@ const validateForm = () => { ...@@ -122,7 +157,7 @@ const validateForm = () => {
122 } 157 }
123 158
124 // 纳税人识别号格式校验 159 // 纳税人识别号格式校验
125 if (form.type === '0') { 160 if (form.type === '0' ) {
126 const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/; 161 const taxReg = /^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/;
127 if (!taxReg.test(form.taxno)) { 162 if (!taxReg.test(form.taxno)) {
128 uni.showToast({title: '纳税人识别号格式不正确', icon: 'none'}); 163 uni.showToast({title: '纳税人识别号格式不正确', icon: 'none'});
...@@ -142,13 +177,7 @@ const handleSubmit = async () => { ...@@ -142,13 +177,7 @@ const handleSubmit = async () => {
142 console.log('提交非税开票表单数据:', form); 177 console.log('提交非税开票表单数据:', form);
143 try { 178 try {
144 await outputInvoiceNoFeisui(form); 179 await outputInvoiceNoFeisui(form);
145 uni.showToast({ 180 showSuccessModal.value = true;
146 title: '开票申请提交成功',
147 icon: 'success'
148 });
149 setTimeout(() => {
150 uni.navigateBack();
151 }, 1500);
152 } catch (error) { 181 } catch (error) {
153 console.log('非税开票失败:', error); 182 console.log('非税开票失败:', error);
154 submitting.value = false; 183 submitting.value = false;
...@@ -156,6 +185,12 @@ const handleSubmit = async () => { ...@@ -156,6 +185,12 @@ const handleSubmit = async () => {
156 submitting.value = false; 185 submitting.value = false;
157 } 186 }
158 }; 187 };
188
189 // 关闭弹框并返回
190 function closeSuccessModal() {
191 showSuccessModal.value = false;
192 uni.navigateBack();
193 }
159 </script> 194 </script>
160 195
161 <style lang="scss" scoped> 196 <style lang="scss" scoped>
...@@ -342,4 +377,84 @@ const handleSubmit = async () => { ...@@ -342,4 +377,84 @@ const handleSubmit = async () => {
342 background: #c0c4cc; 377 background: #c0c4cc;
343 } 378 }
344 } 379 }
380
381 /* 成功弹框 */
382 .success-modal {
383 position: fixed;
384 top: 0;
385 left: 0;
386 right: 0;
387 bottom: 0;
388 z-index: 9999;
389 display: flex;
390 align-items: center;
391 justify-content: center;
392 }
393
394 .success-mask {
395 position: absolute;
396 top: 0;
397 left: 0;
398 right: 0;
399 bottom: 0;
400 background: rgba(0, 0, 0, 0.5);
401 }
402
403 .success-content {
404 position: relative;
405 width: 560rpx;
406 background: #fff;
407 border-radius: 24rpx;
408 padding: 50rpx 40rpx 40rpx;
409 box-sizing: border-box;
410 display: flex;
411 flex-direction: column;
412 align-items: center;
413 z-index: 1;
414 }
415
416 .success-icon {
417 width: 100rpx;
418 height: 100rpx;
419 border-radius: 50%;
420 background: #f0f9f0;
421 display: flex;
422 align-items: center;
423 justify-content: center;
424 margin-bottom: 30rpx;
425 font-size: 48rpx;
426 color: #52c41a;
427 }
428
429 .success-title {
430 font-size: 34rpx;
431 font-weight: 600;
432 color: #333;
433 margin-bottom: 16rpx;
434 text-align: center;
435 }
436
437 .success-desc {
438 font-size: 26rpx;
439 color: #999;
440 line-height: 1.6;
441 text-align: center;
442 margin-bottom: 40rpx;
443 }
444
445 .success-btn {
446 width: 100%;
447 height: 80rpx;
448 line-height: 80rpx;
449 background: #AD181F;
450 color: #fff;
451 font-size: 30rpx;
452 border-radius: 40rpx;
453 border: none;
454 text-align: center;
455 }
456
457 .success-btn::after {
458 border: none;
459 }
345 </style> 460 </style>
...\ No newline at end of file ...\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!