index.vue 13 KB

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