提交 dc152e09 authored 作者: lihuihui's avatar lihuihui

update

上级 15e1d457
<template> <template>
<div class="invoice-container"> <div class="invoice-container">
<van-tabs v-model="form.taxpayer_type" type="card" color="#3276fc" sticky @change="handleTabChange"> <van-tabs v-model="vanTabsIndex" type="card" color="#3276fc" sticky @change="handleTabChange">
<van-tab name="2" title="企业"></van-tab> <van-tab name="2" title="企业"></van-tab>
<van-tab name="1" title="个人"></van-tab> <van-tab name="1" title="个人"></van-tab>
<van-tab name="3" title="非营利性单位"></van-tab> <van-tab name="3" title="非营利性单位"></van-tab>
...@@ -221,6 +221,7 @@ export default { ...@@ -221,6 +221,7 @@ export default {
components: { HistoryInvoiceList }, components: { HistoryInvoiceList },
data() { data() {
return { return {
vanTabsIndex: '2',
searchShow: false, searchShow: false,
invoice_type_label: '', invoice_type_label: '',
form: {}, form: {},
...@@ -233,13 +234,18 @@ export default { ...@@ -233,13 +234,18 @@ export default {
return this.$route.query.project_id === '5005' && this.$route.query.type === '60' return this.$route.query.project_id === '5005' && this.$route.query.type === '60'
}, },
invoiceTypeList() { invoiceTypeList() {
const list = [ let list = [
// { label: '普通发票(纸质)', value: '1' }, // { label: '普通发票(纸质)', value: '1' },
{ label: '普通发票(电子)', value: '2' }, { label: '普通发票(电子)', value: '2' },
{ label: '专用发票(纸质)', value: '3' } { label: '专用发票(纸质)', value: '3' }
] ]
console.log(this.form.taxpayer_type, 'num')
if (this.form.taxpayer_type !== '2') { if (this.form.taxpayer_type !== '2') {
list.splice(1, 1) // list.splice(1, 1)
list = [
// { label: '普通发票(纸质)', value: '1' },
{ label: '普通发票(电子)', value: '2' }
]
} }
return list return list
}, },
...@@ -255,9 +261,9 @@ export default { ...@@ -255,9 +261,9 @@ export default {
defaultForm.sales_rep_user_id_name = this.query.name || '' defaultForm.sales_rep_user_id_name = this.query.name || ''
if (this.$route.query.taxpayer_info) { if (this.$route.query.taxpayer_info) {
console.log('111') console.log('111')
this.form = Object.assign(defaultForm, JSON.parse(this.$route.query.taxpayer_info)) this.form = Object.assign({}, JSON.parse(this.$route.query.taxpayer_info))
this.vanTabsIndex = JSON.parse(this.$route.query.taxpayer_info).taxpayer_type
this.invoice_type_label = this.form.invoice_type === '2' ? '普通发票(电子)' : '专用发票(纸质)' this.invoice_type_label = this.form.invoice_type === '2' ? '普通发票(电子)' : '专用发票(纸质)'
console.log(this.form)
} else { } else {
this.form = Object.assign({ taxpayer_type: '' }, defaultForm) this.form = Object.assign({ taxpayer_type: '' }, defaultForm)
} }
...@@ -305,7 +311,8 @@ export default { ...@@ -305,7 +311,8 @@ export default {
return /^[A-Za-z0-9]{18}$/.test(val) return /^[A-Za-z0-9]{18}$/.test(val)
}, },
handleTabChange(val) { handleTabChange(val) {
this.form = Object.assign({ taxpayer_type: val }, defaultForm) this.form = Object.assign({ taxpayer_type: this.vanTabsIndex }, defaultForm)
console.log(this.form, 'form', defaultForm)
this.setInvoiceType() this.setInvoiceType()
}, },
onConfirm(val) { onConfirm(val) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论