Prechádzať zdrojové kódy

签字注师2 权限

lijt 1 rok pred
rodič
commit
64718d226d

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

@@ -71,6 +71,12 @@ export default class UserService {
       params: params
     })
   }
+  list1 () {
+    return request({
+      url: '/sys/user/list1',
+      method: 'get'
+    })
+  }
   exportTemplate () {
     return request({
       url: '/sys/user/import/template',

+ 49 - 21
src/views/modules/cw/reportManagement/ReportManagementAddForm.vue

@@ -131,7 +131,9 @@
                               {required: true, message:'签字注师2不能为空', trigger:'blur'}
                    ]">
               <!--                <el-input v-model="inputForm.signatureAnnotator2" placeholder="请填写签字注师2" clearable></el-input>-->
-              <AccountantUserSelect size="medium" ref="userSelect2" :disabled="status === 'audit' || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2" @getValue='(value) => {changeSignatory2(value)}'></AccountantUserSelect>
+              <AccountantUserSelect size="medium" ref="userSelect2" :disabled="status === 'audit'
+              || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2"
+                                    @getValue='(value) => {changeSignatory2(value)}'></AccountantUserSelect>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -526,6 +528,7 @@
 
 <script>
   import ReportReviewService from '@/api/cw/reportManagement/ReportReviewService'
+  import UserService from '@/api/sys/UserService'
   // import UpLoadComponent from '@/views/common/UpLoadComponentV2.1'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
@@ -559,6 +562,7 @@
         method: '',
         loading: false,
         inputForm: {
+          qz2: [],
           reportReviewNo: '',
           allPrintNum: '',
           issueNum: '',
@@ -606,6 +610,7 @@
           industry: '',
           businessObjects: ''
         },
+        userService: null,
         keyWatch: '',
         activeName: 'enclosure',
         tableKey: '',
@@ -613,6 +618,7 @@
         visible: false
       }
     },
+    userService: null,
     ReportReviewService: null,
     projectRecordsService: null,
     ProjectReportService: null,
@@ -622,6 +628,8 @@
       this.enterpriseSearchService = new EnterpriseSearchService()
       this.projectRecordsService = new ProjectRecordsService()
       this.projectReportService = new ProjectReportService()
+      this.userService = new UserService()
+      console.log('qz2', this.inputForm.qz2)
     },
     computed: {
       bus: {
@@ -700,6 +708,17 @@
             this.$refs.userSelect2.changeNameValue('')
             this.$refs.userSelect2.clearSelectData()
             this.$forceUpdate()
+            console.log('qz20', this.inputForm.qz2)
+          })
+        } else if (!this.inputForm.qz2.includes(value)) {
+          console.log('q12222', value)
+          console.log('qz21', this.inputForm.qz2)
+          this.$message.warning('该用户没有签字注师2的权限')
+          this.$nextTick(() => {
+            this.inputForm.signatureAnnotator2 = ''
+            this.$refs.userSelect2.changeNameValue('')
+            this.$refs.userSelect2.clearSelectData()
+            this.$forceUpdate()
           })
         } else if (this.commonJS.isNotEmpty(this.inputForm.signatureAnnotator1) &&
           this.inputForm.projectMasterId1 !== this.inputForm.signatureAnnotator1 &&
@@ -716,12 +735,15 @@
             this.$refs.userSelect2.changeNameValue('')
             this.$refs.userSelect2.clearSelectData()
             this.$forceUpdate()
+            console.log('qz22', this.inputForm.qz2)
           })
         } else {
           this.inputForm.signatureAnnotator2 = value
         }
       },
       init (method, id) {
+        console.log('qz2', this.inputForm.qz2)
+        console.log('id', id)
         this.visible = true
         this.activeName = 'enclosure'
         // this.activeName = 'archiveFile'
@@ -734,6 +756,7 @@
           this.method = method
         }
         this.inputForm = {
+          qz2: [],
           reportReviewNo: '',
           allPrintNum: '',
           issueNum: '',
@@ -799,26 +822,31 @@
           // this.$refs.archiveFile.newUpload(this.method, [], 'cwProjectReport', null, null, null, null, false)
           // this.$refs.inputForm.resetFields()
           // this.loading = true
-          /* this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
-            this.inputForm.status = data.status
-            console.log('this.inputForm.servedUnitName', data)
-            this.inputForm = this.recover(this.inputForm, data)
-            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
-              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-            }
-            if (this.commonJS.isEmpty(this.inputForm.officeId)) {
-              this.inputForm.officeId = JSON.parse(localStorage.getItem('user')).officeDTO.id
-            }
-            if (this.commonJS.isEmpty(this.inputForm.realCreate)) {
-              this.inputForm.realCreate = JSON.parse(localStorage.getItem('user')).id
-            }
-            if (this.status === 'audit' || this.status === 'taskFormDetail') {
-              this.method = 'view'
-            }
-            this.$refs.archiveFile.newUpload(this.method, data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
-            this.loading = false
-          }) */
+          this.userService.list1().then(({data}) => {
+            console.log('data111', data)
+            this.inputForm.qz2 = data
+          }
+          )
+          //  this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+          //   this.inputForm.status = data.status
+          //   console.log('this.inputForm.servedUnitName', data)
+          //   this.inputForm = this.recover(this.inputForm, data)
+          //   this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+          //   if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+          //     this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+          //   }
+          //   if (this.commonJS.isEmpty(this.inputForm.officeId)) {
+          //     this.inputForm.officeId = JSON.parse(localStorage.getItem('user')).officeDTO.id
+          //   }
+          //   if (this.commonJS.isEmpty(this.inputForm.realCreate)) {
+          //     this.inputForm.realCreate = JSON.parse(localStorage.getItem('user')).id
+          //   }
+          //   if (this.status === 'audit' || this.status === 'taskFormDetail') {
+          //     this.method = 'view'
+          //   }
+          //   this.$refs.archiveFile.newUpload(this.method, data.cwFileInfoList, 'cwWorkContract', null, null, null, null, false)
+          //   this.loading = false
+          // })
         })
       },
       openContractForm () {