Parcourir la source

中审报销- 调整

huangguoce il y a 1 mois
Parent
commit
6bed939996

+ 111 - 128
src/views/zs/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>

+ 158 - 0
src/views/zs/reimbursement/info/CwReimbursementTypePullFormZs.vue

@@ -0,0 +1,158 @@
+<template>
+  <div>
+    <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-item label="报销类型名称" prop="name">
+            <el-input size="small" v-model="searchForm.name" placeholder="请输入报销类型名称" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <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-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 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>
+    </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: ''
+    }
+  },
+  // 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
+      }
+      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()
+    },
+    filterBusinessProjectNodes(list, targetName = '业务项目报销') {
+      const idSet = new Set();
+      const roots = list.filter(item => item.name === targetName);
+      const queue = [...roots];
+      while (queue.length > 0) {
+        const current = queue.shift();
+        idSet.add(current.id);
+        const children = list.filter(item => item.parentId === current.id);
+        queue.push(...children);
+      }
+
+      return list.filter(item => idSet.has(item.id));
+    },
+    list() {
+      this.loading = true
+      this.searchForm.like = this.like
+      this.searchForm.officeId = this.officeId
+      this.reimbursementApprovalTypeService.bxList({ ...this.searchForm }).then((data) => {
+        let newList = this.filterBusinessProjectNodes(data)
+        this.dataList = newList
+        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
+    }
+  }
+}
+</script>
+<style>
+.messageZindex {
+  z-index: 9999 !important;
+}
+</style>

Fichier diff supprimé car celui-ci est trop grand
+ 944 - 867
src/views/zs/reimbursement/info/InfoForm.vue


Fichier diff supprimé car celui-ci est trop grand
+ 827 - 816
src/views/zs/reimbursement/info/InfoList.vue


Fichier diff supprimé car celui-ci est trop grand
+ 2172 - 2022
src/views/zs/reimbursement/info/ReimbursementForm.vue