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

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

View File

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