|
@@ -0,0 +1,866 @@
|
|
|
+<template>
|
|
|
+ <div class="Invoicing">
|
|
|
+ <div class="header">
|
|
|
+ <div class="item">
|
|
|
+ <div class="text_box">
|
|
|
+ <p class="title">订单编号:</p>
|
|
|
+ <p class="value">{{infoMap.code}}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item mt-10">
|
|
|
+ <div class="text_box">
|
|
|
+ <p class="title">开票金额:</p>
|
|
|
+ <p class="value">{{infoMap.price}}元</p>
|
|
|
+ </div>
|
|
|
+ <div class="rightBtn" @click="tipShow = true">开票规则</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-body">
|
|
|
+ <div class="j-content">
|
|
|
+ <div class="item-box-type">
|
|
|
+ <div class="item-box-title redstar">发票类型</div>
|
|
|
+ <radioGroup v-model="infoMap.type" :list="typelist" @change="initshowModule"></radioGroup>
|
|
|
+ </div>
|
|
|
+ <van-field v-model.trim="infoMap.content" label="发票内容" readonly></van-field>
|
|
|
+ <div class="item-box-type">
|
|
|
+ <div class="item-box-title redstar">发票抬头</div>
|
|
|
+ <radioGroup v-model="infoMap.invoiceHeader" :list="invoiceHeaderlist" @change="initshowModule"></radioGroup>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="companybox">
|
|
|
+ <div class="associate-ent-group" v-show="isAssociateShow">
|
|
|
+ <div class="associate-ent-item" @click="selectEnt(item)" v-for="(item, i) in searchList" v-bind:key="i"
|
|
|
+ v-html="highlightText(item.name, infoMap.company)"></div>
|
|
|
+ </div>
|
|
|
+ <van-field v-model.trim="infoMap.company" label="公司名称" maxlength="50" @focus="infoCheckMap.company = ''"
|
|
|
+ @input="entOnChange('input')" @blur="entOnChange('blur')" :errorMessage="infoCheckMap.company" :required="requireds.company"
|
|
|
+ placeholder="请输入准确的公司名称" v-if="showModule.company" type="textarea" rows="1" autosize></van-field>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.dutyparagraph" label="单位税号" @focus="infoCheckMap.dutyparagraph = ''"
|
|
|
+ @blur="getCheckMap('dutyparagraph')" :errorMessage="infoCheckMap.dutyparagraph" :required="requireds.dutyparagraph"
|
|
|
+ placeholder="请输入纳税人识别号" v-if="showModule.dutyparagraph" type="textarea" rows="1" autosize></van-field>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.unitAddress" label="单位地址" @focus="infoCheckMap.unitAddress = ''"
|
|
|
+ @blur="getCheckMap('unitAddress')" :errorMessage="infoCheckMap.unitAddress" :required="requireds.unitAddress"
|
|
|
+ placeholder="请输入单位地址" v-if="showModule.unitAddress" type="textarea" rows="1" autosize maxlength="200"></van-field>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.tel" label="电话号码" @focus="infoCheckMap.tel = ''"
|
|
|
+ @blur="getCheckMap('tel')" :errorMessage="infoCheckMap.tel" :required ="requireds.tel"
|
|
|
+ placeholder="请输入电话号码" v-if="showModule.tel"></van-field>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.bank" label="开户银行" @focus="infoCheckMap.bank = ''"
|
|
|
+ @blur="getCheckMap('bank')" :errorMessage="infoCheckMap.bank" :required="requireds.bank"
|
|
|
+ placeholder="请输入开户银行" v-if="showModule.bank" type="textarea" rows="1" autosize maxlength="200"></van-field>
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.bankCode" label="银行账号" @focus="infoCheckMap.bankCode = ''"
|
|
|
+ @blur="getCheckMap('bankCode')" :errorMessage="infoCheckMap.bankCode" :required="requireds.bankCode"
|
|
|
+ placeholder="请输入银行账号" v-if="showModule.bankCode" type="textarea" rows="1" autosize></van-field>
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.desc" label="开票备注" @focus="infoCheckMap.desc = ''" :required="requireds.desc" :errorMessage="infoCheckMap.desc" placeholder="请输入开票备注" v-if="showModule.desc" maxlength="200" type="textarea" rows="1" autosize></van-field>
|
|
|
+ </div>
|
|
|
+ <div class="j-content">
|
|
|
+ <van-field v-model.trim="infoMap.name" label="收件人" @focus="infoCheckMap.name = ''"
|
|
|
+ @blur="getCheckMap('name')" :errorMessage="infoCheckMap.name" :required="requireds.name"
|
|
|
+ placeholder="请输入收件人" v-if="showModule.name" maxlength="200"></van-field>
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.phone" label="联系电话" @focus="infoCheckMap.phone = ''"
|
|
|
+ @blur="getCheckMap('phone')" :errorMessage="infoCheckMap.phone" :required="requireds.phone"
|
|
|
+ placeholder="请输入联系电话"></van-field>
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.deliveryAddress" label="收件地址" @focus="infoCheckMap.deliveryAddress = ''"
|
|
|
+ @blur="getCheckMap('deliveryAddress')" :errorMessage="infoCheckMap.deliveryAddress" :required = "requireds.deliveryAddress"
|
|
|
+ placeholder="请输入收件地址" type="textarea" rows="1" autosize v-if="showModule.deliveryAddress" maxlength="200"></van-field>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <van-field v-model.trim="infoMap.email" label="电子邮箱" @focus="infoCheckMap.email = ''"
|
|
|
+ @blur="getCheckMap('email')" :errorMessage="infoCheckMap.email" :required = "requireds.email"
|
|
|
+ placeholder="请输入电子邮箱" type="textarea" rows="1" autosize v-if="showModule.email"
|
|
|
+ maxlength="50"></van-field>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="j-bottom">
|
|
|
+ <p class="b-desc">{{desc}}</p>
|
|
|
+ <div class="j-button-group">
|
|
|
+ <button class="j-button-confirm" :disabled="disabled" @click="confirm_ok">提交</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <popupTip v-model="tipShow" text="开票规则:<br>1.平台提供电子普通发票、电子专用发票、纸质普通发票、纸质专用发票,开票内容统一为“信息技术服务-技术服务费”。<br>2.您申请的电子发票将在3个工作日内由平台开具并发送至您的邮箱,请注意查收;您申请的纸质发票将在25个工作日内由平台开具并邮寄给您,请注意查收,开票金额<200元发票邮寄费用自行承担;<br>3.如有问题可联系客服,客服电话:400-108-6670。">
|
|
|
+ </popupTip>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { ajaxGetCompanyAssociation,ajaxInvoiceSubmit,ajaxInvoiceQuery } from '@/api/modules'
|
|
|
+import { replaceKeyword } from '@/utils/utils'
|
|
|
+import { Field, Icon, Button } from 'vant'
|
|
|
+import popupTip from '@/components/invoice/popupTip'
|
|
|
+import radioGroup from '@/components/invoice/radioGroup'
|
|
|
+export default {
|
|
|
+ name: 'Invoicing',
|
|
|
+ components: {
|
|
|
+ [Field.name]: Field,
|
|
|
+ [Icon.name]: Icon,
|
|
|
+ [Button.name]: Button,
|
|
|
+ popupTip,
|
|
|
+ radioGroup
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ typelist:[{text:'电子普通发票',value:'1'},{text:'电子专用发票',value:'2'},{text:'纸质普通发票',value:'3'},{text:'纸质专用发票',value:'4'}],
|
|
|
+ invoiceHeaderlist:[{text:'个人',value:'1'},{text:'单位',value:'2'}],
|
|
|
+ searchList: [],
|
|
|
+ isAssociateShow: false,
|
|
|
+ isAssociateUpTime: -1,
|
|
|
+ tipShow: false,
|
|
|
+ infoMap: {
|
|
|
+ code:'',
|
|
|
+ price:'',
|
|
|
+ type:'1',
|
|
|
+ invoiceHeader:'2',
|
|
|
+ content:'信息技术服务-技术服务费',
|
|
|
+ company: '',
|
|
|
+ dutyparagraph:'',
|
|
|
+ unitAddress:'',
|
|
|
+ phone:'',
|
|
|
+ bank:'',
|
|
|
+ bankCode:'',
|
|
|
+ desc:'',
|
|
|
+ tel:'',
|
|
|
+ email:'',
|
|
|
+ deliveryAddress:'',
|
|
|
+ name:'',
|
|
|
+ },
|
|
|
+ infoCheckMap: {
|
|
|
+ company: '',
|
|
|
+ dutyparagraph:'',
|
|
|
+ unitAddress:'',
|
|
|
+ phone:'',
|
|
|
+ bank:'',
|
|
|
+ bankCode:'',
|
|
|
+ desc:'',
|
|
|
+ tel:'',
|
|
|
+ email:'',
|
|
|
+ deliveryAddress:'',
|
|
|
+ name:'',
|
|
|
+ },
|
|
|
+ showModule: {
|
|
|
+ company:false,
|
|
|
+ dutyparagraph:false,
|
|
|
+ bankCode:false,
|
|
|
+ bank:false,
|
|
|
+ tel:false,
|
|
|
+ unitAddress:false,
|
|
|
+ desc:false,
|
|
|
+ name:false,
|
|
|
+ phone:true,
|
|
|
+ deliveryAddress:false,
|
|
|
+ email:false
|
|
|
+ },
|
|
|
+ requireds:{
|
|
|
+ company: true,
|
|
|
+ dutyparagraph:true,
|
|
|
+ unitAddress:true,
|
|
|
+ phone:true,
|
|
|
+ bank:true,
|
|
|
+ bankCode:true,
|
|
|
+ desc:false,
|
|
|
+ tel:true,
|
|
|
+ email:true,
|
|
|
+ deliveryAddress:true,
|
|
|
+ name:true,
|
|
|
+ },
|
|
|
+ onlyIdentifying:'',
|
|
|
+ invoiceMoney:'',
|
|
|
+ operator:''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ disabled() {
|
|
|
+ return !(this.checkVerify('name') && this.checkVerify('company') && this.checkVerify('tel') && this.checkVerify('email') && this.checkVerify('bank') && this.checkVerify('bankCode') && this.checkVerify('unitAddress') && this.checkVerify('dutyparagraph') && this.checkVerify('phone') && this.checkVerify('deliveryAddress'))
|
|
|
+ },
|
|
|
+ desc (){
|
|
|
+ if(this.infoMap.type==='1' || this.infoMap.type==='2'){
|
|
|
+ return '您申请的发票将在3个工作日内由平台开具并发送至您的邮箱,请注意查收。'
|
|
|
+ } else if((this.infoMap.type=='3' || this.infoMap.type=='4') && this.infoMap.price >= 200){
|
|
|
+ return'您申请的发票将在25个工作日由平台开具并邮寄给您,请注意查收。'
|
|
|
+ } else if((this.infoMap.type=='3' || this.infoMap.type=='4') && this.infoMap.price < 200){
|
|
|
+ return'您申请的发票将在25个工作日由平台开具并邮寄给您,请注意查收,另开票金额<200元,发票邮寄费用需您自行承担。'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkName() {
|
|
|
+ if (this.infoMap.name && this.infoMap.name.length > 10) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ var namereg = /^[\u4E00-\u9FA5A-Za-z\s]+(·[\u4E00-\u9FA5A-Za-z]+)*$/; //中英文或加.的少数民族名字
|
|
|
+ return namereg.test(this.infoMap.name)
|
|
|
+ },
|
|
|
+
|
|
|
+ checkEmail() {
|
|
|
+ let emailRegExp = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
|
|
|
+ if (this.infoMap.email.length > 50) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return emailRegExp.test(this.infoMap.email)
|
|
|
+ },
|
|
|
+ checkEntName() {
|
|
|
+ if (this.infoMap.company.trim().length > 50 || this.infoMap.company.trim().length < 2) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ checkDutyparagraph () {
|
|
|
+ if (this.infoMap.dutyparagraph.trim().length === 18 || this.infoMap.dutyparagraph.trim().length === 15 || this.infoMap.dutyparagraph.trim().length === 20) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
+ checkBankcode () {
|
|
|
+ let RegExp = /^[1-9]\d{9,29}$/
|
|
|
+ if (!this.infoMap.bankCode) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return RegExp.test(this.infoMap.bankCode)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.initData()
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData(){
|
|
|
+ let {onlyIdentifying,invoiceMoney,operator} = this.$route.query
|
|
|
+ this.onlyIdentifying=onlyIdentifying?onlyIdentifying:''
|
|
|
+ this.invoiceMoney=invoiceMoney?invoiceMoney:''
|
|
|
+ this.operator=operator?operator:''
|
|
|
+ const loading = this.$toast.loading({ duration: 0, message: 'loading...' })
|
|
|
+ ajaxInvoiceQuery({
|
|
|
+ onlyIdentifying:this.onlyIdentifying,
|
|
|
+ invoiceMoney:this.invoiceMoney,
|
|
|
+ operator:this.operator
|
|
|
+ }).then(res=>{
|
|
|
+ loading.clear()
|
|
|
+ if(res.data){
|
|
|
+ this.infoMap.code = res.data.orderCodes?res.data.orderCodes:''
|
|
|
+ this.infoMap.price = res.data.money?res.data.money/100:0
|
|
|
+ this.initEnt(res.data.company_name)
|
|
|
+ if(res.data.invoice){
|
|
|
+ this.$router.replace({ path:'/invoice/viewInvoice', query:{ onlyIdentifying:this.onlyIdentifying,invoiceMoney:this.invoiceMoney,operator:this.operator}})
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ this.initshowModule()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirm_ok() {
|
|
|
+ const loading = this.$toast.loading({ duration: 0, message: '提交中...' })
|
|
|
+ let parms = {
|
|
|
+ onlyIdentifying:this.onlyIdentifying,
|
|
|
+ invoiceMoney:this.invoiceMoney,
|
|
|
+ operator:this.operator,
|
|
|
+ company_name:this.showModule.company?this.infoMap.company:'',
|
|
|
+ phone:this.showModule.phone?this.infoMap.phone:'',
|
|
|
+ mail:this.showModule.email?this.infoMap.email:'',
|
|
|
+ invoice_type:this.invoiceHeaderFilter(this.infoMap.invoiceHeader),
|
|
|
+ taxpayer_identnum:this.showModule.dutyparagraph?this.infoMap.dutyparagraph:'',
|
|
|
+ remark:this.showModule.desc?this.infoMap.desc:'',
|
|
|
+ invoice_variety:this.typeFilter(this.infoMap.type),
|
|
|
+ bank_account:this.showModule.bankCode?this.infoMap.bankCode:'',
|
|
|
+ company_address:this.showModule.unitAddress?this.infoMap.unitAddress:'',
|
|
|
+ bank_name:this.showModule.bank?this.infoMap.bank:'',
|
|
|
+ recipient:this.showModule.name?this.infoMap.name:'',
|
|
|
+ delivery_address:this.showModule.deliveryAddress?this.infoMap.deliveryAddress:'',
|
|
|
+ company_phone:this.showModule.tel?this.infoMap.tel:''
|
|
|
+ }
|
|
|
+ ajaxInvoiceSubmit(parms).then(res=>{
|
|
|
+ loading.clear()
|
|
|
+ if(res.error_code === 0){
|
|
|
+ this.$toast('提交成功!')
|
|
|
+ this.$router.replace({ path:'/invoice/viewInvoice', query:{ onlyIdentifying:this.onlyIdentifying,invoiceMoney:this.invoiceMoney,operator:this.operator}})
|
|
|
+ }else{
|
|
|
+ this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCheckMap(type) {
|
|
|
+ switch (type) {
|
|
|
+ case 'name': {
|
|
|
+ this.infoCheckMap.name = this.infoMap.name === '' ? '收件人为必填项' : ''
|
|
|
+ if (this.infoCheckMap.name === '' && !this.checkName) {
|
|
|
+ this.infoCheckMap.name = '请输入正确格式的收件人'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'tel': {
|
|
|
+ if(this.requireds.tel){
|
|
|
+ this.infoCheckMap.tel = this.infoMap.tel === '' ? '电话号码为必填项' : ''
|
|
|
+ }
|
|
|
+ if (this.infoMap.tel && this.infoCheckMap.tel === '' && !this.checkPhone(this.infoMap.tel)) {
|
|
|
+ this.infoCheckMap.tel = '联系电话格式不正确'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'phone': {
|
|
|
+ this.infoCheckMap.phone = this.infoMap.phone === '' ? '联系电话为必填项' : ''
|
|
|
+ if (this.infoCheckMap.phone === '' && !this.checkPhone(this.infoMap.phone)) {
|
|
|
+ this.infoCheckMap.phone = '联系电话格式不正确'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'email': {
|
|
|
+ this.infoCheckMap.email = this.infoMap.email === '' ? '邮箱为必填项' : ''
|
|
|
+ if (this.infoCheckMap.email === '' && !this.checkEmail) {
|
|
|
+ this.infoCheckMap.email = '请输入正确格式的邮箱'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'company': {
|
|
|
+ this.infoCheckMap.company = this.infoMap.company === '' ? '公司名称为必填项' : ''
|
|
|
+ if (this.infoCheckMap.company === '' && !this.checkEntName) {
|
|
|
+ this.infoCheckMap.company = '请输入正确格式的公司名称'
|
|
|
+ if (this.infoMap.company.length < 2) {
|
|
|
+ this.infoCheckMap.company = '公司名称至少输入2个字'
|
|
|
+ }
|
|
|
+ if (this.infoMap.company.length > 50) {
|
|
|
+ this.infoCheckMap.company = '公司名称最多输入50个字'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'dutyparagraph': {
|
|
|
+ this.infoCheckMap.dutyparagraph = this.infoMap.dutyparagraph === '' ? '纳税人识别号为必填项' : ''
|
|
|
+ if (this.infoCheckMap.dutyparagraph === '' && !this.checkDutyparagraph) {
|
|
|
+ this.infoCheckMap.dutyparagraph = '请输入正确格式的纳税人识别号'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'bankCode': {
|
|
|
+ if(this.requireds.bankCode){
|
|
|
+ this.infoCheckMap.bankCode = this.infoMap.bankCode === '' ? '银行账号为必填项' : ''
|
|
|
+ }
|
|
|
+ if(this.infoMap.bankCode && !this.checkBankcode){
|
|
|
+ this.infoCheckMap.bankCode = '请输入正确格式的银行账号'
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'bank': {
|
|
|
+ if(this.requireds.bank){
|
|
|
+ this.infoCheckMap.bank = this.infoMap.bank === '' ? '开户银行为必填项' : ''
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'unitAddress': {
|
|
|
+ if(this.requireds.unitAddress){
|
|
|
+ this.infoCheckMap.unitAddress = this.infoMap.unitAddress === '' ? '单位地址为必填项' : ''
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'deliveryAddress': {
|
|
|
+ if(this.requireds.deliveryAddress){
|
|
|
+ this.infoCheckMap.deliveryAddress = this.infoMap.deliveryAddress === '' ? '收件地址为必填项' : ''
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkVerify(type){
|
|
|
+ switch (type) {
|
|
|
+ case 'name': {
|
|
|
+ if ((this.infoMap.name === '' || !this.checkName) && this.showModule.name) {
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'tel': {
|
|
|
+ if (this.showModule.tel) {
|
|
|
+ if(!this.requireds.tel && !this.checkPhone(this.infoMap.tel) && this.infoMap.tel){
|
|
|
+ return false
|
|
|
+ }else if((this.infoMap.tel === '' || !this.checkPhone(this.infoMap.tel)) && this.requireds.tel){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'phone': {
|
|
|
+
|
|
|
+ if ((this.infoMap.phone === '' || !this.checkPhone(this.infoMap.phone) && this.showModule.phone)) {
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'email': {
|
|
|
+ if ((this.infoMap.email === '' || !this.checkEmail) && this.showModule.email) {
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'company': {
|
|
|
+ if (this.infoMap.company === '' && !this.checkEntName && this.showModule.company) {
|
|
|
+ return false
|
|
|
+
|
|
|
+ }else if (this.infoMap.company.length < 2 && this.showModule.company) {
|
|
|
+ return false
|
|
|
+ }else if(this.infoMap.company.length > 50 && this.showModule.company) {
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'dutyparagraph': {
|
|
|
+ if ((this.infoMap.dutyparagraph === '' || !this.checkDutyparagraph) && this.showModule.dutyparagraph) {
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'bankCode': {
|
|
|
+
|
|
|
+ if (this.showModule.bankCode) {
|
|
|
+ if(!this.requireds.bankCode && !this.checkBankcode && this.infoMap.bankCode){
|
|
|
+ return false
|
|
|
+ }else if((this.infoMap.bankCode === '' || !this.checkBankcode) && this.requireds.bankCode){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'bank': {
|
|
|
+
|
|
|
+ if(this.requireds.bank && this.infoMap.bank === '' && this.showModule.bank){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'unitAddress': {
|
|
|
+ if(this.requireds.unitAddress && this.infoMap.unitAddress === '' && this.showModule.unitAddress){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'deliveryAddress': {
|
|
|
+ if(this.requireds.deliveryAddress && this.infoMap.deliveryAddress === '' && this.showModule.deliveryAddress){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ entOnChange (type) {
|
|
|
+ if (type === 'blur') {
|
|
|
+ this.getCheckMap('company')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isAssociateShow = false
|
|
|
+ this.searchList = []
|
|
|
+ }, 300)
|
|
|
+ } else {
|
|
|
+ clearTimeout(this.isAssociateUpTime)
|
|
|
+ this.isAssociateUpTime = setTimeout(() => {
|
|
|
+ this.ajaxEntList(this.infoMap.company)
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectEnt (item) {
|
|
|
+ console.log('item', item)
|
|
|
+ this.infoMap.company = item.name ? item.name : ''
|
|
|
+ this.infoMap.dutyparagraph = item.taxCode ? item.taxCode : ''
|
|
|
+ this.isAssociateShow = false
|
|
|
+ this.searchList = []
|
|
|
+ if(this.checkVerify('company')){
|
|
|
+ this.infoCheckMap.company = ''
|
|
|
+ }else{
|
|
|
+ this.getCheckMap('company')
|
|
|
+ }
|
|
|
+ if(this.checkVerify('dutyparagraph')){
|
|
|
+ this.infoCheckMap.dutyparagraph = ''
|
|
|
+ }else{
|
|
|
+ this.getCheckMap('dutyparagraph')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ajaxEntList (str) {
|
|
|
+ if (str.length <= 2) {
|
|
|
+ this.isAssociateShow = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ajaxGetCompanyAssociation({
|
|
|
+ name: str,
|
|
|
+ typ: 'ent',
|
|
|
+ num: 10
|
|
|
+ }).then(res => {
|
|
|
+ const { error_code: code, data } = res
|
|
|
+ if (code === 0) {
|
|
|
+ const result = data?.list || []
|
|
|
+ if (Array.isArray(result) && result.length) {
|
|
|
+ this.isAssociateShow = true
|
|
|
+ this.searchList = result
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initEnt(str){
|
|
|
+ if(!str){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.infoMap.company = str
|
|
|
+ ajaxGetCompanyAssociation({
|
|
|
+ name: str,
|
|
|
+ typ: 'ent',
|
|
|
+ num: 10
|
|
|
+ }).then(res => {
|
|
|
+ const { error_code: code, data } = res
|
|
|
+ if (code === 0) {
|
|
|
+ const result = data?.list || []
|
|
|
+ if (Array.isArray(result) && result.length === 1) {
|
|
|
+ if(result[0].name === str){
|
|
|
+ this.infoMap.dutyparagraph = result[0].taxCode
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initshowModule(){
|
|
|
+ if(this.infoMap.type === '2' || this.infoMap.type === '4'){
|
|
|
+ this.infoMap.invoiceHeader = '2'
|
|
|
+ this.invoiceHeaderlist = [{text:'单位',value:'2'}]
|
|
|
+ }else{
|
|
|
+ this.invoiceHeaderlist = [{text:'个人',value:'1'},{text:'单位',value:'2'}]
|
|
|
+ }
|
|
|
+ if(this.infoMap.invoiceHeader === '2'){
|
|
|
+ this.showModule.company = true
|
|
|
+ this.showModule.dutyparagraph = true
|
|
|
+ this.showModule.bankCode = true
|
|
|
+ this.showModule.bank =true
|
|
|
+ this.showModule.unitAddress = true
|
|
|
+ this.showModule.tel = true
|
|
|
+ }else{
|
|
|
+ this.showModule.company = false
|
|
|
+ this.showModule.dutyparagraph = false
|
|
|
+ this.showModule.bankCode = false
|
|
|
+ this.showModule.bank =false
|
|
|
+ this.showModule.unitAddress = false
|
|
|
+ this.showModule.tel = false
|
|
|
+ }
|
|
|
+ if(this.infoMap.type!=='1'){
|
|
|
+ this.showModule.desc = true
|
|
|
+ }else{
|
|
|
+ this.showModule.desc = false
|
|
|
+ }
|
|
|
+ if(this.infoMap.type === '3' || this.infoMap.type === '4'){
|
|
|
+ this.showModule.name =true
|
|
|
+ this.showModule.deliveryAddress = true
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.showModule.name = false
|
|
|
+ this.showModule.deliveryAddress = false
|
|
|
+ }
|
|
|
+ if(this.infoMap.type === '1' || this.infoMap.type === '2'){
|
|
|
+ this.showModule.email = true
|
|
|
+ }else{
|
|
|
+ this.showModule.email = false
|
|
|
+ }
|
|
|
+ if(this.infoMap.type === '1' || this.infoMap.type === '3'){
|
|
|
+ this.requireds.bankCode = false
|
|
|
+ this.requireds.bank =false
|
|
|
+ this.requireds.unitAddress = false
|
|
|
+ this.requireds.tel = false
|
|
|
+
|
|
|
+ if(!this.infoMap.bankCode){
|
|
|
+ this.infoCheckMap.bankCode = ''
|
|
|
+ }
|
|
|
+ this.infoCheckMap.bank =''
|
|
|
+ this.infoCheckMap.unitAddress = ''
|
|
|
+ if(!this.infoMap.tel){
|
|
|
+ this.infoCheckMap.tel = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.requireds.bankCode = true
|
|
|
+ this.requireds.bank =true
|
|
|
+ this.requireds.unitAddress = true
|
|
|
+ this.requireds.tel = true
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ invoiceHeaderFilter(val) {
|
|
|
+ if (val === '1') {
|
|
|
+ return '个人'
|
|
|
+ } else if (val === '2') {
|
|
|
+ return '单位'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ typeFilter(val) {
|
|
|
+ if (val === '1') {
|
|
|
+ return '电子普通发票'
|
|
|
+ } else if (val === '2') {
|
|
|
+ return '电子专用发票'
|
|
|
+ } else if (val === '3') {
|
|
|
+ return '纸质普通发票'
|
|
|
+ } else if (val === '4') {
|
|
|
+ return '纸质专用发票'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkPhone(val) {
|
|
|
+ return /^1[3-9]\d{9}$/.test(val) || /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/.test(val)
|
|
|
+ },
|
|
|
+ highlightText (value, keyStr) {
|
|
|
+ return replaceKeyword(value, keyStr, '<span class="highlight-text">' + keyStr + '</span>')
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.Invoicing{
|
|
|
+ background: #F5F6F7;
|
|
|
+}
|
|
|
+.redstar{
|
|
|
+
|
|
|
+}
|
|
|
+.redstar::after{
|
|
|
+ // position: absolute;
|
|
|
+ left: 0;
|
|
|
+ color: #ee0a24;
|
|
|
+ font-size: 16px;
|
|
|
+ content: '*';
|
|
|
+ margin-left: 2px;
|
|
|
+ }
|
|
|
+.header {
|
|
|
+ padding: 16px 12px 14px 24px;
|
|
|
+ background-color: #fff;
|
|
|
+ .item{
|
|
|
+ min-height: 20px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ .text_box{
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .title{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
+ letter-spacing: 0em;
|
|
|
+ color: #9B9CA3;
|
|
|
+ }
|
|
|
+ .value{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
+ letter-spacing: 0em;
|
|
|
+ color: #171826;
|
|
|
+ word-wrap: break-word;
|
|
|
+ max-width: 215px;
|
|
|
+ }
|
|
|
+ .rightBtn{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #2ABED1;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+.j-body {
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: scroll;
|
|
|
+ overflow-x: hidden;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 12px 19px 12px;
|
|
|
+}
|
|
|
+
|
|
|
+.j-bottom {
|
|
|
+ .b-desc {
|
|
|
+ text-align: justify;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #FF9F40;
|
|
|
+ padding: 7px 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ background-color: #FFF4E8;
|
|
|
+ }
|
|
|
+
|
|
|
+ .j-button-group {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ padding: 8px 16px 46px 16px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .j-button-confirm {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #2cb7ca;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 1;
|
|
|
+ width: 100%;
|
|
|
+ height: 46px;
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: inherit;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 8px;
|
|
|
+ outline: none;
|
|
|
+ border: 0;
|
|
|
+ appearance: none;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ button[disabled] {
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+}
|
|
|
+.mt-10{
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+.j-content {
|
|
|
+ background-color: #fff;
|
|
|
+ margin-top: 12px;
|
|
|
+ border-radius: 8px;
|
|
|
+ .item-box-type{
|
|
|
+ display: flex;
|
|
|
+ padding: 16px 0 2px 16px;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .item-box-type::after{
|
|
|
+ position: absolute;
|
|
|
+ box-sizing: border-box;
|
|
|
+ content: ' ';
|
|
|
+ pointer-events: none;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 16px;
|
|
|
+ border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
|
|
|
+ -webkit-transform: scaleY(0.5);
|
|
|
+ transform: scaleY(0.5);
|
|
|
+ }
|
|
|
+ .companybox{
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .companybox::after{
|
|
|
+ position: absolute;
|
|
|
+ box-sizing: border-box;
|
|
|
+ content: ' ';
|
|
|
+ pointer-events: none;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 16px;
|
|
|
+ border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
|
|
|
+ -webkit-transform: scaleY(0.5);
|
|
|
+ transform: scaleY(0.5);
|
|
|
+ }
|
|
|
+ .item-box-title{
|
|
|
+ font-family: PingFang SC;
|
|
|
+font-size: 15px;
|
|
|
+font-weight: 400;
|
|
|
+line-height: 22px;
|
|
|
+letter-spacing: 0em;
|
|
|
+text-align: left;
|
|
|
+color: #5F5E64;
|
|
|
+width: 80px;
|
|
|
+ }
|
|
|
+
|
|
|
+.van-cell {
|
|
|
+ padding: 15px 16px;
|
|
|
+ background-color: #fff0;
|
|
|
+}
|
|
|
+.van-cell::after {
|
|
|
+ right: 0;
|
|
|
+ border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+::v-deep{
|
|
|
+ .van-cell__title.van-field__label{
|
|
|
+ font-size: 15px;
|
|
|
+ margin-right: 0;
|
|
|
+ width: 80px;
|
|
|
+ color: #5F5E64;
|
|
|
+ }
|
|
|
+ .van-field__body{
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .van-field__control::placeholder{
|
|
|
+ font-weight: 400;
|
|
|
+ color: #C0C4CC;
|
|
|
+ }
|
|
|
+ .van-cell--required::before{
|
|
|
+ display: none;
|
|
|
+
|
|
|
+ }
|
|
|
+ .van-cell--required span::after{
|
|
|
+ // position: absolute;
|
|
|
+ left: 0;
|
|
|
+ color: #ee0a24;
|
|
|
+ font-size: 16px;
|
|
|
+ content: '*';
|
|
|
+ margin-left: 2px;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+}
|
|
|
+.associate-ent-group {
|
|
|
+ position: absolute;
|
|
|
+ top: 36px;
|
|
|
+ left: 46px;
|
|
|
+ width: 287px;
|
|
|
+ max-height: 245px;
|
|
|
+ z-index: 99;
|
|
|
+ background: #FFFFFF;
|
|
|
+ box-shadow: 0px 4px 16px rgba(8, 31, 38, 0.08);
|
|
|
+ border-radius: 4px;
|
|
|
+ padding-left: 16px;
|
|
|
+ overflow-y:scroll;
|
|
|
+}
|
|
|
+ .associate-ent-group .associate-ent-item {
|
|
|
+ // font-family: PingFang SC;
|
|
|
+ font-style: normal;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #171826;
|
|
|
+ padding: 14px 16px;
|
|
|
+ padding-left: 0;
|
|
|
+ border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
|
|
|
+}
|
|
|
+.associate-ent-group .associate-ent-item:last-child {
|
|
|
+ border-bottom-color: transparent;
|
|
|
+}
|
|
|
+.highlight-text {
|
|
|
+ color: #2cb7ca!important;
|
|
|
+}
|
|
|
+</style>
|