sangwenwei vor 1 Jahr
Ursprung
Commit
5601583d73

+ 8 - 0
src/api/cw/reportManagement/ProjectReportService.js

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

+ 15 - 4
src/views/cw/invoice/FinanceInvoiceRadioForm.vue

@@ -74,7 +74,7 @@
 			  <vxe-column type="seq" width="60" title="序号"></vxe-column>
 			  <vxe-column type="radio" width="60px"></vxe-column>
 			  <vxe-column min-width="150" title="发票申请编号" align="center" field="no"></vxe-column>
-			  <vxe-column min-width="150" title="发票号" align="center" field="number"></vxe-column>
+			  <vxe-column min-width="150" title="发票金额" align="center" field="account"></vxe-column>
 			  <vxe-column min-width="150" title="实际开票单位" align="center" field="billingWorkplaceReal"></vxe-column>
 			  <vxe-column min-width="150" title="创建人" align="center" field="createName"></vxe-column>
 			  <vxe-column min-width="120" title="开票日期" align="center" field="billingDate"></vxe-column>
@@ -102,6 +102,7 @@
 
 <script>
 	import financeInvoiceService from '@/api/cw/invoice/CwFinanceInvoiceService'
+	import projectReportService from '@/api/cw/reportManagement/ProjectReportService'
   export default {
     data () {
       return {
@@ -148,9 +149,19 @@
         if (this.commonJS.isEmpty(row)) {
           this.$message.error('请选择一条数据')
           return
-        }
-        this.close()
-        this.$emit('getInvoice', row,total)
+        }else {
+			//根据开票编号去查询是否与报告已经关联
+			projectReportService.getByInvoiceNumber(row.no).then((data)=>{
+				if (data){
+					this.$message.error('该发票已经和报告关联,请重新选择')
+					return
+				}else {
+					this.close()
+					this.$emit('getInvoice', row,total)
+				}
+			})
+		}
+
       },
       list () {
         this.loading = true

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

@@ -12,7 +12,7 @@
       <div v-if="isShow">
 	  	<el-radio v-model="checkType" label="2" style="margin-right: 20px">报告</el-radio>
         <el-radio v-model="checkType" label="1" style="margin-right: 20px">项目</el-radio>
-        <el-radio v-model="checkType" label="4" style="margin-right: 20px">预开票项目</el-radio>
+        <el-radio v-model="checkType" v-if="hasPermission('project:info:preInvoice')" label="4" style="margin-right: 20px">预开票项目</el-radio>
 	    <el-radio v-model="checkType" v-if="hasPermission('cw_finance:invoice:add:report')" label="3" style="margin-right: 20px">其他</el-radio>
       </div>
 		<!--报告        -->

+ 22 - 16
src/views/cw/projectRecords/ProjectRecordsAddForm.vue

@@ -191,7 +191,7 @@
                     </el-select>
                   </el-form-item>
                 </el-col>
-				  <el-col :span="12">
+				  <el-col :span="12" v-if="hasPermission('project:info:preInvoice') && inputForm.isHaveReport === '1' && inputForm.projectClassification === '16' && inputForm.reportType === '10'">
 					  <el-form-item label="是否预开票" prop="isPreInvoice"
 									:rules="[
 
@@ -834,7 +834,9 @@
           fax: '',
           name: '',
           position: '',
-          sex: ''
+          sex: '',
+			isHaveReport:'1',
+			isPreInvoice:'0'
         }
         this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
@@ -1160,33 +1162,37 @@
 				console.log('report',data)
 				if (data.length === 0){
 					this.isReport = false
+					this.ifCheck = false
 				}else {
 					this.isReport = true
+					this.ifCheck = true
 				}
 			})
 			cwFinanceInvoiceService.getByIds2(this.inputForm.id,'').then((data)=>{
 				console.log('invoice',data)
 				if (data.length === 0){
 					this.isReport = false
+					this.ifCheck = false
 				}else {
 					this.isReport = true
-				}
-			})
-		},
-		preInvoice(){
-      	console.log('this.inputForm.reportType',this.inputForm.reportType)
-      	console.log('this.inputForm.projectClassification',this.inputForm.projectClassification)
-      	console.log('this.inputForm.isHaveReport',this.inputForm.isHaveReport)
-      		if (this.commonJS.isNotEmpty(this.inputForm.isHaveReport) && this.commonJS.isNotEmpty(this.inputForm.projectClassification) && this.commonJS.isNotEmpty(this.inputForm.reportType)){
-      			if (this.inputForm.isHaveReport === '1' && this.inputForm.projectClassification === '16' && this.inputForm.reportType === '10'){
-      				this.ifCheck = false
-				}else {
 					this.ifCheck = true
 				}
-			}else {
-				this.ifCheck = true
-			}
+			})
 		},
+		// preInvoice(){
+      	// console.log('this.inputForm.reportType',this.inputForm.reportType)
+      	// console.log('this.inputForm.projectClassification',this.inputForm.projectClassification)
+      	// console.log('this.inputForm.isHaveReport',this.inputForm.isHaveReport)
+      	// 	if (this.commonJS.isNotEmpty(this.inputForm.isHaveReport) && this.commonJS.isNotEmpty(this.inputForm.projectClassification) && this.commonJS.isNotEmpty(this.inputForm.reportType)){
+      	// 		if (this.inputForm.isHaveReport === '1' && this.inputForm.projectClassification === '16' && this.inputForm.reportType === '10'){
+      	// 			this.ifCheck = false
+		// 		}else {
+		// 			this.ifCheck = true
+		// 		}
+		// 	}else {
+		// 		this.ifCheck = true
+		// 	}
+		// },
 		openUserDia1(){
 			this.$refs.userSelect1.init()
 		},

+ 7 - 3
src/views/cw/reportManagement/ReportReviewTakeNumberForm.vue

@@ -179,7 +179,7 @@
 							<el-form-item label="开票编号" prop="invoiceNumber"
 										  :rules="[{required: true, message:'开票编号不能为空', trigger:'change'}
                    ]">
-								<el-input @focus="openInoviceForm()" :disabled="status === 'audit' || status === 'taskFormDetail'|| inputForm.applyStatus ==='3' || inputForm.applyStatus === '4'"  v-model="inputForm.invoiceNumber" placeholder="请填写开票编号" clearable></el-input>
+								<el-input @focus="openInoviceForm()" :disabled="status === 'audit' || status === 'taskFormDetail'"  v-model="inputForm.invoiceNumber" placeholder="请填写开票编号" clearable></el-input>
 							</el-form-item>
 						</el-col>
 
@@ -622,6 +622,8 @@
 				invoiceTotal:'', //这个为选择发票时已有的发票总数
 				total:'',//页面初始化时查询出的发票总数
 				searchForm: {
+					status:'',
+					id:'',
 					programId:''
 				},
 				completed:true
@@ -815,6 +817,8 @@
 						this.$refs.enclosure.newUpload(this.method, data.cwFileInfoList3, 'cwWorkContract', null, null, null, null, false)
 						this.checkIsPreInvoice()
 						if (this.preInvoice = true){
+							this.searchForm.status = '5'
+							this.searchForm.id = data.id
 							financeInvoiceService.listByProgramId({
 								...this.searchForm,
 							}).then((data) => {
@@ -898,7 +902,7 @@
 							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						} else {
 							//判断项目是否是预开票
-							if (this.preInvoice && this.completed){
+							if (this.preInvoice && this.completed && (this.invoiceTotal <=1 || this.total <=1)){
 								this.$confirm('该项目是否已完成预开票关联','提示',{
 									distinguishCancelAndClose: true,
 									confirmButtonText: '是',
@@ -919,7 +923,7 @@
 						}
 					})
 				} else {
-					if (this.preInvoice && this.completed){
+					if (this.preInvoice && this.completed && (this.invoiceTotal <=1 || this.total <=1)){
 						this.$confirm('该项目是否已完成预开票关联','提示',{
 							distinguishCancelAndClose: true,
 							confirmButtonText: '是',