修改开票编辑后详情错位的bug

This commit is contained in:
qiaomu 2024-06-04 19:25:44 +08:00
parent 60fcd5f8e2
commit 8ecb1e5977

View File

@ -12,23 +12,17 @@
</view> </view>
<view slot="content"> <view slot="content">
<view wx:if="{{editType === 'detail'}}">
<van-field <van-field
label="发票类型" label="发票类型"
readonly="{{editType === 'detail'}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
type="textarea" type="textarea"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ false }}"
> >
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}"> <view slot="input" style="margin-top: -10rpx;">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">普通电子</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">增值税专用电子</van-radio>
</van-radio-group>
</view>
<view wx:else slot="input" style="margin-top: -10rpx;">
<view wx:if="{{detail.type === 0}}"> 普通电子发票 </view> <view wx:if="{{detail.type === 0}}"> 普通电子发票 </view>
<view wx:elif="{{detail.type === 1}}"> 增值税专用电子发票 </view> <view wx:elif="{{detail.type === 1}}"> 增值税专用电子发票 </view>
<view wx:else>-</view> <view wx:else>-</view>
@ -36,21 +30,14 @@
</van-field> </van-field>
<van-field <van-field
label="抬头类型" label="抬头类型"
readonly="{{editType === 'detail'}}" readonly="{{true}}"
autosize="{{true}}" autosize="{{true}}"
type="textarea" type="textarea"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ false }}"
> >
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
<view <view
wx:else
slot="input" slot="input"
style="margin-top: -10rpx;" style="margin-top: -10rpx;"
> >
@ -60,8 +47,6 @@
</view> </view>
</van-field> </van-field>
<van-field <van-field
wx:if="{{editType === 'detail'}}"
value="{{detail.name || '--'}}"
label="发票抬头" label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}" readonly="{{true}}"
@ -69,9 +54,140 @@
type="textarea" type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
/> >
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.name || '-'}} </view>
</view>
</van-field>
<van-field <van-field
wx:elif="{{editType === 'edit' && formData.headerType === 0 }}" label="发票税号"
wx:if="{{detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.tin || '-'}} </view>
</view>
</van-field>
<van-field
label="开户行"
wx:if="{{detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.bank || '-'}} </view>
</view>
</van-field>
<van-field
label="银行账号"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.account || '-'}} </view>
</view>
</van-field>
<van-field
label="地址"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.address || '-'}} </view>
</view>
</van-field>
<van-field
label="电话"
wx:if="{{(detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.phone || '-'}} </view>
</view>
</van-field>
<van-field
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
>
<view slot="input" style="margin-top: -10rpx;">
<view> {{detail.remark || '-'}} </view>
</view>
</van-field>
</view>
<view wx:else>
<van-field
label="发票类型"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ true }}"
>
<view slot="input" style="margin-top: 16rpx;">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">普通电子</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">增值税专用电子</van-radio>
</van-radio-group>
</view>
</van-field>
<van-field
label="抬头类型"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ true }}"
>
<view slot="input" style="margin-top: 16rpx;">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
</van-field>
<van-field
wx:if="{{formData.headerType === 0 }}"
value="{{formData.name || '--'}}" value="{{formData.name || '--'}}"
label="发票抬头" label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
@ -91,155 +207,79 @@
bind:change="onChangeText" bind:change="onChangeText"
border="{{ true }}" border="{{ true }}"
/> />
<van-field
value="{{detail.tin|| '--'}}"
label="发票税号"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field <van-field
value="{{formData.tin }}" value="{{formData.tin }}"
label="发票税号" label="发票税号"
wx:if="{{editType === 'edit' && formData.headerType === 0}}" wx:if="{{formData.headerType === 0}}"
placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}" placeholder="{{'请输入发票税号'}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
title-width="132rpx" title-width="132rpx"
bind:change="onChangeText" bind:change="onChangeText"
data-name="tin" data-name="tin"
border="{{ editType === 'detail' ? false : true }}" border="{{true }}"
/>
<van-field
value="{{detail.bank || '--'}}"
label="开户行"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/> />
<van-field <van-field
value="{{formData.bank}}" value="{{formData.bank}}"
label="开户行" label="开户行"
wx:if="{{editType === 'edit' && formData.headerType === 0}}" wx:if="{{ formData.headerType === 0}}"
placeholder="{{'请输入开户行'}}" placeholder="{{'请输入开户行'}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="bank" data-name="bank"
/> />
<van-field
value="{{detail.account || '--'}}"
label="银行账号"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field <van-field
value="{{formData.account}}" value="{{formData.account}}"
label="银行账号" label="银行账号"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}" wx:if="{{(formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}" placeholder="{{'请输入银行账号' }}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="account" data-name="account"
/> />
<van-field
value="{{detail.address || '--'}}"
label="地址"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field <van-field
value="{{formData.address}}" value="{{formData.address}}"
label="地址" label="地址"
wx:if="{{(editType === 'edit' && formData.headerType === 0)}}" wx:if="{{(formData.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}" placeholder="{{'请输入地址'}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="address" data-name="address"
/> />
<van-field
value="{{detail.phone || '--'}}"
label="电话"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field <van-field
value="{{formData.phone }}" value="{{formData.phone }}"
label="电话" label="电话"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}" wx:if="{{(formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}" placeholder="{{ '请输入电话'}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="phone" data-name="phone"
/> />
<van-field
value="{{detail.remark || '--'}}"
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
<van-field <van-field
value="{{formData.remark}}" value="{{formData.remark}}"
label="备注" label="备注"
wx:else placeholder="{{'请输入备注'}}"
placeholder="{{editType === 'edit' ? '请输入备注' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{true }}"
bind:change="onChangeText" bind:change="onChangeText"
data-name="remark" data-name="remark"
/> />
</view> </view>
</view>
</card> </card>
</view> </view>
<view class="cardWrapper" style="margin-bottom: 40rpx;"> <view class="cardWrapper" style="margin-bottom: 40rpx;">