提交 30bedfe5 authored 作者: lihuihui's avatar lihuihui

update

上级 4e5e2692
......@@ -135,7 +135,7 @@ export default {
// { required: true, message: '请输入纳税人识别号', trigger: 'blur' },
// { validator: checkInvoice, trigger: 'blur' }
// ],
taxpayer_mobile: [{ required: true, message: '请输入电话', trigger: 'blur' }, { validator: checkMobile, trigger: 'blur' }],
taxpayer_mobile: [{ required: true, message: '请输入电话', trigger: 'blur' }],
recipient_email: [{ required: true, message: '请输入邮箱地址', trigger: 'blur' }, { validator: checkEmail, trigger: 'blur' }],
recipient_name: { required: true, message: '请输入收件人名称', trigger: 'blur' },
recipient_address: { required: true, message: '请输入邮寄地址', trigger: 'blur' },
......
......@@ -235,8 +235,8 @@ export default {
invoiceTypeList() {
const list = [
// { label: '普通发票(纸质)', value: '1' },
{ label: '专用发票(纸质)', value: '3' },
{ label: '普通发票(电子)', value: '2' }
{ label: '普通发票(电子)', value: '2' },
{ label: '专用发票(纸质)', value: '3' }
]
if (this.form.taxpayer_type !== '2') {
list.splice(1, 1)
......@@ -253,9 +253,14 @@ export default {
created() {
defaultForm.invoice_remark = this.query.remark || ''
defaultForm.sales_rep_user_id_name = this.query.name || ''
// defaultForm.invoice_type = this.isProject ? '2' : ''
// this.invoice_type_label = this.isProject ? '普通发票(电子)' : ''
this.form = Object.assign({ taxpayer_type: '' }, defaultForm)
if (this.$route.query.taxpayer_info) {
console.log('111')
this.form = Object.assign(defaultForm, JSON.parse(this.$route.query.taxpayer_info))
this.invoice_type_label = this.form.invoice_type === '2' ? '普通发票(电子)' : '专用发票(纸质)'
console.log(this.form)
} else {
this.form = Object.assign({ taxpayer_type: '' }, defaultForm)
}
},
methods: {
selectEnterprise(item) {
......@@ -311,9 +316,9 @@ export default {
setInvoiceType(val) {
const item = this.invoiceTypeList.find(item => item.value === val)
if (item) {
// this.invoice_type_label = this.isProject ? '普通发票(电子)' : item.label
this.invoice_type_label = item.label
} else {
// this.invoice_type_label = this.isProject ? '普通发票(电子)' : ''
this.invoice_type_label = ''
window.setTimeout(() => {
this.$refs.vanForm.resetValidation()
}, 1)
......
......@@ -33,6 +33,7 @@
</template>
<script>
import { Toast } from 'vant'
import { getPayList, handleDeleteInvoice } from '../../api'
const statusMap = {
1: '不可开具',
......@@ -66,14 +67,44 @@ export default {
},
methods: {
handleDeleteInvoice(row) {
console.log(row, 'row')
// item.project_id == '5005' && item.type == '60'
if (row.invoices.length) {
const item = row.invoices.find(item => parseInt(item.invoice_status) === 4)
if (parseInt(item.invoice_type) === 3) {
Toast('纸质发票作废请联系管理员')
return false
}
}
handleDeleteInvoice({ payment_id: row.id }).then(res => {
if (res.code === 0) {
this.$router.go(0)
}
})
},
handleInvoice(val) {
this.$router.push({ path: '/h5/payment/invoice', query: { id: val.id, name: val.sales_rep_user_id_name, remark: val.payer_name, project_id: val.project_id, type: val.type } })
const query = { id: val.id, name: val.sales_rep_user_id_name, remark: val.payer_name, project_id: val.project_id, type: val.type }
if (val.project_id === '5005' && val.type === '60') {
if (val.invoices.length) {
const item = val.invoices.find(item => parseInt(item.invoice_status) === 4)
query.taxpayer_info = JSON.stringify({
taxpayer_address: item.taxpayer_address,
taxpayer_bank_account: item.taxpayer_bank_account,
taxpayer_bank_name: item.taxpayer_bank_name,
taxpayer_identifier: item.taxpayer_identifier,
taxpayer_mobile: item.taxpayer_mobile,
taxpayer_name: item.taxpayer_name,
taxpayer_type: item.taxpayer_type,
invoice_type: item.invoice_type,
recipient_address: item.recipient_address,
recipient_email: item.recipient_email,
recipient_mobile: item.recipient_mobile,
recipient_name: item.recipient_name
})
}
}
this.$router.push({ path: '/h5/payment/invoice', query: query })
},
handleDetials(val) {
window.localStorage.setItem('invoiceDetails', JSON.stringify(val))
......
......@@ -3,7 +3,7 @@ import store from '@/store'
export default async function (to, from, next) {
const isLogin = store.state.user.id || (await store.dispatch('checkLogin'))
if (!isLogin) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
// window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
}
next()
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论