index.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  1. <!--教职工管理-->
  2. <template>
  3. <div class="app-container teacher">
  4. <div v-show="pageType == 1" class="teacher-one-box">
  5. <div class="top-max-box">
  6. <div class="left-max-box ">
  7. <div class="top-button-max-box">
  8. <el-tooltip class="item" effect="dark" content="新增下级部门" placement="top">
  9. <div class="new-button-box" @click="treeButtonClick(1)" v-hasPermi="['system:dept:add']"></div><!--新增-->
  10. </el-tooltip>
  11. <el-tooltip class="item" effect="dark" content="向上移动" placement="top">
  12. <div class="superior-button-box" @click="treeButtonClick(2)" v-hasPermi="['system:dept:edit']"></div><!--上调-->
  13. </el-tooltip>
  14. <el-tooltip class="item" effect="dark" content="向下移动" placement="top">
  15. <div class="down-button-box" @click="treeButtonClick(3)" v-hasPermi="['system:dept:edit']"></div><!--下调-->
  16. </el-tooltip>
  17. <el-tooltip class="item" effect="dark" content="修改" placement="top">
  18. <div class="edit-button-box" @click="treeButtonClick(4)" v-hasPermi="['system:dept:edit']"></div><!--编辑-->
  19. </el-tooltip>
  20. <el-tooltip class="item" effect="dark" content="添加部门人员" placement="top">
  21. <div class="add-button-box" @click="treeButtonClick(5)" v-hasPermi="['system:user_teacher:edit']"></div><!--人员添加-->
  22. </el-tooltip>
  23. <el-tooltip class="item" effect="dark" content="删除" placement="top">
  24. <div class="delete-button-box" @click="treeButtonClick(6)" v-hasPermi="['system:dept:remove']"></div><!--删除-->
  25. </el-tooltip>
  26. </div>
  27. <div class="left-input-box">
  28. <el-input
  29. class="input-left"
  30. maxlength="10"
  31. v-model="inputDeptName"
  32. placeholder="请输入名称"
  33. clearable
  34. size="small"
  35. />
  36. <!--@clear="getTreeselect"-->
  37. <p class="button-right add-button-two-90" @click="getTreeselect">搜索</p>
  38. </div>
  39. <div class="bottom-button-max-box scrollbar-box">
  40. <el-tree
  41. style="margin-right:20px;"
  42. highlight-current
  43. :data="deptOptions"
  44. :props="defaultProps"
  45. icon-class=""
  46. :expand-on-click-node="false"
  47. :filter-node-method="filterNode"
  48. ref="tree"
  49. default-expand-all
  50. @node-click="handleNodeClick"
  51. />
  52. </div>
  53. </div>
  54. <div class="center-max-box"></div>
  55. <div class="teacher-right-max-box">
  56. <el-form :model="queryParams" class="form-box" ref="queryForm" :inline="true" v-show="showSearch">
  57. <!--v-hasPermi="['laboratory:plan:add']"-->
  58. <el-form-item label="关键字" prop="searchValue" label-width="54px">
  59. <el-input
  60. maxLength="20"
  61. v-model="queryParams.searchValue"
  62. placeholder="姓名/工号/电话"
  63. style="width: 130px"
  64. />
  65. </el-form-item>
  66. <el-form-item label="状态" prop="nature" label-width="40px">
  67. <el-select
  68. v-model="queryParams.nature"
  69. placeholder="请选择"
  70. clearable
  71. >
  72. <el-option
  73. v-for="dict in workClass"
  74. :key="dict.dictValue"
  75. :label="dict.dictLabel"
  76. :value="dict.dictValue"
  77. />
  78. </el-select>
  79. </el-form-item>
  80. <el-form-item label="检查者" prop="isCheck" label-width="54px">
  81. <el-select
  82. v-model="queryParams.isCheck"
  83. placeholder="请选择"
  84. clearable
  85. >
  86. <el-option
  87. v-for="dict in userTypeList"
  88. :key="dict.id"
  89. :label="dict.name"
  90. :value="dict.id"
  91. />
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item label="校园卡" prop="cardNumSimple" label-width="54px">
  95. <el-select
  96. v-model="queryParams.cardNumSimple"
  97. placeholder="请选择"
  98. clearable
  99. >
  100. <el-option
  101. v-for="dict in postionList"
  102. :key="dict.postId"
  103. :label="dict.postName"
  104. :value="dict.postId"
  105. />
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item>
  109. <el-dropdown @command="importButton" v-hasPermi="['system:user_teacher:import']">
  110. <div class="form-dropdown-box" style="margin-left:5px;">
  111. <img src="@/assets/ZDimages/personnelManagement/icon_jzgxx_dr.png">
  112. <p>导入</p>
  113. <img src="@/assets/ZDimages/personnelManagement/icon_jzggl_xljt.png">
  114. </div>
  115. <el-dropdown-menu slot="dropdown">
  116. <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}" v-hasPermi="['system:user_teacher:exceltemplate']">下载模板</el-dropdown-item>
  117. <el-dropdown-item style="margin:0 10px;color:#666;" :command="{command:2}">导入数据</el-dropdown-item>
  118. </el-dropdown-menu>
  119. </el-dropdown>
  120. </el-form-item>
  121. <el-form-item>
  122. <el-dropdown @command="exportButton" v-hasPermi="['system:user_teacher:export']">
  123. <div class="form-dropdown-box">
  124. <img src="@/assets/ZDimages/personnelManagement/icon_jzgxx_sc.png">
  125. <p>导出</p>
  126. <img src="@/assets/ZDimages/personnelManagement/icon_jzggl_xljt.png">
  127. </div>
  128. <el-dropdown-menu slot="dropdown">
  129. <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}">导出全部数据</el-dropdown-item>
  130. <el-dropdown-item style="margin:0 10px;color:#666;" :command="{command:2}">导出选中数据</el-dropdown-item>
  131. </el-dropdown-menu>
  132. </el-dropdown>
  133. </el-form-item>
  134. <el-form-item style="float: right;">
  135. <el-col :span="1.5" v-hasPermi="['system:user_teacher:add']">
  136. <p class="add-button-one-90"
  137. @click="addButton"
  138. ><i class="el-icon-plus"></i>新增</p>
  139. </el-col>
  140. </el-form-item>
  141. <el-form-item style="float: right;">
  142. <el-col :span="1.5" v-hasPermi="['system:user_teacher:check']">
  143. <p class="add-button-one-90"
  144. @click="bindingCard"
  145. >批量绑卡</p>
  146. </el-col>
  147. </el-form-item>
  148. <el-form-item>
  149. <p class="inquire-button-one" @click="handleQuery">查询</p>
  150. <p class="reset-button-one" @click="resetQuery">重置</p>
  151. </el-form-item>
  152. </el-form>
  153. <div class="min-list-box">
  154. <el-table :data="userList" border @selection-change="handleSelectionChange" ref="multipleTable" :row-key="getRowKeys">
  155. <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
  156. <el-table-column label="序号" width="50" align="center" type="index"/>
  157. <el-table-column label="姓名" align="left" prop="nickName" width="100" show-overflow-tooltip>
  158. </el-table-column>
  159. <el-table-column label="工号" align="left" prop="userName" width="180">
  160. <template slot-scope="scope">
  161. <div style="display: flex">
  162. <el-tooltip class="item" effect="dark" :disabled="scope.row.userName.length>7?false:true" :content="scope.row.userName" placement="top">
  163. <span style="height:23px;width:80px;margin-right:10px;overflow:hidden">
  164. {{scope.row.userName.length>7?scope.row.userName[0]+scope.row.userName[1]+scope.row.userName[2]+scope.row.userName[3]+scope.row.userName[4]+scope.row.userName[5]+scope.row.userName[6]+'...':scope.row.userName}}
  165. </span>
  166. </el-tooltip>
  167. <el-switch
  168. v-if="scope.row.nature==0"
  169. @click.native="statusCaptcha(scope.row)"
  170. class="switch captcha-img"
  171. active-value="0"
  172. inactive-value="1"
  173. active-color="#0183FA"
  174. inactive-color="#999"
  175. v-model="scope.row.status"
  176. active-text="启用"
  177. inactive-text="停用"
  178. disabled
  179. ></el-switch>
  180. </div>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="手机号码" align="left" prop="phonenumber" width="130" show-overflow-tooltip/>
  184. <el-table-column label="所在部门" align="left" prop="deptName" width="110" show-overflow-tooltip/>
  185. <el-table-column label="身份" align="left" prop="positionName" width="110" show-overflow-tooltip/>
  186. <el-table-column label="创建时间" align="left" prop="createTimeStr" show-overflow-tooltip/>
  187. <el-table-column label="在职状态" align="left" prop="userName" width="100">
  188. <template slot-scope="scope">
  189. <p style="width:64px;margin:0 auto;">
  190. <el-switch
  191. @click.native="natureCaptcha(scope.row)"
  192. class="switch captcha-img"
  193. active-value="0"
  194. inactive-value="1"
  195. active-color="#29B24D"
  196. inactive-color="#999"
  197. v-model="scope.row.nature"
  198. active-text="在职"
  199. inactive-text="离职"
  200. disabled
  201. ></el-switch>
  202. </p>
  203. </template>
  204. </el-table-column>
  205. <el-table-column label="检查者" align="center" prop="isCheck" width="70" show-overflow-tooltip>
  206. <template slot-scope="scope">
  207. <span>{{scope.row.isCheck == 0?'否':(scope.row.isCheck == 1?'是':'')}}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="操作" align="left" width="160" class-name="small-padding fixed-width" v-if="tableButtonType">
  211. <template slot-scope="scope">
  212. <div class="table-button-box">
  213. <p class="table-button-null"></p>
  214. <p class="table-button-p"
  215. v-hasPermi="['system:user_teacher:query']"
  216. @click="infoButton(scope.row)"
  217. >详情</p>
  218. <el-dropdown @command="moreClick" v-hasPermi="['system:user_teacher:query','system:user_teacher:edit','system:user_teacher:remove','system:user_teacher:resetpwd']">
  219. <p class="table-button-p">更多>></p>
  220. <el-dropdown-menu slot="dropdown">
  221. <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;" :command="{row:scope.row,command:1}"
  222. v-hasPermiAnd="['system:user_teacher:query','system:user_teacher:edit']">编辑</el-dropdown-item>
  223. <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;" :command="{row:scope.row,command:2}"
  224. v-hasPermi="['system:user_teacher:remove']">删除</el-dropdown-item>
  225. <el-dropdown-item style="margin:0 10px;" :command="{row:scope.row,command:3}"
  226. v-hasPermi="['system:user_teacher:resetpwd']">重置密码</el-dropdown-item>
  227. </el-dropdown-menu>
  228. </el-dropdown>
  229. <p class="table-button-null"></p>
  230. </div>
  231. </template>
  232. </el-table-column>
  233. </el-table>
  234. <div style="display: flex;height:32px;margin-top:15px;">
  235. <!--<p style="flex:2;"></p>-->
  236. <p style="text-align: left;margin:0;line-height:32px;margin-right:20px;font-size:14px;color:#999;">
  237. <i class="el-icon-warning" style="color:#0183FA;"></i>
  238. 已选择 {{selectedNum}} 项
  239. </p>
  240. <div style="flex:5;">
  241. <pagination :page-sizes="[20, 30, 40, 50]"
  242. v-show="total>0"
  243. :total="total"
  244. style="margin:0;"
  245. :page.sync="queryParams.pageNum"
  246. :limit.sync="queryParams.pageSize"
  247. @pagination="getList"
  248. />
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <add-page v-if="pageType == 2" :editType="editType" :propsData="propsData" :titleName="titleName"></add-page>
  256. <binding-card-page v-if="pageType == 3" :ids="ids"></binding-card-page>
  257. <!--重置密码-->
  258. <el-dialog title="重置密码" :visible.sync="reviseOpen" width="600px" append-to-body class="teacher-revise-dialog-box">
  259. <p class="teacher-text-p">确定要重置该账号的密码吗?</p>
  260. <p class="teacher-text-p">确定操作后,该账号密码将重置为系统初始密码。</p>
  261. <div slot="footer" class="teacher-revise-dialog-button-box">
  262. <p class="reset-button-one" @click="offTeacherResetPwd">取消</p>
  263. <p class="inquire-button-one" @click="teacherResetPwd">确定</p>
  264. </div>
  265. </el-dialog>
  266. <!--导入窗口-->
  267. <el-dialog title="导入数据" :visible.sync="importOpen" @close="importOpenOff" width="600px" append-to-body class="teacher-import-dialog-box">
  268. <el-upload
  269. class="teacher-import-dialog-upLoad-box"
  270. :drag="true"
  271. :data="upImportData"
  272. :action="uploadImgUrl"
  273. :show-file-list="false"
  274. :on-success="handleAvatarSuccess"
  275. :headers="headers"
  276. :before-upload="beforeAvatarUpload">
  277. <i class="el-icon-upload"></i>
  278. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  279. <div class="el-upload__tip" slot="tip">
  280. <el-checkbox v-model="upImportData.upDate">是否更新已经存在的用户数据</el-checkbox>
  281. </div>
  282. <div class="el-upload__tip" slot="tip">仅允许导入xls、xlsx、格式文件。<span style="color:#0183FA;cursor: pointer" v-hasPermi="['system:user_teacher:exceltemplate']" @click="importTemplate">下载模板</span></div>
  283. <div class="el-upload-text-box" slot="tip" v-if="getImportData.downFile">
  284. <div class="img-text-box">
  285. <img src="@/assets/ZDimages/personnelManagement/icon_dr_wj.png">
  286. <p>{{getImportData.textName}}</p>
  287. </div>
  288. <p class="text-p">数据导入成功 <span style="color:#0183FA;">{{getImportData.successNum}}</span> 条,失败 <span style="color:#FF6464 ;">{{getImportData.failureNum}}</span> 条</p>
  289. <div class="img-text-box">
  290. <img src="@/assets/ZDimages/personnelManagement/icon_dr_sj.png">
  291. <p style="color:#0183FA;cursor: pointer;" @click="failureExcel">点击下载失败数据报表</p>
  292. </div>
  293. </div>
  294. </el-upload>
  295. <div slot="footer" class="teacher-import-dialog-button-box">
  296. <p class="inquire-button-one" @click="importOpenOff">确定</p>
  297. </div>
  298. <div class="teacher-import-dialog-position-box" v-if="loading"></div>
  299. </el-dialog>
  300. <!--编辑--组织架构-->
  301. <el-dialog title="修改部门" v-if="treeOpen" :visible.sync="treeOpen" width="600px" append-to-body class="teacher-tree-dialog-box">
  302. <el-form :model="treeForm" class="teacher-tree-dialog-form-box" ref="treeForm" :rules="rules" v-show="showSearch">
  303. <el-form-item label="上级部门" prop="parentId" label-width="90px" v-if="treeForm.parentId != 0">
  304. <treeselect v-model="treeForm.parentId" :options="deptOptions" :show-count="true" @select="deptSelect" placeholder="请选择上级部门" />
  305. </el-form-item>
  306. <el-form-item label="部门编号" prop="deptNum" label-width="90px" v-if="treeForm.parentId != 0">
  307. <el-input v-model="treeForm.deptNum" maxlength="15"
  308. onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" placeholder="请输入部门编号"/>
  309. </el-form-item>
  310. <el-form-item label="部门名称" prop="deptName" label-width="90px">
  311. <el-input v-model="treeForm.deptName" maxlength="15" placeholder="请输入部门名称"/>
  312. </el-form-item>
  313. <el-form-item v-if="deptType"
  314. label="部门类型" prop="deptType" label-width="90px">
  315. <el-radio-group v-model="treeForm.deptType" style="margin:4px 0 0 10px;">
  316. <el-radio :label="1">学院</el-radio>
  317. <el-radio :label="0">非学院</el-radio>
  318. </el-radio-group>
  319. </el-form-item>
  320. </el-form>
  321. <div slot="footer" class="teacher-tree-dialog-button-box">
  322. <p class="reset-button-one" @click="treeOpenOff">取消</p>
  323. <p class="inquire-button-one" @click="editDeptButton">确定</p>
  324. </div>
  325. </el-dialog>
  326. <!--新增--组织架构-->
  327. <el-dialog title="新增部门" v-if="treeAddOpen" :visible.sync="treeAddOpen" width="600px" append-to-body class="teacher-tree-dialog-box">
  328. <el-form :model="treeAddForm" class="teacher-tree-dialog-form-box" ref="treeAddForm" :rules="rules" v-show="showSearch">
  329. <el-form-item label="上级部门" prop="id" label-width="110px">
  330. <treeselect style="width:402px;" v-model="treeAddForm.id" :options="deptOptions" :show-count="true"
  331. @select="deptAddSelect" placeholder="请选择上级部门"/>
  332. </el-form-item>
  333. <div class="scrollbar-box" style="max-height:456px">
  334. <div style="display:flex;border:1px solid #d8d8d8;border-radius:6px;margin:0 20px 20px;padding-top:20px;position: relative"
  335. v-for="(item,index) in treeAddForm.teaCherDpetList" :key="index">
  336. <div style="width:490px;">
  337. <el-form-item label="部门编号" :prop="'teaCherDpetList.' + index + '.deptNum'" :rules="rules.deptNum" label-width="90px">
  338. <el-input v-model="item.deptNum" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" maxlength="15" placeholder="请输入部门编号"/>
  339. </el-form-item>
  340. <el-form-item label="部门名称" :prop="'teaCherDpetList.' + index + '.deptName'" :rules="rules.deptName" label-width="90px">
  341. <el-input v-model="item.deptName" maxlength="15" placeholder="请输入部门名称"/>
  342. </el-form-item>
  343. <el-form-item v-if="deptType"
  344. label="部门类型" :prop="'teaCherDpetList.' + index + '.deptType'" :rules="rules.deptType" label-width="90px">
  345. <el-radio-group v-model="item.deptType" style="margin:4px 0 0 10px;">
  346. <el-radio :label="1">学院</el-radio>
  347. <el-radio :label="0">非学院</el-radio>
  348. </el-radio-group>
  349. </el-form-item>
  350. </div>
  351. <div style="position: absolute;right:30px;bottom:22px;">
  352. <div style="display: flex;width:100px;" v-if="index != treeAddForm.teaCherDpetList.length-1">
  353. <p class="el-icon-delete" style="margin:10px 20px;font-size:20px;width:20px;cursor: pointer;color:#FF6666;" @click="delDeptItem(index)"></p>
  354. </div>
  355. <div style="display: flex;width:100px;" v-if="index == treeAddForm.teaCherDpetList.length-1 && index < 4 && index != 0">
  356. <p class="el-icon-circle-plus-outline" style="margin:10px 20px;font-size:20px;width:20px;cursor: pointer;color:#0183FA;" @click="addDeptItem"></p>
  357. <p class="el-icon-delete" style="margin:10px 0;font-size:20px;width:20px;cursor: pointer;color:#FF6666;" @click="delDeptItem(index)"></p>
  358. </div>
  359. <div style="display: flex;width:100px;" v-if="index == treeAddForm.teaCherDpetList.length-1 && index == 4">
  360. <p class="el-icon-delete" style="margin:10px 20px;font-size:20px;width:20px;cursor: pointer;color:#FF6666;" @click="delDeptItem(index)"></p>
  361. </div>
  362. <div style="display: flex;width:100px;" v-if="index == treeAddForm.teaCherDpetList.length-1 && index < 4 && index == 0">
  363. <p class="el-icon-circle-plus-outline" style="margin:10px 20px;font-size:20px;width:20px;cursor: pointer;color:#0183FA;" @click="addDeptItem"></p>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </el-form>
  369. <div slot="footer" class="teacher-tree-dialog-button-box">
  370. <p class="reset-button-one" @click="treeAddOpenOff">取消</p>
  371. <p class="inquire-button-one" @click="addDeptButton">确定</p>
  372. </div>
  373. </el-dialog>
  374. <user-list ref="userOpen"></user-list>
  375. </div>
  376. </template>
  377. <script>
  378. import { getAuthRole, updateAuthRole, resetUserPwd } from "@/api/system/user";
  379. import { allListPost } from "@/api/system/post";
  380. import { listDepartments } from "@/api/system/dept";
  381. import { setSubjectAdmin,getSubjectList,getNoAdminSubjectList,getNoAdminSubjectListNopage } from "@/api/laboratory/subject";
  382. import { listUser, delUser, addUser, updateUser, changeUserStatus,putUserTeacher,delTeacher,
  383. teacherResetPwd,addDeptByTeacher,putDeptByTeacher,updateDeptName,editDeptOrder,delDept,
  384. editUserByDept,getTeacherInfo,editNatureLinkage,treeselect } from "@/api/system/user_teacher";
  385. import { getUser } from "@/api/system/user_student";
  386. import { getToken } from "@/utils/auth";
  387. import Treeselect from "@riophae/vue-treeselect";
  388. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  389. import { Message } from 'element-ui'
  390. import userList from "./userList.vue"
  391. import addPage from "./addPage.vue"
  392. import bindingCardPage from "./bindingCardPage.vue"
  393. export default {
  394. name: "User",
  395. components: {
  396. Treeselect,
  397. userList,
  398. addPage,
  399. bindingCardPage
  400. },
  401. data() {
  402. return {
  403. tableButtonType:this.hasPermiDom(['system:user_teacher:query','system:user_teacher:query','system:user_teacher:edit','system:user_teacher:remove','system:user_teacher:resetpwd']),
  404. uploadImgUrl: window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/system/user/teacher/importData", // 上传地址
  405. headers: {
  406. Authorization: "Bearer " + getToken(),
  407. },
  408. // 遮罩层
  409. loading: true,
  410. // 选中数组
  411. ids: [],
  412. // 非单个禁用
  413. single: true,
  414. // 非多个禁用
  415. multiple: true,
  416. // 显示搜索条件
  417. showSearch: true,
  418. // 总条数
  419. total: 0,
  420. // 用户表格数据
  421. userList: [],
  422. idData:[],
  423. // 弹出层标题
  424. title: "",
  425. // 部门树选项
  426. deptOptions: undefined,
  427. // 重置密码弹层开关
  428. reviseOpen: false,
  429. // 部门名称
  430. deptName: undefined,
  431. // 默认密码
  432. initPassword: undefined,
  433. // 日期范围
  434. dateRange: [],
  435. // 职称字典
  436. professional: [],
  437. // 工作性质字典
  438. workClass:[],
  439. // 是否是检查者
  440. userTypeList:[
  441. {
  442. id:0,
  443. name:"否",
  444. },
  445. {
  446. id:1,
  447. name:"是",
  448. },
  449. ],
  450. // 性别状态字典
  451. sexOptions: [],
  452. // 岗位选项
  453. postOptions: [],
  454. // 角色选项
  455. roleOptions: [],
  456. // 学院选项
  457. facultyOptions: [],
  458. // 实验室选项
  459. laboratoryOptions: [],
  460. // 表单参数
  461. form: {},
  462. defaultProps: {
  463. children: "children",
  464. label: "label"
  465. },
  466. // 查询参数
  467. queryParams: {
  468. pageNum: 1,
  469. pageSize:20,
  470. searchValue: "",
  471. cardNumSimple: "",
  472. nature: "",
  473. isCheck: "",
  474. },
  475. // 列信息
  476. columns: [
  477. { key: 0, label: `用户编号`, visible: true },
  478. { key: 1, label: `用户名称`, visible: true },
  479. { key: 2, label: `用户昵称`, visible: true },
  480. { key: 3, label: `部门`, visible: true },
  481. { key: 4, label: `手机号码`, visible: true },
  482. { key: 5, label: `状态`, visible: true },
  483. { key: 6, label: `创建时间`, visible: true }
  484. ],
  485. addRules:{
  486. userName: [
  487. { required: true, message: "请输入学号", trigger: "blur" },
  488. { required: true, message: "请输入学号", validator: this.spaceJudgment, trigger: "blur" }
  489. ],
  490. nickName: [
  491. { required: true, message: "请输入姓名", trigger: "blur" },
  492. { required: true, message: "请输入姓名", validator: this.spaceJudgment, trigger: "blur" }
  493. ],
  494. deptId: [
  495. { required: true, message: "请选择学院", trigger: "blur" }
  496. ],
  497. sex: [
  498. { required: true, message: "请选择性别", trigger: "blur" }
  499. ],
  500. },
  501. // 表单校验
  502. rules: {
  503. parentId: [
  504. { required: true, message: "请选择上级部门", trigger: "blur" }
  505. ],
  506. id: [
  507. { required: true, message: "请选择上级部门", trigger: "blur" }
  508. ],
  509. deptNum: [
  510. { required: true, message: "请输入部门编号", trigger: "blur" },
  511. { required: true, message: "请输入部门编号", validator: this.spaceJudgment, trigger: "blur" }
  512. ],
  513. deptName: [
  514. { required: true, message: "请输入部门名称", trigger: "blur" },
  515. { required: true, message: "请输入部门名称", validator: this.spaceJudgment, trigger: "blur" }
  516. ],
  517. deptType: [
  518. { required: true, message: "请选择部门类型", trigger: "blur" },
  519. { required: true, message: "请选择部门类型", validator: this.spaceJudgment, trigger: "blur" }
  520. ],
  521. },
  522. //表格扩展选择器---需要在@selection-change绑定的方法内监控selection数组长度
  523. selectedNum:0,
  524. //页面状态
  525. pageType:1,
  526. editType:false,
  527. //组件传参数据
  528. propsData:{},
  529. //危险源数据
  530. laboratoryList:[],
  531. //学院列表
  532. deptList:[],
  533. //职位列表
  534. postionList: [
  535. {
  536. postName:"未绑定",
  537. postId:"0",
  538. },
  539. {
  540. postName:"已绑定",
  541. postId:"1",
  542. },
  543. ],
  544. //文化程度
  545. educationList:[],
  546. // 新增学生开关
  547. addStudentType:false,
  548. addTitle:"",
  549. addForm:{},
  550. //导入弹层开关
  551. importOpen:false,
  552. //导入数据
  553. upImportData:{
  554. sysUserEnable:true,
  555. upDate:false,
  556. },
  557. getImportData:{
  558. downFile:false,
  559. successNum:0,
  560. failureNum:0,
  561. textName:"",
  562. },
  563. //新增组织架构数据
  564. treeAddOpen:false,
  565. treeAddForm:{
  566. id:null,
  567. parentId:"",
  568. ancestors:"",
  569. teaCherDpetList:[],
  570. },
  571. //编辑组织架构数据
  572. treeOpen:false,
  573. treeForm:{
  574. id:"",
  575. parentId:null,
  576. deptName:"",
  577. ancestors:"",
  578. },
  579. treeFormOne:{},
  580. userId:"",
  581. currentDate:'',
  582. inputDeptName:"",
  583. //部门类型开关
  584. deptType:false,
  585. };
  586. },
  587. watch: {
  588. // 根据名称筛选部门树
  589. deptName(val) {
  590. this.$refs.tree.filter(val);
  591. }
  592. },
  593. created() {
  594. this.getList();
  595. this.getTreeselect();
  596. this.getDeptList();
  597. // this.getPostionList();
  598. // //职称
  599. // this.getDicts("professional").then(response => {
  600. // this.professional = response.data;
  601. // });
  602. //工作性质
  603. this.getDicts("work_class").then(response => {
  604. this.workClass = response.data;
  605. });
  606. //性别
  607. this.getDicts("sys_user_sex").then(response => {
  608. this.sexOptions = response.data;
  609. });
  610. //文化程度
  611. this.getDicts("education").then(response => {
  612. this.educationList = response.data;
  613. });
  614. this.getConfigKey("sys.user.initPassword").then(response => {
  615. this.initPassword = response.msg;
  616. });
  617. },
  618. methods: {
  619. //批量绑卡页面跳转与数量检测
  620. bindingCard(){
  621. let self = this;
  622. if(self.ids.length<1){
  623. self.msgError('请先勾选人员')
  624. return
  625. }
  626. if(self.ids.length>50){
  627. self.msgError('批量绑卡最多只可选中50条数据,当前选中了'+self.ids.length+'条.')
  628. return
  629. }
  630. this.pageType = 3;
  631. },
  632. //人员添加接口
  633. takeUserData(ids,idsData){
  634. let list = [];
  635. for(let i=0;i<ids.length;i++){
  636. let obj = {
  637. userId:ids[i],
  638. deptId:this.queryParams.deptId
  639. }
  640. list.push(obj);
  641. }
  642. editUserByDept(list).then(response => {
  643. this.msgSuccess(response.msg)
  644. this.$refs.userOpen.show();
  645. this.getList();
  646. this.getTreeselect();
  647. this.delTreeForm();
  648. });
  649. },
  650. //编辑部门关闭
  651. treeOpenOff(){
  652. this.treeOpen = false;
  653. },
  654. //编辑部门提交
  655. editDeptButton(){
  656. let self = this;
  657. this.$refs["treeForm"].validate(valid => {
  658. if (valid) {
  659. if(this.treeForm.parentId == 0){
  660. let obj = {
  661. deptId:this.treeForm.id,
  662. deptName:this.treeForm.deptName,
  663. }
  664. obj.deptType = this.deptType?this.treeForm.deptType:'0'
  665. updateDeptName(obj).then(response => {
  666. this.treeOpen = false;
  667. this.delTreeForm();
  668. this.msgSuccess(response.msg)
  669. this.getTreeselect();
  670. this.$set(this,'treeForm',{});
  671. this.$set(this,'treeAddForm',{});
  672. });
  673. }else{
  674. let obj = {
  675. deptId:this.treeForm.id,
  676. parentId:this.treeForm.parentId,
  677. deptNum:this.treeForm.deptNum,
  678. ancestors:this.treeForm.ancestors,
  679. deptName:this.treeForm.deptName,
  680. };
  681. obj.deptType = this.deptType?this.treeForm.deptType:'0'
  682. putDeptByTeacher(obj).then(response => {
  683. this.treeOpen = false;
  684. this.delTreeForm();
  685. this.msgSuccess(response.msg)
  686. this.getTreeselect();
  687. this.$set(this,'treeForm',{});
  688. this.$set(this,'treeAddForm',{});
  689. });
  690. }
  691. }
  692. });
  693. },
  694. //新增子部门
  695. addDeptItem(){
  696. this.treeAddForm.teaCherDpetList.push({deptNum:"",deptName:""})
  697. },
  698. //删除子部门
  699. delDeptItem(index){
  700. this.treeAddForm.teaCherDpetList.splice(index,1)
  701. },
  702. //新增部门提交
  703. addDeptButton(){
  704. let self = this;
  705. this.$refs["treeAddForm"].validate(valid => {
  706. if (valid) {
  707. let newObj = {
  708. teaCherDpetList:[]
  709. }
  710. for(let i=0;i<self.treeAddForm.teaCherDpetList.length;i++){
  711. let obj = {
  712. ancestors:this.treeAddForm.ancestors,
  713. parentId:this.treeAddForm.id,
  714. deptNum:this.treeAddForm.teaCherDpetList[i].deptNum,
  715. deptName:this.treeAddForm.teaCherDpetList[i].deptName,
  716. }
  717. obj.deptType = this.deptType?this.treeAddForm.teaCherDpetList[i].deptType:'0'
  718. newObj.teaCherDpetList.push(obj);
  719. }
  720. addDeptByTeacher(newObj).then(response => {
  721. this.treeAddOpen = false;
  722. this.msgSuccess(response.msg)
  723. this.getTreeselect();
  724. this.$set(this,'treeForm',{});
  725. this.$set(this,'treeAddForm',{});
  726. });
  727. }
  728. });
  729. },
  730. //关闭新增页面
  731. treeAddOpenOff(){
  732. this.treeAddOpen = false;
  733. },
  734. //新增节点选择部门
  735. deptAddSelect(item){
  736. this.$set(this,'deptType',item.ancestors == '0'?true:false);
  737. this.treeAddForm.parentId = item.id;
  738. this.treeAddForm.ancestors = item.ancestors;
  739. },
  740. //编辑节点选择部门
  741. deptSelect(item){
  742. this.$set(this,'deptType',item.ancestors == '0'?true:false);
  743. this.treeForm.parentId = item.id;
  744. this.treeForm.ancestors = item.ancestors;
  745. },
  746. // 节点单击事件
  747. handleNodeClick(data) {
  748. console.log("data",data);
  749. this.$set(this.queryParams,'deptId',data.id);
  750. let obj = {
  751. id : data.id,
  752. deptNum : data.deptNum,
  753. parentId : data.parentId,
  754. deptName : data.label,
  755. deptType : data.deptType,
  756. ancestors : data.ancestors,
  757. }
  758. this.$set(this,'treeForm',obj);
  759. this.$set(this,'treeFormOne',JSON.parse(JSON.stringify(obj)));
  760. // this.treeForm.id = data.id;
  761. // this.treeForm.deptNum = data.deptNum;
  762. // this.treeForm.parentId = data.parentId;
  763. // this.treeForm.deptName = data.label;
  764. // this.treeForm.ancestors = data.ancestors;
  765. this.selectedNum = 0;
  766. this.$refs.multipleTable.clearSelection()
  767. this.getList();
  768. },
  769. //操作启用停用开关
  770. statusCaptcha(row){
  771. let obj = {
  772. userId:row.userId,//用户id
  773. userName:row.userName,//用户账户
  774. status:row.status == 1?'0':'1',//账户启用停用,0是启用,1是停用
  775. };
  776. putUserTeacher(obj).then(response => {
  777. row.status = row.status == 1?'0':'1';
  778. this.msgSuccess(response.msg)
  779. });
  780. },
  781. //操作在职开关
  782. natureCaptcha(row){
  783. let obj = {
  784. userId:row.userId,//用户id
  785. userName:row.userName,//用户账户
  786. nature:row.nature == 1?'0':'1',//账户启用停用,0是在职,1是离职
  787. };
  788. editNatureLinkage(obj).then(response => {
  789. this.msgSuccess(response.msg)
  790. this.getList();
  791. });
  792. },
  793. // 组织树操作
  794. treeButtonClick(type){
  795. let self = this;
  796. if(type == 1){
  797. //新增部门
  798. let obj = {
  799. id:null,
  800. parentId:"",
  801. ancestors:"",
  802. teaCherDpetList:[
  803. {deptNum:"",deptName:""}
  804. ]
  805. }
  806. if(this.treeForm.id){
  807. obj.id = this.treeForm.id;
  808. obj.parentId = this.treeForm.parentId;
  809. obj.ancestors = this.treeForm.ancestors;
  810. }
  811. this.$set(this,'deptType',this.treeForm.ancestors == '0'?true:false);
  812. this.$set(this,'treeAddForm',obj);
  813. this.treeAddOpen = true;
  814. }else {
  815. if(!this.queryParams.deptId){
  816. this.msgError("请先选择部门")
  817. return
  818. }
  819. if(type == 2){
  820. //部门上移动
  821. let obj = {
  822. parentId:this.treeForm.parentId,
  823. deptId:this.treeForm.id,
  824. upDownOper:"1",
  825. }
  826. editDeptOrder(obj).then(response => {
  827. this.delTreeForm();
  828. this.msgSuccess(response.msg)
  829. this.getTreeselect();
  830. });
  831. }else if(type == 3){
  832. //部门下移动
  833. let obj = {
  834. parentId:this.treeForm.parentId,
  835. deptId:this.treeForm.id,
  836. upDownOper:"2",
  837. }
  838. editDeptOrder(obj).then(response => {
  839. this.delTreeForm();
  840. this.msgSuccess(response.msg)
  841. this.getTreeselect();
  842. });
  843. }else if(type == 4){
  844. //部门编辑
  845. this.$set(this,'treeForm',JSON.parse(JSON.stringify(this.treeFormOne)));
  846. let list = this.treeForm.ancestors.split(',')
  847. this.$set(this,'deptType',(list[0]&&list[1]&&!list[2])?true:false);
  848. this.treeOpen = true;
  849. }else if(type == 5){
  850. //部门添加人员
  851. this.$refs.userOpen.show();
  852. }else if(type == 6){
  853. //部门删除
  854. this.$confirm('确认要删除吗?', "警告", {
  855. confirmButtonText: "确定",
  856. cancelButtonText: "取消",
  857. type: "warning"
  858. }).then(() => {
  859. // 确定
  860. delDept(self.treeForm.id).then(response => {
  861. self.delTreeForm();
  862. self.msgSuccess(response.msg)
  863. self.getTreeselect();
  864. });
  865. }).catch(function() {});
  866. }
  867. }
  868. },
  869. delTreeForm(){
  870. this.queryParams.deptId = "";
  871. this.treeForm = {
  872. id:"",
  873. parentId:null,
  874. deptName:"",
  875. ancestors:"",
  876. }
  877. },
  878. //****************************************导入功能**************************************
  879. handleAvatarSuccess(res, file) {
  880. if(res.code == 200){
  881. this.getImportData.downFile = res.data.downFile
  882. this.getImportData.successNum = res.data.successNum
  883. this.getImportData.failureNum = res.data.failureNum
  884. // this.importOpen = false;
  885. // this.getList();
  886. }else{
  887. this.msgError(res.msg);
  888. }
  889. this.loading = false;
  890. },
  891. beforeAvatarUpload(file) {
  892. let type = false;
  893. console.log('file',file);
  894. if (file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type == 'application/vnd.ms-excel') {
  895. this.getImportData.textName = file.name;
  896. type = true;
  897. this.loading = true;
  898. }else{
  899. this.$message.error('只能上传xls/xlsx格式文件');
  900. type = false;
  901. }
  902. return type;
  903. },
  904. /** 查询职位列表 */
  905. getPostionList() {
  906. allListPost().then(response => {
  907. console.log(",IIIIIIIIIIIIIIIIIIIIIIIII",response.data)
  908. this.$set(this, 'postionList', response.data)
  909. });
  910. },
  911. /** 查询学院列表 */
  912. getDeptList() {
  913. listDepartments().then(response => {
  914. this.$set(this, 'deptList', response.data)
  915. });
  916. },
  917. outPage(){
  918. this.pageType = 1;
  919. this.getList();
  920. },
  921. //新增按钮
  922. addButton(){
  923. this.pageType = 2;
  924. this.propsData = {};
  925. this.titleName = '新增教职工';
  926. this.editType = false;
  927. },
  928. //详情按钮
  929. infoButton(row){
  930. getTeacherInfo(row.userId).then(response => {
  931. this.propsData = response.data;
  932. this.titleName = '教职工详情';
  933. this.editType = true;
  934. this.pageType = 2;
  935. });
  936. },
  937. //更多选项
  938. moreClick(item){
  939. let self = this;
  940. if(item.command == 1){
  941. getTeacherInfo(item.row.userId).then(response => {
  942. this.titleName = '教职工编辑';
  943. this.propsData = response.data;
  944. this.propsData.roleIds = response.roleIds;
  945. this.editType = false;
  946. this.pageType = 2;
  947. });
  948. }else if(item.command == 2){
  949. this.$confirm('确认要删除吗?', "警告", {
  950. confirmButtonText: "确定",
  951. cancelButtonText: "取消",
  952. type: "warning"
  953. }).then(() => {
  954. // 确定
  955. delTeacher(item.row.userId).then(response => {
  956. self.msgSuccess(response.msg);
  957. self.getList();
  958. });
  959. }).catch(function() {});
  960. }else if(item.command == 3){
  961. this.userId = item.row.userId;
  962. this.reset();
  963. this.title = "重置密码";
  964. this.reviseOpen = true;
  965. }
  966. },
  967. offTeacherResetPwd(){
  968. this.$set(this,'reviseOpen',false);
  969. },
  970. teacherResetPwd(){
  971. let obj = {
  972. userId:this.userId
  973. }
  974. teacherResetPwd(obj).then(response => {
  975. this.reviseOpen = false;
  976. this.msgSuccess(response.msg);
  977. });
  978. },
  979. /*===记录勾选数据===
  980. 需要再el-table 添加 :row-key="getRowKeys"
  981. 需要在selection 添加 :reserve-selection="true"
  982. */
  983. getRowKeys(row) {
  984. return row.userId
  985. },
  986. //=========表格扩展选择器方法---结束=========
  987. /** 查询用户列表 */
  988. getList() {
  989. this.loading = true;
  990. listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  991. this.$set(this,'userList',response.rows);
  992. this.total = response.total;
  993. this.loading = false;
  994. }
  995. );
  996. },
  997. /** 查询部门下拉树结构 */
  998. getTreeselect() {
  999. let obj = {
  1000. deptName:this.inputDeptName,
  1001. }
  1002. treeselect(obj).then(response => {
  1003. this.deptOptions = response.data;
  1004. });
  1005. },
  1006. // 筛选节点
  1007. filterNode(value, data) {
  1008. if (!value) return true;
  1009. return data.label.indexOf(value) !== -1;
  1010. },
  1011. // 取消按钮
  1012. cancel() {
  1013. this.open = false;
  1014. // this.reset();
  1015. },
  1016. addReset(){
  1017. this.addForm = {
  1018. userId: undefined,
  1019. nickName: undefined,
  1020. userName: undefined,
  1021. deptId: undefined,
  1022. sex: undefined,
  1023. phonenumber: undefined,
  1024. email: undefined,
  1025. major: undefined,
  1026. grade: undefined,
  1027. category: undefined,
  1028. tutorUserId: undefined,
  1029. };
  1030. },
  1031. // 表单重置
  1032. reset() {
  1033. this.form = {
  1034. userId: undefined,
  1035. deptId: undefined,
  1036. userName: undefined,
  1037. nickName: undefined,
  1038. password: undefined,
  1039. phonenumber: undefined,
  1040. email: undefined,
  1041. sex: undefined,
  1042. status: "0",
  1043. remark: undefined,
  1044. postIds: [],
  1045. roleIds: []
  1046. };
  1047. this.resetForm("form");
  1048. },
  1049. /** 搜索按钮操作 */
  1050. handleQuery() {
  1051. this.pageType = 1;
  1052. this.queryParams.pageNum = 1;
  1053. this.$set(this,"selectedNum",0);
  1054. this.$refs.multipleTable.clearSelection()
  1055. this.getList();
  1056. },
  1057. /** 重置按钮操作 */
  1058. resetQuery() {
  1059. this.dateRange = [];
  1060. // this.resetForm("queryForm");
  1061. this.$set(this,'queryParams',{
  1062. pageNum: 1,
  1063. pageSize:20,
  1064. searchValue: "",
  1065. cardNumSimple: "",
  1066. nature: "",
  1067. isCheck: "",
  1068. });
  1069. this.handleQuery();
  1070. },
  1071. // 多选框选中数据
  1072. handleSelectionChange(selection) {
  1073. this.selectedNum = selection.length;
  1074. this.ids = selection.map(item => item.userId);
  1075. this.single = selection.length != 1;
  1076. this.multiple = !selection.length;
  1077. },
  1078. //导入页面关闭
  1079. importOpenOff(){
  1080. this.importOpen = false;
  1081. this.getImportData.downFile = false;
  1082. this.getImportData.successNum = 0;
  1083. this.getImportData.failureNum = 0;
  1084. this.getImportData.textName = "";
  1085. },
  1086. /** 导入按钮操作 */
  1087. importButton(item){
  1088. if(item.command == 1){
  1089. // 下载模板
  1090. this.download('/system/user/teacher/importTemplate', {}, `导入模板.xlsx`)
  1091. }else if(item.command == 2){
  1092. // 导入数据
  1093. console.log('导入数据');
  1094. this.importOpen = true;
  1095. }
  1096. },
  1097. /** 当前时间 */
  1098. getCurrentTime () {
  1099. const yy = new Date().getFullYear()
  1100. const mm = new Date().getMonth() + 1
  1101. const dd = new Date().getDate()
  1102. const hh = new Date().getHours()
  1103. const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  1104. const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  1105. return yy + '-' + mm + '-' + dd
  1106. },
  1107. /** 导出按钮操作 */
  1108. exportButton(item) {
  1109. let self = this;
  1110. this.currentDate=this.getCurrentTime()
  1111. if(item.command == 1){
  1112. self.$confirm(`确认导出全部数据?`, "提示", {
  1113. confirmButtonText: "确定",
  1114. cancelButtonText: "取消",
  1115. type: "warning"
  1116. }).then(async () => {
  1117. self.download('/system/user/teacher/export/', {...self.queryParams}, '教职工信息-'+this.currentDate+'.xlsx')
  1118. }).catch(() => {})
  1119. }else if(item.command == 2){
  1120. if(self.ids.length>0) {
  1121. self.$confirm(`确认导出选中数据?`, "提示", {
  1122. confirmButtonText: "确定",
  1123. cancelButtonText: "取消",
  1124. type: "warning"
  1125. }).then(async () => {
  1126. let ids = self.ids.join(',');
  1127. let obj = {
  1128. ids :ids
  1129. }
  1130. self.download(`/system/user/teacher/export/`,obj, '教职工信息-'+this.currentDate+'.xlsx')
  1131. }).catch(() => {})
  1132. }else {
  1133. Message({
  1134. message: "请选择要导出的数据",
  1135. type: 'error'
  1136. });
  1137. }
  1138. }
  1139. },
  1140. /** 下载模板操作 */
  1141. importTemplate() {
  1142. this.download('/system/user/teacher/importTemplate', {}, `导入模板.xlsx`)
  1143. },
  1144. /*下载失败列表*/
  1145. failureExcel(){
  1146. this.download('/system/user/teacher/importErrorData', {}, `失败报表.xlsx`)
  1147. },
  1148. }
  1149. };
  1150. </script>
  1151. <style scoped lang="scss">
  1152. .teacher {
  1153. display: flex!important;
  1154. flex-direction: column;
  1155. .button-box{
  1156. width:300px;
  1157. display: flex;
  1158. }
  1159. .data-max-box{
  1160. position:relative;
  1161. margin-top:-20px;
  1162. p{
  1163. margin:0;
  1164. }
  1165. .info-title-p{
  1166. line-height:80px;
  1167. font-size:18px;
  1168. padding-left:20px;
  1169. border-bottom:1px solid #E0E0E0;
  1170. margin-bottom:20px;
  1171. }
  1172. .info-data-box{
  1173. height:40px;
  1174. display:flex;
  1175. padding-left:20px;
  1176. p{
  1177. width:270px;
  1178. line-height:40px;
  1179. font-size:16px;
  1180. }
  1181. }
  1182. .reset-button-p{
  1183. position: absolute;
  1184. right:0;
  1185. top:20px;
  1186. cursor: pointer;
  1187. text-align: center;
  1188. width: 70px;
  1189. height: 40px;
  1190. line-height: 40px;
  1191. border-radius: 6px;
  1192. font-size:14px;
  1193. border: 1px solid #DCDFE6;
  1194. color: #606266;
  1195. background: #ffffff;
  1196. }
  1197. }
  1198. .data-item-max-box{
  1199. position:relative;
  1200. margin-top:-20px;
  1201. p{
  1202. margin:0;
  1203. }
  1204. .info-title-p{
  1205. line-height:80px;
  1206. font-size:18px;
  1207. padding-left:20px;
  1208. border-bottom:1px solid #E0E0E0;
  1209. }
  1210. .info-for-max-box{
  1211. .info-for-box{
  1212. width:300px;
  1213. height:163px;
  1214. border: 1px solid #E0E0E0;
  1215. border-radius: 6px;
  1216. display: inline-block;
  1217. margin:20px 20px 0;
  1218. div{
  1219. display: flex;
  1220. margin-top:25px;
  1221. p:nth-child(1){
  1222. font-size:14px;
  1223. margin-left:19px;
  1224. border-radius:4px;
  1225. padding:0 4px;
  1226. margin-right:6px;
  1227. }
  1228. p:nth-child(2){
  1229. font-size:16px;
  1230. }
  1231. }
  1232. .address-p{
  1233. font-size:14px;
  1234. height:44px;
  1235. line-height:20px;
  1236. margin-top:24px;
  1237. text-align: center;
  1238. overflow: hidden;
  1239. }
  1240. .button-p{
  1241. line-height:47px;
  1242. text-align: center;
  1243. border-top:1px solid #E0E0E0;
  1244. font-size:14px;
  1245. color:#FE3B2F;
  1246. cursor:pointer
  1247. }
  1248. }
  1249. .info-add-box{
  1250. width:300px;
  1251. height:163px;
  1252. border: 1px solid #E0E0E0;
  1253. border-radius: 6px;
  1254. margin:20px 20px 0;
  1255. cursor:pointer;
  1256. p{
  1257. line-height:163px;
  1258. text-align: center;
  1259. font-size:14px;
  1260. i{
  1261. margin-right:5px;
  1262. }
  1263. }
  1264. }
  1265. }
  1266. .reset-button-p{
  1267. position: absolute;
  1268. right:0;
  1269. top:20px;
  1270. cursor: pointer;
  1271. text-align: center;
  1272. width: 70px;
  1273. height: 40px;
  1274. line-height: 40px;
  1275. border-radius: 6px;
  1276. font-size:14px;
  1277. border: 1px solid #DCDFE6;
  1278. color: #606266;
  1279. background: #ffffff;
  1280. }
  1281. }
  1282. .teacher-one-box{
  1283. flex:1;
  1284. display: flex;
  1285. flex-direction: column;
  1286. overflow: hidden!important;
  1287. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  1288. padding:20px!important;
  1289. .top-max-box{
  1290. flex:1;
  1291. display: flex;
  1292. overflow: hidden!important;
  1293. .left-max-box{
  1294. width:326px;
  1295. display: flex;
  1296. flex-direction: column;
  1297. .top-button-max-box{
  1298. width: 306px;
  1299. height: 40px;
  1300. border: 1px dashed #0045AF;
  1301. border-radius: 10px;
  1302. margin-bottom:10px;
  1303. div{
  1304. display: inline-block;
  1305. overflow: hidden;
  1306. width:20px;
  1307. height:20px;
  1308. margin:10px 0 0 29px;
  1309. cursor: pointer;
  1310. }
  1311. div:nth-child(1){
  1312. margin-left:20px;
  1313. }
  1314. .new-button-box{
  1315. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xzxjbm.png");
  1316. }
  1317. .new-button-box:hover{
  1318. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xzxjbm_xz.png");
  1319. }
  1320. .superior-button-box{
  1321. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xs.png");
  1322. }
  1323. .superior-button-box:hover{
  1324. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xs_xz.png");
  1325. }
  1326. .down-button-box{
  1327. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xx.png");
  1328. }
  1329. .down-button-box:hover{
  1330. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_xx_xz.png");
  1331. }
  1332. .edit-button-box{
  1333. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_bj.png");
  1334. }
  1335. .edit-button-box:hover{
  1336. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_b_xz.png");
  1337. }
  1338. .add-button-box{
  1339. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_tj.png");
  1340. }
  1341. .add-button-box:hover{
  1342. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_tj_xz.png");
  1343. }
  1344. .delete-button-box{
  1345. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_shanchu.png");
  1346. }
  1347. .delete-button-box:hover{
  1348. background: url("~@/assets/ZDimages/personnelManagement/icon_jzgxx_shanchu_xz.png");
  1349. }
  1350. }
  1351. .left-input-box{
  1352. display: flex;
  1353. margin-bottom:10px;
  1354. .input-left{
  1355. flex:1;
  1356. }
  1357. .button-right{
  1358. width:60px;
  1359. font-size:14px;
  1360. line-height:40px;
  1361. margin:0 20px 0 10px;
  1362. font-weight:500;
  1363. }
  1364. }
  1365. .bottom-button-max-box{
  1366. flex:1;
  1367. }
  1368. }
  1369. .center-max-box{
  1370. border-right:2px dashed #E0E0E0;
  1371. margin-right:20px;
  1372. margin-top:20px;
  1373. }
  1374. .teacher-right-max-box{
  1375. flex:1;
  1376. display: flex;
  1377. flex-direction: column;
  1378. overflow: hidden!important;
  1379. .min-list-box{
  1380. flex: 1;
  1381. overflow: hidden!important;
  1382. display: flex;
  1383. flex-direction: column;
  1384. }
  1385. }
  1386. }
  1387. }
  1388. }
  1389. </style>
  1390. <style lang="scss">
  1391. .teacher-right-max-box{
  1392. .form-box{
  1393. .el-select{
  1394. width:90px !important;
  1395. > .el-input{
  1396. width:90px !important;
  1397. }
  1398. }
  1399. }
  1400. }
  1401. .teacher-right-max-box{
  1402. .form-box{
  1403. .form-dropdown-box{
  1404. display: flex;
  1405. margin:0;
  1406. padding:0 5px 0 0;
  1407. cursor: pointer;
  1408. height:40px;
  1409. img:nth-child(1){
  1410. width:16px;
  1411. height:16px;
  1412. margin-top:12px;
  1413. }
  1414. p{
  1415. width:47px;
  1416. text-align: center;
  1417. font-size:14px;
  1418. margin:0;
  1419. line-height:40px;
  1420. }
  1421. img:nth-child(3){
  1422. width:10px;
  1423. height:6px;
  1424. margin-top:17px;
  1425. }
  1426. }
  1427. }
  1428. }
  1429. .teacher-right-max-box{
  1430. .min-list-box{
  1431. .switch .el-switch__label {
  1432. position: absolute;
  1433. display: none;
  1434. color: #fff !important;
  1435. }
  1436. .switch .el-switch__label--right {
  1437. z-index: 1;
  1438. }
  1439. .switch .el-switch__label--right span{
  1440. margin-left: 10px;
  1441. }
  1442. .switch .el-switch__label--left {
  1443. z-index: 1;
  1444. }
  1445. .switch .el-switch__label--left span{
  1446. margin-left: 24px;
  1447. }
  1448. .switch .el-switch__label.is-active {
  1449. display: block;
  1450. }
  1451. .switch.el-switch .el-switch__core,
  1452. .el-switch .el-switch__label {
  1453. width: 64px !important;
  1454. margin: 0;
  1455. }
  1456. }
  1457. }
  1458. .teacher-revise-dialog-box{
  1459. .teacher-text-p{
  1460. margin-left:110px;
  1461. font-size:16px;
  1462. }
  1463. .teacher-revise-dialog-button-box{
  1464. display: flex;
  1465. width:190px;
  1466. margin:0 auto;
  1467. p{
  1468. margin:0;
  1469. width:70px;
  1470. height:30px;
  1471. line-height:30px;
  1472. font-size:14px;
  1473. }
  1474. p:nth-child(1){
  1475. margin-right:50px;
  1476. }
  1477. }
  1478. }
  1479. .teacher-import-dialog-box{
  1480. .teacher-import-dialog-upLoad-box{
  1481. .el-upload{
  1482. width:450px;
  1483. margin:0 55px;
  1484. .el-upload-dragger{
  1485. width:450px;
  1486. .el-icon-upload{
  1487. font-size:100px;
  1488. color:#CBE6FE;
  1489. }
  1490. .el-upload__text{
  1491. margin-top:20px;
  1492. }
  1493. }
  1494. }
  1495. .el-upload__tip{
  1496. margin-left:60px;
  1497. font-size:14px;
  1498. margin-top:10px;
  1499. }
  1500. .el-upload-text-box{
  1501. background: #F5F5F5;
  1502. border-radius: 10px;
  1503. margin:15px 30px 0;
  1504. padding:0 20px 15px;
  1505. overflow: hidden;
  1506. *{
  1507. margin:0;
  1508. }
  1509. .img-text-box{
  1510. display: flex;
  1511. margin-top:15px;
  1512. img{
  1513. width:16px;
  1514. height:16px;
  1515. margin-right:13px;
  1516. }
  1517. p{
  1518. height:16px;
  1519. line-height:16px;
  1520. font-size:12px;
  1521. }
  1522. }
  1523. .text-p{
  1524. margin-top:15px;
  1525. margin-left:29px;
  1526. height:16px;
  1527. line-height:16px;
  1528. font-size:12px;
  1529. }
  1530. }
  1531. }
  1532. .teacher-import-dialog-button-box{
  1533. display: flex;
  1534. width:190px;
  1535. margin:0 auto;
  1536. p{
  1537. width:70px;
  1538. height:30px;
  1539. line-height:30px;
  1540. font-size:14px;
  1541. margin:0 auto;
  1542. }
  1543. }
  1544. .teacher-import-dialog-position-box{
  1545. width:100%;
  1546. height:100%;
  1547. position: absolute;
  1548. top:0;
  1549. left:0;
  1550. z-index: 999;
  1551. background: rgba(255,255,255,0.4);
  1552. border-radius:20px;
  1553. }
  1554. }
  1555. .teacher-tree-dialog-box{
  1556. .teacher-tree-dialog-form-box{
  1557. }
  1558. .teacher-tree-dialog-button-box{
  1559. display: flex;
  1560. width:190px;
  1561. margin:0 auto;
  1562. p{
  1563. margin:0;
  1564. width:70px;
  1565. height:30px;
  1566. line-height:30px;
  1567. font-size:14px;
  1568. }
  1569. p:nth-child(1){
  1570. margin-right:50px;
  1571. }
  1572. }
  1573. }
  1574. </style>