From 3a45da15c947c2d478a44a51bd0f926647b1b841 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 11 四月 2025 16:33:17 +0800
Subject: [PATCH] 提交
---
company/src/components/enterprise/selectEmployees.vue | 262 ++++++++++++++++++++++++++++++++++------------------
1 files changed, 172 insertions(+), 90 deletions(-)
diff --git a/company/src/components/enterprise/selectEmployees.vue b/company/src/components/enterprise/selectEmployees.vue
index 365c51c..dfa5994 100644
--- a/company/src/components/enterprise/selectEmployees.vue
+++ b/company/src/components/enterprise/selectEmployees.vue
@@ -6,16 +6,39 @@
:confirm-working="isWorking"
@confirm="confirm"
>
- <el-input v-model="val" placeholder="鏌ヨ鍛樺伐濮撳悕" @keypress.enter.native="getList" style="margin-bottom: 15px;"></el-input>
+ <div style="display: inline-block;padding: 20px 10px;color: red" class="el-upload__tip" >
+ 鎿嶄綔鎻愮ず锛� 璇峰湪涓嬮潰鎼滅储妗嗗唴杈撳叆鍛樺伐濮撳悕鎴栬韩浠借瘉鍙疯繘琛屽憳宸ヤ俊鎭悳绱紝骞堕�夋嫨鍛樺伐杩涜鎿嶄綔
+ </div>
+ <el-select
+ value-key="id"
+ v-model="seleData"
+ filterable
+ multiple
+ remote
+ style="margin-bottom: 15px;width: 100%;margin-right: 10px"
+ placeholder="璇疯緭鍏ュ憳宸ュ鍚嶆垨韬唤璇佸彿杩涜閫夋嫨"
+ :remote-method="searchSelData"
+ :loading="loading">
+ <el-option
+ v-for="item in memberList"
+ :key="item.id"
+ :label="item.name+' ' +(item.idcardNo||'')"
+ :value="item">
+ </el-option>
+ </el-select>
+<!--
+ <el-input v-model="val" placeholder="璇疯緭鍏ュ憳宸ュ鍚嶅悗锛岀偣鍑绘悳绱㈡寜閽垨鑰呮寜涓媏nter閿繘琛屾煡璇�" @keypress.enter.native="getList" style="margin-bottom: 15px;width: 50%;margin-right: 10px"></el-input>
+-->
+<!-- <el-button type="primary" @click="getList" style="width: 100px;">鎼滅储</el-button>-->
<el-table
- :data="list"
+ :data="seleData"
border
- @selection-change="handleSelectionChange"
+ selection-change1="handleSelectionChange"
style="width: 100%">
- <el-table-column
+<!-- <el-table-column
type="selection"
width="55">
- </el-table-column>
+ </el-table-column>-->
<el-table-column label="搴忓彿" width="80px">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
@@ -38,96 +61,155 @@
label="鎵�灞炲伐绉�">
</el-table-column>
</el-table>
+ <template v-slot:footer>
+ <el-button type="primary" :loading="confirming" @click="confirm">纭畾</el-button>
+ <el-button @click="visible=false">杩斿洖</el-button>
+ </template>
</GlobalWindow>
</template>
<script>
- import BaseOpera from '@/components/base/BaseOpera'
- import GlobalWindow from '@/components/common/GlobalWindow'
- import { findListByDTO } from '@/api/business/member'
- export default {
- name: 'selectEmployees',
- extends: BaseOpera,
- components: { GlobalWindow },
- data () {
- return {
- val: '',
- list: [],
- price: '',
- insuranceApplyId: '',
- notInInsuranceApplyId: '',
- seleData: [],
- oldList: []
- }
- },
- created () {
- this.config({
- api: '/business/dispatchUnit',
- 'field.id': 'id'
- })
- },
- methods: {
- open (title, obj) {
- this.insuranceApplyId = ''
- this.notInInsuranceApplyId = ''
- this.price = obj.price
- this.oldList = obj.arr
- this.list = []
- if (obj.insuranceApplyId) {
- this.insuranceApplyId = obj.insuranceApplyId
- }
- if (obj.notInInsuranceApplyId) {
- this.notInInsuranceApplyId = obj.notInInsuranceApplyId
- }
- this.title = title
- this.visible = true
- this.getList()
- },
- confirm() {
- if (this.seleData.length === 0) {
- this.$message.warning('鑷冲皯閫夋嫨涓�椤瑰唴瀹�')
- return
- }
- for (let i = 0; i < this.seleData.length; i++) {
- for (let a = 0; a < this.oldList.length; a++) {
- if (this.seleData[i].name === this.oldList[a].memberName || this.seleData[i].idCard === this.oldList[a].idcardNo) {
- this.$message.warning(`[${this.seleData[i].name}]鍛樺伐閲嶅`)
- return
- }
- }
- }
- this.seleData.forEach(item => {
- item.idCard = item.idcardNo
- item.memberName = item.name
- item.memberId = item.id
- if (this.notInInsuranceApplyId) {
- item.workTypeName = ''
- item.worktypeId = ''
- item.duId = ''
- item.duName = ''
- }
- item.fee = this.price
- })
- this.$emit('result', this.seleData)
- this.visible = false
- },
- handleSelectionChange (e) {
- this.seleData = e
- },
- getList() {
- findListByDTO({
- name: this.val,
- insuranceApplyId: this.insuranceApplyId,
- notInInsuranceApplyId: this.notInInsuranceApplyId
- }).then(res => {
- res.forEach(item => {
- item.fee = ''
- })
- this.list = res
- })
- }
- }
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import { findListByDTO } from '@/api/business/member'
+export default {
+ name: 'selectEmployees',
+ extends: BaseOpera,
+ components: { GlobalWindow },
+ data () {
+ return {
+ confirming:false,
+ type: '',
+ val: '',
+ memberIds:[],
+ loading:false,
+ memberList:[],
+ list: [],
+ price: '',
+ insuranceApplyId: '',
+ notInInsuranceApplyId: '',
+ validTime: '',
+ seleData: [],
+ oldList: []
}
+ },
+ created () {
+ this.config({
+ api: '/business/dispatchUnit',
+ 'field.id': 'id'
+ })
+ },
+ methods: {
+ open (title, obj) {
+ this.insuranceApplyId = ''
+ this.notInInsuranceApplyId = ''
+ this.val = ''
+ this.price = obj.price
+ this.confirming=false
+ this.oldList = obj.arr
+ // this.seleData = obj.arr || []
+ this.memberIds=[]
+ this.seleData=[]
+ this.memberList=[]
+ this.confirming=false
+ if (obj.type) {
+ this.type = obj.type
+ }
+ this.list = []
+ if (obj.insuranceApplyId) {
+ this.insuranceApplyId = obj.insuranceApplyId
+ }
+ if (obj.notInInsuranceApplyId) {
+ this.notInInsuranceApplyId = obj.notInInsuranceApplyId
+ }
+ if (obj.validTime) {
+ this.validTime = obj.validTime
+ }
+ this.title = title
+ this.visible = true
+ // this.getList()
+ },
+ confirm () {
+ if(this.confirming){
+ return
+ }
+ this.confirming=true
+ if (this.seleData.length === 0) {
+ this.$message.warning('鑷冲皯鎼滅储閫夋嫨涓�浣嶅憳宸ヨ繘琛屾搷浣�')
+ this.confirming=false
+ return
+ }
+ for (let i = 0; i < this.seleData.length; i++) {
+ for (let a = 0; a < this.oldList.length; a++) {
+ // this.seleData[i].name === this.oldList[a].memberName ||
+ if (this.seleData[i].idcardNo === this.oldList[a].idCard) {
+ this.$message.warning(`[${this.seleData[i].name}]鍛樺伐閲嶅`)
+ this.confirming=false
+ return
+ }
+ }
+ }
+ this.seleData.forEach(item => {
+ item.idCard = item.idcardNo
+ item.memberName = item.name
+ item.memberId = item.id
+ item.reducePrice = item.fee
+ if (this.notInInsuranceApplyId || this.type == 1) {
+ item.workTypeName = ''
+ item.worktypeId = ''
+ item.duId = ''
+ item.duName = ''
+ }
+ item.fee = this.price
+ })
+
+ console.log(this.oldList)
+ console.log(this.seleData)
+ this.confirming=false
+ this.$emit('result', this.seleData)
+ this.seleData=[]
+ this.visible = false
+ },
+ handleSelectionChange (e) {
+ this.seleData = e
+ },
+ getList () {
+ if(this.memberIds ==null || !this.memberIds.length){
+ this.$message.error('璇锋悳绱㈡妫�鏌ヤ汉鍛樹俊鎭悗杩涜鎼滅储锛�')
+ return;
+ }
+ findListByDTO({
+ name: this.val,
+ subtractMemberIds:this.memberIds,
+ insuranceApplyId: this.insuranceApplyId,
+ notInInsuranceApplyId: this.notInInsuranceApplyId,
+ validTime: this.validTime
+ }).then(res => {
+ res.forEach(item => {
+ item.reducePrice = item.fee
+ item.fee = ''
+ })
+ this.list = res
+ })
+ },
+ searchSelData (query) {
+ if (query !== '') {
+ this.loading = true;
+ findListByDTO({
+ name: query,
+ insuranceApplyId: this.insuranceApplyId,
+ notInInsuranceApplyId: this.notInInsuranceApplyId,
+ validTime: this.validTime
+ }).then(res => {
+ this.loading = false
+ this.memberList = res
+ }).finally(() => {
+ this.loading = false
+ })
+ }
+ }
+ }
+}
</script>
<style lang="scss" scoped>
--
Gitblit v1.9.3