Quellcode durchsuchen

项目修改校验

sangwenwei vor 1 Jahr
Ursprung
Commit
af95ad6161

+ 7 - 0
src/api/cw/invoice/CwFinanceInvoiceService.js

@@ -93,6 +93,13 @@ export default {
 			params: { projectId: projectId, ...invoiceForm },
 		});
 	},
+	getByIds2: function (projectId, invoiceForm) {
+		return request({
+			url: prefix + "/cw_finance/invoice/getByIds2",
+			method: "get",
+			params: { projectId: projectId, ...invoiceForm },
+		});
+	},
 	getByContractId: function (contractId, invoiceForm) {
 		return request({
 			url: prefix + "/cw_finance/invoice/getByContractId",

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

@@ -160,6 +160,14 @@ saveSignatureAnnotator: function (inputForm) {
       params: {projectId: projectId, ...reportForm}
     })
   },
+	getIdByProjectId2: function (projectId, reportForm) {
+		return request({
+			url: prefix + '/cwProjectReport/getIdByProjectId2',
+			method: 'get',
+			params: {projectId: projectId, ...reportForm}
+		})
+	},
+
   getIdByClientId: function (clientId, reportForm) {
     return request({
       url: prefix + '/cwProjectReport/getIdByClientId',

+ 25 - 1
src/views/cw/projectRecords/ProjectRecordsAddForm.vue

@@ -157,7 +157,7 @@
 									:rules="[
                                  {required: true, message:'有无报告不能为空', trigger:'blur'}
                   ]">
-						  <el-radio v-model="inputForm.isHaveReport" v-for="item in $dictUtils.getDictList('is_have_report')" :label="item.value" style="margin-right: 20px">
+						  <el-radio :disabled="isReport" v-model="inputForm.isHaveReport" v-for="item in $dictUtils.getDictList('is_have_report')" :label="item.value" style="margin-right: 20px">
 							  {{item.label}}</el-radio>
 					  </el-form-item>
 				  </el-col>
@@ -438,6 +438,8 @@
   import contractInfoService from '@/api/cw/workContract/ContractInfoService'
   import UserSelectSignatory from '../workClientInfo/clientUserSelect'
   import CwProjectBusinessTypeService from '@/api/cw/projectBusinessType/CwProjectBusinessTypeService'
+  import projectReportService from "@/api/cw/reportManagement/ProjectReportService";
+  import cwFinanceInvoiceService from "@/api/cw/invoice/CwFinanceInvoiceService";
   export default {
     props: {
       businessId: {
@@ -534,6 +536,7 @@
 			  pageSize: 10,
 			  orders: []
 		  },
+		  isReport: false
       }
     },
 	  cwProjectBusinessTypeService: null,
@@ -677,6 +680,7 @@
             if (this.commonJS.isEmpty(this.inputForm.projectMoney)) {
               this.inputForm.projectMoney = ''
             }
+            this.checkProject()
             this.loading = false
           })
         })
@@ -1093,6 +1097,26 @@
 			this.inputForm.businessType = row.id
 			this.inputForm.businessTypeName = row.name
 		},
+		//校验当前项目是否生成报告或根据项目开票
+		checkProject(){
+			projectReportService.getIdByProjectId2(this.inputForm.id,'').then((data)=>{
+				console.log('report',data)
+				if (data.length === 0){
+					this.isReport = false
+				}else {
+					this.isReport = true
+				}
+			})
+			cwFinanceInvoiceService.getByIds2(this.inputForm.id,'').then((data)=>{
+				console.log('invoice',data)
+				if (data.length === 0){
+					this.isReport = false
+				}else {
+					this.isReport = true
+				}
+			})
+
+		}
     }
   }
 </script>