|
@@ -58,7 +58,7 @@
|
|
<view class="invoice-group tit">
|
|
<view class="invoice-group tit">
|
|
<checkbox-group class="row-group" @change="checkboxChange">
|
|
<checkbox-group class="row-group" @change="checkboxChange">
|
|
<view class="text">商品明细</view>
|
|
<view class="text">商品明细</view>
|
|
- <checkbox class="row-radio" value="明细" :checked="inventoryChecked ? true : false" color="#E15616"></checkbox>
|
|
|
|
|
|
+ <checkbox class="row-radio" value="明细" :checked="inventoryChecked" color="#E15616"></checkbox>
|
|
</checkbox-group>
|
|
</checkbox-group>
|
|
</view>
|
|
</view>
|
|
<view class="invoice-ltitle">发票抬头</view>
|
|
<view class="invoice-ltitle">发票抬头</view>
|
|
@@ -71,14 +71,14 @@
|
|
</radio-group>
|
|
</radio-group>
|
|
</view>
|
|
</view>
|
|
<view class="invoice-group from">
|
|
<view class="invoice-group from">
|
|
- <view class="group-from" v-if="invoiceData.invoiceTitleType == '0'">
|
|
|
|
- <input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写个人抬头" maxlength="20">
|
|
|
|
|
|
+ <view class="group-from" v-if="peopleInvoiceData.invoiceTitleType == '0'">
|
|
|
|
+ <input class="form-input" type="text" v-model="peopleInvoiceData.invoiceTitle" placeholder="请填写个人抬头" maxlength="20">
|
|
</view>
|
|
</view>
|
|
- <view class="group-from" v-if="invoiceData.invoiceTitleType == '1'">
|
|
|
|
- <input class="form-input" type="text" v-model="invoiceData.invoiceTitle" placeholder="请填写公司抬头" maxlength="20">
|
|
|
|
|
|
+ <view class="group-from" v-if="peopleInvoiceData.invoiceTitleType == '1'">
|
|
|
|
+ <input class="form-input" type="text" v-model="peopleInvoiceData.invoiceTitle" placeholder="请填写公司抬头" maxlength="20">
|
|
</view>
|
|
</view>
|
|
- <view class="group-from" v-if="invoiceData.invoiceTitleType == '1'">
|
|
|
|
- <input class="form-input" type="text" v-model="invoiceData.corporationTaxNum" placeholder="请填写纳税人识别号" maxlength="20">
|
|
|
|
|
|
+ <view class="group-from" v-if="peopleInvoiceData.invoiceTitleType == '1'">
|
|
|
|
+ <input class="form-input" type="text" v-model="peopleInvoiceData.corporationTaxNum" placeholder="请填写纳税人识别号" maxlength="20">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -115,16 +115,20 @@
|
|
{value:'0',name:'个人'},
|
|
{value:'0',name:'个人'},
|
|
{value:'1',name:'公司'},
|
|
{value:'1',name:'公司'},
|
|
],
|
|
],
|
|
|
|
+ peopleInvoiceData:{
|
|
|
|
+ invoiceTitle:'', //单位名称
|
|
|
|
+ invoiceContent:'', //商品明细
|
|
|
|
+ corporationTaxNum:'',//纳税人识别号
|
|
|
|
+ invoiceTitleType:'0'//发票抬头类型 1企业 0个人
|
|
|
|
+ },
|
|
invoiceData:{
|
|
invoiceData:{
|
|
id:'',
|
|
id:'',
|
|
- invoiceContent:'', //商品明细
|
|
|
|
invoiceTitle:'', //单位名称
|
|
invoiceTitle:'', //单位名称
|
|
corporationTaxNum:'',//纳税人识别号
|
|
corporationTaxNum:'',//纳税人识别号
|
|
registeredAddress: '',//单位地址
|
|
registeredAddress: '',//单位地址
|
|
registeredPhone:'', //注册电话
|
|
registeredPhone:'', //注册电话
|
|
openBank:'', //开户银行
|
|
openBank:'', //开户银行
|
|
bankAccountNo: '' ,//银行账号
|
|
bankAccountNo: '' ,//银行账号
|
|
- invoiceTitleType:'0',//发票抬头类型 1企业 0个人
|
|
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -136,7 +140,7 @@
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
getUseFindInvoice(){//获取发票信息
|
|
getUseFindInvoice(){//获取发票信息
|
|
- this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
|
|
|
+ this.$api.getStorage().then((resolve) => {
|
|
getFindInvoice({userId:resolve.userID}).then(response =>{
|
|
getFindInvoice({userId:resolve.userID}).then(response =>{
|
|
if(response.data == null){
|
|
if(response.data == null){
|
|
this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
|
|
this.invoiceData = Object.assign(this.invoiceData,'',{type:0})
|
|
@@ -147,7 +151,7 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
updateInvoiceFn(){//保存发票信息
|
|
updateInvoiceFn(){//保存发票信息
|
|
- this.$api.getComStorage('orderUserInfo').then((resolve) =>{
|
|
|
|
|
|
+ this.$api.getStorage().then((resolve) => {
|
|
let params =Object.assign(this.invoiceData,'',{userId:resolve.userID})
|
|
let params =Object.assign(this.invoiceData,'',{userId:resolve.userID})
|
|
updateInvoice(params).then(response =>{})
|
|
updateInvoice(params).then(response =>{})
|
|
})
|
|
})
|
|
@@ -160,7 +164,7 @@
|
|
break;
|
|
break;
|
|
case '2':
|
|
case '2':
|
|
this.choiceaInvoiceTwo()
|
|
this.choiceaInvoiceTwo()
|
|
- this.invoiceText = this.invoiceData.invoiceTitle
|
|
|
|
|
|
+ this.invoiceText = this.peopleInvoiceData.invoiceTitle
|
|
break;
|
|
break;
|
|
case '3':
|
|
case '3':
|
|
this.choiceaInvoiceFirst()
|
|
this.choiceaInvoiceFirst()
|
|
@@ -201,32 +205,37 @@
|
|
this.hideSpec()
|
|
this.hideSpec()
|
|
},
|
|
},
|
|
choiceaInvoiceTwo(){//普通发票
|
|
choiceaInvoiceTwo(){//普通发票
|
|
- if(this.invoiceData.invoiceContent == ''){
|
|
|
|
- this.$util.msg('请选择商品明细',2000)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- switch(this.invoiceData.invoiceTitleType){
|
|
|
|
|
|
+ switch(this.peopleInvoiceData.invoiceTitleType){
|
|
case '0':
|
|
case '0':
|
|
- if(this.invoiceData.invoiceTitle == ""){
|
|
|
|
|
|
+ if(this.peopleInvoiceData.invoiceContent == ''){
|
|
|
|
+ this.$util.msg('请选择商品明细',2000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.peopleInvoiceData.invoiceTitle == ""){
|
|
this.$util.msg('请输入个人抬头',2000)
|
|
this.$util.msg('请输入个人抬头',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case '1':
|
|
case '1':
|
|
- if(this.invoiceData.invoiceTitle == ""){
|
|
|
|
|
|
+ if(this.peopleInvoiceData.invoiceContent == ''){
|
|
|
|
+ this.$util.msg('请选择商品明细',2000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.peopleInvoiceData.invoiceTitle == ""){
|
|
this.$util.msg('请输入公司抬头',2000)
|
|
this.$util.msg('请输入公司抬头',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.invoiceData.corporationTaxNum == ""){
|
|
|
|
|
|
+ if(this.peopleInvoiceData.corporationTaxNum == ""){
|
|
this.$util.msg('请输入纳税人识别号',2000)
|
|
this.$util.msg('请输入纳税人识别号',2000)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:1}))
|
|
|
|
|
|
+ this.$emit('handleChoiceaInvoice',Object.assign(this.peopleInvoiceData,'',{type:1}))
|
|
this.hideSpec()
|
|
this.hideSpec()
|
|
},
|
|
},
|
|
choiceaInvoiceThree(){//不开发票
|
|
choiceaInvoiceThree(){//不开发票
|
|
|
|
+ this.invoiceData = {}
|
|
this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:0}))
|
|
this.$emit('handleChoiceaInvoice',Object.assign(this.invoiceData,'',{type:0}))
|
|
this.hideSpec()
|
|
this.hideSpec()
|
|
},
|
|
},
|
|
@@ -247,21 +256,35 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(this.invoiceType == '3'){
|
|
|
|
- this.getUseFindInvoice()
|
|
|
|
- }
|
|
|
|
|
|
+ switch(this.invoiceType){
|
|
|
|
+ case '2':
|
|
|
|
+ this.peopleInvoiceData.invoiceTitleType = "0"
|
|
|
|
+ this.titleCurrent = 0
|
|
|
|
+ break;
|
|
|
|
+ case '3':
|
|
|
|
+ this.getUseFindInvoice()
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
radioChangeTitle(e) {
|
|
radioChangeTitle(e) {
|
|
- this.invoiceData.invoiceTitleType = e.target.value;
|
|
|
|
|
|
+ this.peopleInvoiceData.invoiceTitleType = e.target.value;
|
|
for (let i = 0; i < this.invoiceTitleList.length; i++) {
|
|
for (let i = 0; i < this.invoiceTitleList.length; i++) {
|
|
- if (this.invoiceTitleList[i].value === this.invoiceData.invoiceTitleType) {
|
|
|
|
|
|
+ if (this.invoiceTitleList[i].value === this.peopleInvoiceData.invoiceTitleType) {
|
|
this.titleCurrent = i;
|
|
this.titleCurrent = i;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ switch(this.peopleInvoiceData.invoiceTitleType){
|
|
|
|
+ case '1':
|
|
|
|
+ this.inventoryChecked = false
|
|
|
|
+ this.peopleInvoiceData.invoiceTitle = ""
|
|
|
|
+ this.peopleInvoiceData.invoiceContent = ""
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
checkboxChange(e){
|
|
checkboxChange(e){
|
|
- this.invoiceData.invoiceContent = e.detail.value[0]
|
|
|
|
|
|
+ this.inventoryChecked = !this.inventoryChecked
|
|
|
|
+ this.peopleInvoiceData.invoiceContent = e.detail.value[0]
|
|
},
|
|
},
|
|
inputBankNum(val) {
|
|
inputBankNum(val) {
|
|
if (/\S{5}/.test(val)) {
|
|
if (/\S{5}/.test(val)) {
|