Browse Source

报销单第一条类别如果为差旅费或者操作奖,即可新增

huangguoce 2 weeks ago
parent
commit
79adf997e7

+ 57 - 50
src/api/cw/reimbursementApproval/ReimbursementApprovalTypeService.js

@@ -1,54 +1,61 @@
-import request from '@/utils/httpRequest';
+import request from "@/utils/httpRequest";
 import { PUBLIC_MODULES_PATH as prefix } from "../../AppPath";
 
 export default class ReimbursementApprovalTypeService {
-  list (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/list',
-      method: 'get',
-      params: param
-    })
-  }
-  bxList (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/bxList',
-      method: 'get',
-      params: param
-    })
-  }
-  cgList (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/cgList',
-      method: 'get',
-      params: param
-    })
-  }
-  save (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/save',
-      method: 'post',
-      data: param
-    })
-  }
-  findById (id) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/findById',
-      method: 'get',
-      params: {id: id}
-    })
-  }
-	findByName (name) {
-		return request({
-			url: prefix + '/reimbursementApproval/type/findByName',
-			method: 'get',
-			params: {name: name}
-		})
-	}
-  remove (id) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/deleteById',
-      method: 'get',
-      params: {id: id}
-    })
-  }
+	list(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/list",
+			method: "get",
+			params: param,
+		});
+	}
+	bxList(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/bxList",
+			method: "get",
+			params: param,
+		});
+	}
+	bxListByClCz(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/bxListByClCz",
+			method: "get",
+			params: param,
+		});
+	}
+	cgList(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/cgList",
+			method: "get",
+			params: param,
+		});
+	}
+	save(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/save",
+			method: "post",
+			data: param,
+		});
+	}
+	findById(id) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/findById",
+			method: "get",
+			params: { id: id },
+		});
+	}
+	findByName(name) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/findByName",
+			method: "get",
+			params: { name: name },
+		});
+	}
+	remove(id) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/deleteById",
+			method: "get",
+			params: { id: id },
+		});
+	}
 }

+ 50 - 43
src/api/pubmodules/ReimbursementApprovalTypeService.js

@@ -1,47 +1,54 @@
-import request from '@/utils/httpRequest'
+import request from "@/utils/httpRequest";
 import { PUBLIC_MODULES_PATH as prefix } from "../AppPath";
 
 export default class ReimbursementApprovalTypeService {
-  list (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/list',
-      method: 'get',
-      params: param
-    })
-  }
-  bxList (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/bxList',
-      method: 'get',
-      params: param
-    })
-  }
-  cgList (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/cgList',
-      method: 'get',
-      params: param
-    })
-  }
-  save (param) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/save',
-      method: 'post',
-      data: param
-    })
-  }
-  findById (id) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/findById',
-      method: 'get',
-      params: {id: id}
-    })
-  }
-  remove (id) {
-    return request({
-      url: prefix + '/reimbursementApproval/type/deleteById',
-      method: 'get',
-      params: {id: id}
-    })
-  }
+	list(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/list",
+			method: "get",
+			params: param,
+		});
+	}
+	bxList(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/bxList",
+			method: "get",
+			params: param,
+		});
+	}
+	bxListByClCz(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/bxListByClCz",
+			method: "get",
+			params: param,
+		});
+	}
+	cgList(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/cgList",
+			method: "get",
+			params: param,
+		});
+	}
+	save(param) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/save",
+			method: "post",
+			data: param,
+		});
+	}
+	findById(id) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/findById",
+			method: "get",
+			params: { id: id },
+		});
+	}
+	remove(id) {
+		return request({
+			url: prefix + "/reimbursementApproval/type/deleteById",
+			method: "get",
+			params: { id: id },
+		});
+	}
 }

+ 111 - 128
src/views/ccpm/reimbursement/info/CwReimbursementTypePullForm.vue

@@ -1,15 +1,10 @@
 <template>
   <div>
-    <el-dialog
-      title="报销类型选择"
-      :close-on-click-modal="false"
-	  dialogDrag
-	  width="1100px"
-      height="500px"
-      @close="close"
+    <el-dialog title="报销类型选择" :close-on-click-modal="false" dialogDrag width="1100px" height="500px" @close="close"
       v-model="visible">
       <div style="height: calc(100% - 80px);">
-        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm"
+          @keyup.enter.native="refreshList()" @submit.native.prevent>
           <!-- 搜索框-->
           <el-form-item label="报销类型名称" prop="name">
             <el-input size="small" v-model="searchForm.name" placeholder="请输入报销类型名称" clearable></el-input>
@@ -20,142 +15,130 @@
             <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
           </el-form-item>
         </el-form>
-        <vxe-table
-          border="inner"
-          auto-resize
-          resizable
-          height="500px"
-          :loading="loading"
-          size="small"
-          ref="typeTable"
-          show-header-overflow
-          show-overflow
-          highlight-hover-row
-          :menu-config="{}"
-          :sort-config="{remote:true}"
-          :data="dataList"
-          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId',expandAll: true}"
-          :row-config="{isCurrent: true}"
-          :radio-config="{trigger: 'row'}">
+        <vxe-table border="inner" auto-resize resizable height="500px" :loading="loading" size="small" ref="typeTable"
+          show-header-overflow show-overflow highlight-hover-row :menu-config="{}" :sort-config="{ remote: true }"
+          :data="dataList" :tree-config="{ transform: true, rowField: 'id', parentField: 'parentId', expandAll: true }"
+          :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 type="radio" width="40"></vxe-column>
           <vxe-column title="报销内容名称" field="name" align="left" tree-node show-overflow="title"></vxe-column>
           <vxe-column width="100" title="序号" field="sort"></vxe-column>
         </vxe-table>
       </div>
-		<template #footer>
-			<span class="dialog-footer">
-			  <el-button size="default" @click="close()" icon="el-icon-circle-close">关闭</el-button>
-			  <el-button size="default" type="primary" v-if="method != 'view'" @click="getProgramForType" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
-			</span>
-		</template>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button size="default" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+          <el-button size="default" type="primary" v-if="method != 'view'" @click="getProgramForType"
+            icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+        </span>
+      </template>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
-  // import ReimbursementTypeService from '@/api/zs/reimbursement/ReimbursementTypeService'
-  import ReimbursementApprovalTypeService from '@/api/pubmodules/ReimbursementApprovalTypeService'
-  export default {
-    data () {
-      return {
-        searchForm: {
-          name: ''
-        },
-        dataList: [],
-        tablePage: {
-          total: 0,
-          currentPage: 1,
-          pageSize: 10,
-          orders: []
-        },
-        title: '',
-        method: '',
-        visible: false,
-        loading: false,
-        like: '',
-        officeId: ''
+// import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+// import ReimbursementTypeService from '@/api/zs/reimbursement/ReimbursementTypeService'
+import ReimbursementApprovalTypeService from '@/api/pubmodules/ReimbursementApprovalTypeService'
+export default {
+  data() {
+    return {
+      searchForm: {
+        name: ''
+      },
+      dataList: [],
+      tablePage: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        orders: []
+      },
+      title: '',
+      method: '',
+      visible: false,
+      loading: false,
+      like: '',
+      officeId: ''
+    }
+  },
+  // reimbursementTypeService: null,
+  // reimbursementTypeService: null,
+  reimbursementApprovalTypeService: null,
+  created() {
+    // this.reimbursementTypeService = new ReimbursementTypeService()
+    // this.reimbursementTypeService = new ReimbursementTypeService()
+    this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+  },
+  components: {
+  },
+  methods: {
+    init(like, deptName) {
+      console.log('like', like)
+      if (like === '1') {
+        this.like = '1'
+      } else {
+        this.like = ''
       }
+      this.officeId = deptName
+      this.visible = true
+      this.list()
     },
-    // reimbursementTypeService: null,
-    // reimbursementTypeService: null,
-    reimbursementApprovalTypeService: null,
-    created () {
-      // this.reimbursementTypeService = new ReimbursementTypeService()
-      // this.reimbursementTypeService = new ReimbursementTypeService()
-      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
-    },
-    components: {
-    },
-    methods: {
-      init (like, deptName) {
-        console.log('like', like)
-        if (like === '1') {
-          this.like = '1'
-        } else {
-          this.like = ''
-        }
-        this.officeId = deptName
-        this.visible = true
-        this.list()
-      },
-      // 表单提交
-      getProgramForType () {
-        let rows
-        if (this.commonJS.isEmpty(this.$refs.typeTable.getRadioRecord())) {
-          this.$message.error('请选择一条数据')
-          return
+    // 表单提交
+    getProgramForType() {
+      let rows
+      if (this.commonJS.isEmpty(this.$refs.typeTable.getRadioRecord())) {
+        this.$message.error('请选择一条数据')
+        return
+      }
+      rows = this.$refs.typeTable.getRadioRecord()
+      this.dataList.forEach((item) => {
+        if (item.parentId === rows.id) {
+          this.$message.error('只可以选择最小节点的数据')
+          throw new Error('只可以选择最小节点的数据')
         }
-        rows = this.$refs.typeTable.getRadioRecord()
-        this.dataList.forEach((item) => {
-          if (item.parentId === rows.id) {
-            this.$message.error('只可以选择最小节点的数据')
-            throw new Error('只可以选择最小节点的数据')
-          }
-        })
-        this.$emit('getProgramForType', rows)
-        this.close()
-      },
-      list () {
-        this.loading = true
-        this.searchForm.like = this.like
-        this.searchForm.officeId = this.officeId
-        this.reimbursementApprovalTypeService.bxList({...this.searchForm}).then((data) => {
-          this.dataList = data
-          this.loading = false
-          this.$nextTick(() => {
-            this.$refs.typeTable.setAllTreeExpand(true)
-          })
+      })
+      this.$emit('getProgramForType', rows)
+      this.close()
+    },
+    list() {
+      this.loading = true
+      this.searchForm.like = this.like
+      this.searchForm.officeId = this.officeId
+      this.reimbursementApprovalTypeService.bxList({ ...this.searchForm }).then((data) => {
+        this.dataList = data
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.typeTable.setAllTreeExpand(true)
         })
-        // this.reimbursementTypeService.bxList({...this.searchForm}).then(({data}) => {
-        //   this.dataList = data
-        //   this.loading = false
-        // })
-        // this.reimbursementTypeService.list({...this.searchForm}).then(({data}) => {
-        //   this.dataList = data
-        //   this.loading = false
-        // })
-      },
-      // 当前页
-      currentChangeHandle ({currentPage, pageSize}) {
-        this.tablePage.currentPage = currentPage
-        this.tablePage.pageSize = pageSize
-        this.list()
-      },
-      resetSearch () {
-        this.$refs.searchForm.resetFields()
-        this.list()
-      },
-      close () {
-        this.detail = ''
-        this.visible = false
-      }
+      })
+      // this.reimbursementTypeService.bxList({...this.searchForm}).then(({data}) => {
+      //   this.dataList = data
+      //   this.loading = false
+      // })
+      // this.reimbursementTypeService.list({...this.searchForm}).then(({data}) => {
+      //   this.dataList = data
+      //   this.loading = false
+      // })
+    },
+    // 当前页
+    currentChangeHandle({ currentPage, pageSize }) {
+      this.tablePage.currentPage = currentPage
+      this.tablePage.pageSize = pageSize
+      this.list()
+    },
+    resetSearch() {
+      this.$refs.searchForm.resetFields()
+      this.list()
+    },
+    close() {
+      this.detail = ''
+      this.visible = false
     }
   }
+}
 </script>
 <style>
-  .messageZindex {
-    z-index:9999 !important;
-  }
+.messageZindex {
+  z-index: 9999 !important;
+}
 </style>

+ 411 - 96
src/views/common/reimbursement/ReimbursementComponent.vue

@@ -37,13 +37,13 @@
         </div>
         <div v-if="tenantFlag === 'pg' && inputForm.sourceType === '1'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                项目报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button style="margin-left: 20px" type="primary"
+                项目报销详情
+                <el-button v-if="insertBtn" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'" size="default"
                     @click="insertEvent('detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -182,13 +182,13 @@
         </div>
         <div v-else-if="tenantFlag === 'cw' && inputForm.sourceType === '1'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                项目报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button style="margin-left: 20px" type="primary"
+                项目报销详情
+                <el-button style="margin-left: 20px" type="primary" v-if="insertBtn"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'" size="default"
                     @click="insertEvent('detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -327,13 +327,13 @@
         </div>
         <div v-else-if="tenantFlag !== 'pg' && inputForm.sourceType === '1'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                项目报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                项目报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -468,7 +468,7 @@
         <div v-if="inputForm.sourceType === '2'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
                 合同报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
+                    v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <!-- <el-button size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('contract_detail')" plain>
@@ -590,13 +590,13 @@
         </div>
         <div v-if="inputForm.sourceType === '3' && tenantFlag === 'cw'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                报告报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                报告报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('report_detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -736,13 +736,13 @@
         </div>
         <div v-else-if="inputForm.sourceType === '3' && tenantFlag !== 'cw'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                报告报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                报告报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('report_detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -876,13 +876,13 @@
 
         <div v-if="inputForm.sourceType === '4'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                其他报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                其他报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('others')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -1017,12 +1017,12 @@
         </div>
         <div v-if="inputForm.sourceType === '5'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                采购报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                采购报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || this.formReadOnly" @click="insertEvent('procured')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -1136,13 +1136,13 @@
         </div>
         <div v-if="inputForm.sourceType === '8'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                中审项目报销详情<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
-                <!-- <el-button size="default" style="margin-left: 20px" type="primary"
+                中审项目报销详情
+                <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('zs_project_detail')" plain>
                     新增报销单
-                </el-button> -->
+                </el-button>
+                <span style="color: red;" v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <el-form inline :disabled="false" style="display: inline-block;">
                     <el-button v-if="this.isConfirm == 1" type="primary" size="default" style="margin-left: 10px;"
                         @click="allSelect('0')">全部取消</el-button>
@@ -1299,7 +1299,7 @@
         <div v-if="inputForm.reimbursementType === '0'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
                 专用发票信息<span style="color: red;"
-                    v-if="this.isConfirm == 4">(报销信息仅可登记一条报销单(每个报销流程仅针对一张白色或蓝色报销单)。可在报销单后操作栏新增xml格式数电发票信息)</span>
+                    v-if="this.isConfirm == 4">(每个报销流程仅针对一张白色或蓝色报销单。可在报销单后操作栏新增xml格式数电发票信息)</span>
                 <!-- <el-button size="default" style="margin-left: 10px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('amount')" plain>
@@ -1424,6 +1424,7 @@ import processService from '@/api/flowable/processService'
 import userService from '@/api/sys/UserService'
 import ProgramPageForm from '@/views/finance/invoice/ProgramPageForm'
 import { set } from 'lodash'
+import { ElMessageBox } from 'element-plus'
 export default {
     props: {
         businessId: {
@@ -1437,6 +1438,7 @@ export default {
     },
     data() {
         return {
+            insertBtn: false,
             status: "",
             companyName: "",
             isConfirm: "2",
@@ -1560,6 +1562,11 @@ export default {
             isZjbry: false,
             isDgsbxBmzr: false,
             payment: '',
+            // 针对业务差旅费和业务操作奖的数据
+            reimbursementTypeList: [
+                { name: '业务差旅费', id: '69cfed65fb46460bbef3ebfa0ccfbd7b' },
+                { name: '业务操作奖', id: '2cf080d5bcd2416598710b741f057cfe' }
+            ]
         }
     },
     ReimbursementService: null,
@@ -1585,6 +1592,15 @@ export default {
         ProgramPageForm,
         CwReimbursementTypePullFormCw
     },
+    // inputForm.sourceType发生变化,就隐藏按钮,加一个深度监听
+    watch: {
+        'inputForm.sourceType': {
+            handler(newVal, oldVal) {
+                this.insertBtn = false
+            },
+            deep: true
+        },
+    },
     computed: {
         name() {
             return this.$store.state.user.name
@@ -1626,39 +1642,70 @@ export default {
         // 删除
         removeEvent(row, rowIndex, type) {
             this.handleTableInfo(this.inputForm.sourceType)
-            this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(item => item.remarks != row.uniqueId)
-            if (type === 'detail') {
-                this.$refs.detailTable.remove(row)
-                this.inputForm.detailInfos.splice(rowIndex, 1)
-            }
-            if (type === 'amount') {
-                this.$refs.amountTable.remove(row)
-                this.inputForm.amountInfos.splice(rowIndex, 1)
-            }
-            if (type === 'invoiceReimbursement') {
-                this.$refs.invoiceReimbursementTable.remove(row)
-                this.inputForm.invoiceReimbursements.splice(rowIndex, 1)
-            }
-            if (type === 'contract_detail') {
-                this.$refs.detailTableContract.remove(row)
-                this.inputForm.detailInfoContracts.splice(rowIndex, 1)
-            }
-            if (type === 'report_detail') {
-                this.$refs.detailTableReport.remove(row)
-                this.inputForm.detailInfoReports.splice(rowIndex, 1)
-            }
-            if (type === 'zs_project_detail') {
-                this.$refs.detailTableProject.remove(row)
-                this.inputForm.detailInfoProject.splice(rowIndex, 1)
-            }
-            if (type === 'others') {
-                this.$refs.detailTableOthers.remove(row)
-                this.inputForm.detailInfoOthers.splice(rowIndex, 1)
-            }
-            if (type === 'procured') {
-                this.$refs.detailTableProcured.remove(row)
-                this.inputForm.detailInfoProcured.splice(rowIndex, 1)
+            //删除第一条数据
+            if (rowIndex === 0 && this.tableData.length > 1) {
+                ElMessageBox.confirm(
+                    `是否确认删除第1张报销单?(所有报销单数据也将同步删除)`,
+                    '提示',
+                    {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning',
+                    }
+                ).then(() => {
+                    this.insertBtn = false
+                    // 清空附件
+                    this.inputForm.invoiceReimbursementFiles = []
+                    const tableMap = {
+                        detail: { ref: 'detailTable', data: 'detailInfos' },
+                        amount: { ref: 'amountTable', data: 'amountInfos' },
+                        invoiceReimbursement: { ref: 'invoiceReimbursementTable', data: 'invoiceReimbursements' },
+                        contract_detail: { ref: 'detailTableContract', data: 'detailInfoContracts' },
+                        report_detail: { ref: 'detailTableReport', data: 'detailInfoReports' },
+                        zs_project_detail: { ref: 'detailTableProject', data: 'detailInfoProject' },
+                        others: { ref: 'detailTableOthers', data: 'detailInfoOthers' },
+                        procured: { ref: 'detailTableProcured', data: 'detailInfoProcured' },
+                    }
+
+                    const cfg = tableMap[type]
+                    if (cfg) {
+                        const tableRef = this.$refs[cfg.ref]
+                        const list = this.inputForm[cfg.data]
+                        for (let i = list.length - 1; i >= 0; i--) {
+                            tableRef.remove(list[i])
+                            list.splice(i, 1)
+                        }
+                    }
+
+                })
+            } else {
+                //删除非第一条数据
+                this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                    item => item.remarks !== row.uniqueId
+                )
+
+                const tableMap = {
+                    detail: { ref: 'detailTable', data: 'detailInfos' },
+                    amount: { ref: 'amountTable', data: 'amountInfos' },
+                    invoiceReimbursement: { ref: 'invoiceReimbursementTable', data: 'invoiceReimbursements' },
+                    contract_detail: { ref: 'detailTableContract', data: 'detailInfoContracts' },
+                    report_detail: { ref: 'detailTableReport', data: 'detailInfoReports' },
+                    zs_project_detail: { ref: 'detailTableProject', data: 'detailInfoProject' },
+                    others: { ref: 'detailTableOthers', data: 'detailInfoOthers' },
+                    procured: { ref: 'detailTableProcured', data: 'detailInfoProcured' },
+                }
+
+                const cfg = tableMap[type]
+                if (cfg) {
+                    const tableRef = this.$refs[cfg.ref]
+                    const list = this.inputForm[cfg.data]
+                    tableRef.remove(row)
+                    list.splice(rowIndex, 1)
+                }
+
             }
+
+
         },
         generateRandomId() {
             let id = '';
@@ -2084,7 +2131,7 @@ export default {
         typePullForm(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullForm.init('2', deptName)
+            this.$refs.cwReimbursementTypePullForm.init('2', deptName, rowIndex)
 
             //this.$refs.cwReimbursementTypePullForm.init('1', deptName)
         },
@@ -2092,12 +2139,12 @@ export default {
         typePullFormCw(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullFormCw.init('1', deptName)
+            this.$refs.cwReimbursementTypePullFormCw.init('1', deptName, rowIndex)
         },
         typePullFormProject(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullFormCwProject.init('1', deptName)
+            this.$refs.cwReimbursementTypePullFormCwProject.init('1', deptName, rowIndex)
         },
         typePullForm2(rowIndex, deptName) {
             this.indexRow = rowIndex
@@ -2107,17 +2154,17 @@ export default {
         typePullForm3(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullForm3.init('1', deptName)
+            this.$refs.cwReimbursementTypePullForm3.init('1', deptName, rowIndex)
         },
         typePullForm4(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullForm4.init('2', deptName)
+            this.$refs.cwReimbursementTypePullForm4.init('2', deptName, rowIndex)
         },
         typePullForm8(rowIndex, deptName) {
             this.indexRow = rowIndex
             // this.$refs.reimbursementTypePullForm.init()
-            this.$refs.cwReimbursementTypePullForm8.init('2', deptName)
+            this.$refs.cwReimbursementTypePullForm8.init('2', deptName, rowIndex)
         },
         typePullForm5(rowIndex, deptName) {
             this.indexRow = rowIndex
@@ -2126,22 +2173,161 @@ export default {
         },
         // 报销内容详情
         getProgramForType(rows) {
-            this.inputForm.detailInfos[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfos[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+            // this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+            // this.inputForm.detailInfos[this.indexRow].typeName = rows.name
+            // this.indexRow = ''
+            // this.$forceUpdate()
+
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfos[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfos[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfos.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfos[i], i, 'detail')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
         },
         getProgramForTypeCw(rows) {
-            this.inputForm.detailInfoReports[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfoReports[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfoReports[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfoReports[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfoReports[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfoReports.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfoReports[i], i, 'report_detail')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
         },
         getProgramForTypeCwProject(rows) {
-            this.inputForm.detailInfos[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfos[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfos[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfos[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfos[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    // 选中的就是“业务差旅费 / 业务操作奖”
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfos.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfos[i], i, 'detail')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
+        },
+        // 针对业务差旅费和业务操作奖
+        typeChange(value, row, rowIndex) {
+            console.log(value, row, rowIndex);
+            console.log(value, row, rowIndex);
+            console.log(value, row, rowIndex);
         },
         getProgramForType2(rows) {
             this.inputForm.detailInfoContracts[this.indexRow].typeId = rows.id
@@ -2150,16 +2336,102 @@ export default {
             this.$forceUpdate()
         },
         getProgramForType3(rows) {
-            this.inputForm.detailInfoReports[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfoReports[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfoReports[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfoReports[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfoReports[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    // 选中的就是“业务差旅费 / 业务操作奖”
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfoReports.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfoReports[i], i, 'report_detail')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
         },
         getProgramForType4(rows) {
-            this.inputForm.detailInfoOthers[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfoOthers[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfoOthers[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfoOthers[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfoOthers[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    // 选中的就是“业务差旅费 / 业务操作奖”
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfoOthers.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfoOthers[i], i, 'others')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
         },
         getProgramForType5(rows) {
             this.inputForm.detailInfoProcured[this.indexRow].typeId = rows.id
@@ -2168,10 +2440,53 @@ export default {
             this.$forceUpdate()
         },
         getProgramForType8(rows) {
-            this.inputForm.detailInfoProject[this.indexRow].typeId = rows.id
-            this.inputForm.detailInfoProject[this.indexRow].typeName = rows.name
-            this.indexRow = ''
-            this.$forceUpdate()
+            const isSpecialType = name => ['业务差旅费', '业务操作奖'].includes(name)
+
+            const updateTypeInfo = () => {
+                this.inputForm.detailInfoProject[this.indexRow].typeId = rows.id
+                this.inputForm.detailInfoProject[this.indexRow].typeName = rows.name
+                this.indexRow = ''
+                this.$forceUpdate()
+            }
+
+            if (this.indexRow === 0) {
+                const currentName = this.inputForm.detailInfoProject[this.indexRow].typeName
+                const newName = rows.name
+
+                if (isSpecialType(newName)) {
+                    // 选中的就是“业务差旅费 / 业务操作奖”
+                    this.insertBtn = true
+                    updateTypeInfo()
+                } else if (isSpecialType(currentName)) {
+                    // 原来是特殊类型,现在切换成别的类型
+                    ElMessageBox.confirm(
+                        `您即将修改报销类别为 ${newName}。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?`,
+                        '提示',
+                        {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning',
+                        }
+                    ).then(() => {
+                        this.insertBtn = false
+                        // 只保留第一张报销单对应的文件
+                        this.inputForm.invoiceReimbursementFiles = this.inputForm.invoiceReimbursementFiles.filter(
+                            item => item.remarks === this.tableData[0].uniqueId
+                        )
+                        // 倒序删除除第一条外的 数据
+                        for (let i = this.inputForm.detailInfoProject.length - 1; i > 0; i--) {
+                            this.removeEvent(this.inputForm.detailInfoProject[i], i, 'zs_project_detail')
+                        }
+                        updateTypeInfo()
+                    })
+                } else {
+                    // 普通类型直接赋值
+                    updateTypeInfo()
+                }
+            } else {
+                // 非第0行,直接更新
+                updateTypeInfo()
+            }
         },
 
         // 报销人下拉弹窗

+ 115 - 124
src/views/cw/reimbursementApproval/info/CwReimbursementTypePullForm.vue

@@ -1,16 +1,10 @@
 <template>
   <div>
-    <el-dialog
-      title="报销类型选择"
-      :close-on-click-modal="false"
-	  draggable
-      width="1100px"
-      height="500px"
-      append-to-body
-      @close="close"
-      v-model="visible">
+    <el-dialog title="报销类型选择" :close-on-click-modal="false" draggable width="1100px" height="500px" append-to-body
+      @close="close" v-model="visible">
       <div style="height: calc(100% - 80px);">
-        <el-form :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+        <el-form :inline="true" class="query-form" ref="searchForm" :model="searchForm"
+          @keyup.enter.native="refreshList()" @submit.native.prevent>
           <!-- 搜索框-->
           <el-form-item label="报销类型名称" prop="name">
             <el-input v-model="searchForm.name" placeholder="请输入报销类型名称" clearable></el-input>
@@ -21,136 +15,133 @@
             <el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
           </el-form-item>
         </el-form>
-        <vxe-table
-          border="inner"
-          auto-resize
-          resizable
-          height="500px"
-          :loading="loading"
-          ref="typeTable"
-          show-header-overflow
-          show-overflow
-          highlight-hover-row
-          :menu-config="{}"
-          :sort-config="{remote:true}"
-          :data="dataList"
-          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId',expandAll: true}"
-          :row-config="{isCurrent: true}"
-          :radio-config="{trigger: 'row'}">
+        <vxe-table border="inner" auto-resize resizable height="500px" :loading="loading" ref="typeTable"
+          show-header-overflow show-overflow highlight-hover-row :menu-config="{}" :sort-config="{ remote: true }"
+          :data="dataList" :tree-config="{ transform: true, rowField: 'id', parentField: 'parentId', expandAll: true }"
+          :row-config="{ isCurrent: true }" :radio-config="{ trigger: 'row' }">
           <vxe-column type="seq" width="60" title="序号"></vxe-column>
-          <vxe-column type="radio" width="60" ></vxe-column>
+          <vxe-column type="radio" width="60"></vxe-column>
           <vxe-column title="报销内容名称" field="name" align="left" tree-node></vxe-column>
           <vxe-column width="100" title="序号" field="sort"></vxe-column>
         </vxe-table>
       </div>
-		<template #footer>
-			<span class="dialog-footer">
-			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
-			  <el-button type="primary" v-if="method != 'view'" @click="getProgramForType" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
-			</span>
-		</template>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+          <el-button type="primary" v-if="method != 'view'" @click="getProgramForType" icon="el-icon-circle-check"
+            v-noMoreClick>确定</el-button>
+        </span>
+      </template>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
-  import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
-  export default {
-    data () {
-      return {
-        searchForm: {
-          name: ''
-        },
-        dataList: [],
-        tablePage: {
-          total: 0,
-          currentPage: 1,
-          pageSize: 10,
-          orders: []
-        },
-        title: '',
-        method: '',
-        visible: false,
-        loading: false,
-        like: '',
-        officeId: ''
+// import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
+import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
+export default {
+  data() {
+    return {
+      searchForm: {
+        name: ''
+      },
+      dataList: [],
+      tablePage: {
+        total: 0,
+        currentPage: 1,
+        pageSize: 10,
+        orders: []
+      },
+      title: '',
+      method: '',
+      visible: false,
+      loading: false,
+      like: '',
+      officeId: '',
+      rowIndex: ""
+    }
+  },
+  // reimbursementTypeService: null,
+  reimbursementApprovalTypeService: null,
+  created() {
+    // this.reimbursementTypeService = new ReimbursementTypeService()
+    this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+  },
+  components: {
+  },
+  methods: {
+    init(like, deptName, rowIndex) {
+      if (like === '1') {
+        this.like = '1'
+      } else {
+        this.like = ''
       }
+      this.officeId = deptName
+      if (this.commonJS.isNotEmpty(rowIndex)) {
+        this.rowIndex = rowIndex
+      } else {
+        this.rowIndex = 0
+      }
+      console.log('this.officeId', this.officeId)
+      this.visible = true
+      this.list()
     },
-    // reimbursementTypeService: null,
-    reimbursementApprovalTypeService: null,
-    created () {
-      // this.reimbursementTypeService = new ReimbursementTypeService()
-      this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
-    },
-    components: {
-    },
-    methods: {
-      init (like, deptName) {
-        console.log('进来了')
-        console.log('like', like)
-        if (like === '1') {
-          this.like = '1'
-        } else {
-          this.like = ''
-        }
-        this.officeId = deptName
-        console.log('this.officeId', this.officeId)
-        this.visible = true
-        this.list()
-      },
-      // 表单提交
-      getProgramForType () {
-        let rows
-        if (this.commonJS.isEmpty(this.$refs.typeTable.getRadioRecord())) {
-          this.$message.error('请选择一条数据')
-          return
+    // 表单提交
+    getProgramForType() {
+      let rows
+      if (this.commonJS.isEmpty(this.$refs.typeTable.getRadioRecord())) {
+        this.$message.error('请选择一条数据')
+        return
+      }
+      rows = this.$refs.typeTable.getRadioRecord()
+      this.dataList.forEach((item) => {
+        if (item.parentId === rows.id) {
+          this.$message.error('只可以选择最小节点的数据')
+          throw new Error('只可以选择最小节点的数据')
         }
-        rows = this.$refs.typeTable.getRadioRecord()
-        this.dataList.forEach((item) => {
-          if (item.parentId === rows.id) {
-            this.$message.error('只可以选择最小节点的数据')
-            throw new Error('只可以选择最小节点的数据')
-          }
-        })
-        this.$emit('getProgramForType', rows)
-        this.close()
-      },
-      list () {
-        this.loading = true
-        this.searchForm.like = this.like
-        this.searchForm.officeId = this.officeId
-        this.reimbursementApprovalTypeService.bxList({...this.searchForm}).then((data) => {
-          this.dataList = data
-          this.loading = false
-          this.$nextTick(() => {
-            this.$refs.typeTable.setAllTreeExpand(true)
-          })
-        })
-        // this.reimbursementTypeService.list({...this.searchForm}).then((data) => {
-        //   this.dataList = data
-        //   this.loading = false
-        // })
-      },
-      // 当前页
-      currentChangeHandle ({currentPage, pageSize}) {
-        this.tablePage.currentPage = currentPage
-        this.tablePage.pageSize = pageSize
-        this.list()
-      },
-      resetSearch () {
-        this.$refs.searchForm.resetFields()
-        this.list()
-      },
-      close () {
-        this.detail = ''
-        this.visible = false
+      })
+      this.$emit('getProgramForType', rows)
+      this.close()
+    },
+    list() {
+      this.loading = true
+      this.searchForm.like = this.like
+      this.searchForm.officeId = this.officeId
+      let apiName = "bxListByClCz"
+      if (this.rowIndex == 0) {
+        apiName = "bxList"
       }
+      this.reimbursementApprovalTypeService[apiName]({ ...this.searchForm }).then((data) => {
+        this.dataList = data
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.typeTable.setAllTreeExpand(true)
+        })
+      })
+      // this.reimbursementTypeService.list({...this.searchForm}).then((data) => {
+      //   this.dataList = data
+      //   this.loading = false
+      // })
+    },
+    // 当前页
+    currentChangeHandle({ currentPage, pageSize }) {
+      this.tablePage.currentPage = currentPage
+      this.tablePage.pageSize = pageSize
+      this.list()
+    },
+    resetSearch() {
+      this.$refs.searchForm.resetFields()
+      this.list()
+    },
+    close() {
+      this.detail = ''
+      this.visible = false
     }
   }
+}
 </script>
 <style>
-  .messageZindex {
-    z-index:9999 !important;
-  }
+.messageZindex {
+  z-index: 9999 !important;
+}
 </style>

+ 13 - 3
src/views/zs/reimbursement/info/CwReimbursementTypePullForm.vue

@@ -58,7 +58,8 @@ export default {
       visible: false,
       loading: false,
       like: '',
-      officeId: ''
+      officeId: '',
+      rowIndex: ""
     }
   },
   // reimbursementTypeService: null,
@@ -72,7 +73,7 @@ export default {
   components: {
   },
   methods: {
-    init(like, deptName) {
+    init(like, deptName, rowIndex) {
       console.log('like', like)
       if (like === '1') {
         this.like = '1'
@@ -80,6 +81,11 @@ export default {
         this.like = ''
       }
       this.officeId = deptName
+      if (this.commonJS.isNotEmpty(rowIndex)) {
+        this.rowIndex = rowIndex
+      } else {
+        this.rowIndex = 0
+      }
       this.visible = true
       this.list()
     },
@@ -104,7 +110,11 @@ export default {
       this.loading = true
       this.searchForm.like = this.like
       this.searchForm.officeId = this.officeId
-      this.reimbursementApprovalTypeService.bxList({ ...this.searchForm }).then((data) => {
+      let apiName = "bxListByClCz"
+      if (this.rowIndex == 0) {
+        apiName = "bxList"
+      }
+      this.reimbursementApprovalTypeService[apiName]({ ...this.searchForm }).then((data) => {
         this.dataList = data
         this.loading = false
         this.$nextTick(() => {

+ 13 - 3
src/views/zs/reimbursement/info/CwReimbursementTypePullFormZs.vue

@@ -58,7 +58,8 @@ export default {
       visible: false,
       loading: false,
       like: '',
-      officeId: ''
+      officeId: '',
+      rowIndex: ""
     }
   },
   // reimbursementTypeService: null,
@@ -72,7 +73,7 @@ export default {
   components: {
   },
   methods: {
-    init(like, deptName) {
+    init(like, deptName, rowIndex) {
       console.log('like', like)
       if (like === '1') {
         this.like = '1'
@@ -80,6 +81,11 @@ export default {
         this.like = ''
       }
       this.officeId = deptName
+      if (this.commonJS.isNotEmpty(rowIndex)) {
+        this.rowIndex = rowIndex
+      } else {
+        this.rowIndex = 0
+      }
       this.visible = true
       this.list()
     },
@@ -117,7 +123,11 @@ export default {
       this.loading = true
       this.searchForm.like = this.like
       this.searchForm.officeId = this.officeId
-      this.reimbursementApprovalTypeService.bxList({ ...this.searchForm }).then((data) => {
+      let apiName = "bxListByClCz"
+      if (this.rowIndex == 0) {
+        apiName = "bxList"
+      }
+      this.reimbursementApprovalTypeService[apiName]({ ...this.searchForm }).then((data) => {
         let newList = this.filterBusinessProjectNodes(data)
         this.dataList = newList
         this.loading = false