index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item :label="$t('序号')" prop="serialNum">
  5. <el-input
  6. v-model="queryParams.serialNum"
  7. :placeholder="$t('请输入') + $t('序号')"
  8. clearable
  9. size="small"
  10. @input="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item :label="$t('课程代码')" prop="courseCode">
  14. <el-input
  15. v-model="queryParams.courseCode"
  16. :placeholder="$t('请输入') + $t('课程代码')"
  17. clearable
  18. size="small"
  19. @input="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item :label="$t('课程名称')" prop="item">
  23. <el-input
  24. v-model="queryParams.item"
  25. :placeholder="$t('请输入') + $t('课程名称')"
  26. clearable
  27. size="small"
  28. @input="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item :label="$t('参会人员名单')" prop="staffId">
  32. <el-input
  33. v-model="queryParams.staffId"
  34. :placeholder="$t('请输入') + $t('需参会人员')+ $t('空格') + $t('员工号')"
  35. clearable
  36. size="small"
  37. @input="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item :label="$t('备注')" prop="remarks">
  41. <el-input
  42. v-model="queryParams.remarks"
  43. :placeholder="$t('请输入') + $t('备注')"
  44. clearable
  45. size="small"
  46. @input="handleQuery"
  47. />
  48. </el-form-item>
  49. <el-form-item>
  50. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  51. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  52. </el-form-item>
  53. </el-form>
  54. <el-row :gutter="10" class="mb8">
  55. <el-col :span="1.5">
  56. <el-button
  57. type="primary"
  58. icon="el-icon-plus"
  59. size="mini"
  60. @click="handleAdd"
  61. v-hasPermi="['training:companylevel:add']"
  62. >{{ $t('新增') }}</el-button>
  63. </el-col>
  64. <!--<el-col :span="1.5">
  65. <el-button
  66. type="success"
  67. icon="el-icon-edit"
  68. size="mini"
  69. @click="handleDeleteAll"
  70. v-hasPermi="['training:companylevel:remove']"
  71. >清除历史参会数据</el-button>
  72. </el-col>-->
  73. <el-col :span="1.5">
  74. <el-button
  75. type="danger"
  76. icon="el-icon-delete"
  77. size="mini"
  78. :disabled="multiple"
  79. @click="handleDelete"
  80. v-hasPermi="['training:companylevel:remove']"
  81. >{{ $t('删除') }}</el-button>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-button
  85. type="info"
  86. icon="el-icon-upload2"
  87. size="mini"
  88. @click="handleImport"
  89. v-hasPermi="['training:companylevel:edit']"
  90. >{{ $t('导入培训记录') }}</el-button>
  91. </el-col>
  92. <!-- <el-col :span="1.5">-->
  93. <!-- <el-button-->
  94. <!-- type="warning"-->
  95. <!-- icon="el-icon-download"-->
  96. <!-- size="mini"-->
  97. <!-- @click="handleExport"-->
  98. <!-- >导出</el-button>-->
  99. <!-- </el-col>-->
  100. <el-col :span="1.5">
  101. <el-button
  102. type="warning"
  103. icon="el-icon-refresh"
  104. size="mini"
  105. @click="handleScore"
  106. >{{ $t('更新培训成绩') }}</el-button>
  107. </el-col>
  108. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  109. </el-row>
  110. <el-table v-loading="loading" :data="companylevelList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  111. <el-table-column type="selection" width="55" align="center" />
  112. <el-table-column :label="$t('序号')" align="center" prop="serialNum" width="70" :show-overflow-tooltip="true"/>
  113. <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" :show-overflow-tooltip="true"/>
  114. <el-table-column :label="$t('课程名称')" align="center" prop="item" width="500" :show-overflow-tooltip="true"/>
  115. <el-table-column :label="$t('频率')" align="center" prop="frequency" width="100" :show-overflow-tooltip="true" >
  116. <template slot-scope="scope">
  117. <span v-if="scope.row.frequency !== null">每{{scope.row.frequency}}年一次</span>
  118. <span v-else>一次</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column :label="$t('参会人员名单')" align="center" prop="staffId" width="400" :show-overflow-tooltip="true"/>
  122. <el-table-column :label="$t('备注')" align="center" prop="remarks" width="300" :show-overflow-tooltip="true"/>
  123. <el-table-column :label="$t('操作')" align="center" fixed="right" width="300" class-name="small-padding fixed-width">
  124. <template slot-scope="scope">
  125. <el-button
  126. size="mini"
  127. type="text"
  128. icon="el-icon-edit"
  129. @click="handleUpdate(scope.row)"
  130. v-hasPermi="['training:companylevel:edit']"
  131. >{{ $t('修改') }}</el-button>
  132. <el-button
  133. size="mini"
  134. type="text"
  135. icon="el-icon-user"
  136. @click="handleStaffmgr(scope.row)"
  137. >{{ $t('参会人员名单') }}</el-button>
  138. <el-button
  139. size="mini"
  140. type="text"
  141. icon="el-icon-delete"
  142. @click="handleDelete(scope.row)"
  143. v-hasPermi="['training:companylevel:remove']"
  144. >{{ $t('删除') }}</el-button>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <pagination
  149. v-show="total>0"
  150. :total="total"
  151. :page.sync="queryParams.pageNum"
  152. :limit.sync="queryParams.pageSize"
  153. @pagination="getList"
  154. />
  155. <!-- 添加或修改公司级培训对话框 -->
  156. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
  157. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  158. <el-form-item :label="$t('序号')" prop="serialNum">
  159. <el-input v-model="form.serialNum" :placeholder="$t('请输入') + $t('序号')" />
  160. </el-form-item>
  161. <el-form-item :label="$t('课程代码')" prop="courseCode">
  162. <el-input v-model="form.courseCode" :placeholder="$t('请输入') + $t('课程代码')" />
  163. </el-form-item>
  164. <el-form-item :label="$t('课程名称')" prop="item">
  165. <el-input v-model="form.item" :placeholder="$t('请输入') + $t('课程名称')" />
  166. </el-form-item>
  167. <el-row>
  168. <el-col :span="8">
  169. <el-form-item :label="$t('是否需要重复培训')" prop="needFrequency" label-width="125px">
  170. <el-checkbox v-model="needFrequency"></el-checkbox>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="16">
  174. <el-form-item :label="$t('频率')" prop="frequency" v-if="needFrequency === true">
  175. {{ $t('每') }}
  176. <el-input-number v-model="form.frequency" controls-position="right" :min="1" :max="10" size="mini"></el-input-number>
  177. {{ $t('年一次') }}
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. <el-form-item :label="$t('参会人员名单')" prop="staffId">
  182. <el-input v-model="form.staffId" :placeholder="$t('请输入') + $t('参会人员名单')" />
  183. </el-form-item>
  184. <el-form-item :label="$t('备注')" prop="remarks">
  185. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
  186. </el-form-item>
  187. <el-form-item :label="$t('归属部门')" prop="deptId">
  188. <treeselect v-model="form.deptId" :options="deptOptions" :placeholder="$t('请选择') + $t('归属部门')" />
  189. </el-form-item>
  190. </el-form>
  191. <div slot="footer" class="dialog-footer">
  192. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  193. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  194. </div>
  195. </el-dialog>
  196. <!-- 添加参与公司级培训人员名单对话框 -->
  197. <el-dialog v-dialogDrag :title="participantsTitle" :visible.sync="participantsOpen" width="1500px" append-to-body>
  198. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  199. <el-form-item :label="$t('序号')" prop="serialNum">
  200. <el-input v-model="form.serialNum" disabled />
  201. </el-form-item>
  202. <el-form-item :label="$t('课程代码')" prop="courseCode">
  203. <el-input v-model="form.courseCode" disabled />
  204. </el-form-item>
  205. <el-form-item :label="$t('课程名称')" prop="item">
  206. <el-input v-model="form.item" disabled />
  207. </el-form-item>
  208. <el-form-item :label="$t('实际岗位')">
  209. <el-checkbox-group v-model="checkboxPost" size="medium" @change="postChange">
  210. <el-checkbox-button v-for="post in actualpostOptions" :label="post.key" :key="post.key">{{post.label}}</el-checkbox-button>
  211. </el-checkbox-group>
  212. </el-form-item>
  213. <el-form-item :label="$t('人员姓名')">
  214. <el-select v-model="searchStaffmgr" filterable :placeholder="$t('请选择') + $t('人员')">
  215. <el-option
  216. v-for="dict in stffmgrOptions"
  217. :key="dict.staffid"
  218. :label="dict.label"
  219. :value="dict.staffid">
  220. <span style="float: left">{{ dict.label }}</span>
  221. <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
  222. </el-option>
  223. </el-select>
  224. <el-button type="primary" @click="insertSearchStaffmgr" style="margin-left: 15px;">{{ $t('添加') }}</el-button>
  225. </el-form-item>
  226. </el-form>
  227. <div class="staff_checked">
  228. <el-transfer v-model="checked" :data="stffmgrOptions" @change="staffChange" :left-default-checked="leftList" >
  229. <span slot-scope="{ option }">{{ option.label }}
  230. <span style="float: right; color: #8492a6; font-size: 12px; padding-left: 10px;padding-right: 15px;">{{ option.staffid }}</span>
  231. <span style="float: right; color: #8492a6; font-size: 12px; padding-left: 10px;">{{ option.actualpost }}</span>
  232. </span>
  233. </el-transfer>
  234. </div>
  235. <div slot="footer" class="dialog-footer">
  236. <el-button type="primary" @click="submitParticipants">{{ $t('确 定') }}</el-button>
  237. <el-button @click="cancelParticipants">{{ $t('取 消') }}</el-button>
  238. </div>
  239. </el-dialog>
  240. <!-- 用户导入对话框 -->
  241. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  242. <el-upload
  243. ref="upload"
  244. :limit="1"
  245. accept=".xlsx, .xls"
  246. :headers="upload.headers"
  247. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  248. :disabled="upload.isUploading"
  249. :on-progress="handleFileUploadProgress"
  250. :on-success="handleFileSuccess"
  251. :auto-upload="false"
  252. drag
  253. >
  254. <i class="el-icon-upload"></i>
  255. <div class="el-upload__text">
  256. {{ $t('将文件拖到此处,或') }}
  257. <em>{{ $t('点击上传') }}</em>
  258. </div>
  259. <div class="el-upload__tip" slot="tip">
  260. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  261. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  262. </div>
  263. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  264. <input name="type" :value="upload.type" hidden />
  265. </form>
  266. <div class="el-upload__tip" style="color:#ff0000" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  267. </el-upload>
  268. <div slot="footer" class="dialog-footer">
  269. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  270. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  271. </div>
  272. </el-dialog>
  273. </div>
  274. </template>
  275. <script>
  276. import { listCompanylevel, updateScore, resetCompanylevel, getCompanylevel, delCompanylevel, addCompanylevel, updateCompanylevel, exportCompanylevel, importTemplate} from "@/api/training/companylevel";
  277. import { deleteAll } from "@/api/training/participants";
  278. import { listStaffmgr } from "@/api/plant/staffmgr";
  279. import { treeselect } from "@/api/system/dept";
  280. import { getToken } from "@/utils/auth";
  281. import Treeselect from "@riophae/vue-treeselect";
  282. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  283. export default {
  284. name: "Companylevel",
  285. components: { Treeselect },
  286. data() {
  287. return {
  288. //选择人员数据
  289. checked: [],
  290. //岗位字典数据
  291. actualpostOptions: [],
  292. //人员筛选按钮选择数据
  293. checkboxPost: [],
  294. // 遮罩层
  295. loading: true,
  296. // 选中数组
  297. ids: [],
  298. // 非单个禁用
  299. single: true,
  300. // 非多个禁用
  301. multiple: true,
  302. // 显示搜索条件
  303. showSearch: false,
  304. // 总条数
  305. total: 0,
  306. // 公司级培训表格数据
  307. companylevelList: [],
  308. // 培训岗位字典
  309. positionOptions: [],
  310. //左侧选框默认选择
  311. leftList: [],
  312. // 弹出层标题
  313. title: "",
  314. participantsTitle: "",
  315. // 部门树选项
  316. deptOptions: undefined,
  317. clientHeight:300,
  318. // 是否显示弹出层
  319. open: false,
  320. participantsOpen: false,
  321. //搜索人员
  322. searchStaffmgr: "",
  323. // 用户导入参数
  324. upload: {
  325. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  326. //下载模板类型
  327. type: "companyLevelRecord",
  328. // 是否显示弹出层(用户导入)
  329. open: false,
  330. // 弹出层标题(用户导入)
  331. title: "",
  332. // 是否禁用上传
  333. isUploading: false,
  334. // 是否更新已经存在的用户数据
  335. updateSupport: 0,
  336. // 设置上传的请求头部
  337. headers: { Authorization: "Bearer " + getToken() },
  338. // 上传的地址
  339. url: process.env.VUE_APP_BASE_API + "/training/hisparticipants/importData"
  340. },
  341. // 查询参数
  342. queryParams: {
  343. pageNum: 1,
  344. pageSize: 20,
  345. serialNum: null,
  346. courseCode: null,
  347. item: null,
  348. staffId: null,
  349. remarks: null,
  350. },
  351. //人员表查询参数
  352. staffmgrQueryParams: {
  353. units: "10,18,20",
  354. actualpost: null
  355. },
  356. //人员表联查
  357. stffmgrOptions: undefined,
  358. // 表单参数
  359. form: {},
  360. //是否需要重复培训
  361. needFrequency: '',
  362. // 表单校验
  363. rules: {
  364. deptId: [
  365. { required: true, message: this.$t('部门编号') + this.$t('不能为空') , trigger: "blur" }
  366. ]
  367. }
  368. };
  369. },
  370. watch: {
  371. // 根据名称筛选部门树
  372. deptName(val) {
  373. this.$refs.tree.filter(val);
  374. }
  375. },
  376. created() {
  377. //设置表格高度对应屏幕高度
  378. this.$nextTick(() => {
  379. this.clientHeight = document.body.clientHeight -250
  380. })
  381. this.getStaffmar();
  382. this.getPost();
  383. this.getTreeselect();
  384. this.getDicts("ACTUALPOST").then(response => {
  385. this.positionOptions = response.data;
  386. });
  387. },
  388. methods: {
  389. /** 查询公司级培训列表 */
  390. getList() {
  391. this.loading = true;
  392. let _this = this
  393. listCompanylevel(this.queryParams).then(response => {
  394. this.companylevelList = response.rows;
  395. this.companylevelList.forEach(function (value,key,arr) {
  396. let stffmgrName = "";
  397. if (value.staffId != null) {
  398. let staffId = value.staffId.split(",");
  399. staffId.forEach(function (id, index) {
  400. _this.stffmgrOptions.forEach(function (item) {
  401. if (item.key === id) {
  402. if (index === 0) {
  403. stffmgrName = item.label
  404. }else {
  405. stffmgrName = stffmgrName + "," + item.label
  406. }
  407. }
  408. });
  409. });
  410. }
  411. _this.companylevelList[key].staffId = stffmgrName
  412. });
  413. this.total = response.total;
  414. this.loading = false;
  415. });
  416. },
  417. /** 查询部门下拉树结构 */
  418. getTreeselect() {
  419. treeselect().then(response => {
  420. this.deptOptions = response.data;
  421. });
  422. },
  423. // 取消按钮
  424. cancel() {
  425. this.open = false;
  426. this.reset();
  427. },
  428. // 选择参会人员取消按钮
  429. cancelParticipants() {
  430. this.participantsOpen = false;
  431. this.reset();
  432. },
  433. // 表单重置
  434. reset() {
  435. this.form = {
  436. id: null,
  437. serialNum: null,
  438. courseCode: null,
  439. item: null,
  440. staffId: null,
  441. remarks: null,
  442. delFlag: null,
  443. createrCode: null,
  444. createdate: null,
  445. updaterCode: null,
  446. updatedate: null,
  447. frequency: null,
  448. deptId: null
  449. };
  450. this.resetForm("form");
  451. },
  452. /** 搜索按钮操作 */
  453. handleQuery() {
  454. this.queryParams.pageNum = 1;
  455. this.getList();
  456. },
  457. /** 重置按钮操作 */
  458. resetQuery() {
  459. this.resetForm("queryForm");
  460. this.handleQuery();
  461. },
  462. //获取人员表
  463. getStaffmar() {
  464. listStaffmgr(this.staffmgrQueryParams).then(response => {
  465. const allData = response.rows
  466. const data = [];
  467. for (let i = 0; i < allData.length; i++) {
  468. data.push({
  469. key: allData[i].staffid,
  470. label: allData[i].name,
  471. staffid: allData[i].staffid,
  472. actualpost: this.selectDictLabel(this.positionOptions, allData[i].actualpost)
  473. });
  474. }
  475. this.stffmgrOptions = data;
  476. this.getList();
  477. })
  478. },
  479. //获取岗位字典
  480. getPost() {
  481. this.getDicts("ACTUALPOST").then(response => {
  482. const allData = response.data
  483. const data = [];
  484. for (let i = 0; i < allData.length; i++) {
  485. data.push({
  486. key: allData[i].dictValue,
  487. label: allData[i].dictLabel,
  488. });
  489. }
  490. this.actualpostOptions = data
  491. });
  492. },
  493. //选择参会人员变动
  494. staffChange() {
  495. this.form.staffId = this.checked.toString()
  496. },
  497. //岗位筛选变动
  498. postChange() {
  499. this.leftList = [];
  500. if (this.checkboxPost.length > 0) {
  501. this.staffmgrQueryParams.actualposts = this.checkboxPost.toString();
  502. this.$nextTick(() => {
  503. listStaffmgr(this.staffmgrQueryParams).then(response => {
  504. const allData = response.rows
  505. const data = [];
  506. for (let i = 0; i < allData.length; i++) {
  507. data[i] = allData[i].staffid
  508. }
  509. this.leftList = data;
  510. })
  511. })
  512. }
  513. },
  514. // 多选框选中数据
  515. handleSelectionChange(selection) {
  516. this.ids = selection.map(item => item.id)
  517. this.single = selection.length!==1
  518. this.multiple = !selection.length
  519. },
  520. /** 新增按钮操作 */
  521. handleAdd() {
  522. this.reset();
  523. this.open = true;
  524. this.needFrequency = false;
  525. this.title = this.$t('新增') + this.$t('空格') + this.$t('公司级培训');
  526. },
  527. /** 修改按钮操作 */
  528. handleUpdate(row) {
  529. this.reset();
  530. const id = row.id || this.ids
  531. getCompanylevel(id).then(response => {
  532. this.form = response.data;
  533. //是否需要重复培训内容
  534. if (this.form.frequency != null) {
  535. this.needFrequency = true;
  536. }else {
  537. this.needFrequency = false;
  538. }
  539. this.open = true;
  540. this.title = this.$t('修改') + this.$t('公司级培训');
  541. });
  542. },
  543. /** 参会人员名单按钮操作 */
  544. handleStaffmgr(row) {
  545. this.leftList = [];
  546. const id = row.id || this.ids
  547. getCompanylevel(id).then(response => {
  548. this.form = response.data;
  549. if (response.data.staffId != null) {
  550. this.checked = response.data.staffId.split(",");
  551. }else {
  552. this.checked = [];
  553. }
  554. this.participantsOpen = true;
  555. this.participantsTitle = this.$t('参加') +this.$t('空格')+ this.$t('公司级') + this.$t('空格') + this.$t('培训人员') + this.$t('空格') + this.$t('名单');
  556. });
  557. },
  558. /** 提交按钮 */
  559. submitForm() {
  560. this.$refs["form"].validate(valid => {
  561. if (valid) {
  562. if (this.needFrequency === false) {
  563. this.form.frequency = null
  564. }
  565. if (this.form.id != null) {
  566. updateCompanylevel(this.form).then(response => {
  567. this.msgSuccess(this.$t('修改成功'));
  568. this.open = false;
  569. this.getList();
  570. });
  571. } else {
  572. addCompanylevel(this.form).then(response => {
  573. this.msgSuccess(this.$t('新增成功'));
  574. this.open = false;
  575. this.getList();
  576. });
  577. }
  578. }
  579. });
  580. },
  581. /** 参会人员提交按钮 */
  582. submitParticipants() {
  583. this.$refs["form"].validate(valid => {
  584. if (valid) {
  585. updateCompanylevel(this.form).then(response => {
  586. this.msgSuccess(this.$t('修改成功'));
  587. this.participantsOpen = false;
  588. this.checkboxPost = [];
  589. this.getList();
  590. });
  591. }
  592. });
  593. },
  594. /** 参会人员人名搜索添加按钮 */
  595. insertSearchStaffmgr() {
  596. const data = [];
  597. for (let i = 0; i < this.leftList.length; i++) {
  598. data.push(this.leftList[i])
  599. }
  600. data.push(this.searchStaffmgr)
  601. this.leftList = data
  602. this.$nextTick(() => {
  603. this.searchStaffmgr = "";
  604. })
  605. },
  606. /** 删除按钮操作 */
  607. handleDelete(row) {
  608. const ids = row.id || this.ids;
  609. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  610. confirmButtonText: this.$t('确定'),
  611. cancelButtonText: this.$t('取消'),
  612. type: "warning"
  613. }).then(function() {
  614. return delCompanylevel(ids);
  615. }).then(() => {
  616. this.getList();
  617. this.msgSuccess(this.$t('删除成功'));
  618. })
  619. },
  620. /** 导出按钮操作 */
  621. handleExport() {
  622. const queryParams = this.queryParams;
  623. this.$confirm(this.$t('是否确认导出所有公司级培训数据项?'), this.$t('警告'), {
  624. confirmButtonText: this.$t('确定'),
  625. cancelButtonText: this.$t('取消'),
  626. type: "warning"
  627. }).then(function() {
  628. return exportCompanylevel(queryParams);
  629. }).then(response => {
  630. this.download(response.msg);
  631. })
  632. },
  633. /** 导入按钮操作 */
  634. handleImport() {
  635. this.upload.title = this.$t('导入培训记录');
  636. this.upload.open = true;
  637. },
  638. handleScore(){
  639. updateScore().then(response => {
  640. const allData = response
  641. this.msgSuccess(this.$t('更新成功'));
  642. })
  643. },
  644. /** 下载模板操作 */
  645. importTemplate() {
  646. this.$refs['downloadFileForm'].submit()
  647. },
  648. // 文件上传中处理
  649. handleFileUploadProgress(event, file, fileList) {
  650. this.upload.isUploading = true;
  651. },
  652. // 文件上传成功处理
  653. handleFileSuccess(response, file, fileList) {
  654. this.upload.open = false;
  655. this.upload.isUploading = false;
  656. this.$refs.upload.clearFiles();
  657. if (response.data[0] != null) {
  658. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  659. }else {
  660. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  661. }
  662. this.getList();
  663. },
  664. // 提交上传文件
  665. submitFileForm() {
  666. this.$refs.upload.submit();
  667. },
  668. //清除所有历史数据
  669. handleDeleteAll() {
  670. let _this = this
  671. this.$confirm(this.$t('是否确认重置公司级培训参会人员信息?'), this.$t('警告'), {
  672. confirmButtonText: this.$t('确定'),
  673. cancelButtonText: this.$t('取消'),
  674. type: "warning"
  675. }).then(function() {
  676. deleteAll().then(response => {
  677. resetCompanylevel(_this.form).then(response => {
  678. _this.msgSuccess(this.$t('清除成功'));
  679. _this.getList();
  680. });
  681. })
  682. })
  683. }
  684. }
  685. };
  686. </script>
  687. <style scoped>
  688. .staff_checked >>> .el-transfer-panel {
  689. width : 600px;
  690. }
  691. .el-transfer-panel__item.el-checkbox {
  692. width: 553px !important;
  693. }
  694. </style>