sangwenwei hai 1 ano
pai
achega
675af38d3f

+ 1 - 1
src/views/cw/invoice/FinanceInvoiceRadioForm.vue

@@ -145,7 +145,7 @@
       // 表单提交
       getProject () {
         let row = this.$refs.invoiceTable.getRadioRecord()
-		  let total = this.tablePage.total
+		  let total = this.tablePage.total-1
         if (this.commonJS.isEmpty(row)) {
           this.$message.error('请选择一条数据')
           return

+ 68 - 28
src/views/cw/reportManagement/ReportReviewTakeNumberForm.vue

@@ -902,7 +902,7 @@
 							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						} else {
 									//判断项目是否是预开票
-									if (this.preInvoice && this.completed && (this.invoiceTotal <= 1 || this.total <= 1)) {
+									if (this.preInvoice && this.completed ) {
 										if (this.commonJS.isEmpty(this.inputForm.invoiceNumber)){
 											this.loading = false
 											this.$message.error('发票编号未关联,请关联发票')
@@ -915,22 +915,43 @@
 													this.$message.error('该发票已经和报告关联,请重新选择')
 													throw new Error('发票编号未关联,请关联发票')
 												}else {
-													this.$confirm('该项目是否已完成预开票关联', '提示', {
-														distinguishCancelAndClose: true,
-														confirmButtonText: '是',
-														cancelButtonText: '否',
-													}).then(async () => {
-														this.inputForm.isCompleteInvoice = '1'
-														this.doSubmit('start', callback)
-													}).catch((action) => {
-														if (action === 'cancel') {
-															this.inputForm.isCompleteInvoice = '0'
+													if (this.invoiceTotal < 1 || this.total < 1){
+														this.$confirm('该项目是否已完成预开票关联', '提示', {
+															distinguishCancelAndClose: true,
+															confirmButtonText: '是',
+															cancelButtonText: '否',
+														}).then(async () => {
+															this.inputForm.isCompleteInvoice = '1'
 															this.doSubmit('start', callback)
-														}
-													})
+														}).catch((action) => {
+															if (action === 'cancel') {
+																this.inputForm.isCompleteInvoice = '0'
+																this.doSubmit('start', callback)
+															}
+														})
+													}else {
+														this.doSubmit('start', callback)
+													}
+												}
+											})
+										}else if (this.invoiceTotal < 1 || this.total < 1){
+											this.$confirm('该项目是否已完成预开票关联', '提示', {
+												distinguishCancelAndClose: true,
+												confirmButtonText: '是',
+												cancelButtonText: '否',
+											}).then(async () => {
+												this.inputForm.isCompleteInvoice = '1'
+												this.doSubmit('start', callback)
+											}).catch((action) => {
+												if (action === 'cancel') {
+													this.inputForm.isCompleteInvoice = '0'
+													this.doSubmit('start', callback)
 												}
 											})
+										}else {
+											this.doSubmit('start', callback)
 										}
+
 									} else {
 										this.doSubmit('start', callback)
 									}
@@ -946,36 +967,55 @@
 						this.$message.error('取号类型未选择,请选择')
 						throw new Error('取号类型未选择,请选择')
 					}else {
-						if (this.preInvoice && this.completed && (this.invoiceTotal <= 1 || this.total <= 1)){
+						if (this.preInvoice && this.completed ){
 							if (this.commonJS.isEmpty(this.inputForm.invoiceNumber)){
 								this.loading = false
 								this.$message.error('发票编号未关联,请关联发票')
 								throw new Error('发票编号未关联,请关联发票')
 							}else if (this.commonJS.isNotEmpty(this.inputForm.invoiceNumber)) {
 								//根据开票编号去查询是否与报告已经关联
-								projectReportService.getByInvoiceNumber(this.inputForm.invoiceNumber).then((data) => {
+								projectReportService.getByInvoiceNumber(this.inputForm.invoiceNumber, this.inputForm.id).then((data) => {
 									if (data) {
 										this.loading = false
 										this.$message.error('该发票已经和报告关联,请重新选择')
 										throw new Error('发票编号未关联,请关联发票')
 									}else {
-										this.$confirm('该项目是否已完成预开票关联','提示',{
-											distinguishCancelAndClose: true,
-											confirmButtonText: '是',
-											cancelButtonText: '否',
-										}).then(async ()=>{
-											this.inputForm.isCompleteInvoice = '1'
-											this.doSubmit('start', callback)
-										}).catch(async (action)=>{
-											if (action === 'cancel'){
-												this.inputForm.isCompleteInvoice = '0'
+										if (this.invoiceTotal < 1 || this.total < 1){
+											this.$confirm('该项目是否已完成预开票关联','提示',{
+												distinguishCancelAndClose: true,
+												confirmButtonText: '是',
+												cancelButtonText: '否',
+											}).then(async ()=>{
+												this.inputForm.isCompleteInvoice = '1'
 												this.doSubmit('start', callback)
-											}
-										})
+											}).catch(async (action)=>{
+												if (action === 'cancel'){
+													this.inputForm.isCompleteInvoice = '0'
+													this.doSubmit('start', callback)
+												}
+											})
+										}else {
+											this.doSubmit('start', callback)
+										}
 									}
 								})
+							}else if (this.invoiceTotal < 1 || this.total < 1){
+								this.$confirm('该项目是否已完成预开票关联','提示',{
+									distinguishCancelAndClose: true,
+									confirmButtonText: '是',
+									cancelButtonText: '否',
+								}).then(async ()=>{
+									this.inputForm.isCompleteInvoice = '1'
+									this.doSubmit('start', callback)
+								}).catch(async (action)=>{
+									if (action === 'cancel'){
+										this.inputForm.isCompleteInvoice = '0'
+										this.doSubmit('start', callback)
+									}
+								})
+							}else {
+								this.doSubmit('start', callback)
 							}
-
 						}else {
 							this.doSubmit('start', callback)
 						}