浏览代码

报销类别及附件调整

sangwenwei 7 月之前
父节点
当前提交
e2a6742a86

+ 47 - 0
src/api/pubmodules/JyReimbursementApprovalTypeService.js

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

+ 156 - 0
src/views/common/JyReimbursementTypePullForm.vue

@@ -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>

+ 9 - 9
src/views/common/UpLoadComponent.vue

@@ -295,15 +295,15 @@
 				//   return
 				// }
 
-				if (!exnameFix(file, '1', 'doc,docx,pdf')) {
-					for (let i = 0; i <this.dataListNew.length ; i++) {
-						this.deleteById(this.dataListNew[i],i,this.dataListNew)
-					}
-					this.fileList = []
-					this.dataListNew = []
-					// this.$message.error('文件仅支持 xml 格式!')
-					return
-				}
+				// if (!exnameFix(file, '1', 'doc,docx,pdf')) {
+				// 	for (let i = 0; i <this.dataListNew.length ; i++) {
+				// 		this.deleteById(this.dataListNew[i],i,this.dataListNew)
+				// 	}
+				// 	this.fileList = []
+				// 	this.dataListNew = []
+				// 	// this.$message.error('文件仅支持 xml 格式!')
+				// 	return
+				// }
 
 				if (!beforeAvatarUpload(file, 1, this.maxValue)) {
 					this.$message.error('文件大小不能超过 ' + this.maxValue + ' MB!')

+ 1 - 3
src/views/jy/borrowMoney/RefundForm.vue

@@ -183,11 +183,10 @@
 							if (data.refundStatus === '5' && this.status !== 'audit' && this.status !== 'taskFormDetail'){
 								this.inputForm.refundLower = ''
 							}
-							if (data.refundStatus === '1' || data.refundStatus === '4'){
+							if (data.refundStatus === '1' || data.refundStatus === '4' || data.refundStatus === '3'){
 								this.borrowService.findByBorId(data.refundId).then((da)=>{
 									console.log('da',da)
 									if (da.length === 0){
-										this.inputForm.finalMoney = data.boMoney
 										this.inputForm.endMoney=data.moneyLower
 									}else {
 										let money = 0
@@ -196,7 +195,6 @@
 										}
 										 let money1=parseFloat(data.moneyLower)
 										let money2 = money1 - money
-										this.inputForm.finalMoney = money2
 										this.inputForm.endMoney=money2
 									}
 								})

+ 1 - 1
src/views/jy/drive/DriveAccountForm.vue

@@ -398,7 +398,7 @@
 					}
 					this.inputForm.accountFiles = this.$refs.upLoadComponentAccount.getDataList()
 					if (this.inputForm.accountFiles.length === 0){
-						this.$message.error('请上传里程数图片')
+						this.$message.error('请上传里程数附件')
 						this.loading = false
 						return
 					}

+ 20 - 10
src/views/jy/driveInfo/DriveInfoAddForm.vue

@@ -95,14 +95,24 @@
 				this.$refs['inputForm'].validate((valid) => {
 					if (valid) {
 						this.loading = true
-						this.driveInfoService.save(this.inputForm).then((data) => {
-							this.close()
-							this.$message.success(data)
-							this.$emit('refreshDataList')
-							this.loading = false
-						}).catch(() => {
-							this.loading = false
+						this.driveInfoService.checkNumber(this.inputForm.driveNumber).then((da)=>{
+							if (da){
+								this.$message.error('已存在该车辆')
+								this.loading = false
+								throw new Error()
+							}else {
+								this.driveInfoService.save(this.inputForm).then((data) => {
+									this.close()
+									this.$message.success(data)
+									this.$emit('refreshDataList')
+									this.loading = false
+								}).catch(() => {
+									this.loading = false
+								})
+							}
+
 						})
+
 					}
 				})
 			},
@@ -113,12 +123,12 @@
 			checkNumber(){
 				this.loading = true
 				if (this.commonJS.isNotEmpty(this.inputForm.driveNumber)){
-					this.driveInfoService.checkNumber(this.inputForm.driveNumber).then(data=>{
+					this.driveInfoService.checkNumber(this.inputForm.driveNumber).then((data)=>{
 						if (data){
 							this.$message.error('已存在该车辆')
-							this.loading = false
-							throw new Error()
 						}
+						this.loading = false
+						throw new Error()
 					})
 				}
 

+ 2 - 1
src/views/reimbursement/info/ReimbursementForm.vue

@@ -653,7 +653,7 @@
 	import userService from '@/api/sys/userService'
 	import taskService from '@/api/flowable/taskService'
 	import ProgramPageForm from '@/views/finance/invoice/ProgramPageForm'
-	import ReimbursementTypePullForm from '@/views/common/CwReimbursementTypePullForm'
+	import ReimbursementTypePullForm from '@/views/common/JyReimbursementTypePullForm'
 	// import CwReimbursementTypePullForm from '@/views/cw/reimbursementApproval/info/CwReimbursementTypePullForm'
 	import UserPullForm from '@/views/finance/invoice/UserPullForm'
 	import WorkContractChooseCom from '@/views/workContract/WorkContractChooseCom'
@@ -841,6 +841,7 @@
 					this.$refs.inputForm.resetFields()
 					this.reimbursementService.findById(this.inputForm.id).then((data) => {
 						this.inputForm = this.recover(this.inputForm, data)
+						console.log('data',data)
 						this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
 						this.$refs.uploadComponent.clearUpload()
 						if (this.status === 'audit' || this.status === 'taskFormDetail') {