|
@@ -106,13 +106,13 @@
|
|
</el-card>
|
|
</el-card>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="单位税号:" prop="taxpayer_identnum">
|
|
<el-form-item label="单位税号:" prop="taxpayer_identnum">
|
|
- <el-input placeholder="请输入单位税号" v-model="ruleForm.taxpayer_identnum"></el-input>
|
|
|
|
|
|
+ <el-input @blur="validateForm" placeholder="请输入单位税号" v-model="ruleForm.taxpayer_identnum"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="min-height: 36px;height: auto;" label="单位地址:" :rules="[{ required: ruleForm.invoice_variety == '电子专用发票', message: '请输入单位地址', trigger: 'blur' }]" prop="company_address">
|
|
<el-form-item style="min-height: 36px;height: auto;" label="单位地址:" :rules="[{ required: ruleForm.invoice_variety == '电子专用发票', message: '请输入单位地址', trigger: 'blur' }]" prop="company_address">
|
|
<el-input ref="company_address" :style="{height: addressHeight + 'px'}" type="textarea" :rows="1" placeholder="请输入单位地址" v-model="ruleForm.company_address"></el-input>
|
|
<el-input ref="company_address" :style="{height: addressHeight + 'px'}" type="textarea" :rows="1" placeholder="请输入单位地址" v-model="ruleForm.company_address"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="电话号码:">
|
|
<el-form-item label="电话号码:">
|
|
- <el-input placeholder="请输入电话号码" v-model="ruleForm.company_phone"></el-input>
|
|
|
|
|
|
+ <el-input maxlength="11" placeholder="请输入电话号码" v-model="ruleForm.company_phone"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="开户银行:">
|
|
<el-form-item label="开户银行:">
|
|
<el-input placeholder="请输入开户银行" v-model="ruleForm.bank_name"></el-input>
|
|
<el-input placeholder="请输入开户银行" v-model="ruleForm.bank_name"></el-input>
|
|
@@ -125,16 +125,16 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
<el-form-item label="联系电话:" prop="phone">
|
|
<el-form-item label="联系电话:" prop="phone">
|
|
- <el-input placeholder="请输入手机号" v-model="ruleForm.phone"></el-input>
|
|
|
|
|
|
+ <el-input maxlength="11" @blur="validateForm" placeholder="请输入手机号" v-model="ruleForm.phone"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="电子邮箱:" prop="mail">
|
|
<el-form-item label="电子邮箱:" prop="mail">
|
|
- <el-input placeholder="邮箱用于接收电子发票" v-model="ruleForm.mail"></el-input>
|
|
|
|
|
|
+ <el-input @blur="validateForm" placeholder="邮箱用于接收电子发票" v-model="ruleForm.mail"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="min-height: 36px;height: auto;" v-if="ruleForm.invoice_type == '个人'" label="开票备注:">
|
|
<el-form-item style="min-height: 36px;height: auto;" v-if="ruleForm.invoice_type == '个人'" label="开票备注:">
|
|
<el-input ref="remark" :style="{height: remarkHeight + 'px'}" :rows="1" placeholder="非必填,此部分内容会展示在发票“备注”上,请按照贵司财务要求进行填写" type="textarea" v-model="ruleForm.remark"></el-input>
|
|
<el-input ref="remark" :style="{height: remarkHeight + 'px'}" :rows="1" placeholder="非必填,此部分内容会展示在发票“备注”上,请按照贵司财务要求进行填写" type="textarea" v-model="ruleForm.remark"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="margin-top: 32px;">
|
|
<el-form-item style="margin-top: 32px;">
|
|
- <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
|
|
|
|
|
+ <el-button :disabled="!isFormValid" type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
|
<el-button @click="resetForm('ruleForm')">取消</el-button>
|
|
<el-button @click="resetForm('ruleForm')">取消</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -167,7 +167,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="modal fade" id="switchModal" tabindex="-1" data-keyboard="false" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
|
|
|
+ <div class="modal fade" id="switchModal" tabindex="-1" data-keyboard="false" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog" style="max-width:400px;">
|
|
<div class="modal-dialog" style="max-width:400px;">
|
|
<div class="modal-content">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<div class="modal-header">
|
|
@@ -180,7 +180,7 @@
|
|
<button type="button" class="btn btn-default" data-dismiss="modal" id="i-know-btn">我知道了</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal" id="i-know-btn">我知道了</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div> -->
|
|
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<!-- main END -->
|
|
<!-- main END -->
|
|
{{include "/common/pcbottom.html"}}
|
|
{{include "/common/pcbottom.html"}}
|
|
@@ -196,83 +196,19 @@
|
|
var order_code = {{.T.order_code}};
|
|
var order_code = {{.T.order_code}};
|
|
var order_mail = {{.T.mail}};
|
|
var order_mail = {{.T.mail}};
|
|
var order_phone = {{.T.phone}};
|
|
var order_phone = {{.T.phone}};
|
|
- // 查询是否可以开发票
|
|
|
|
- // $.ajax({
|
|
|
|
- // url: '/jypay/invoice/switch',
|
|
|
|
- // type: "GET",
|
|
|
|
- // success: function(res) {
|
|
|
|
- // if (res.code === '1001') {
|
|
|
|
- // $('body').removeClass('hidden')
|
|
|
|
- // // 不能开票
|
|
|
|
- // $('#switchModal').modal('show').find('.text').text(res.messge)
|
|
|
|
- // return
|
|
|
|
- // } else{
|
|
|
|
- // $.post("/jypay/invoice/available",{order_code:orderCode},function(rr){
|
|
|
|
- // if(rr.status==0){
|
|
|
|
- // window.location.replace("/front/order/invoicetimeOut?f=upgrade")
|
|
|
|
- // }else{
|
|
|
|
- // $("body").removeClass("hidden");
|
|
|
|
- // var order_mail = {{.T.mail}};
|
|
|
|
- // var order_phone = {{.T.phone}};
|
|
|
|
- // if(order_mail!==""&&order_mail!==null&&order_mail!==undefined){
|
|
|
|
- // $(".email").val(order_mail)
|
|
|
|
- // $(".email").parent().siblings('.success').show();
|
|
|
|
- // }
|
|
|
|
- // if(order_phone!==""&&order_phone!==null&&order_phone!==undefined){
|
|
|
|
- // $(".tel").val(order_phone)
|
|
|
|
- // $(".tel").parent().siblings('.success').show();
|
|
|
|
- // }
|
|
|
|
- // var isSys = getParam("isSys");
|
|
|
|
- // if(isSys === "true"){
|
|
|
|
- // $.ajax({
|
|
|
|
- // type: 'POST',
|
|
|
|
- // url: '/jypay/invoice/show',
|
|
|
|
- // data: {"order_code":orderCode},
|
|
|
|
- // success: function(r){
|
|
|
|
- // if(r.status === "processing"){
|
|
|
|
- // if(r.data.invoice_type === "个人"){
|
|
|
|
- // $(".email").val(r.data.mail);
|
|
|
|
- // $(".tel").val(r.data.phone);
|
|
|
|
- // $(".email").parent().siblings('.success').show();
|
|
|
|
- // $(".tel").parent().siblings('.success').show();
|
|
|
|
- // }else{
|
|
|
|
- // $(".email").val(r.data.mail);
|
|
|
|
- // $(".tel").val(r.data.phone);
|
|
|
|
- // $(".unit_name").val(r.data.company_name);
|
|
|
|
- // $(".taxpayer_number").val(r.data.taxpayer_identnum);
|
|
|
|
- // $(".email").parent().siblings('.success').show();
|
|
|
|
- // $(".tel").parent().siblings('.success').show();
|
|
|
|
- // $(".unit_name").parent().siblings('.success').show();
|
|
|
|
- // $(".taxpayer_number").parent().siblings('.success').show();
|
|
|
|
- // $("#invoice_title > button").text("单位")
|
|
|
|
- // $(".unit_invoice").show();
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // checkForm();
|
|
|
|
- // $(".cancel_btn").on("click",function(){
|
|
|
|
- // window.history.go(-1);
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
- // $('#ruleModal').on('show.bs.modal', function () {
|
|
|
|
- // var $this = $(this);
|
|
|
|
- // var $modal_dialog = $this.find('.modal-dialog');
|
|
|
|
- // $this.css('display', 'block');
|
|
|
|
- // $modal_dialog.css({
|
|
|
|
- // 'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2)
|
|
|
|
- // });
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- // $("#public-nav").css("background","#fff");
|
|
|
|
- // $(".public-nav").css("border-bottom", "1px solid #e0e0e0");
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
haslogin({{.T.logid}});
|
|
haslogin({{.T.logid}});
|
|
|
|
+ $('#i-know-btn').on('click', function () {
|
|
|
|
+ // 新窗口打开
|
|
|
|
+ // 判断窗口是不是window.open打开的
|
|
|
|
+ if (window.opener && window.opener !== window) {
|
|
|
|
+ window.close()
|
|
|
|
+ } else {
|
|
|
|
+ if (history.length <= 1) {
|
|
|
|
+ window.close()
|
|
|
|
+ }
|
|
|
|
+ history.back()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
var invoiceNode = new Vue({
|
|
var invoiceNode = new Vue({
|
|
el: '#invoice',
|
|
el: '#invoice',
|
|
delimiters: ['${', '}'],
|
|
delimiters: ['${', '}'],
|
|
@@ -335,7 +271,8 @@
|
|
only_Identifying: ''
|
|
only_Identifying: ''
|
|
},
|
|
},
|
|
addressHeight: 36,
|
|
addressHeight: 36,
|
|
- remarkHeight: 36
|
|
|
|
|
|
+ remarkHeight: 36,
|
|
|
|
+ isFormValid: false // 表单是否通过校验
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
@@ -346,8 +283,14 @@
|
|
const invoiceid = utils.getParam('invoiceid')
|
|
const invoiceid = utils.getParam('invoiceid')
|
|
this.urlParams.type = type
|
|
this.urlParams.type = type
|
|
this.urlParams.invoiceid = invoiceid
|
|
this.urlParams.invoiceid = invoiceid
|
|
|
|
+ this.setPageOver()
|
|
this.invouceInfoEcho()
|
|
this.invouceInfoEcho()
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.validateForm()
|
|
|
|
+ }, 200)
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
'ruleForm.invoice_variety': {
|
|
'ruleForm.invoice_variety': {
|
|
handler (val) {
|
|
handler (val) {
|
|
@@ -365,9 +308,44 @@
|
|
handler() {
|
|
handler() {
|
|
this.remarkHeight = this.getTextareaHeight(this.$refs.remark.$el);
|
|
this.remarkHeight = this.getTextareaHeight(this.$refs.remark.$el);
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ 'ruleForm.invoice_type': {
|
|
|
|
+ handler(val) {
|
|
|
|
+ // 清空校验
|
|
|
|
+ this.$refs['ruleForm'].clearValidate();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 查询是否可以开发票
|
|
|
|
+ setPageOver () {
|
|
|
|
+ const switchUrl = '/jypay/invoice/switch'
|
|
|
|
+ const url = '/jypay/invoice/available'
|
|
|
|
+ const params = {
|
|
|
|
+ order_code: this.ruleForm.order_code
|
|
|
|
+ }
|
|
|
|
+ this.ajaxComponent(switchUrl).then(r => {
|
|
|
|
+ if (r.code === '1001') {
|
|
|
|
+ // 不能开票
|
|
|
|
+ $('#switchModal').modal('show').find('.text').text(r.messge)
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.ajaxComponent(url, params).then(res => {
|
|
|
|
+ if(res) {
|
|
|
|
+ if(res.status !== 1) {
|
|
|
|
+ window.location.replace("/front/order/invoicetimeOut?f=upgrade")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ validateForm() {
|
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
|
+ // this.$refs.ruleForm.clearValidate();
|
|
|
|
+ this.isFormValid = valid
|
|
|
|
+ });
|
|
|
|
+ },
|
|
getTextareaHeight(textareaEl) {
|
|
getTextareaHeight(textareaEl) {
|
|
textareaEl = textareaEl.querySelector('textarea');
|
|
textareaEl = textareaEl.querySelector('textarea');
|
|
textareaEl.style.height = 'auto';
|
|
textareaEl.style.height = 'auto';
|
|
@@ -392,7 +370,7 @@
|
|
const { only_Identifying, invoice_type, invoice_variety, invoice_content, mail, phone, remark, company_name, taxpayer_identnum, company_address, company_phone, bank_name, bank_account } = data
|
|
const { only_Identifying, invoice_type, invoice_variety, invoice_content, mail, phone, remark, company_name, taxpayer_identnum, company_address, company_phone, bank_name, bank_account } = data
|
|
this.ruleForm.invoice_type = invoice_type
|
|
this.ruleForm.invoice_type = invoice_type
|
|
this.ruleForm.invoice_variety = invoice_variety
|
|
this.ruleForm.invoice_variety = invoice_variety
|
|
- this.ruleForm.invoice_content = [invoice_content]
|
|
|
|
|
|
+ this.ruleForm.invoice_content = invoice_content
|
|
this.ruleForm.mail = mail
|
|
this.ruleForm.mail = mail
|
|
this.ruleForm.phone = phone
|
|
this.ruleForm.phone = phone
|
|
this.ruleForm.remark = remark
|
|
this.ruleForm.remark = remark
|
|
@@ -482,15 +460,30 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
resetForm(formName) {
|
|
resetForm(formName) {
|
|
- this.$refs[formName].resetFields();
|
|
|
|
|
|
+ this.ruleForm = {
|
|
|
|
+ order_code: '',
|
|
|
|
+ invoice_content: '信息技术服务-技术服务费',
|
|
|
|
+ invoice_type: '单位',
|
|
|
|
+ invoice_variety: '电子普通发票',
|
|
|
|
+ mail: '',
|
|
|
|
+ phone: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ company_name: '',
|
|
|
|
+ taxpayer_identnum: '',
|
|
|
|
+ company_address: '',
|
|
|
|
+ company_phone: '',
|
|
|
|
+ bank_name: '',
|
|
|
|
+ bank_account: ''
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleInput(value) {
|
|
handleInput(value) {
|
|
- this.debounce(this.getCompanyList(value), 500)
|
|
|
|
|
|
+ utils.debounce(this.getCompanyList(value), 300)
|
|
},
|
|
},
|
|
handleBlur() {
|
|
handleBlur() {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.companyList = []
|
|
this.companyList = []
|
|
}, 200);
|
|
}, 200);
|
|
|
|
+ this.validateForm()
|
|
},
|
|
},
|
|
handleClick(item) {
|
|
handleClick(item) {
|
|
const { name, taxCode } = item
|
|
const { name, taxCode } = item
|
|
@@ -510,22 +503,26 @@
|
|
}
|
|
}
|
|
this.ajaxComponent(url, params).then((res) => {
|
|
this.ajaxComponent(url, params).then((res) => {
|
|
if(res && res.error_code === 0) {
|
|
if(res && res.error_code === 0) {
|
|
- this.companyList = res.data.list
|
|
|
|
|
|
+ if(res.data.list) {
|
|
|
|
+ this.companyList = res.data.list
|
|
|
|
+ } else {
|
|
|
|
+ this.companyList = []
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- debounce(fn, delay) {
|
|
|
|
- let timeoutId;
|
|
|
|
- return function(...args) {
|
|
|
|
- if (timeoutId) {
|
|
|
|
- clearTimeout(timeoutId);
|
|
|
|
- }
|
|
|
|
- timeoutId = setTimeout(() => {
|
|
|
|
- fn.apply(this, args);
|
|
|
|
- timeoutId = null;
|
|
|
|
- }, delay);
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
|
|
+ // debounce(fn, delay) {
|
|
|
|
+ // let timeoutId;
|
|
|
|
+ // return function(...args) {
|
|
|
|
+ // if (timeoutId) {
|
|
|
|
+ // clearTimeout(timeoutId);
|
|
|
|
+ // }
|
|
|
|
+ // timeoutId = setTimeout(() => {
|
|
|
|
+ // fn.apply(this, args);
|
|
|
|
+ // timeoutId = null;
|
|
|
|
+ // }, delay);
|
|
|
|
+ // };
|
|
|
|
+ // },
|
|
// 封装公共ajax
|
|
// 封装公共ajax
|
|
ajaxComponent(url, params, contentType) {
|
|
ajaxComponent(url, params, contentType) {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|