wangqiang 1 рік тому
батько
коміт
1d08221391

+ 6 - 0
src/api/sys/userService.js

@@ -2,6 +2,12 @@ import request from "@/utils/httpRequest";
 import { SYS_PATH as prefix } from "../AppPath";
 
 export default {
+	getDepartmentId: function () {
+		return request({
+			url: prefix + "/sys/user/getDepartmentId",
+			method: "get",
+		});
+	},
 	findIdCardOnly(param) {
 		return request({
 			url: prefix + '/sys/user/findIdCardOnly',

+ 3 - 2
src/views/cw/invoice/ProgramPageForm.vue

@@ -11,8 +11,9 @@
       v-model="visible">
       <div v-if="isShow">
         <el-radio v-model="checkType" label="1" style="margin-right: 20px">项目</el-radio>
-        <el-radio v-model="checkType" label="2" 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>
+<!--        <el-radio v-model="checkType" label="2" 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>-->
+	    <el-radio v-model="checkType" label="3" style="margin-right: 20px">其他</el-radio>
       </div>
 		<!--报告        -->
 		<div v-if="checkType === '2'">

+ 1 - 1
src/views/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -1577,7 +1577,7 @@
 				  this.inputForm.files = this.$refs.uploadComponent.getDataList()
                 this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
                   if (this.commonJS.isNotEmpty(data)) {
-                    if (data === '公司领导审批') {
+                    if (data === '财务审批') {
                       this.inputForm.type = '5'
                     }
                   }

+ 45 - 13
src/views/cw/workContract/ContractFilePaperForm.vue

@@ -256,7 +256,7 @@
 
 
           <el-col :span="12">
-			  <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status !== 'audit'"
+			  <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method !== 'view' && !testFlag "
 					   label-width="150px">
 				<el-form-item label="案卷号" prop="filedNo"
 							  :rules="[{required: true, message: '请输入案卷号', trigger: 'blur'}
@@ -334,6 +334,8 @@
 </template>
 
 <script>
+	import CommonApi from '@/api/cw/common/CommonApi'
+	import userService from "@/api/sys/userService";
   import contractInfoService from '@/api/cw/workContract/ContractInfoService'
   import ContractFilePaperService from '@/api/cw/workContract/ContractFilePaperService'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
@@ -353,6 +355,7 @@
     data () {
       return {
         visable: false,
+		  testFlag: false,
         gridData: [],
         radio: 0,
         tableData: [],
@@ -394,6 +397,7 @@
           contractFees: []
         },
         inputForm: {
+			taskFiledPaperProcInsId: '',
           departmentName: '', // 部门名称
           customerId: '',  // 客户id
           address: '',
@@ -471,7 +475,9 @@
     },
     ossService: null,
     contractFilePaperService: null,
+	  commonApi: null,
     created () {
+		this.commonApi = new CommonApi()
       this.ossService = new OSSSerive()
       this.contractFilePaperService = new ContractFilePaperService()
     },
@@ -558,6 +564,7 @@
         this.dataListNew = []
         this.method = method
         this.inputForm = {
+			taskFiledPaperProcInsId: '',
           departmentName: '', // 部门名称
           customerId: '',  // 客户id
           address: '',
@@ -615,6 +622,17 @@
           // console.log('this.inputForm.id', this.inputForm.id)
           contractInfoService.findById(this.inputForm.id).then((data) => {
             this.inputForm = this.recover(this.inputForm, data)
+
+			  this.commonApi.getTaskNameByProcInsId(this.inputForm.taskFiledPaperProcInsId).then((data) => {
+				  if (this.commonJS.isNotEmpty(data)) {
+					  if (data === '公司领导审核') {
+						  this.testFlag = false
+					  } else if (data === '部门主任审核') {
+						  this.testFlag = true
+					  }
+				  }
+			  })
+			console.log('this.testFlag', this.testFlag)
             const f = []
             if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
               data.fees.split(',').forEach(item => {
@@ -820,14 +838,19 @@
           this.contractFilePaperService.save(this.inputForm).then((data) => {
             // console.log('data', data)
             this.inputForm.id = data.businessId
-            callback(data.businessTable, data.businessId, this.inputForm)
-            this.$refs.inputForm.resetFields()
-            this.loading = false
+			  //去后台查询该员工所属部门的部门主任
+			  userService.getDepartmentId().then((assignee) =>{
+				  this.inputForm.assignee = assignee.id
+				  callback(data.businessTable, data.businessId, this.inputForm)
+				  this.$refs.inputForm.resetFields()
+				  this.loading = false
+			  })
+
           })
         }
       },
       // 通过
-      agreeForm (callback) {
+     async agreeForm (callback) {
         this.loading = true
         if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadFile.checkProgress()) {
           this.loading = false
@@ -835,8 +858,7 @@
         } else {
           let id = this.inputForm.id
           this.loading = true
-          this.inputForm.status = '5'
-          this.inputForm.filedPaperType = '5'
+
           this.inputForm.contractProperList = []
           this.inputForm.contractInfoId = id
           if (this.inputForm.filedNo === '' || this.inputForm.filedNo === undefined) {
@@ -845,12 +867,22 @@
             throw new Error('请填写案卷号')
           }
 			this.inputForm.createTime = ''
-          this.contractFilePaperService.save(this.inputForm).then((data) => {
-            callback(data.businessTable, data.businessId, this.inputForm)
-            this.$refs.inputForm.resetFields()
-            this.loading = false
-            this.businessId = ''
-          })
+			this.commonApi.getTaskNameByProcInsId(this.inputForm.taskFiledPaperProcInsId).then((data) => {
+				console.log('进来了')
+				if (this.commonJS.isNotEmpty(data)) {
+					if (data === '公司领导审核') {
+						this.inputForm.status = '5'
+						this.inputForm.filedPaperType = '5'
+					}
+				} else {
+					this.inputForm.filedPaperType = '2'
+				}
+				this.contractFilePaperService.save(this.inputForm).then((data) => {
+					console.log('data', data)
+					callback(data.businessTable, data.businessId, this.inputForm)
+					this.loading = false
+				})
+			})
         }
       },
       changeContractFee () {

+ 8 - 3
src/views/cw/workContract/CwWorkContractBorrowForm.vue

@@ -126,6 +126,7 @@
 </template>
 
 <script>
+	import userService from "@/api/sys/userService";
   import UpLoadComponent from '@/views/common/UpLoadComponent'
   // import WorkContractService from '@/api/sys/WorkContractService'
   import contractInfoService from '@/api/cw/workContract/ContractInfoService'
@@ -297,9 +298,13 @@
             } else {
               this.inputForm.borrowType = '2'
               this.cwWorkContractBorrowService.save(this.inputForm).then((data) => {
-                callback(data.businessTable, data.businessId, this.inputForm)
-                this.$refs.inputForm.resetFields()
-                this.loading = false
+				  //去后台查询该员工所属部门的部门主任
+				  userService.getDepartmentId().then((assignee) =>{
+					  this.inputForm.assignee = assignee.id
+					  callback(data.businessTable, data.businessId, this.inputForm)
+					  this.$refs.inputForm.resetFields()
+					  this.loading = false
+				  })
               }).catch(() => {
                 this.$refs.inputForm.resetFields()
                 this.loading = false