|
@@ -12,11 +12,11 @@
|
|
|
</div>
|
|
|
<div class="form invoiceForm">
|
|
|
<van-form @submit="onSubmit" style="margin-top: 10px; background: #fff">
|
|
|
- <van-field name="radio" label="发票类型" input-align="right">
|
|
|
+ <van-field name="radio" label="发票类型" input-align="right">
|
|
|
<template #input>
|
|
|
<van-radio-group v-model="formData.invoiceType" direction="horizontal">
|
|
|
- <van-radio :name="0">普通发票</van-radio>
|
|
|
- <van-radio :name="1">专用发票</van-radio>
|
|
|
+ <van-radio :name="0" checked-color="#00B3EC">普通发票</van-radio>
|
|
|
+ <van-radio :name="1" checked-color="#00B3EC">专用发票</van-radio>
|
|
|
</van-radio-group>
|
|
|
</template>
|
|
|
</van-field>
|
|
@@ -69,7 +69,8 @@
|
|
|
placeholder="请填写企业电话"
|
|
|
:rules="[{ required: true, message: '请填写企业电话' }]"
|
|
|
/>
|
|
|
- <van-field v-if="formData.invoiceType == 0"
|
|
|
+ <van-field
|
|
|
+ v-if="formData.invoiceType == 0"
|
|
|
v-model="formData.invoiceEmail"
|
|
|
input-align="right"
|
|
|
name="电子邮箱"
|
|
@@ -77,7 +78,8 @@
|
|
|
placeholder="请填写接收发票邮箱"
|
|
|
:rules="[{ required: true, message: '请填写接收发票邮箱' }]"
|
|
|
/>
|
|
|
- <van-field v-if="formData.invoiceType == 1"
|
|
|
+ <van-field
|
|
|
+ v-if="formData.invoiceType == 1"
|
|
|
v-model="formData.getAddress"
|
|
|
input-align="right"
|
|
|
name="收件地址"
|
|
@@ -85,7 +87,8 @@
|
|
|
placeholder="请填写收件地址"
|
|
|
:rules="[{ required: true, message: '请填写收件地址' }]"
|
|
|
/>
|
|
|
- <van-field v-if="formData.invoiceType == 1"
|
|
|
+ <van-field
|
|
|
+ v-if="formData.invoiceType == 1"
|
|
|
v-model="formData.getAddrName"
|
|
|
input-align="right"
|
|
|
name="收件人"
|
|
@@ -93,24 +96,28 @@
|
|
|
placeholder="请填写收件人姓名"
|
|
|
:rules="[{ required: true, message: '请填写收件人姓名' }]"
|
|
|
/>
|
|
|
- <van-field v-if="formData.invoiceType == 1"
|
|
|
+ <van-field
|
|
|
+ v-if="formData.invoiceType == 1"
|
|
|
v-model="formData.getAddrPhone"
|
|
|
input-align="right"
|
|
|
name="收件人电话"
|
|
|
label="收件人电话"
|
|
|
placeholder="请填写收件人电话"
|
|
|
- :rules="[{ required: true, message: '请填写手机号' }, {
|
|
|
- // 自定义校验规则
|
|
|
- validator: (value) => {
|
|
|
- return /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(value);
|
|
|
- },
|
|
|
- message: '请输入正确格式的手机号码',
|
|
|
- trigger: 'onBlur',
|
|
|
-}]"
|
|
|
+ :rules="[
|
|
|
+ { required: true, message: '请填写手机号' },
|
|
|
+ {
|
|
|
+ // 自定义校验规则
|
|
|
+ validator: (value) => {
|
|
|
+ return /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(value);
|
|
|
+ },
|
|
|
+ message: '请输入正确格式的手机号码',
|
|
|
+ trigger: 'onBlur',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
- <div class="but">
|
|
|
- <van-button round block type="primary" native-type="submit"> 提交 </van-button>
|
|
|
+ <div class="but" style="background-color: #f5f5f5">
|
|
|
+ <van-button block type="primary" native-type="submit"> 提交 </van-button>
|
|
|
</div>
|
|
|
</van-form>
|
|
|
</div>
|
|
@@ -119,7 +126,7 @@
|
|
|
|
|
|
<script lang="ts" setup name="detailPage">
|
|
|
import { ref, onMounted, unref } from 'vue';
|
|
|
-import { getInvoiceAddress, invoiceApply } from '/@/api'
|
|
|
+import { getInvoiceAddress, invoiceApply } from '/@/api';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
const router = useRouter();
|
|
|
const { id } = unref(router.currentRoute)?.params;
|
|
@@ -132,64 +139,67 @@ const formData = ref({
|
|
|
invoiceHead: '',
|
|
|
checked: '1',
|
|
|
checkeds: '1',
|
|
|
- invoiceAmount:0,
|
|
|
- invoiceType:0,
|
|
|
- phone:'',
|
|
|
- getAddrName:'',
|
|
|
- getAddrPhone:'',
|
|
|
- getAddress:'',
|
|
|
+ invoiceAmount: 0,
|
|
|
+ invoiceType: 0,
|
|
|
+ phone: '',
|
|
|
+ getAddrName: '',
|
|
|
+ getAddrPhone: '',
|
|
|
+ getAddress: '',
|
|
|
+});
|
|
|
+onMounted(async () => {
|
|
|
+ let { data } = await getInvoiceAddress('20230227175908840');
|
|
|
+ formData.value.invoiceAmount = data.payAmount;
|
|
|
+ formData.value.getAddrName = data.getAddrName;
|
|
|
+ formData.value.getAddrPhone = data.getAddrPhone;
|
|
|
+ formData.value.getAddress = data.getAddress;
|
|
|
});
|
|
|
-onMounted( async ()=>{
|
|
|
- let { data } = await getInvoiceAddress('20230227175908840')
|
|
|
- console.log('payAmount',data)
|
|
|
- formData.value.invoiceAmount = data.payAmount
|
|
|
- formData.value.getAddrName = data.getAddrName
|
|
|
- formData.value.getAddrPhone = data.getAddrPhone
|
|
|
- formData.value.getAddress = data.getAddress
|
|
|
-})
|
|
|
async function onSubmit() {
|
|
|
const res = await invoiceApply({
|
|
|
...formData.value,
|
|
|
- repairId:id,
|
|
|
- })
|
|
|
- console.log(res)
|
|
|
+ repairId: id,
|
|
|
+ });
|
|
|
+ console.log(res);
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" >
|
|
|
- .van-cell-group{
|
|
|
- margin: 0 !important;
|
|
|
- }
|
|
|
-.evaluate {
|
|
|
- min-height: 100vh;
|
|
|
- background-color: #f5f5f5;
|
|
|
- .invoiceForm{
|
|
|
- .van-field__error-message{
|
|
|
- text-align: right;
|
|
|
+ .evaluate {
|
|
|
+
|
|
|
+ .van-cell-group {
|
|
|
+ margin: 0 !important;
|
|
|
+ }
|
|
|
+ .van-radio--horizontal {
|
|
|
+ margin: 0 0 0 20px;
|
|
|
}
|
|
|
- }
|
|
|
- .evaluate_top {
|
|
|
- background-color: #fff;
|
|
|
- .border {
|
|
|
- border-top: 1px solid #e7e7e7;
|
|
|
+ min-height: 100vh;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ .invoiceForm {
|
|
|
+ .van-field__error-message {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
}
|
|
|
- .colortext {
|
|
|
- color: #e34d59;
|
|
|
+ .evaluate_top {
|
|
|
+ background-color: #fff;
|
|
|
+ .border {
|
|
|
+ border-top: 1px solid #e7e7e7;
|
|
|
+ }
|
|
|
+ .colortext {
|
|
|
+ color: #e34d59;
|
|
|
+ }
|
|
|
+ .cell {
|
|
|
+ height: 48px;
|
|
|
+ padding: 0 15px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: PingFang SC-Regular, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
}
|
|
|
- .cell {
|
|
|
- height: 48px;
|
|
|
- padding: 0 15px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFang SC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #333333;
|
|
|
+ .but {
|
|
|
+ padding: 25px 15px;
|
|
|
}
|
|
|
- }
|
|
|
- .but {
|
|
|
- padding: 25px 15px;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|
|
|
|