Browse Source

报告号申请

sangwenwei 1 năm trước cách đây
mục cha
commit
085291eb35

+ 2 - 2
src/api/cw/reportManagement/ProjectReportService.js

@@ -275,11 +275,11 @@ saveSignatureAnnotator: function (inputForm) {
 			params: {id: id}
 		})
 	},
-	getByInvoiceNumber: function (invoiceNumber) {
+	getByInvoiceNumber: function (invoiceNumber,id) {
 		return request({
 			url: prefix + '/cwProjectReport/getByInvoiceNumber',
 			method: 'get',
-			params: {invoiceNumber: invoiceNumber}
+			params: {invoiceNumber: invoiceNumber,id:id}
 		})
 	},
 

+ 3 - 12
src/views/cw/invoice/FinanceInvoiceRadioForm.vue

@@ -149,18 +149,9 @@
         if (this.commonJS.isEmpty(row)) {
           this.$message.error('请选择一条数据')
           return
-        }else {
-			//根据开票编号去查询是否与报告已经关联
-			projectReportService.getByInvoiceNumber(row.no).then((data)=>{
-				if (data){
-					this.$message.error('该发票已经和报告关联,请重新选择')
-					return
-				}else {
-					this.close()
-					this.$emit('getInvoice', row,total)
-				}
-			})
-		}
+        }
+		  this.close()
+		  this.$emit('getInvoice', row,total)
 
       },
       list () {

+ 2 - 2
src/views/cw/invoice/InvoiceFormTask.vue

@@ -300,7 +300,7 @@
             </el-input>
           </el-form-item>
         </el-col >
-		  <el-col :span="12" v-if="(this.commonJS.isNotEmpty(this.bj1)) && status === 'audit' && isPreInvoice !== '1'">
+		  <el-col :span="12" v-if="(this.commonJS.isNotEmpty(this.bj1)) && status === 'audit'">
 			  <el-form-item label="报备类型" prop="reportType"
 							:rules="[]"
 			  >
@@ -314,7 +314,7 @@
 				  </el-select>
 			  </el-form-item>
 		  </el-col>
-		  <el-col :span="12" v-if="(this.commonJS.isNotEmpty(this.bj1)) && status !== 'audit' && isPreInvoice !== '1'">
+		  <el-col :span="12" v-if="(this.commonJS.isNotEmpty(this.bj1)) && status !== 'audit'">
 			  <el-form-item label="报备类型" prop="reportType"
 							:rules="[{required: true, message:'报备类型不能为空', trigger:'blur'}]"
 			  >

+ 62 - 47
src/views/cw/reportManagement/ReportReviewTakeNumberForm.vue

@@ -901,32 +901,39 @@
 							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						} else {
-							if (this.commonJS.isEmpty(this.inputForm.invoiceNumber)){
-								this.loading = false
-								this.$message.error('发票编号未关联,请关联发票')
-								throw new Error('发票编号未关联,请关联发票')
-							}else {
-								//判断项目是否是预开票
-								if (this.preInvoice && this.completed && (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)
+									//判断项目是否是预开票
+									if (this.preInvoice && this.completed && (this.invoiceTotal <= 1 || this.total <= 1)) {
+										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, 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((action) => {
+														if (action === 'cancel') {
+															this.inputForm.isCompleteInvoice = '0'
+															this.doSubmit('start', callback)
+														}
+													})
+												}
+											})
 										}
-									})
-								}else {
-									this.doSubmit('start', callback)
-								}
-							}
-
-
+									} else {
+										this.doSubmit('start', callback)
+									}
 						}
 					})
 				} else {
@@ -938,33 +945,41 @@
 						this.loading = false
 						this.$message.error('取号类型未选择,请选择')
 						throw new Error('取号类型未选择,请选择')
-					}else if (this.commonJS.isEmpty(this.inputForm.invoiceNumber)){
-						this.loading = false
-						this.$message.error('发票编号未关联,请关联发票')
-						throw new Error('发票编号未关联,请关联发票')
 					}else {
-						if (this.preInvoice && this.completed && (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)
-								}
-							})
+						if (this.preInvoice && this.completed && (this.invoiceTotal <= 1 || this.total <= 1)){
+							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) => {
+									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'
+												this.doSubmit('start', callback)
+											}
+										})
+									}
+								})
+							}
+
 						}else {
 							this.doSubmit('start', callback)
 						}
 					}
-
-
-
-
 				}
 			},
 			async agreeForm (callback) {