|
@@ -0,0 +1,156 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ title="报销类型选择"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ draggable
|
|
|
+ width="1100px"
|
|
|
+ height="500px"
|
|
|
+ append-to-body
|
|
|
+ @close="close"
|
|
|
+ @keyup.enter.native=""
|
|
|
+ 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-item label="报销类型名称" prop="name">
|
|
|
+ <el-input v-model="searchForm.name" placeholder="请输入报销类型名称" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="list()" icon="el-icon-search">查询</el-button>
|
|
|
+ <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"
|
|
|
+ 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="50" ></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>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ // import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
|
|
|
+ import ReimbursementApprovalTypeService from '@/api/pubmodules/JyReimbursementApprovalTypeService'
|
|
|
+ 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,
|
|
|
+ reimbursementApprovalTypeService: null,
|
|
|
+ created () {
|
|
|
+ // this.reimbursementTypeService = new ReimbursementTypeService()
|
|
|
+ this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init (like, deptName) {
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+ .messageZindex {
|
|
|
+ z-index:9999 !important;
|
|
|
+ }
|
|
|
+</style>
|