|
|
@@ -19,40 +19,40 @@
|
|
|
<!-- 增值税发票 -->
|
|
|
<template v-if="form.type == 2">
|
|
|
|
|
|
- <u-form-item label="申请主体" label-width="130" required prop="main">
|
|
|
- <u-radio-group v-model="form.main">
|
|
|
+ <u-form-item label="申请主体" label-width="130" required prop="subject">
|
|
|
+ <u-radio-group v-model="form.subject">
|
|
|
<u-radio :key="index" name="2">
|
|
|
企业
|
|
|
</u-radio>
|
|
|
</u-radio-group>
|
|
|
</u-form-item>
|
|
|
|
|
|
- <u-form-item label="发票抬头" label-width="130" required prop="header" >
|
|
|
- <u-input placeholder="请输入" v-model="form.header" />
|
|
|
+ <u-form-item label="发票抬头" label-width="130" required prop="invoiceTitle" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.invoiceTitle" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="单位税号" label-width="130" required prop="tax" >
|
|
|
- <u-input placeholder="请输入" v-model="form.tax" />
|
|
|
+ <u-form-item label="单位税号" label-width="130" required prop="taxRegistryNumber" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.taxRegistryNumber" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="单位地址" label-width="130" required prop="address" >
|
|
|
- <u-input placeholder="请输入" v-model="form.address" />
|
|
|
+ <u-form-item label="单位地址" label-width="130" required prop="companyAddress" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.companyAddress" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="电话号码" label-width="130" required prop="tel" >
|
|
|
- <u-input placeholder="请输入" v-model="form.tel" />
|
|
|
+ <u-form-item label="电话号码" label-width="130" required prop="phone" >
|
|
|
+ <u-input placeholder="请输入" type="number" v-model="form.phone" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="开户银行" label-width="130" required prop="bank" >
|
|
|
- <u-input placeholder="请输入" v-model="form.bank" />
|
|
|
+ <u-form-item label="开户银行" label-width="130" required prop="bankName" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.bankName" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="银行账号" label-width="130" required prop="bankNo" >
|
|
|
- <u-input placeholder="请输入" v-model="form.bankNo" />
|
|
|
+ <u-form-item label="银行账号" label-width="130" required prop="bankAccount" >
|
|
|
+ <u-input placeholder="请输入" type="number" v-model="form.bankAccount" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="收件地址" label-width="130" required prop="recieveAddress" >
|
|
|
- <u-input placeholder="请输入" v-model="form.recieveAddress" />
|
|
|
+ <u-form-item label="收件地址" label-width="130" required prop="receivingAddress" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.receivingAddress" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="收件人" label-width="130" required prop="name" >
|
|
|
- <u-input placeholder="请输入" v-model="form.name" />
|
|
|
+ <u-form-item label="收件人" label-width="130" required prop="receivingName" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.receivingName" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="收件手机" label-width="130" required prop="phone" >
|
|
|
- <u-input placeholder="请输入" v-model="form.phone" />
|
|
|
+ <u-form-item label="收件手机" label-width="130" required prop="receivingTel" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.receivingTel" />
|
|
|
</u-form-item>
|
|
|
|
|
|
</template>
|
|
|
@@ -60,24 +60,24 @@
|
|
|
|
|
|
<!-- 普通发票 -->
|
|
|
<template v-else>
|
|
|
- <u-form-item label="申请主体" label-width="130" required prop="main">
|
|
|
- <u-radio-group v-model="form.main">
|
|
|
+ <u-form-item label="申请主体" label-width="130" required prop="subject">
|
|
|
+ <u-radio-group v-model="form.subject">
|
|
|
<u-radio v-for="(item, index) in mainList" :key="index" :name="item.value">
|
|
|
{{ item.name }}
|
|
|
</u-radio>
|
|
|
</u-radio-group>
|
|
|
</u-form-item>
|
|
|
|
|
|
- <u-form-item label="发票抬头" label-width="130" required prop="header" >
|
|
|
- <u-input placeholder="请输入" v-model="form.header" />
|
|
|
+ <u-form-item label="发票抬头" label-width="130" required prop="invoiceTitle" >
|
|
|
+ <u-input placeholder="请输入" v-model="form.invoiceTitle" />
|
|
|
</u-form-item>
|
|
|
</template>
|
|
|
<!-- 普通发票 -->
|
|
|
|
|
|
|
|
|
- <u-form-item label="选择订单" label-width="130" required prop="orderIds" right-icon="arrow-right" ref="orderIds">
|
|
|
+ <u-form-item label="选择订单" label-width="130" required prop="orderGoodsIds" right-icon="arrow-right" ref="orderGoodsIds">
|
|
|
<view class="form-item" @click="selectOrderModal = true">
|
|
|
- <u-input placeholder="请选择" disabled @click="selectOrderModal = true" v-model="form.orderIds" />
|
|
|
+ <u-input placeholder="请选择" disabled @click="selectOrderModal = true" v-model="form.orderGoodsIds" />
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
<view>
|
|
|
@@ -85,9 +85,9 @@
|
|
|
<view class="close" @click="deleteOrder(index)">
|
|
|
<u-icon name="close-circle-fill" color="#FF2D55" size="40"></u-icon>
|
|
|
</view>
|
|
|
- <view class="title">商品名称</view>
|
|
|
- <view class="number">订单编号</view>
|
|
|
- <view class="price">¥ 100元</view>
|
|
|
+ <view class="title">商品名称:{{item.goodsName}}</view>
|
|
|
+ <view class="number">订单编号:{{item.orderSn}}</view>
|
|
|
+ <view class="price">价格:¥ {{item.goodsPrice}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -96,7 +96,7 @@
|
|
|
|
|
|
<view class="order-text">
|
|
|
<view class="order-text__label">本次申请开票金额:</view>
|
|
|
- <view class="order-text__price">¥ 999.00</view>
|
|
|
+ <view class="order-text__price">¥ {{toFixed(invoicePirce)}}</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="submit" @click="formSubmit">
|
|
|
@@ -109,14 +109,14 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="record__list">
|
|
|
- <view class="record-item" @click="orderDetailModal = true;" v-for="(record,index) in recordList" :key="index">
|
|
|
+ <view class="record-item" @click="showDetailModal(record);" v-for="(record,index) in recordList" :key="index">
|
|
|
<view class="item__time">2021/10/29 09:30:00</view>
|
|
|
<view class="item__content">
|
|
|
<view class="top">
|
|
|
- <view class="state" :class="{wait:record.state == 1,refuse:record.state == 2,agree:record.state == 3}">
|
|
|
- <text v-if="record.state == 1">待审核</text>
|
|
|
- <text v-if="record.state == 2">驳回</text>
|
|
|
- <text v-if="record.state == 3">通过</text>
|
|
|
+ <view class="state" :class="{wait:record.periodStatus == 1,refuse:record.periodStatus == 2,agree:record.periodStatus == 3}">
|
|
|
+ <text v-if="record.periodStatus == 1">待审核</text>
|
|
|
+ <text v-if="record.periodStatus == 2">驳回</text>
|
|
|
+ <text v-if="record.periodStatus == 3">通过</text>
|
|
|
<u-icon class="arrow" name="arrow-right" color="#ffffff" size="28"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -125,33 +125,36 @@
|
|
|
<view class="flex">
|
|
|
<view class="text">发票类型</view>
|
|
|
<view class="flex__auto">
|
|
|
- <text>普通发票</text>
|
|
|
+ <text v-if="record.type == 1">普通发票</text>
|
|
|
+ <text v-if="record.type == 2">增值税专用发票</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex">
|
|
|
<view class="text">申请主体</view>
|
|
|
<view class="flex__auto">
|
|
|
- <text>个人</text>
|
|
|
+ <text v-if="record.subject == 1">个人</text>
|
|
|
+ <text v-if="record.subject == 2">企业</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex">
|
|
|
<view class="text">发票状态</view>
|
|
|
<view class="flex__auto">
|
|
|
- <text class="red" :class="{red:record.state != 2 ,green:record.state == 2}">未开票</text>
|
|
|
+ <text class="red" v-if="record.invoiceStatus == 1">未开票</text>
|
|
|
+ <text class="green" v-if="record.invoiceStatus == 2">已开票</text>
|
|
|
+ <text class="red" v-if="record.invoiceStatus == -1">已退票</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view @click.stop="showOrder(record.checked,index)">
|
|
|
<view class="flex noborder" >
|
|
|
<view class="text">开票订单</view>
|
|
|
<view class="flex__auto">
|
|
|
- <text class="red">3</text>
|
|
|
+ <text style="margin-right:10rpx;">{{record.orderList.length}}</text>
|
|
|
<u-icon v-if="!record.checked" name="arrow-down" color="#ccc" size="28"></u-icon>
|
|
|
<u-icon v-if="record.checked" name="arrow-up" color="#ccc" size="28"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="order-list" v-if="record.checked">
|
|
|
- <view class="order-item">1.2021七大员新考施工专业人员岗提高班</view>
|
|
|
- <view class="order-item">2.2021七大员新考施工专业人员岗提高班订单名称过长换行</view>
|
|
|
+ <view class="order-item" :key="orderIndex" v-for="(orderItem,orderIndex) in record.orderList">{{orderIndex+1}}.{{orderItem.goodsName}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -181,9 +184,9 @@
|
|
|
>
|
|
|
<view class="order-item__bg" :class="item.checked?'active':''" >
|
|
|
<view>
|
|
|
- <view class="order-title">商品名称</view>
|
|
|
- <view class="order-number">订单编号</view>
|
|
|
- <view class="order-price">¥ 100元</view>
|
|
|
+ <view class="order-title">{{item.goodsName}}</view>
|
|
|
+ <view class="order-number">{{item.orderSn}}</view>
|
|
|
+ <view class="order-price">¥ {{item.goodsPrice}}元</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-checkbox >
|
|
|
@@ -204,7 +207,7 @@
|
|
|
<u-popup class="modal" v-model="orderDetailModal" mode="center" border-radius="40">
|
|
|
<view class="order-detail">
|
|
|
<view class="order-detail__content">
|
|
|
- <scroll-view scroll-y="true" style="height: 972rpx;">
|
|
|
+ <scroll-view scroll-y="true" style="height: 860rpx;">
|
|
|
<view class="content">
|
|
|
<view class="header">2021年10月29日 09:30:00</view>
|
|
|
<view class="body">
|
|
|
@@ -213,75 +216,63 @@
|
|
|
<view class="content">
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">发票类型:</view>
|
|
|
- <text>普通发票</text>
|
|
|
+ <text v-if="invoiceDetail.type == 1">普通发票</text>
|
|
|
+ <text v-if="invoiceDetail.type == 2">增值税专用发票</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">申请主体:</view>
|
|
|
- <text>个人</text>
|
|
|
+ <text v-if="invoiceDetail.subject == 1">个人</text>
|
|
|
+ <text v-if="invoiceDetail.subject == 2">企业</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">发票抬头:</view>
|
|
|
- <text>广东中正科技教育科技有限公司</text>
|
|
|
+ <text>{{invoiceDetail.invoiceTitle}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">单位税号:</view>
|
|
|
- <text>SH123456789</text>
|
|
|
+ <text>{{invoiceDetail.taxRegistryNumber || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">单位地址:</view>
|
|
|
- <text>广州市天河区燕岭路123号建设大厦F座 16楼过长换行</text>
|
|
|
+ <text>{{invoiceDetail.companyAddress || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">电话号码:</view>
|
|
|
- <text>企业 拷贝</text>
|
|
|
+ <text>{{invoiceDetail.phone || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">开户银行:</view>
|
|
|
- <text>中国工商银行星星支行</text>
|
|
|
+ <text>{{invoiceDetail.bankName || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">银行账号:</view>
|
|
|
- <text>SH123456789 拷贝</text>
|
|
|
+ <text>{{invoiceDetail.bankAccount || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">收件地址:</view>
|
|
|
- <text>广州市天河区燕岭路123号</text>
|
|
|
+ <text>{{invoiceDetail.receivingAddress || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">收件人:</view>
|
|
|
- <text>李大米</text>
|
|
|
- </u-cell-item>
|
|
|
- <u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
- <view slot="title">发票抬头:</view>
|
|
|
- <text>广东中正科技教育科技有限公司</text>
|
|
|
+ <text>{{invoiceDetail.receivingName || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
|
|
|
<view slot="title">收件手机:</view>
|
|
|
- <text>13800138000</text>
|
|
|
+ <text>{{invoiceDetail.receivingTel || ''}}</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
|
|
|
<view slot="title">开票订单:</view>
|
|
|
</u-cell-item>
|
|
|
<view class="order-list">
|
|
|
- <view class="order-item">
|
|
|
- <view class="order-title">2021七大员新考施工专业人员岗提高班</view>
|
|
|
- <view class="order-number">GDXY1234567890</view>
|
|
|
- <view class="order-price">¥ 100元</view>
|
|
|
- </view>
|
|
|
- <view class="order-item">
|
|
|
- <view class="order-title">2021七大员新考施工专业人员岗提高班</view>
|
|
|
- <view class="order-number">GDXY1234567890</view>
|
|
|
- <view class="order-price">¥ 100元</view>
|
|
|
- </view>
|
|
|
- <view class="order-item">
|
|
|
- <view class="order-title">2021七大员新考施工专业人员岗提高班</view>
|
|
|
- <view class="order-number">GDXY1234567890</view>
|
|
|
- <view class="order-price">¥ 100元</view>
|
|
|
+ <view class="order-item" :key="orderIndex" v-for="(orderItem,orderIndex) in invoiceDetail.orderList">
|
|
|
+ <view class="order-title">{{orderItem.goodsName}}</view>
|
|
|
+ <view class="order-number">{{orderItem.orderSn}}</view>
|
|
|
+ <view class="order-price">¥ {{orderItem.goodsRealPrice}}元</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="order-text">
|
|
|
<view class="order-text__label">本次申请开票金额:</view>
|
|
|
- <view class="order-text__price">¥ 999.00</view>
|
|
|
+ <view class="order-text__price">¥ {{toFixed(invoiceDetail.amount)}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -290,34 +281,35 @@
|
|
|
<view class="content">
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">审核结果:</view>
|
|
|
- <text class="text wait">待审核</text>
|
|
|
- <text class="text agree">通过</text>
|
|
|
- <text class="text refuse">驳回</text>
|
|
|
+ <text class="text wait" v-if="invoiceDetail.periodStatus == 1">待审核</text>
|
|
|
+ <text class="text agree" v-if="invoiceDetail.periodStatus == 3">通过</text>
|
|
|
+ <text class="text refuse" v-if="invoiceDetail.periodStatus == 2">驳回</text>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">发票状态:</view>
|
|
|
- <text class="text refuse">未开票</text>
|
|
|
- <text class="text agree">已开票</text>
|
|
|
- <text class="text refuse">已退票</text>
|
|
|
+ <text class="text refuse" v-if="invoiceDetail.invoiceStatus == 1">未开票</text>
|
|
|
+ <text class="text agree" v-if="invoiceDetail.invoiceStatus == 2">已开票</text>
|
|
|
+ <text class="text refuse" v-if="invoiceDetail.invoiceStatus == -1">已退票</text>
|
|
|
</u-cell-item>
|
|
|
|
|
|
- <u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
+ <u-cell-item :border-bottom="false" hover-class="none" :arrow="false" v-if="invoiceDetail.invoiceImg">
|
|
|
<view slot="title">发票预览:</view>
|
|
|
<view>
|
|
|
- <image class="preview" src="/static/info_3.png"></image>
|
|
|
- <view class="download-btn" @click="download">下载电子发票</view>
|
|
|
+ <image class="preview" @click="previewImg(invoiceDetail)" :src="$method.splitImgHost(invoiceDetail.invoiceImg)"></image>
|
|
|
+ <view class="download-btn" @click="download(invoiceDetail)">下载电子发票</view>
|
|
|
</view>
|
|
|
</u-cell-item>
|
|
|
|
|
|
|
|
|
<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
<view slot="title">机构发票邮寄状态:</view>
|
|
|
- <text class="text">是</text>
|
|
|
+ <text class="text" v-if="invoiceDetail.sendInvoice == 1">是</text>
|
|
|
+ <text class="text" v-else>否</text>
|
|
|
</u-cell-item>
|
|
|
|
|
|
- <u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
- <view slot="title">发票邮寄快递单号:</view>
|
|
|
- <text class="text">153666689456</text>
|
|
|
+ <u-cell-item v-if="invoiceDetail.sendInvoice == 1" @click.stop="copy(invoiceDetail.trackingNum)" :border-bottom="false" hover-class="none" :arrow="false">
|
|
|
+ <view slot="title">发票邮寄快递单号:(点击可复制)</view>
|
|
|
+ <text class="text">{{invoiceDetail.trackingNum}}</text>
|
|
|
</u-cell-item>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -326,12 +318,12 @@
|
|
|
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
- <view class="order-detail__btns">
|
|
|
+ <view class="order-detail__btns" v-if="invoiceDetail.periodStatus == 1">
|
|
|
<view class="btn" @click="orderDetailModal = false;">知道了</view>
|
|
|
<view class="btn warm" @click="orderCancelModal = true;">撤销申请</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="order-detail__btns">
|
|
|
+ <view class="order-detail__btns" v-else>
|
|
|
<view class="btn ok" @click="orderDetailModal = false;">知道了</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -364,16 +356,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
checkOrderList:[],
|
|
|
- recordList:[{
|
|
|
- checked:false,
|
|
|
- state:'1'
|
|
|
- },{
|
|
|
- checked:false,
|
|
|
- state:'2'
|
|
|
- },{
|
|
|
- checked:false,
|
|
|
- state:'3'
|
|
|
- }],
|
|
|
+ recordList:[],
|
|
|
list: [
|
|
|
{
|
|
|
name: '发票申请'
|
|
|
@@ -382,14 +365,25 @@ export default {
|
|
|
name: '发票记录'
|
|
|
}
|
|
|
],
|
|
|
+ invoiceDetail:{
|
|
|
+ amount:0
|
|
|
+ },
|
|
|
form:{
|
|
|
type:'1',
|
|
|
- main:'',
|
|
|
- header:'',
|
|
|
- orderIds:'',
|
|
|
+ subject:'',
|
|
|
+ invoiceTitle:'',
|
|
|
+ orderGoodsIds:'',
|
|
|
+ taxRegistryNumber:'',
|
|
|
+ companyAddress:'',
|
|
|
+ phone:'',
|
|
|
+ bankName:'',
|
|
|
+ bankAccount:'',
|
|
|
+ receivingAddress:'',
|
|
|
+ receivingName:'',
|
|
|
+ receivingTel:'',
|
|
|
},
|
|
|
rules: {
|
|
|
- phone: [
|
|
|
+ receivingTel: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入收件手机',
|
|
|
@@ -415,7 +409,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- main: [
|
|
|
+ subject: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择申请主体',
|
|
|
@@ -423,7 +417,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- header: [
|
|
|
+ invoiceTitle: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入发票抬头',
|
|
|
@@ -431,7 +425,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- tax: [
|
|
|
+ taxRegistryNumber: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入单位税号',
|
|
|
@@ -439,7 +433,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- address: [
|
|
|
+ companyAddress: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入单位地址',
|
|
|
@@ -447,7 +441,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- tel: [
|
|
|
+ phone: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入电话号码',
|
|
|
@@ -455,7 +449,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- bank: [
|
|
|
+ bankName: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入开户银行',
|
|
|
@@ -463,7 +457,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- bankNo: [
|
|
|
+ bankAccount: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入银行账号',
|
|
|
@@ -471,7 +465,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- recieveAddress: [
|
|
|
+ receivingAddress: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入收件地址',
|
|
|
@@ -479,7 +473,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- name: [
|
|
|
+ receivingName: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请输入收件人',
|
|
|
@@ -487,7 +481,7 @@ export default {
|
|
|
trigger: ['change'],
|
|
|
}
|
|
|
],
|
|
|
- orderIds: [
|
|
|
+ orderGoodsIds: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择订单',
|
|
|
@@ -497,11 +491,12 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
orderValue:'',
|
|
|
- orderList:[{checked:false,name:'1'},{checked:false,name:'2'},{checked:false,name:'3'},{checked:false,name:'4'}],
|
|
|
+ orderList:[],
|
|
|
selectOrderModal:false,
|
|
|
orderDetailModal:false,
|
|
|
orderCancelModal:false,
|
|
|
current: 0,
|
|
|
+ invoicePirce:0,
|
|
|
order: [],
|
|
|
typeList:[{
|
|
|
name:'普通发票',
|
|
|
@@ -521,12 +516,52 @@ export default {
|
|
|
},
|
|
|
// onPullDownRefresh() {},
|
|
|
onLoad(option) {
|
|
|
- // this.$refs.uForm.setRules(this.rules)
|
|
|
+ this.orderInvoiceCanInvoiceList();
|
|
|
+ this.$refs.uForm.setRules(this.rules)
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ orderCancel() {
|
|
|
+ let invoiceDetail = JSON.parse(JSON.stringify(this.invoiceDetail))
|
|
|
+ invoiceDetail.status = -1;
|
|
|
+ this.$api.orderInvoiceCancel(invoiceDetail).then(res => {
|
|
|
+ if(res.data.code == 200) {
|
|
|
+ this.orderInvoiceList();
|
|
|
+ this.orderInvoiceCanInvoiceList();
|
|
|
+ this.orderDetailModal = false;
|
|
|
+ this.orderCancelModal = false;
|
|
|
+ uni.showToast({
|
|
|
+ title:'撤销成功',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showDetailModal(item) {
|
|
|
+ this.orderDetailModal = true;
|
|
|
+ this.invoiceDetail = item;
|
|
|
+ },
|
|
|
+ toFixed(number) {
|
|
|
+ console.log(number.toFixed(2))
|
|
|
+ return number.toFixed(2)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取可开发票的订单
|
|
|
+ */
|
|
|
+ orderInvoiceCanInvoiceList() {
|
|
|
+ this.$api.orderInvoiceCanInvoiceList().then(res => {
|
|
|
+ if(res.data.code == 200) {
|
|
|
+ res.data.rows.forEach(item => {
|
|
|
+ item.checked = false;
|
|
|
+ })
|
|
|
+ this.orderList = res.data.rows;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/**
|
|
|
* @param {Object} checkedState 显示状态
|
|
|
* @param {Object} index 索引值
|
|
|
@@ -541,8 +576,35 @@ export default {
|
|
|
formSubmit() {
|
|
|
this.$refs.uForm.validate(valid => {
|
|
|
if(valid) {
|
|
|
- uni.showToast({
|
|
|
- title:'申请成功'
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ data.orderGoodsIds = data.orderGoodsIds.split(',')
|
|
|
+ data.amount = this.invoicePirce
|
|
|
+ this.$api.orderInvoice(data).then(res => {
|
|
|
+ if(res.data.code == 200) {
|
|
|
+ this.orderInvoiceCanInvoiceList();
|
|
|
+ this.form = {
|
|
|
+ type:'',
|
|
|
+ subject:'',
|
|
|
+ invoiceTitle:'',
|
|
|
+ orderGoodsIds:'',
|
|
|
+ taxRegistryNumber:'',
|
|
|
+ companyAddress:'',
|
|
|
+ phone:'',
|
|
|
+ bankName:'',
|
|
|
+ bankAccount:'',
|
|
|
+ receivingAddress:'',
|
|
|
+ receivingName:'',
|
|
|
+ receivingTel:'',
|
|
|
+ };
|
|
|
+ uni.showToast({
|
|
|
+ title:'申请成功'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title:res.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -554,9 +616,9 @@ export default {
|
|
|
formTypeChange(e) {
|
|
|
console.log(e)
|
|
|
if(e == '2') {
|
|
|
- this.$set(this.form,'main','2')
|
|
|
+ this.$set(this.form,'subject','2')
|
|
|
} else {
|
|
|
- this.$set(this.form,'main','')
|
|
|
+ this.$set(this.form,'subject','')
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -566,71 +628,150 @@ export default {
|
|
|
change(e) {
|
|
|
console.log(e)
|
|
|
this.current = e;
|
|
|
+
|
|
|
+ if(this.current == 1) {
|
|
|
+ this.orderInvoiceList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ orderInvoiceList() {
|
|
|
+ this.$api.orderInvoiceList().then(res => {
|
|
|
+ if(res.data.code == 200) {
|
|
|
+ this.recordList = res.data.rows
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title:res.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
radioGroupChange(e) {
|
|
|
console.log(e)
|
|
|
},
|
|
|
+ copy(str) {
|
|
|
+ let newStr = String(str)
|
|
|
+ uni.setClipboardData({
|
|
|
+ data: newStr,
|
|
|
+ success: function () {
|
|
|
+ console.log('success');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
okPopup() {
|
|
|
this.selectOrderModal = false;
|
|
|
let strArr = [];
|
|
|
+ this.invoicePirce = 0;
|
|
|
this.orderList.forEach((item,index) => {
|
|
|
if(item.checked) {
|
|
|
this.$set(this.orderList[index],'disabled',true)
|
|
|
- strArr.push(item.name)
|
|
|
+ strArr.push(item.orderGoodsId)
|
|
|
+ this.invoicePirce += item.goodsPrice
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.form.orderIds = strArr.join(',')
|
|
|
+ this.form.orderGoodsIds = strArr.join(',')
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.orderIds.onFieldChange()
|
|
|
+ this.$refs.orderGoodsIds.onFieldChange()
|
|
|
})
|
|
|
- console.log(this.$refs.orderIds)
|
|
|
+ console.log(this.$refs.orderGoodsIds)
|
|
|
},
|
|
|
|
|
|
deleteOrder(index) {
|
|
|
this.$set(this.orderList[index],'disabled',false)
|
|
|
this.$set(this.orderList[index],'checked',false)
|
|
|
let strArr = [];
|
|
|
+ this.invoicePirce = 0;
|
|
|
this.orderList.forEach((item,index) => {
|
|
|
if(item.checked) {
|
|
|
- strArr.push(item.name)
|
|
|
+ strArr.push(item.orderGoodsId)
|
|
|
+ this.invoicePirce += item.goodsPrice
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.form.orderIds = strArr.join(',')
|
|
|
+ this.form.orderGoodsIds = strArr.join(',')
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.orderIds.onFieldChange()
|
|
|
+ this.$refs.orderGoodsIds.onFieldChange()
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- download() {
|
|
|
- uni.downloadFile({
|
|
|
- url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
|
|
|
- success: function (res) {
|
|
|
- console.log(999)
|
|
|
- var filePath = res.tempFilePath;
|
|
|
- uni.openDocument({
|
|
|
- filePath: filePath,
|
|
|
- showMenu: true,
|
|
|
- success: function (res) {
|
|
|
- console.log(res,'打开文档成功');
|
|
|
- },
|
|
|
- fail:function(err) {
|
|
|
- console.log(err)
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ previewImg(item) {
|
|
|
+ // 预览图片
|
|
|
+ uni.previewImage({
|
|
|
+ urls: [this.$method.splitImgHost(item.invoiceImg,true,1000)],
|
|
|
+ longPressActions: {
|
|
|
+ itemList: ['发送给朋友', '保存图片', '收藏'],
|
|
|
+ success: function(data) {
|
|
|
+ console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log(err.errMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- orderCancel() {
|
|
|
- this.orderDetailModal = false;
|
|
|
- this.orderCancelModal = false;
|
|
|
- uni.showToast({
|
|
|
- title:'撤销成功',
|
|
|
- icon:'none'
|
|
|
- })
|
|
|
+ download(item) {
|
|
|
+ //获取相册授权
|
|
|
+ uni.getSetting({
|
|
|
+ success:(res) => {
|
|
|
+ if (!res.authSetting['scope.writePhotosAlbum']) {
|
|
|
+ uni.authorize({
|
|
|
+ scope: 'scope.writePhotosAlbum',
|
|
|
+ success() {
|
|
|
+ //这里是用户同意授权后的回调
|
|
|
+ this.saveImgToLocal(item);
|
|
|
+ },
|
|
|
+ fail() {//这里是用户拒绝授权后的回调
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {//用户已经授权过了
|
|
|
+ this.saveImgToLocal(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ saveImgToLocal(item){
|
|
|
+
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定保存到相册吗',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+
|
|
|
+ uni.downloadFile({
|
|
|
+ url: this.$method.splitImgHost(item.invoiceImg,true,1000),//图片地址
|
|
|
+ success: (res) =>{
|
|
|
+ if (res.statusCode === 200){
|
|
|
+ uni.saveImageToPhotosAlbum({
|
|
|
+ filePath: res.tempFilePath,
|
|
|
+ success: function() {
|
|
|
+ uni.showToast({
|
|
|
+ title: "保存成功",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: function() {
|
|
|
+ uni.showToast({
|
|
|
+ title: "保存失败",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ } else if (res.cancel) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
computed: { ...mapGetters(['userInfo']) }
|
|
|
@@ -752,6 +893,7 @@ page {
|
|
|
position:fixed;
|
|
|
left:50%;
|
|
|
bottom:40rpx;
|
|
|
+ z-index: 999;
|
|
|
transform: translateX(-50%);
|
|
|
}
|
|
|
}
|
|
|
@@ -800,7 +942,7 @@ page {
|
|
|
&.refuse {
|
|
|
background: #FF3B30;
|
|
|
}
|
|
|
- &.wait {
|
|
|
+ &.agree {
|
|
|
background: #34C759;
|
|
|
}
|
|
|
|
|
|
@@ -940,7 +1082,7 @@ page {
|
|
|
|
|
|
.order-detail {
|
|
|
width: 640rpx;
|
|
|
- height: 1112rpx;
|
|
|
+ height: 1000rpx;
|
|
|
background: #FFFFFF;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|