|
@@ -0,0 +1,677 @@
|
|
|
+<template>
|
|
|
+ <!--添加/编辑弹窗-->
|
|
|
+ <el-dialog class="trainingCourseAddDialog" :title='dialogTitle' @close="dialogClose"
|
|
|
+ :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ :visible.sync="dialogType" v-if="dialogType" width="1373px">
|
|
|
+ <!--提交界面-->
|
|
|
+ <el-form class="add-dialog-form-box" ref="dialogForm" v-show="!dialogUserType" :model="dialogForm" :rules="rules" label-width="120px">
|
|
|
+ <el-form-item label="课程名称:" prop="data1">
|
|
|
+ <el-input v-model="dialogForm.data1" placeholder="请输入课程名称" maxLength="15" style="width:800px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <div class="dialogFormFlex">
|
|
|
+ <el-form-item label="主讲老师:" prop="data2">
|
|
|
+ <el-select
|
|
|
+ style="width:300px;"
|
|
|
+ v-model="dialogForm.data2"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="请输入姓名"
|
|
|
+ :remote-method="getMainTeacher"
|
|
|
+ :loading="loading">
|
|
|
+ <el-option
|
|
|
+ v-for="item in mainTeacherOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.label">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="辅导老师:" prop="data3" label-width="200px">
|
|
|
+ <el-select
|
|
|
+ style="width:300px;"
|
|
|
+ v-model="dialogForm.data3"
|
|
|
+ multiple
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="请输入姓名"
|
|
|
+ :remote-method="getSecondaryTeacher"
|
|
|
+ :loading="loading">
|
|
|
+ <el-option
|
|
|
+ v-for="item in secondaryTeacherOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.label">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上课人员:" prop="data4" label-width="200px">
|
|
|
+ <p style="line-height:40px;color:#0183FA;cursor: pointer" @click="addUserButton">
|
|
|
+ 已选择 ({{dialogForm.data4?dialogForm.data4.length:0}}人)
|
|
|
+ </p>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="dialogFormFlex">
|
|
|
+ <el-form-item label="上课场所:" prop="data5">
|
|
|
+ <el-select v-model="dialogForm.data5"
|
|
|
+ style="width:300px;" placeholder="请选择学院">
|
|
|
+ <el-option
|
|
|
+ @change="deptChange"
|
|
|
+ v-for="item in deptOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.label">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="实验室:" prop="data6" label-width="200px">
|
|
|
+ <el-select v-model="dialogForm.data6" v-if="dialogForm.data7 == 1"
|
|
|
+ style="width:300px;" placeholder="请选择实验室">
|
|
|
+ <el-option
|
|
|
+ v-for="item in subOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.label">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input v-model="dialogForm.data6" v-if="dialogForm.data7 == 2"
|
|
|
+ placeholder="请输入上课场所" maxLength="15" style="width:300px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <p class="inquire-button-one"
|
|
|
+ style="margin-left:20px;width:140px;border-radius:4px;" @click="subTypeClick">
|
|
|
+ {{dialogForm.data7==1?'手动输入上课场所':(dialogForm.data7==2?'选择学校':'')}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="dialogFormFlex">
|
|
|
+ <el-form-item label="上课时间:" prop="courseTime">
|
|
|
+ <el-time-picker
|
|
|
+ class="trainingCourse-el-time-picker"
|
|
|
+ :popper-append-to-body="true"
|
|
|
+ is-range
|
|
|
+ style="width:300px;"
|
|
|
+ format="HH:mm"
|
|
|
+ value-format="HH:mm"
|
|
|
+ v-model="dialogForm.courseTime"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ placeholder="选择时间范围">
|
|
|
+ </el-time-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上课日期:" prop="courseDate" label-width="200px">
|
|
|
+ <el-date-picker
|
|
|
+ style="width:300px;"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ v-model="dialogForm.courseDate"
|
|
|
+ type="daterange"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="课程内容:" prop="data8">
|
|
|
+ <el-input type="textarea" v-model="dialogForm.data8" resize="none" show-word-limit
|
|
|
+ :autosize="{ minRows: 10, maxRows: 10}" maxLength="100" placeholder="请输入处理描述"
|
|
|
+ style="width:1122px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <!--人员选择界面-->
|
|
|
+ <div class="inspectionPlan-dialog-user-box" v-show="dialogUserType">
|
|
|
+ <div class="left-max-box">
|
|
|
+ <div class="dept-table-title-box">
|
|
|
+ <p>待选人员</p>
|
|
|
+ <p>{{userNumLeft}}/{{userTotalLeft}}</p>
|
|
|
+ </div>
|
|
|
+ <div class="dept-table-max-box">
|
|
|
+ <el-form :model="userQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
|
|
|
+ <el-form-item label="" prop="deptId">
|
|
|
+ <el-select v-model="userQueryParamsLeft.deptId" clearable placeholder="选择部门" style="width: 110px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptOptions"
|
|
|
+ :key="item.deptId"
|
|
|
+ :label="item.deptName"
|
|
|
+ :value="item.deptId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="searchValue" class="form-index">
|
|
|
+ <el-input
|
|
|
+ maxLength="20"
|
|
|
+ v-model="userQueryParamsLeft.searchValue"
|
|
|
+ placeholder="搜索姓名/工号"
|
|
|
+ clearable
|
|
|
+ @clear="userHandleQueryLeft"
|
|
|
+ style="width: 240px">
|
|
|
+ <p class="el-icon-search" slot="append" @click="userHandleQueryLeft"></p>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="margin-right:0;">
|
|
|
+ <p class="reset-button-one" @click="userResetQueryLeft" style="width:60px;">重置</p>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
|
|
|
+ <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
|
|
|
+ <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
|
|
|
+ <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
|
|
|
+ </el-table>
|
|
|
+ <pagination layout="total, prev, pager, next, jumper"
|
|
|
+ v-show="userTotalLeft>0"
|
|
|
+ :total="userTotalLeft"
|
|
|
+ :pager-count="5"
|
|
|
+ :page.sync="userQueryParamsLeft.pageNum"
|
|
|
+ :limit.sync="userQueryParamsLeft.pageSize"
|
|
|
+ @pagination="userGetListLeft"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="center-box">
|
|
|
+ <p class="el-icon-arrow-left" @click="userArrowButton(1)"></p>
|
|
|
+ <p class="el-icon-arrow-right" @click="userArrowButton(2)"></p>
|
|
|
+ </div>
|
|
|
+ <div class="right-max-box">
|
|
|
+ <div class="dept-table-title-box">
|
|
|
+ <p>已选成员</p>
|
|
|
+ <p>{{userNumRight}}/{{userTotalRight}}</p>
|
|
|
+ </div>
|
|
|
+ <div class="dept-table-max-box">
|
|
|
+ <el-form :model="userQueryParamsRight" class="form-box" ref="queryForm" :inline="true" label-width="50px">
|
|
|
+ <el-form-item label="" prop="deptId">
|
|
|
+ <el-select v-model="userQueryParamsRight.deptId" clearable placeholder="选择部门" style="width: 110px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptOptions"
|
|
|
+ :key="item.deptId"
|
|
|
+ :label="item.deptName"
|
|
|
+ :value="item.deptId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="searchValue" class="form-index">
|
|
|
+ <el-input
|
|
|
+ maxLength="20"
|
|
|
+ v-model="userQueryParamsRight.searchValue"
|
|
|
+ placeholder="搜索姓名/工号"
|
|
|
+ clearable
|
|
|
+ @clear="userHandleQueryRight"
|
|
|
+ style="width: 240px">
|
|
|
+ <p class="el-icon-search" slot="append" @click="userHandleQueryRight"></p>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="margin-right:0;">
|
|
|
+ <p class="reset-button-one" @click="userResetQueryRight" style="width:60px;">重置</p>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table ref="rightUserTable" border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
|
|
|
+ <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
|
|
|
+ <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
|
|
|
+ <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
|
|
|
+ </el-table>
|
|
|
+ <pagination layout="total, prev, pager, next, jumper"
|
|
|
+ v-show="userTotalRight>0"
|
|
|
+ :total="userTotalRight"
|
|
|
+ :pager-count="5"
|
|
|
+ :page.sync="userQueryParamsRight.pageNum"
|
|
|
+ :limit.sync="userQueryParamsRight.pageSize"
|
|
|
+ @pagination="userGetListRight"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--公共操作按钮-->
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <p class="dialog-footer-null-p"></p>
|
|
|
+ <el-button @click="dialogClose">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="dialogSubmit">确认</el-button>
|
|
|
+ <p class="dialog-footer-null-p"></p>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { findUserList } from '@/api/safetyCheck/index'
|
|
|
+ export default {
|
|
|
+ name: 'trainingCourseAddDialog',
|
|
|
+ props:{
|
|
|
+ addDialogData:{},
|
|
|
+ },
|
|
|
+ data(){
|
|
|
+ const timeRules = (rule, value, callback) => {
|
|
|
+ if(value[0] == value[1]){
|
|
|
+ callback(new Error("开始与结束时间不能相同"));
|
|
|
+ }else{
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return{
|
|
|
+ // 设置只能选择当前日期及之后的日期
|
|
|
+ pickerOptions: {
|
|
|
+ disabledDate(time) {
|
|
|
+ return time.getTime() < Date.now() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 遮罩层
|
|
|
+ loading: false,
|
|
|
+ //弹窗数据
|
|
|
+ dialogType:true,
|
|
|
+ dialogUserType:false,
|
|
|
+ dialogTitle:"",
|
|
|
+ dialogForm:{
|
|
|
+ data1:"",
|
|
|
+ data2:"",
|
|
|
+ data3:"",
|
|
|
+ data4:[],
|
|
|
+ data5:"",
|
|
|
+ data6:"",
|
|
|
+ data7:1,
|
|
|
+ data8:"",
|
|
|
+ courseTime:[new Date(2023, 1, 1, 0, 0), new Date(2023, 1, 1, 23, 59)],
|
|
|
+ courseDate:[],
|
|
|
+ },
|
|
|
+ //验证
|
|
|
+ rules: {
|
|
|
+ phone: [
|
|
|
+ { required: true, message: "请输入联系方式", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入联系方式", validator: this.spaceJudgment, trigger: "blur" },
|
|
|
+ { pattern:/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(16[0-9])|(17[0,3,5-8])|(18[0-9])|(147))+\d{8}$/, message: "请输入正确的联系方式", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ data1: [
|
|
|
+ { required: true, message: "请输入课程名称", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入课程名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ ],
|
|
|
+ data2: [
|
|
|
+ { required: true, message: "请选择主讲老师", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ data4: [
|
|
|
+ { required: true, message: "请选择上课人员", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ data5: [
|
|
|
+ { required: true, message: "请选择上课场所", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ courseTime: [
|
|
|
+ { required: true, message: "请选择上课时间", trigger: "blur" },
|
|
|
+ { required: true, message: "开始与结束时间不能相同", validator: timeRules, trigger: "blur" },
|
|
|
+ ],
|
|
|
+ courseDate: [
|
|
|
+ { required: true, message: "请选择上课日期", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ //主要老师
|
|
|
+ mainTeacherOptions:[{value:'1',label:"1"}],
|
|
|
+ //辅助老师
|
|
|
+ secondaryTeacherOptions:[],
|
|
|
+ //院系列表
|
|
|
+ deptOptions:[],
|
|
|
+ //实验室列表
|
|
|
+ subOptions:[],
|
|
|
+ /**********人员选择数据**********/
|
|
|
+ userQueryParamsLeft:{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ deptId:"",
|
|
|
+ searchValue:"",
|
|
|
+ filtType:1
|
|
|
+ },
|
|
|
+ userTableListLeft:[],
|
|
|
+ userTotalLeft:0,
|
|
|
+ userNumLeft:0,
|
|
|
+ userIdsLeft:[],
|
|
|
+ userQueryParamsRight:{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ deptId:"",
|
|
|
+ searchValue:"",
|
|
|
+ filtType:2
|
|
|
+ },
|
|
|
+ userTableListRight:[],
|
|
|
+ userTotalRight:0,
|
|
|
+ userNumRight:0,
|
|
|
+ userIdsRight:[],
|
|
|
+ //选择人员交互数据
|
|
|
+ dialogTableDataList:[],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.initialize();
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ //初始化
|
|
|
+ initialize(){
|
|
|
+ this.$set(this,'dialogTitle',this.addDialogData.id?'编辑':'添加');
|
|
|
+ if(this.addDialogData.id){
|
|
|
+ //编辑数据
|
|
|
+ }
|
|
|
+ this.getDeptList();
|
|
|
+ },
|
|
|
+ //提交按钮
|
|
|
+ dialogSubmit(){
|
|
|
+ if(this.dialogUserType){
|
|
|
+ //选择人员页面
|
|
|
+ if(!this.dialogTableDataList[0]){
|
|
|
+ this.msgError('请选择人员')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let userList = JSON.parse(JSON.stringify(this.dialogTableDataList))
|
|
|
+ this.$set(this.dialogForm,'data4',userList)
|
|
|
+ this.$set(this,'dialogUserType',false)
|
|
|
+ }else{
|
|
|
+ //提交页面
|
|
|
+ this.$refs["dialogForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.$parent.controlsButton(6)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //取消按钮
|
|
|
+ dialogClose(){
|
|
|
+ if(this.dialogUserType){
|
|
|
+ //选择人员页面
|
|
|
+ this.$set(this,'dialogTitle',this.addDialogData.id?'编辑':'添加');
|
|
|
+ this.$set(this,'dialogUserType',false);
|
|
|
+ }else{
|
|
|
+ //提交页面
|
|
|
+ this.$parent.controlsButton(5)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //主要老师搜索
|
|
|
+ getMainTeacher(query){
|
|
|
+ if(query != ''){
|
|
|
+ this.loading = true;
|
|
|
+ console.log('query',query)
|
|
|
+ this.$set(this,'mainTeacherOptions',[{value:'1',label:"11"}])
|
|
|
+ this.loading = false;
|
|
|
+ console.log('mainTeacherOptions',this.mainTeacherOptions)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //辅助老师搜错
|
|
|
+ getSecondaryTeacher(query){
|
|
|
+ if(query != ''){
|
|
|
+ console.log('1')
|
|
|
+ this.loading = true;
|
|
|
+ this.$set(this,'secondaryTeacherOptions',[{value:'2',label:"22"}])
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择院系
|
|
|
+ deptChange(val){
|
|
|
+ this.$set(this.dialogForm,'data6','');
|
|
|
+ this.getSubList(val)
|
|
|
+ },
|
|
|
+ //获取院系列表
|
|
|
+ getDeptList(){
|
|
|
+ this.$set(this,'deptOptions',[]);
|
|
|
+ },
|
|
|
+ //获取实验室列表
|
|
|
+ getSubList(val){
|
|
|
+ this.$set(this,'subOptions',[]);
|
|
|
+ },
|
|
|
+ //实验室切换
|
|
|
+ subTypeClick(){
|
|
|
+ this.$set(this.dialogForm,'data6','');
|
|
|
+ this.$set(this.dialogForm,'data7',this.dialogForm.data7==1?2:1);
|
|
|
+ },
|
|
|
+ //开启人员选择
|
|
|
+ addUserButton(){
|
|
|
+ let userList = JSON.parse(JSON.stringify(this.dialogForm.data4))
|
|
|
+ this.$set(this,'dialogTableDataList',userList)
|
|
|
+ this.$set(this,'dialogTitle','选择人员');
|
|
|
+ this.$set(this,'dialogUserType',true);
|
|
|
+ this.userHandleQueryLeft();
|
|
|
+ this.userHandleQueryRight();
|
|
|
+ },
|
|
|
+ /*===================================人员选择相关===================================*/
|
|
|
+ //查询
|
|
|
+ userHandleQueryLeft(){
|
|
|
+ this.$set(this.userQueryParamsLeft,'pageNum',1);
|
|
|
+ this.$set(this,'userNumLeft',0);
|
|
|
+ this.$set(this,'userIdsLeft',[]);
|
|
|
+ this.$refs.leftUserTable.clearSelection();
|
|
|
+ this.userGetListLeft();
|
|
|
+ },
|
|
|
+ //重置
|
|
|
+ userResetQueryLeft(){
|
|
|
+ this.$set(this,'userQueryParamsLeft',{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ deptId:"",
|
|
|
+ searchValue:"",
|
|
|
+ filtType:1
|
|
|
+ });
|
|
|
+ this.userHandleQueryLeft();
|
|
|
+ },
|
|
|
+ //查询接口
|
|
|
+ userGetListLeft(){
|
|
|
+ let self = this;
|
|
|
+ let leftObj = JSON.parse(JSON.stringify(this.userQueryParamsLeft));
|
|
|
+ leftObj.selectedUserIds = [];
|
|
|
+ for(let i=0;i<self.dialogTableDataList.length;i++){
|
|
|
+ leftObj.selectedUserIds.push(self.dialogTableDataList[i].userId);
|
|
|
+ }
|
|
|
+ findUserList(leftObj).then(response => {
|
|
|
+ this.userTotalLeft = response.total;
|
|
|
+ this.userTableListLeft = response.rows;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //查询
|
|
|
+ userHandleQueryRight(){
|
|
|
+ this.$set(this.userQueryParamsRight,'pageNum',1);
|
|
|
+ this.$set(this,'userNumRight',0);
|
|
|
+ this.$set(this,'userIdsRight',[]);
|
|
|
+ this.$refs.rightUserTable.clearSelection();
|
|
|
+ this.userGetListRight();
|
|
|
+ },
|
|
|
+ //重置
|
|
|
+ userResetQueryRight(){
|
|
|
+ this.$set(this,'userQueryParamsRight',{
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ deptId:"",
|
|
|
+ searchValue:"",
|
|
|
+ filtType:2
|
|
|
+ });
|
|
|
+ this.userHandleQueryRight();
|
|
|
+ },
|
|
|
+ //查询接口
|
|
|
+ userGetListRight(){
|
|
|
+ let self = this;
|
|
|
+ let rightObj = JSON.parse(JSON.stringify(this.userQueryParamsRight));
|
|
|
+ rightObj.userIds = [];
|
|
|
+ for(let i=0;i<self.dialogTableDataList.length;i++){
|
|
|
+ rightObj.userIds.push(self.dialogTableDataList[i].userId);
|
|
|
+ }
|
|
|
+ findUserList(rightObj).then(response => {
|
|
|
+ this.userTotalRight = response.total;
|
|
|
+ this.userTableListRight = response.rows;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ userChangeLeft(selection){
|
|
|
+ this.userNumLeft = selection.length;
|
|
|
+ this.userIdsLeft = selection.map(item => item.userId);
|
|
|
+ },
|
|
|
+ userChangeRight(selection){
|
|
|
+ this.userNumRight = selection.length;
|
|
|
+ this.userIdsRight = selection.map(item => item.userId);
|
|
|
+ },
|
|
|
+ //人员穿梭按钮
|
|
|
+ userArrowButton(type){
|
|
|
+ let self = this;
|
|
|
+ if(type == 1){
|
|
|
+ //右至左
|
|
|
+ if(this.$refs.rightUserTable.selection[0]){
|
|
|
+ let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
|
|
|
+ let userIdsRight = JSON.parse(JSON.stringify(this.$refs.rightUserTable.selection))
|
|
|
+ for(let i=0;i<userIdsRight.length;i++){
|
|
|
+ for(let s=0;s<list.length;s++){
|
|
|
+ if(userIdsRight[i].userId == list[s].userId){
|
|
|
+ list.splice(s,1);
|
|
|
+ s--
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'dialogTableDataList',list);
|
|
|
+ this.$refs.rightUserTable.clearSelection();
|
|
|
+ this.userHandleQueryLeft();
|
|
|
+ this.userHandleQueryRight();
|
|
|
+ }else{
|
|
|
+ this.msgError('请先勾选右侧列表')
|
|
|
+ }
|
|
|
+ }else if(type == 2){
|
|
|
+ //左至右
|
|
|
+ if(this.userIdsLeft[0]){
|
|
|
+ let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
|
|
|
+ let userIdsLeft = JSON.parse(JSON.stringify(this.$refs.leftUserTable.selection))
|
|
|
+ for(let i=0;i<userIdsLeft.length;i++){
|
|
|
+ let obj = {
|
|
|
+ userId:userIdsLeft[i].userId,
|
|
|
+ name:userIdsLeft[i].nickName,
|
|
|
+ jobNum:userIdsLeft[i].userName,
|
|
|
+ deptName:userIdsLeft[i].deptName,
|
|
|
+ deptId:userIdsLeft[i].deptId,
|
|
|
+ userType:userIdsLeft[i].userType,
|
|
|
+ }
|
|
|
+ list.push(obj);
|
|
|
+ }
|
|
|
+ if(list.length>50){
|
|
|
+ this.msgError('巡查成员最多50人')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$set(this,'dialogTableDataList',list);
|
|
|
+ this.$refs.leftUserTable.clearSelection();
|
|
|
+ this.userHandleQueryLeft();
|
|
|
+ this.userHandleQueryRight();
|
|
|
+ }else{
|
|
|
+ this.msgError('请先勾选左侧列表')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*===记录勾选数据===
|
|
|
+ 需要再el-table 添加 :row-key="getRowKeys"
|
|
|
+ 需要在selection 添加 :reserve-selection="true"
|
|
|
+ */
|
|
|
+ getRowKeys(row) {
|
|
|
+ return row.userId
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ .trainingCourseAddDialog{
|
|
|
+ .add-dialog-form-box{
|
|
|
+ height: 610px;
|
|
|
+ }
|
|
|
+ .dialogFormFlex{
|
|
|
+ display:flex;
|
|
|
+ }
|
|
|
+ .inspectionPlan-dialog-user-box{
|
|
|
+ display: flex;
|
|
|
+ overflow: hidden;
|
|
|
+ height:610px;
|
|
|
+ .el-table__empty-text{
|
|
|
+ background-size: 30%!important;
|
|
|
+ }
|
|
|
+ .dept-table-title-box{
|
|
|
+ display: flex;
|
|
|
+ padding:0 20px;
|
|
|
+ background: rgba(1,131,250,0.1);
|
|
|
+ p{
|
|
|
+ flex:1;
|
|
|
+ color:#0183FA;
|
|
|
+ font-size:16px;
|
|
|
+ line-height:40px;
|
|
|
+ }
|
|
|
+ p:nth-child(1){
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ p:nth-child(2){
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dept-table-max-box{
|
|
|
+ border: 1px solid #e0e0e0;
|
|
|
+ flex:1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ padding:20px;
|
|
|
+ .form-index{
|
|
|
+ .el-input__inner{
|
|
|
+ border-right:none;
|
|
|
+ padding-right:0;
|
|
|
+ }
|
|
|
+ .el-input-group__append{
|
|
|
+ background: #fff;
|
|
|
+ cursor: pointer;
|
|
|
+ padding:0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ input{
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .left-max-box{
|
|
|
+ height:610px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ width:632px;
|
|
|
+ }
|
|
|
+ .right-max-box{
|
|
|
+ height:610px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ width:632px;
|
|
|
+ }
|
|
|
+ .center-box{
|
|
|
+ width:68px;
|
|
|
+ p{
|
|
|
+ display: block;
|
|
|
+ border-radius:50%;
|
|
|
+ width:30px;
|
|
|
+ height:30px;
|
|
|
+ line-height:30px;
|
|
|
+ text-align: center;
|
|
|
+ background: rgba(245,245,245,1);
|
|
|
+ color:rgba(62,62,62,1);
|
|
|
+ cursor: pointer;
|
|
|
+ font-size:16px;
|
|
|
+ }
|
|
|
+ p:nth-child(1){
|
|
|
+ margin:270px 19px 0;
|
|
|
+ }
|
|
|
+ p:nth-child(2){
|
|
|
+ margin:14px 19px 0;
|
|
|
+ }
|
|
|
+ p:hover{
|
|
|
+ color:#fff;
|
|
|
+ background: #0183fa;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-icon-search{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input-group__append{
|
|
|
+ padding:0;
|
|
|
+ p{
|
|
|
+ text-align: center;
|
|
|
+ line-height: 34px;
|
|
|
+ width:50px;
|
|
|
+ height:34px;
|
|
|
+ font-size:16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dialog-footer{
|
|
|
+ display: flex;
|
|
|
+ .dialog-footer-null-p{
|
|
|
+ flex:1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|