修改发票下载查询和发票信息修改
This commit is contained in:
parent
8ecb1e5977
commit
8b970f2b8f
|
@ -1,5 +1,5 @@
|
||||||
import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice";
|
import { getInvoiceInfoDetail, downloadInvoice } from "../../service/invoice";
|
||||||
import { alertInfo, loadingFunc } from "../../utils/index";
|
import { alertError, alertInfo, loadingFunc } from "../../utils/index";
|
||||||
import request from '../../utils/request'
|
import request from '../../utils/request'
|
||||||
const { OK } = request;
|
const { OK } = request;
|
||||||
// pages/invoiceInfo/index.js
|
// pages/invoiceInfo/index.js
|
||||||
|
@ -43,10 +43,18 @@ Page({
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!data) {
|
||||||
|
alertInfo("暂无文档信息")
|
||||||
|
return
|
||||||
|
}
|
||||||
wx.downloadFile({
|
wx.downloadFile({
|
||||||
url: data,
|
url: data,
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
|
if (!res.tempFilePath) {
|
||||||
|
alertError("没有开票信息")
|
||||||
|
return;
|
||||||
|
}
|
||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
fileType: [res.tapIndex === 0 ? 'xml' : "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
fileType: [res.tapIndex === 0 ? 'xml' : "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||||
|
@ -54,11 +62,15 @@ Page({
|
||||||
|
|
||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function (e) {
|
||||||
|
alertError("打开失败")
|
||||||
|
console.log('打开失败错误为', e)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fail: (e) => {
|
||||||
|
console.log('e', e)
|
||||||
|
alertInfo("下载文件失败")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -31,3 +31,9 @@
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.operate {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice"
|
import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice"
|
||||||
import { getUserInfo } from "../../../../service/user";
|
import { getUserInfo } from "../../../../service/user";
|
||||||
import { alertInfo, alertSuccess } from "../../../../utils/index";
|
import { alertInfo, alertSuccess, isValidPhoneNumber } from "../../../../utils/index";
|
||||||
import request from '../../../../utils/request'
|
import request from '../../../../utils/request'
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
|
|
||||||
|
@ -93,9 +93,9 @@ Component({
|
||||||
// alertInfo("请输入地址")
|
// alertInfo("请输入地址")
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
if (!phone) {
|
if (phone && !isValidPhoneNumber(phone)) {
|
||||||
alertInfo("请输入电话")
|
alertInfo("手机号格式不正确")
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
if (!bank) {
|
if (!bank) {
|
||||||
alertInfo("请输入开户行")
|
alertInfo("请输入开户行")
|
||||||
|
|
|
@ -121,23 +121,7 @@
|
||||||
<view> {{detail.address || '-'}} </view>
|
<view> {{detail.address || '-'}} </view>
|
||||||
</view>
|
</view>
|
||||||
</van-field>
|
</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
|
<van-field
|
||||||
label="备注"
|
label="备注"
|
||||||
wx:if="{{editType === 'detail' }}"
|
wx:if="{{editType === 'detail' }}"
|
||||||
|
@ -255,17 +239,7 @@
|
||||||
data-name="address"
|
data-name="address"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-field
|
|
||||||
value="{{formData.phone }}"
|
|
||||||
label="电话"
|
|
||||||
wx:if="{{(formData.headerType === 0) }}"
|
|
||||||
placeholder="{{ '请输入电话'}}"
|
|
||||||
custom-style="padding-left: 0; padding-right: 0;"
|
|
||||||
title-width="132rpx"
|
|
||||||
border="{{ true }}"
|
|
||||||
bind:change="onChangeText"
|
|
||||||
data-name="phone"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<van-field
|
<van-field
|
||||||
value="{{formData.remark}}"
|
value="{{formData.remark}}"
|
||||||
|
@ -285,6 +259,38 @@
|
||||||
<view class="cardWrapper" style="margin-bottom: 40rpx;">
|
<view class="cardWrapper" style="margin-bottom: 40rpx;">
|
||||||
<card title="接收信息">
|
<card title="接收信息">
|
||||||
<view slot="content">
|
<view slot="content">
|
||||||
|
<view wx:if="{{editType === 'detail'}}">
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
<view wx:else>
|
||||||
|
<van-field
|
||||||
|
value="{{formData.phone }}"
|
||||||
|
label="手机号"
|
||||||
|
wx:if="{{(formData.headerType === 0) }}"
|
||||||
|
placeholder="{{ '请输入手机号' }}"
|
||||||
|
custom-style="padding-left: 0; padding-right: 0;"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{ true }}"
|
||||||
|
bind:change="onChangeText"
|
||||||
|
data-name="phone"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{detail.email || '--'}}"
|
value="{{detail.email || '--'}}"
|
||||||
wx:if="{{editType === 'detail'}}"
|
wx:if="{{editType === 'detail'}}"
|
||||||
|
@ -297,7 +303,11 @@
|
||||||
border="{{ editType === 'detail' ? false : true }}"
|
border="{{ editType === 'detail' ? false : true }}"
|
||||||
bind:change="onChangeText"
|
bind:change="onChangeText"
|
||||||
data-name="email"
|
data-name="email"
|
||||||
/>
|
>
|
||||||
|
<view slot="input" style="margin-top: -10rpx;">
|
||||||
|
<view> {{detail.email || '-'}} </view>
|
||||||
|
</view>
|
||||||
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{formData.email}}"
|
value="{{formData.email}}"
|
||||||
wx:else
|
wx:else
|
||||||
|
|
|
@ -233,3 +233,8 @@ export const getPixelRatio = () => {
|
||||||
})
|
})
|
||||||
return pixelRatio
|
return pixelRatio
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function isValidPhoneNumber(phoneNumber) {
|
||||||
|
return /^1\d{10}$/.test(phoneNumber);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user