From 50fb58286ed3b718c39a97e0987ee7561a295651 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 04 七月 2025 17:56:41 +0800
Subject: [PATCH] git ch
---
company/src/components/enterprise/importEmployees.vue | 108 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 97 insertions(+), 11 deletions(-)
diff --git a/company/src/components/enterprise/importEmployees.vue b/company/src/components/enterprise/importEmployees.vue
index c19bb3d..8e3f2df 100644
--- a/company/src/components/enterprise/importEmployees.vue
+++ b/company/src/components/enterprise/importEmployees.vue
@@ -6,6 +6,12 @@
:confirm-working="isWorking"
@confirm="confirm"
>
+ <p class="tip-warn" v-if="type ==1"><i class="el-icon-warning"></i>鎻愰啋锛�<br>
+ <span style="">鍔犱繚浜哄憳鍚嶅崟涓紝浜哄憳濮撳悕銆佽韩浠借瘉鍙枫�佹淳閬e崟浣嶅拰宸ョ淇℃伅鍧囦负蹇呭~椤癸紝澶囨敞淇℃伅鍙负绌猴紝璇峰綍鍏ュ悎娉曟暟鎹��</span>
+ </p>
+ <p class="tip-warn" v-if="type !=1"><i class="el-icon-warning"></i>鎻愰啋锛�<br>
+ <span style="">鍑忎繚浜哄憳鍚嶅崟涓紝浜哄憳濮撳悕銆佽韩浠借瘉鍙峰潎涓哄繀濉」锛屽娉ㄤ俊鎭彲涓虹┖锛岃褰曞叆鍚堟硶鏁版嵁銆�</span>
+ </p>
<el-form class="demo-form-inline">
<el-form-item label="涓婁紶鍚嶅崟" required>
<div style="width: 100%;display: flex;align-items: center;">
@@ -26,7 +32,7 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
-import { importExcel } from '@/api/business/member'
+import { importExcel,importReuduceExcel } from '@/api/business/member'
export default {
name: 'importEmployees',
extends: BaseOpera,
@@ -39,30 +45,40 @@
price: 0,
type: null,
solutionId: null,
+ applyId: null,
addList: [],
- fileName: ''
+ delList: [],
+ fileName: '',
+ hasDispatchUnit: null
}
},
methods: {
open (title, obj) {
this.title = title
this.addList = []
+ this.delList = []
this.fileName = ''
this.type = obj.type
this.visible = true
this.solutionId = obj.solutionId
+ this.applyId = obj.insuranceApplyId
this.list = obj.arr
this.price = obj.price
- this.importing=false
- this.confirming=false
+ this.hasDispatchUnit = obj.hasDispatchUnit
+ this.importing= false
+ this.confirming= false
},
// 瀵煎嚭妯℃澘
exportTemplate () {
// 鎶曚繚鐢宠
if (this.type === 1) {
- window.open(process.env.VUE_APP_MEMBER1_URL)
+ if (this.hasDispatchUnit === 1) {
+ window.open('/template/personnel_no.xlsx')
+ } else {
+ window.open('/template/personnel_add.xlsx')
+ }
} else {
- window.open(process.env.VUE_APP_MEMBER_URL)
+ window.open('/template/personnel_reduce.xlsx')
}
},
clickRef () {
@@ -72,7 +88,15 @@
this.importing=true
this.$refs.fileExcel.click()
},
- result (e) {
+ result(e){
+ if (this.type === 1) {
+ this.result1(e)
+ } else {
+ this.result2(e)
+ }
+ },
+ result1 (e) {
+ this.addList = []
const data = new FormData()
data.append('file', e.target.files[0])
data.append('solutionId', this.solutionId)
@@ -96,10 +120,42 @@
this.$refs.fileExcel.value = null
})
},
+ result2 (e) {
+ this.delList = []
+ const data = new FormData()
+ data.append('file', e.target.files[0])
+ data.append('applyId', this.applyId)
+ importReuduceExcel(data)
+ .then(res => {
+ res.forEach(item => {
+ item.memberName = item.name
+ item.reducePrice = item.fee
+ })
+ this.delList = res
+ this.fileName = e.target.files[0].name
+ this.importing =false
+ })
+ .catch(err => {
+ this.importing = false
+ this.$message.error(err)
+ this.fileName = ''
+ })
+ .finally(() => {
+ this.importing =false
+ this.$refs.fileExcel.value = null
+ })
+ },
confirm () {
+ if (this.type === 1) {
+ this.confirm1()
+ } else {
+ this.confirm2()
+ }
+ },
+ confirm1 () {
if(this.addList==null || this.addList.length ==0){
this.$message.error('瀵煎叆浜哄憳鍚嶅崟涓虹┖锛岃鍏堜笂浼犱汉鍛樺悕鍗�')
- return;
+ return
}
if(this.confirming){
return
@@ -108,7 +164,13 @@
for (let i = 0; i < this.addList.length; i++) {
for (let a = 0; a < this.list.length; a++) {
if (this.addList[i].idCard === this.list[a].idcardNo) {
- this.$message.warning(`[${this.addList[i].name}]鍛樺伐閲嶅`)
+ this.$message.warning(`銆�${this.addList[i].name}銆戝憳宸ヨ韩浠借瘉銆�${this.addList[i].idCard}銆戦噸澶峘)
+ this.confirming = false
+ return
+ }
+ if (this.addList[i].idCard === this.list[a].idCard) {
+ this.$message.warning(`銆�${this.addList[i].name}銆戝憳宸ヨ韩浠借瘉銆�${this.addList[i].idCard}銆戦噸澶峘)
+ this.confirming = false
return
}
}
@@ -116,10 +178,34 @@
this.addList.forEach(item => {
item.fee = this.price
})
-
- // this.confirming = false
this.visible = false
this.$emit('result', this.addList)
+ },
+ confirm2() {
+ if(this.delList==null || this.delList.length ==0){
+ this.$message.error('瀵煎叆浜哄憳鍚嶅崟涓虹┖锛岃鍏堜笂浼犱汉鍛樺悕鍗�')
+ return
+ }
+ if(this.confirming){
+ return
+ }
+ this.confirming = true
+ for (let i = 0; i < this.delList.length; i++) {
+ for (let a = 0; a < this.list.length; a++) {
+ if (this.delList[i].idCard === this.list[a].idcardNo) {
+ this.$message.warning(`銆�${this.delList[i].name}銆戝憳宸ヨ韩浠借瘉銆�${this.delList[i].idCard}銆戦噸澶峘)
+ this.confirming = false
+ return
+ }
+ if (this.delList[i].idCard === this.list[a].idCard) {
+ this.$message.warning(`銆�${this.delList[i].name}銆戝憳宸ヨ韩浠借瘉銆�${this.delList[i].idCard}銆戦噸澶峘)
+ this.confirming = false
+ return
+ }
+ }
+ }
+ this.visible = false
+ this.$emit('result', this.delList)
}
}
}
--
Gitblit v1.9.3