浏览代码

Merge remote-tracking branch 'origin/master'

lizhenhao 2 年之前
父节点
当前提交
e888ebcc56

+ 2 - 0
src/views/modules/reimbursement/info/InfoList.vue

@@ -405,10 +405,12 @@
             this.$router.push({
               path: '/flowable/task/TaskFormDetail',
               query: {
+                isShow: 'false',
                 readOnly: true,
                 title: '流程详情',
                 formTitle: '流程详情',
                 businessId: row.id,
+                status: 'reback',
                 ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
             })
           })

+ 19 - 9
src/views/modules/reimbursement/info/ReimbursementForm.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
              label-width="100px" @submit.native.prevent>
 
       <el-divider content-position="left"><i class="el-icon-document"></i> 基础信息</el-divider>
@@ -46,7 +46,7 @@
 
       <el-divider content-position="left"><i class="el-icon-document"></i>
         报销详情
-        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view'" size="mini" @click="insertEvent('detail')" plain>
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly" size="mini" @click="insertEvent('detail')" plain>
           新增
         </el-button>
       </el-divider>
@@ -68,6 +68,7 @@
           <vxe-table-column field="userName" title="报销人" :edit-render="{}" :rules="[{required: true, message:'请选择报销人', trigger:'blur'}]">
             <template v-slot:edit="scope">
               <el-input v-model="scope.row.userName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
+<!--              <UserSelect :limit='1' :name="scope.row.userName" @getValue='(value, label) => {scope.row.userId = value, scope.row.userName = label}'></UserSelect>-->
             </template>
           </vxe-table-column>
           <vxe-table-column field="deptName" title="报销部门" :edit-render="{}">
@@ -120,7 +121,7 @@
 
       <el-divider content-position="left"><i class="el-icon-document"></i>
         专用发票信息
-        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view'" size="mini" @click="insertEvent('amount')" plain>
+        <el-button style="margin-left: 20px" type="primary" :disabled="method==='view' || this.formReadOnly " size="mini" @click="insertEvent('amount')" plain>
           新增
         </el-button>
       </el-divider>
@@ -189,6 +190,7 @@
   import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
   import ReimbursementTypePullForm from '@/views/modules/finance/invoice/ReimbursementTypePullForm'
   import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  import UserSelect from '@/components/userSelect'
   export default {
     data () {
       return {
@@ -236,7 +238,8 @@
       SelectTree,
       ProgramPageForm,
       ReimbursementTypePullForm,
-      UserPullForm
+      UserPullForm,
+      UserSelect
     },
     computed: {
       name () {
@@ -284,6 +287,9 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
+          if (this.formReadOnly === true) {
+            method = 'view'
+          }
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
             this.$refs.inputForm.resetFields()
@@ -346,6 +352,8 @@
       async insertEvent (type) {
         if (type === 'detail') {
           await this.$refs.detailTable.insert().then((data) => {
+            data.userName = this.name
+            data.deptName = this.officeName
             this.inputForm.detailInfos.push(data)
           })
         }
@@ -369,8 +377,10 @@
         this.inputForm.type = '1'
         this.reimbursementService.save(this.inputForm).then(({data}) => {
           callback()
+          this.$refs.inputForm.resetFields()
           this.loading = false
         }).catch(() => {
+          this.$refs.inputForm.resetFields()
           this.loading = false
         })
       },
@@ -416,11 +426,11 @@
                 }
               }
             }
-            if (this.commonJS.isEmpty(this.inputForm.amountInfos)) {
-              this.$message.error('至少填写一条专用发票信息')
-              this.loading = false
-              return
-            }
+            // if (this.commonJS.isEmpty(this.inputForm.amountInfos)) {
+            //   this.$message.error('至少填写一条专用发票信息')
+            //   this.loading = false
+            //   return
+            // }
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
             this.inputForm.type = '2'
             this.reimbursementService.save(this.inputForm).then(({data}) => {