|
@@ -23,7 +23,7 @@
|
|
</label>
|
|
</label>
|
|
</radio-group>
|
|
</radio-group>
|
|
</view>
|
|
</view>
|
|
- <view class="invoice-main from" v-if="invoiceType == '1'">
|
|
|
|
|
|
+ <view class="invoice-main from" v-if="invoiceType == '3'">
|
|
<view class="invoice-from">
|
|
<view class="invoice-from">
|
|
<view class="label">单位名称:</view>
|
|
<view class="label">单位名称:</view>
|
|
<input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写单位信息(必填)" maxlength="20">
|
|
<input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写单位信息(必填)" maxlength="20">
|
|
@@ -50,7 +50,7 @@
|
|
type="text"
|
|
type="text"
|
|
v-model="invoiceData.bankAccountNo"
|
|
v-model="invoiceData.bankAccountNo"
|
|
placeholder="请填写银行账号(必填)"
|
|
placeholder="请填写银行账号(必填)"
|
|
- maxlength="25">
|
|
|
|
|
|
+ maxlength="19">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="invoice-main" v-if="invoiceType == '2'">
|
|
<view class="invoice-main" v-if="invoiceType == '2'">
|
|
@@ -82,7 +82,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="invoice-main" v-if="invoiceType == '3'">
|
|
|
|
|
|
+ <view class="invoice-main" v-if="invoiceType == '1'">
|
|
<view class="invoice-none">不开具发票信息</view>
|
|
<view class="invoice-none">不开具发票信息</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -95,31 +95,28 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import { getFindInvoice,updateInvoice } from "@/api/order.js"
|
|
export default{
|
|
export default{
|
|
name:"invoice",
|
|
name:"invoice",
|
|
- props:{
|
|
|
|
- invoiceDatas:{
|
|
|
|
- type:Object
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
data() {
|
|
data() {
|
|
return{
|
|
return{
|
|
- invoiceText:'',
|
|
|
|
|
|
+ invoiceText:'不开发票',
|
|
specClass: '',//规格弹窗css类,控制开关动画
|
|
specClass: '',//规格弹窗css类,控制开关动画
|
|
invoiceType:'1',//发票类型
|
|
invoiceType:'1',//发票类型
|
|
current:0,
|
|
current:0,
|
|
titleCurrent:0,
|
|
titleCurrent:0,
|
|
inventoryChecked:false,
|
|
inventoryChecked:false,
|
|
invoiceTypeList:[
|
|
invoiceTypeList:[
|
|
- {value:'1',name:'增值税发票'},
|
|
|
|
|
|
+ {value:'1',name:'不开发票'},
|
|
{value:'2',name:'普通发票'},
|
|
{value:'2',name:'普通发票'},
|
|
- {value:'3',name:'不开发票'},
|
|
|
|
|
|
+ {value:'3',name:'增值税发票'},
|
|
],
|
|
],
|
|
invoiceTitleList:[
|
|
invoiceTitleList:[
|
|
{value:'0',name:'个人'},
|
|
{value:'0',name:'个人'},
|
|
{value:'1',name:'公司'},
|
|
{value:'1',name:'公司'},
|
|
],
|
|
],
|
|
invoiceData:{
|
|
invoiceData:{
|
|
|
|
+ id:'',
|
|
invoiceContent:'', //商品明细
|
|
invoiceContent:'', //商品明细
|
|
invoiceTitle:'', //单位名称
|
|
invoiceTitle:'', //单位名称
|
|
corporationTaxNum:'',//纳税人识别号
|
|
corporationTaxNum:'',//纳税人识别号
|
|
@@ -132,35 +129,46 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- this.initData(this.invoiceDatas)
|
|
|
|
|
|
+ // this.initData(this.invoiceDatas)
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
- initData(res) {
|
|
|
|
- if(res){
|
|
|
|
- this.invoiceText = '无发票信息'
|
|
|
|
- }else{
|
|
|
|
- this.invoiceData = res
|
|
|
|
- this.invoiceText = res.invoiceTitle
|
|
|
|
- this.invoiceData.bankAccountNo = this.$reg.bankRegex(res.bankAccountNo)
|
|
|
|
- }
|
|
|
|
|
|
+ getUseFindInvoice(){//获取发票信息
|
|
|
|
+ this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
|
+ getFindInvoice({userId:resolve.userID}).then(response =>{
|
|
|
|
+ if(response.data == null){
|
|
|
|
+ this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
|
|
|
|
+ }else{
|
|
|
|
+ this.invoiceData = response.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ updateInvoiceFn(){//保存发票信息
|
|
|
|
+ this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
|
+ let params =Object.assign(this.invoiceData,'',{userId:resolve.userID})
|
|
|
|
+ updateInvoice(params).then(response =>{})
|
|
|
|
+ })
|
|
},
|
|
},
|
|
choiceaInvoiceConfim(){
|
|
choiceaInvoiceConfim(){
|
|
switch(this.invoiceType){
|
|
switch(this.invoiceType){
|
|
case '1':
|
|
case '1':
|
|
- this.choiceaInvoiceFirst()
|
|
|
|
- this.invoiceText = this.invoiceData.invoiceTitle
|
|
|
|
|
|
+ this.choiceaInvoiceThree()
|
|
|
|
+ this.invoiceText = '不开发票'
|
|
break;
|
|
break;
|
|
case '2':
|
|
case '2':
|
|
this.choiceaInvoiceTwo()
|
|
this.choiceaInvoiceTwo()
|
|
this.invoiceText = this.invoiceData.invoiceTitle
|
|
this.invoiceText = this.invoiceData.invoiceTitle
|
|
break;
|
|
break;
|
|
case '3':
|
|
case '3':
|
|
|
|
+ this.choiceaInvoiceFirst()
|
|
|
|
+ this.invoiceText = this.invoiceData.invoiceTitle
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
this.choiceaInvoiceThree()
|
|
this.choiceaInvoiceThree()
|
|
this.invoiceText = '不开发票'
|
|
this.invoiceText = '不开发票'
|
|
- break;
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
choiceaInvoiceFirst(){//增值税发票
|
|
choiceaInvoiceFirst(){//增值税发票
|
|
@@ -188,6 +196,7 @@
|
|
this.$util.msg('请输入银行账号',2000)
|
|
this.$util.msg('请输入银行账号',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.updateInvoiceFn()
|
|
this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:2}))
|
|
this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:2}))
|
|
this.hideSpec()
|
|
this.hideSpec()
|
|
},
|
|
},
|
|
@@ -238,6 +247,9 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(this.invoiceType == '3'){
|
|
|
|
+ this.getUseFindInvoice()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
radioChangeTitle(e) {
|
|
radioChangeTitle(e) {
|
|
this.invoiceData.invoiceTitleType = e.target.value;
|
|
this.invoiceData.invoiceTitleType = e.target.value;
|