Bladeren bron

报销功能修改

lizhenhao 2 jaren geleden
bovenliggende
commit
aaf974febb

+ 6 - 4
src/views/modules/cw/reimbursementApproval/info/InfoForm.vue

@@ -24,8 +24,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="所属部门" prop="department">
-              <el-input v-model="inputForm.department" :disabled="true"></el-input>
+            <el-form-item label="所属部门" prop="departmentName">
+              <el-input v-model="inputForm.departmentName" :disabled="true"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -593,7 +593,8 @@
           preList: [],
           purchaseNo: '',
           tradeTotalPrice: '',
-          purchaseId: ''
+          purchaseId: '',
+          departmentName: ''
         }
       }
     },
@@ -629,7 +630,8 @@
           preList: [],
           purchaseNo: '',
           tradeTotalPrice: '',
-          purchaseId: ''
+          purchaseId: '',
+          departmentName: ''
         }
         if (method === 'add') {
           this.title = `新建报销类型`

+ 19 - 16
src/views/modules/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -16,8 +16,8 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="所属部门" prop="department">
-            <el-input v-model="inputForm.department" :disabled="true"></el-input>
+          <el-form-item label="所属部门" prop="departmentName">
+            <el-input v-model="inputForm.departmentName" :disabled="true"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -650,7 +650,8 @@
           preList: [],
           purchaseNo: '',
           tradeTotalPrice: '',
-          purchaseId: ''
+          purchaseId: '',
+          departmentName: ''
         }
       }
     },
@@ -740,7 +741,8 @@
           preList: [],
           purchaseNo: '',
           tradeTotalPrice: '',
-          purchaseId: ''
+          purchaseId: '',
+          departmentName: ''
         }
         if (method === 'add') {
           this.title = `新建报销类型`
@@ -751,6 +753,19 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
+          if (this.commonJS.isEmpty(this.inputForm.department)) {
+            this.inputForm.department = JSON.parse(localStorage.getItem('user')).officeDTO.id
+            this.inputForm.departmentName = JSON.parse(localStorage.getItem('user')).officeDTO.name
+          }
+          if (this.commonJS.isEmpty(this.inputForm.userId)) {
+            this.inputForm.userId = JSON.parse(localStorage.getItem('user')).id
+          }
+          if (this.commonJS.isEmpty(this.inputForm.userName)) {
+            this.inputForm.userName = JSON.parse(localStorage.getItem('user')).name
+          }
+          if (this.commonJS.isEmpty(this.inputForm.reimDate)) {
+            this.inputForm.reimDate = new Date()
+          }
           if (this.formReadOnly === true && this.businessId !== 'false') {
             method = 'view'
           }
@@ -761,18 +776,6 @@
               this.inputForm = this.recover(this.inputForm, data)
               this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-              if (this.commonJS.isEmpty(this.inputForm.userId)) {
-                this.inputForm.userId = JSON.parse(localStorage.getItem('user')).id
-              }
-              if (this.commonJS.isEmpty(this.inputForm.userName)) {
-                this.inputForm.userName = JSON.parse(localStorage.getItem('user')).name
-              }
-              if (this.commonJS.isEmpty(this.inputForm.reimDate)) {
-                this.inputForm.reimDate = new Date()
-              }
-              if (this.commonJS.isEmpty(this.inputForm.department)) {
-                this.inputForm.department = JSON.parse(localStorage.getItem('user')).officeDTO.name
-              }
               if (this.commonJS.isNotEmpty(this.inputForm.purchaseId)) {
                 this.startPur(this.inputForm.purchaseId)
               }