index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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(3)">学时审核</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="
  63. activeBusList.businessId === items.id ? 'color:red;' : ''
  64. "
  65. @click="getapiUserList(items)"
  66. >
  67. {{ items.onlyName }}
  68. </li>
  69. <li v-if="!item.children.length" style="color: blue">
  70. 暂无选项
  71. </li>
  72. </ul>
  73. </div>
  74. </el-col>
  75. <el-col :span="12" v-if="activeBusList.businessId">
  76. <el-select
  77. v-model="activeUserid"
  78. placeholder="请选择审核人"
  79. @change="editUserList"
  80. >
  81. <el-option
  82. v-for="(item, index) in options"
  83. :key="index"
  84. :label="item.nickName"
  85. :value="item.userId"
  86. :disabled="userList1.indexOf(item.userId) !== -1"
  87. >
  88. </el-option>
  89. </el-select>
  90. <ul style="max-height: 300px; overflow: auto">
  91. <li
  92. v-for="(item, index) in userList1"
  93. :key="index"
  94. class="userName"
  95. >
  96. {{ getuserName(item) }}
  97. <i
  98. class="el-icon-error clearSty"
  99. @click="userList1.splice(index, 1)"
  100. ></i>
  101. <div style="clear: both"></div>
  102. </li>
  103. </ul>
  104. <el-select
  105. v-model="activeUserid"
  106. placeholder="请选择复审人"
  107. @change="editUserLists"
  108. >
  109. <el-option
  110. v-for="(item, index) in options"
  111. :key="index"
  112. :label="item.nickName"
  113. :value="item.userId"
  114. :disabled="userList2.indexOf(item.userId) !== -1"
  115. >
  116. </el-option>
  117. </el-select>
  118. <ul style="max-height: 300px; overflow: auto">
  119. <li
  120. v-for="(item, index) in userList2"
  121. :key="index"
  122. class="userName"
  123. >
  124. {{ getuserName(item) }}
  125. <i
  126. class="el-icon-error clearSty"
  127. @click="userList2.splice(index, 1)"
  128. ></i>
  129. <div style="clear: both"></div>
  130. </li>
  131. </ul>
  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. activeBusList: {},
  155. userList1: [],
  156. userList2: [],
  157. };
  158. },
  159. mounted() {
  160. this.getTypes();
  161. },
  162. methods: {
  163. getFist(int) {
  164. if (this.activeFist === int) {
  165. this.activeFist = "";
  166. } else {
  167. this.activeFist = int;
  168. }
  169. },
  170. submits() {
  171. if (!this.userList1.length) {
  172. this.$message.warning("请选择指派审核人");
  173. return;
  174. }
  175. if (!this.userList2.length) {
  176. this.$message.warning("请选择指派复审人");
  177. return;
  178. }
  179. /**
  180. * 提交api
  181. */
  182. let ays = {
  183. ...this.activeBusList,
  184. userList1: this.userList1,
  185. userList2: this.userList2,
  186. };
  187. console.log(ays, "数据");
  188. this.$message.success("指派成功");
  189. },
  190. editUserList(int) {
  191. this.userList1.push(int);
  192. this.activeUserid = "";
  193. },
  194. editUserLists(int) {
  195. this.userList2.push(int);
  196. this.activeUserid = "";
  197. },
  198. /**
  199. * 点击业务层次获取对应审核人
  200. */
  201. getapiUserList(item) {
  202. this.activeBusList = {
  203. educationId: item.educationId,
  204. projectId: item.projectId,
  205. businessId: item.id,
  206. };
  207. /**
  208. * 模拟数据
  209. */
  210. this.userList1 = [];
  211. this.userList2 = [];
  212. },
  213. /**
  214. * 获取教育类型及业务层次
  215. */
  216. getTypes() {
  217. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  218. this.$api.inquirebusinessList({ status: 1 }).then((result) => {
  219. result.rows.forEach((items) => {
  220. items.onlyName = items.projectName + "-" + items.businessName;
  221. res.rows.forEach((ite, ide) => {
  222. ite.onlyName = ite.educationName;
  223. ite.checked = false;
  224. if (!ite.children) {
  225. ite.children = [];
  226. }
  227. if (items.educationId === ite.id) {
  228. ite.children.push(items);
  229. }
  230. });
  231. });
  232. this.educationType = res.rows;
  233. });
  234. });
  235. this.$api.obtainUserList({ status: 1 }).then((res) => {
  236. this.options = res.rows;
  237. });
  238. },
  239. /**
  240. * 获取标题
  241. */
  242. getName(int) {
  243. var ast = "";
  244. switch (int) {
  245. case 1:
  246. ast = "填写资料审核-指派审核人";
  247. break;
  248. case 2:
  249. ast = "盖章资料审核-指派审核人";
  250. break;
  251. case 3:
  252. ast = "学时审核-指派审核人";
  253. break;
  254. default:
  255. break;
  256. }
  257. return ast;
  258. },
  259. /**
  260. * 转换审核人名字
  261. */
  262. getuserName(int) {
  263. var ast = "";
  264. for (let i = 0; i < this.options.length; i++) {
  265. if (this.options[i].userId === int) {
  266. return this.options[i].nickName;
  267. }
  268. }
  269. },
  270. getInfo(int) {
  271. this.statePop = int;
  272. this.activeFist = "";
  273. this.activeUserid = "";
  274. this.userList1 = [];
  275. this.userList2 = [];
  276. this.dialogVisible = true;
  277. },
  278. },
  279. };
  280. </script>
  281. <style lang="less" scoped>
  282. .leftBox {
  283. border: 1px solid #999;
  284. border-radius: 4px;
  285. overflow-y: auto;
  286. max-height: 400px;
  287. padding: 10px;
  288. }
  289. .floatSty {
  290. float: left;
  291. margin-right: 20px;
  292. margin-bottom: 20px;
  293. border-radius: 4px;
  294. overflow: hidden;
  295. border: 1px solid #999;
  296. .headsty {
  297. height: 30px;
  298. line-height: 30px;
  299. background-color: #eee;
  300. color: #333;
  301. text-align: center;
  302. font-size: 14px;
  303. }
  304. .dis_sty {
  305. display: flex;
  306. flex-direction: column;
  307. align-items: center;
  308. padding: 20px;
  309. .btnSty {
  310. padding: 0px 10px;
  311. height: 28px;
  312. line-height: 28px;
  313. text-align: center;
  314. border-radius: 4px;
  315. border: 1px solid #999;
  316. font-size: 14px;
  317. margin-bottom: 10px;
  318. cursor: pointer;
  319. transition: all 0.2s;
  320. &:hover {
  321. background-color: #f4f4f4;
  322. }
  323. }
  324. }
  325. }
  326. /deep/.el-button {
  327. border-radius: 8px;
  328. }
  329. /deep/.el-dialog {
  330. border-radius: 8px;
  331. .el-dialog__header {
  332. padding: 0;
  333. .hearders {
  334. height: 40px;
  335. display: flex;
  336. align-items: center;
  337. justify-content: space-between;
  338. padding: 0px 18px 0px 20px;
  339. border-bottom: 1px solid #e2e2e2;
  340. .leftTitle {
  341. font-size: 14px;
  342. font-weight: bold;
  343. color: #2f4378;
  344. }
  345. .rightBoxs {
  346. display: flex;
  347. align-items: center;
  348. img {
  349. width: 14px;
  350. height: 14px;
  351. margin-left: 13px;
  352. cursor: pointer;
  353. }
  354. }
  355. }
  356. }
  357. .el-dialog__footer {
  358. padding: 0;
  359. .dialog-footer {
  360. padding: 0px 40px;
  361. height: 70px;
  362. border-top: 1px solid #e2e2e2;
  363. display: flex;
  364. align-items: center;
  365. justify-content: flex-end;
  366. }
  367. }
  368. }
  369. .imgBox {
  370. width: 100%;
  371. // height: 210px;
  372. border: 1px solid #e2e2e2;
  373. border-radius: 8px;
  374. padding: 8px 8px 3px;
  375. display: flex;
  376. flex-direction: column;
  377. align-items: center;
  378. .imgLabel {
  379. flex: 1;
  380. width: 100%;
  381. border: 1px dotted #e2e2e2;
  382. color: #999;
  383. font-size: 14px;
  384. cursor: pointer;
  385. border-radius: 8px;
  386. .msPhoto {
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. max-width: 100%;
  391. max-height: 270px;
  392. img {
  393. max-width: 100%;
  394. max-height: 270px;
  395. }
  396. }
  397. .imgbbx {
  398. display: flex;
  399. flex-direction: column;
  400. align-items: center;
  401. justify-content: center;
  402. width: 100%;
  403. height: 100%;
  404. i {
  405. font-weight: bold;
  406. margin: 14px 0;
  407. font-size: 24px;
  408. }
  409. }
  410. }
  411. p {
  412. margin: 5px 0px;
  413. }
  414. }
  415. .userName {
  416. display: table;
  417. border-radius: 4px;
  418. border: 1px solid #999;
  419. margin: 0px 6px 6px 0px;
  420. padding: 0px 8px;
  421. height: 26px;
  422. line-height: 26px;
  423. font-size: 14px;
  424. .clearSty {
  425. color: red;
  426. cursor: pointer;
  427. font-size: 14px;
  428. }
  429. }
  430. </style>