index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <div id="assignReviewers">
  3. <div class="floatSty">
  4. <div class="headsty">资料审核管理</div>
  5. <div class="dis_sty">
  6. <div class="btnSty" @click="getInfo(1)">资料审核</div>
  7. <!-- <div class="btnSty" @click="getInfo(2)">盖章资料审核</div> -->
  8. </div>
  9. </div>
  10. <div class="floatSty">
  11. <div class="headsty">班级管理</div>
  12. <div class="dis_sty">
  13. <div class="btnSty" @click="getInfo(2)">学时审核</div>
  14. </div>
  15. </div>
  16. <div style="clear: both"></div>
  17. <el-dialog
  18. :visible.sync="dialogVisible"
  19. width="610px"
  20. :show-close="false"
  21. :close-on-click-modal="false"
  22. >
  23. <div slot="title" class="hearders">
  24. <div class="leftTitle">{{ getName(statePop) }}</div>
  25. <div class="rightBoxs">
  26. <img
  27. src="@/assets/images/Close@2x.png"
  28. alt=""
  29. @click="dialogVisible = false"
  30. />
  31. </div>
  32. </div>
  33. <div>
  34. <el-row :gutter="20">
  35. <el-col :span="12" class="leftBox">
  36. <div
  37. v-for="(item, index) in educationType"
  38. :key="index"
  39. style="margin-bottom: 6px"
  40. >
  41. <div
  42. @click="getFist(item.id)"
  43. style="cursor: pointer; margin-bottom: 6px"
  44. >
  45. <i
  46. :class="
  47. item.id === activeFist
  48. ? 'el-icon-caret-bottom'
  49. : 'el-icon-caret-right'
  50. "
  51. ></i>
  52. {{ item.onlyName }}
  53. </div>
  54. <ul
  55. v-if="item.id === activeFist"
  56. style="margin: 0px; padding-left: 18px"
  57. >
  58. <li
  59. v-for="(items, indexs) in item.children"
  60. :key="indexs"
  61. style="margin-bottom: 4px; cursor: pointer"
  62. :style="businessId === items.id ? 'color:red;' : ''"
  63. @click="getapiUserList(items)"
  64. >
  65. {{ items.onlyName }}
  66. </li>
  67. <li v-if="!item.children.length" style="color: blue">
  68. 暂无选项
  69. </li>
  70. </ul>
  71. </div>
  72. </el-col>
  73. <el-col :span="12" v-if="businessId">
  74. <el-select
  75. v-model="activeUserid"
  76. placeholder="请选择审核人"
  77. @change="editUserList"
  78. >
  79. <el-option
  80. v-for="(item, index) in options"
  81. :key="index"
  82. :label="item.nickName"
  83. :value="item.userId"
  84. :disabled="userList1.indexOf(item.userId) !== -1"
  85. >
  86. </el-option>
  87. </el-select>
  88. <ul style="max-height: 300px; overflow: auto">
  89. <li
  90. v-for="(item, index) in userList1"
  91. :key="index"
  92. class="userName"
  93. >
  94. {{ getuserName(item) }}
  95. <i
  96. class="el-icon-error clearSty"
  97. @click="userList1.splice(index, 1)"
  98. ></i>
  99. <div style="clear: both"></div>
  100. </li>
  101. </ul>
  102. <div v-if="statePop === 2">
  103. <el-select
  104. v-model="activeUserid"
  105. placeholder="请选择复审人"
  106. @change="editUserLists"
  107. >
  108. <el-option
  109. v-for="(item, index) in options"
  110. :key="index"
  111. :label="item.nickName"
  112. :value="item.userId"
  113. :disabled="userList2.indexOf(item.userId) !== -1"
  114. >
  115. </el-option>
  116. </el-select>
  117. <ul style="max-height: 300px; overflow: auto">
  118. <li
  119. v-for="(item, index) in userList2"
  120. :key="index"
  121. class="userName"
  122. >
  123. {{ getuserName(item) }}
  124. <i
  125. class="el-icon-error clearSty"
  126. @click="userList2.splice(index, 1)"
  127. ></i>
  128. <div style="clear: both"></div>
  129. </li>
  130. </ul>
  131. </div>
  132. <div style="text-align: center">
  133. <el-button size="mini" @click="submits">确定</el-button>
  134. </div>
  135. </el-col>
  136. </el-row>
  137. </div>
  138. <span slot="footer" class="dialog-footer">
  139. <el-button @click="dialogVisible = false">取 消</el-button>
  140. </span>
  141. </el-dialog>
  142. </div>
  143. </template>
  144. <script>
  145. export default {
  146. data() {
  147. return {
  148. dialogVisible: false,
  149. statePop: "",
  150. educationType: [],
  151. options: [], //审核人列表
  152. activeUserid: "", //select的v-model绑定值
  153. activeFist: "", //当前选中教育类型ID
  154. businessId: "",
  155. userList1: [],
  156. userList2: [],
  157. };
  158. },
  159. mounted() {
  160. this.getTypes();
  161. },
  162. methods: {
  163. /**
  164. *
  165. * @param {Number} int
  166. * @remards 点击教育类型触发
  167. */
  168. getFist(int) {
  169. if (this.activeFist === int) {
  170. this.activeFist = "";
  171. } else {
  172. this.activeFist = int;
  173. }
  174. },
  175. /**
  176. * 确定提交修改
  177. */
  178. submits() {
  179. if (!this.userList1.length) {
  180. this.$message.warning("请选择指派审核人");
  181. return;
  182. }
  183. if (this.statePop === 2) {
  184. if (!this.userList2.length) {
  185. this.$message.warning("请选择指派复审人");
  186. return;
  187. }
  188. }
  189. /**
  190. * 提交api
  191. */
  192. if (this.statePop === 1) {
  193. let ays = {
  194. id: this.businessId,
  195. profileTpUserIds: this.userList1.toString(),
  196. // userList2: this.userList2,
  197. };
  198. this.$api.editcourseBusinessProfileTpUserIds(ays).then((res) => {
  199. this.$message.success("指派成功");
  200. });
  201. }
  202. if (this.statePop === 2) {
  203. let ays = {
  204. id: this.businessId,
  205. periodUserIds: this.userList1.toString(),
  206. periodConfirmUserIds: this.userList2.toString(),
  207. };
  208. this.$api.editcourseBusinessPeriodUserIds(ays).then((res) => {
  209. this.$message.success("指派成功");
  210. });
  211. }
  212. },
  213. /**
  214. *
  215. * @param {Number} int
  216. * @remards 新增审核人
  217. */
  218. editUserList(int) {
  219. this.userList1.push(int);
  220. this.activeUserid = "";
  221. },
  222. /**
  223. *
  224. * @param {Number} int
  225. * @remards 新增复审人
  226. */
  227. editUserLists(int) {
  228. this.userList2.push(int);
  229. this.activeUserid = "";
  230. },
  231. /**
  232. * 点击业务层次获取对应审核人
  233. */
  234. getapiUserList(item) {
  235. this.businessId = item.id;
  236. /**
  237. * 模拟数据
  238. */
  239. this.userList1 = [];
  240. this.userList2 = [];
  241. this.$api
  242. .inquiresystemUserbusinessPeopleList({ id: item.id })
  243. .then((res) => {
  244. this.options = res.rows;
  245. this.$api.obtainbusiness(item.id).then((result) => {
  246. if (this.statePop === 1) {
  247. if (result.data.profileTpUserIds) {
  248. this.userList1 = result.data.profileTpUserIds
  249. .split(",")
  250. .map(Number);
  251. }
  252. }
  253. if (this.statePop === 2) {
  254. if (result.data.periodUserIds) {
  255. this.userList1 = result.data.periodUserIds
  256. .split(",")
  257. .map(Number);
  258. }
  259. if (result.data.periodConfirmUserIds) {
  260. this.userList2 = result.data.periodConfirmUserIds
  261. .split(",")
  262. .map(Number);
  263. }
  264. }
  265. });
  266. });
  267. },
  268. /**
  269. * 获取教育类型及业务层次
  270. */
  271. getTypes() {
  272. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  273. this.$api.inquirebusinessList({ status: 1 }).then((result) => {
  274. result.rows.forEach((items) => {
  275. items.onlyName = items.projectName + "-" + items.businessName;
  276. res.rows.forEach((ite, ide) => {
  277. ite.onlyName = ite.educationName;
  278. ite.checked = false;
  279. if (!ite.children) {
  280. ite.children = [];
  281. }
  282. if (items.educationId === ite.id) {
  283. ite.children.push(items);
  284. }
  285. });
  286. });
  287. this.educationType = res.rows;
  288. });
  289. });
  290. },
  291. /**
  292. * 获取标题
  293. */
  294. getName(int) {
  295. var ast = "";
  296. switch (int) {
  297. case 1:
  298. ast = "资料审核-指派审核人";
  299. break;
  300. case 2:
  301. ast = "学时审核-指派审核人";
  302. break;
  303. default:
  304. break;
  305. }
  306. return ast;
  307. },
  308. /**
  309. * 转换审核人名字
  310. */
  311. getuserName(int) {
  312. var ast = "";
  313. for (let i = 0; i < this.options.length; i++) {
  314. if (this.options[i].userId === int) {
  315. return this.options[i].nickName;
  316. }
  317. }
  318. },
  319. /**
  320. *
  321. * @param {Number} int 1资料审核2学时审核
  322. * 初始化窗口数据
  323. */
  324. getInfo(int) {
  325. this.statePop = int;
  326. this.activeFist = "";
  327. this.activeUserid = "";
  328. this.businessId = "";
  329. this.userList1 = [];
  330. this.userList2 = [];
  331. this.dialogVisible = true;
  332. },
  333. },
  334. };
  335. </script>
  336. <style lang="less" scoped>
  337. .leftBox {
  338. border: 1px solid #999;
  339. border-radius: 4px;
  340. overflow-y: auto;
  341. max-height: 400px;
  342. padding: 10px;
  343. }
  344. .floatSty {
  345. float: left;
  346. margin-right: 20px;
  347. margin-bottom: 20px;
  348. border-radius: 4px;
  349. overflow: hidden;
  350. border: 1px solid #999;
  351. .headsty {
  352. height: 30px;
  353. line-height: 30px;
  354. background-color: #eee;
  355. color: #333;
  356. text-align: center;
  357. font-size: 14px;
  358. }
  359. .dis_sty {
  360. display: flex;
  361. flex-direction: column;
  362. align-items: center;
  363. padding: 20px;
  364. .btnSty {
  365. padding: 0px 10px;
  366. height: 28px;
  367. line-height: 28px;
  368. text-align: center;
  369. border-radius: 4px;
  370. border: 1px solid #999;
  371. font-size: 14px;
  372. margin-bottom: 10px;
  373. cursor: pointer;
  374. transition: all 0.2s;
  375. &:hover {
  376. background-color: #f4f4f4;
  377. }
  378. }
  379. }
  380. }
  381. /deep/.el-button {
  382. border-radius: 8px;
  383. }
  384. /deep/.el-dialog {
  385. border-radius: 8px;
  386. .el-dialog__header {
  387. padding: 0;
  388. .hearders {
  389. height: 40px;
  390. display: flex;
  391. align-items: center;
  392. justify-content: space-between;
  393. padding: 0px 18px 0px 20px;
  394. border-bottom: 1px solid #e2e2e2;
  395. .leftTitle {
  396. font-size: 14px;
  397. font-weight: bold;
  398. color: #2f4378;
  399. }
  400. .rightBoxs {
  401. display: flex;
  402. align-items: center;
  403. img {
  404. width: 14px;
  405. height: 14px;
  406. margin-left: 13px;
  407. cursor: pointer;
  408. }
  409. }
  410. }
  411. }
  412. .el-dialog__footer {
  413. padding: 0;
  414. .dialog-footer {
  415. padding: 0px 40px;
  416. height: 70px;
  417. border-top: 1px solid #e2e2e2;
  418. display: flex;
  419. align-items: center;
  420. justify-content: flex-end;
  421. }
  422. }
  423. }
  424. .imgBox {
  425. width: 100%;
  426. // height: 210px;
  427. border: 1px solid #e2e2e2;
  428. border-radius: 8px;
  429. padding: 8px 8px 3px;
  430. display: flex;
  431. flex-direction: column;
  432. align-items: center;
  433. .imgLabel {
  434. flex: 1;
  435. width: 100%;
  436. border: 1px dotted #e2e2e2;
  437. color: #999;
  438. font-size: 14px;
  439. cursor: pointer;
  440. border-radius: 8px;
  441. .msPhoto {
  442. display: flex;
  443. justify-content: center;
  444. align-items: center;
  445. max-width: 100%;
  446. max-height: 270px;
  447. img {
  448. max-width: 100%;
  449. max-height: 270px;
  450. }
  451. }
  452. .imgbbx {
  453. display: flex;
  454. flex-direction: column;
  455. align-items: center;
  456. justify-content: center;
  457. width: 100%;
  458. height: 100%;
  459. i {
  460. font-weight: bold;
  461. margin: 14px 0;
  462. font-size: 24px;
  463. }
  464. }
  465. }
  466. p {
  467. margin: 5px 0px;
  468. }
  469. }
  470. .userName {
  471. display: table;
  472. border-radius: 4px;
  473. border: 1px solid #999;
  474. margin: 0px 6px 6px 0px;
  475. padding: 0px 8px;
  476. height: 26px;
  477. line-height: 26px;
  478. font-size: 14px;
  479. .clearSty {
  480. color: red;
  481. cursor: pointer;
  482. font-size: 14px;
  483. }
  484. }
  485. </style>