浏览代码

Merge remote-tracking branch 'origin/master'

lizhenhao 2 年之前
父节点
当前提交
d8e9783272
共有 2 个文件被更改,包括 20 次插入5 次删除
  1. 17 2
      src/views/modules/reimbursement/type/TypeForm.vue
  2. 3 3
      src/views/modules/reimbursement/type/TypeList.vue

+ 17 - 2
src/views/modules/reimbursement/type/TypeForm.vue

@@ -13,7 +13,18 @@
         <el-row  :gutter="15">
           <el-col :span="21">
             <el-form-item label="上级节点" prop="parentId">
-              <el-input v-model="inputForm.parentId" placeholder="请选择上级节点"></el-input>
+              <SelectTree
+                ref="areaTree"
+                :props="{
+                      value: 'id',             // ID字段名
+                      label: 'name',         // 显示名称
+                      children: 'children'    // 子级字段名
+                    }"
+                url="/reimbursement/type/treeData"
+                :value="inputForm.parentId"
+                :clearable="true"
+                :accordion="true"
+                @getValue="(value) => {inputForm.parentId=value}"/>
             </el-form-item>
           </el-col>
           <el-col :span="21">
@@ -41,6 +52,7 @@
 
 <script>
   import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
   export default {
     data () {
       return {
@@ -59,6 +71,9 @@
     created () {
       this.reimbursementTypeService = new ReimbursementTypeService()
     },
+    components: {
+      SelectTree
+    },
     methods: {
       init (method, id) {
         this.method = method
@@ -82,9 +97,9 @@
         this.visible = true
         this.loading = false
         this.$nextTick(() => {
-          this.$refs.inputForm.resetFields()
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
+            this.$refs.inputForm.resetFields()
             this.reimbursementTypeService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))

+ 3 - 3
src/views/modules/reimbursement/type/TypeList.vue

@@ -5,8 +5,8 @@
       <el-form-item label="报销内容名称" prop="name">
         <el-input size="small" v-model="searchForm.name" placeholder="请输入报销内容名称" clearable></el-input>
       </el-form-item>
-      <el-form-item label="序号" prop="no">
-        <el-input size="small" v-model="searchForm.no" placeholder="请输入序号" clearable></el-input>
+      <el-form-item label="序号" prop="sort">
+        <el-input size="small" v-model="searchForm.sort" placeholder="请输入序号" clearable></el-input>
       </el-form-item>
 
       <el-form-item>
@@ -42,7 +42,7 @@
           <vxe-column type="seq" width="40"></vxe-column>
           <vxe-column type="checkbox" width="40" ></vxe-column>
           <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
-          <vxe-column width="100" title="序号" field="no"></vxe-column>
+          <vxe-column width="100" title="序号" field="sort"></vxe-column>
 
           <vxe-column title="操作" width="230px" fixed="right" align="center">
             <template  slot-scope="scope">