index.vue 55 KB

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