Browse Source

报销类型选择修改

lizhenhao 2 years ago
parent
commit
df58dbb3a8

+ 8 - 5
src/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm.vue

@@ -36,7 +36,8 @@
           :sort-config="{remote:true}"
           :data="dataList"
           :tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"
-          :checkbox-config="{}">
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}">
           <vxe-column type="seq" width="60" title="序号"></vxe-column>
           <vxe-column type="radio" width="40" ></vxe-column>
           <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
@@ -94,10 +95,12 @@
           return
         }
         rows = this.$refs.typeTable.getRadioRecord()
-        if (rows.level !== '3') {
-          this.$message.error('请选择子集数据')
-          return
-        }
+        this.dataList.forEach((item) => {
+          if (item.parentId === rows.id) {
+            this.$message.error('只可以选择最小节点的数据')
+            throw new Error('只可以选择最小节点的数据')
+          }
+        })
         this.$emit('getProgramForType', rows)
         this.close()
       },

+ 1 - 1
src/views/modules/cw/reimbursementApproval/info/InfoList.vue

@@ -58,7 +58,7 @@
                   label: 'name',         // 显示名称
                   children: 'children'    // 子级字段名
                 }"
-          url="/reimbursementApproval/type/treeData1?type=12"
+          url="/reimbursementApproval/type/treeData1?type=last"
           :value="searchForm.remiType"
           :clearable="true"
           :accordion="true"

+ 1 - 1
src/views/modules/reimbursement/info/InfoList.vue

@@ -58,7 +58,7 @@
                   label: 'name',         // 显示名称
                   children: 'children'    // 子级字段名
                 }"
-          url="/reimbursement/type/treeData?type=12"
+          url="/reimbursementApproval/type/treeData1?type=last"
           :value="searchForm.remiType"
           :clearable="true"
           :accordion="true"

+ 3 - 3
src/views/modules/reimbursement/info/ReimbursementForm.vue

@@ -188,7 +188,7 @@
   import XEUtils from 'xe-utils'
   import UserService from '@/api/sys/UserService'
   import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
-  import ReimbursementTypePullForm from '@/views/modules/finance/invoice/ReimbursementTypePullForm'
+  import ReimbursementTypePullForm from '@/views/modules/cw/reimbursementApproval/info/CwReimbursementTypePullForm'
   import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
   export default {
     data () {
@@ -577,8 +577,8 @@
         this.$refs.reimbursementTypePullForm.init()
       },
       getProgramForType (rows) {
-        this.inputForm.detailInfos[this.indexRow].typeId = rows[0].id
-        this.inputForm.detailInfos[this.indexRow].typeName = rows[0].name
+        this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+        this.inputForm.detailInfos[this.indexRow].typeName = rows.name
         this.indexRow = ''
         this.$forceUpdate()
       },