PlanUserStatus.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <div>
  3. <!---lxh-修改密码-->
  4. <div class="dig_update">
  5. <el-dialog
  6. :visible.sync="dialogVisible"
  7. :close-on-click-modal="false"
  8. width="80%"
  9. style="border-radius: 40px"
  10. >
  11. <div slot="title">
  12. <div label-width="150px" class="demo-ruleForm">
  13. <p v-if="isView" class="dig_title">进度查看</p>
  14. <p v-if="!isView" class="dig_title">编辑计划</p>
  15. <div slot=""></div>
  16. <div slot="footer"></div>
  17. <div style="margin-bottom: 20px;">
  18. <el-input v-model="studentName" clearable placeholder="请输入姓名" style="width: 200px;"></el-input
  19. >&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
  20. <el-button type="primary" round icon="el-icon-search" @click="searchTarget"
  21. >搜索</el-button
  22. >
  23. <el-button type="info" round @click="clearSearch">清空</el-button>
  24. </div>
  25. <div class="table-content">
  26. <el-table
  27. :data="tableData"
  28. :row-style="{ height: '0px' }"
  29. :cell-style="{ padding: '5px' }"
  30. :header-cell-style="{ background: '#F8F8F8', color: '#606266' }"
  31. >
  32. <el-table-column
  33. show-overflow-tooltip
  34. prop="userName"
  35. label="姓名"
  36. align="center"
  37. width=""
  38. >
  39. </el-table-column>
  40. <el-table-column prop="userNo" label="学号" align="center" width="">
  41. </el-table-column>
  42. <el-table-column
  43. prop="isComplete"
  44. label="是否已完成"
  45. :formatter="formaCom"
  46. align="center"
  47. width=""
  48. >
  49. <template slot-scope="scope">
  50. <div
  51. style="display: flex; justify-content: center; align-items: center"
  52. v-if="scope.row.isComplete == '1'"
  53. >
  54. <img
  55. style="width: 16px"
  56. src="../assets/img/home/isCom.png"
  57. alt=""
  58. />&nbsp;&nbsp;
  59. <div style="color: #00955e">已完成</div>
  60. </div>
  61. <!-- <div
  62. style="display: flex; justify-content: center; align-items: center"
  63. v-if="view.status == '进行中'"
  64. >
  65. <img
  66. style="width: 16px"
  67. src="../../../assets/img/home/isRun.png"
  68. alt=""
  69. />&nbsp;&nbsp;
  70. <div style="color: #f6cb00">进行中</div>
  71. </div> -->
  72. <div
  73. style="display: flex; justify-content: center; align-items: center"
  74. v-if="scope.row.isComplete == '0'"
  75. >
  76. <img
  77. style="width: 16px"
  78. src="../assets/img/home/isNo.png"
  79. alt=""
  80. />&nbsp;&nbsp;
  81. <div style="color: #d52121">未完成</div>
  82. </div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. prop="orgName"
  87. label="所属组织架构"
  88. align="center"
  89. width=""
  90. >
  91. </el-table-column>
  92. <el-table-column label="操作" width="" align="center" v-if="proDataLin.planStatus=='2'">
  93. <template slot-scope="scope">
  94. <div class="detail_button_out" v-show="scope.row.isComplete == '1'&&proDataLin.planStatus=='2'&&scope.row.isReset=='0'">
  95. <div class="detail_button" @click="anewStart(scope.row)">
  96. <img style="width: 18px" src="../assets/img/table/pro.png" />
  97. <span> 重新测试 </span>
  98. </div>
  99. </div>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </div>
  104. <el-pagination
  105. class="pag_class"
  106. background
  107. @size-change="handleSizeChange"
  108. @current-change="handleCurrentChange"
  109. :current-page.sync="pageNum"
  110. layout="total, sizes, prev, pager, next"
  111. :page-size="pageSize"
  112. :page-sizes="[10, 20, 50, 100]"
  113. :total="total"
  114. >
  115. </el-pagination>
  116. <div class="dig_button"></div>
  117. </div>
  118. </div>
  119. </el-dialog>
  120. <el-dialog
  121. class="dig_update"
  122. :visible.sync="resetVisible"
  123. width="30%"
  124. center
  125. style="border-radius: 40px"
  126. >
  127. <div slot="title">
  128. <div class="demo-ruleForm">
  129. <p class="dig_title">重新测试</p>
  130. <p style="margin-bottom: 40px;text-align: center;">确认重新测试吗?</p>
  131. <div class="dig_button">
  132. <el-button type="info" round @click="cancleReset()">取消</el-button>
  133. <!-- <el-button type="success" round @click="submitForm('ruleForm')"
  134. >提交</el-button
  135. > -->
  136. <el-button type="success" round @click="submitCom()">确定</el-button>
  137. </div>
  138. </div>
  139. </div>
  140. </el-dialog>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. // import { oSessionStorage } from "../../utils/utils";
  146. import { oSessionStorage } from "../utils/utils";
  147. import md5 from "md5";
  148. export default {
  149. data() {
  150. return {
  151. //学生名字
  152. studentName:'',
  153. //重新测试弹出确认框
  154. resetVisible:false,
  155. userVisible: false,
  156. //编辑返回的值
  157. userDetailData: {},
  158. //组织架构名字
  159. groupName: "",
  160. disableFlag: false,
  161. phoneFlag: false,
  162. flag: 3,
  163. dialogVisible: false,
  164. //渠道列表
  165. isView: true,
  166. //当前计划ID
  167. planId: "",
  168. userInfo: {},
  169. proDataLin: [],
  170. total: 0,
  171. pageSize: 10,
  172. pageNum: 1,
  173. tableData: [],
  174. userTotal: 0,
  175. userpageSize: 10,
  176. userPageNum: 1,
  177. userTableData: [],
  178. multipleSelection: [],
  179. userNo:''
  180. };
  181. },
  182. mounted() {
  183. this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
  184. //获取渠道信息
  185. // this.ruleForm.type = "3";
  186. },
  187. methods: {
  188. clearSearch() {
  189. this.studentName = "";
  190. //搜索的用户编号
  191. this.searchTarget();
  192. },
  193. //取消关闭重新测试框
  194. cancleReset(){
  195. //关闭弹出框
  196. this.resetVisible=false;
  197. },
  198. //提交确认框
  199. submitCom(){
  200. //提交进行重新测试
  201. //然后重新查询页面列表
  202. let url = `/record/resetUserRecord?planId=${this.proDataLin.id}&userNo=${this.userNo}`;
  203. this.$http.get(url, {}, (res) => {
  204. this.resetVisible=false;
  205. if (res && res.code == 200) {
  206. //关闭弹出框
  207. //调用列表刷线接口
  208. //
  209. this.$message.success('设置重新测试成功');
  210. this.searchList();
  211. } else {
  212. // this.$toast.fail(res.msg);
  213. this.$message.error(res.msg);
  214. }
  215. });
  216. },
  217. anewStart(val){
  218. this.userNo=val.userNo
  219. //保存选择个人的信息
  220. this.resetVisible=true;
  221. },
  222. formaCom(val) {
  223. if (val.isComplete == "0") {
  224. return "未完成";
  225. } else {
  226. return "已完成";
  227. }
  228. },
  229. deleteUser(val) {
  230. let data = [val.id];
  231. //调用接口开始添加
  232. let url = `/planUser/deletePlanUsers`;
  233. this.$http.post(url, data, (res) => {
  234. if (res && res.code == 200) {
  235. this.searchTarget();
  236. this.tableData = res.data.content;
  237. this.total = res.data.totalElements;
  238. } else {
  239. // this.$toast.fail(res.msg);
  240. this.$message.error(res.msg);
  241. }
  242. });
  243. },
  244. addUser() {
  245. this.userVisible = true;
  246. //调用待添加的用户
  247. this.userSearchTarget();
  248. },
  249. isComUser(val, row) {
  250. //添加已选用户
  251. let data = [];
  252. if (val == 1) {
  253. for (let i = 0; i < this.multipleSelection.length; i++) {
  254. //
  255. let obj = {
  256. orgName: this.multipleSelection[i].orgName,
  257. orgNo: this.multipleSelection[i].orgNo,
  258. planId: this.proDataLin.id,
  259. userName: this.multipleSelection[i].userName,
  260. userNo: this.multipleSelection[i].userNo,
  261. };
  262. data.push(obj);
  263. }
  264. } else {
  265. let obj = {
  266. orgName: row.orgName,
  267. orgNo: row.orgNo,
  268. planId: this.proDataLin.id,
  269. userName: row.userName,
  270. userNo: row.userNo,
  271. };
  272. data.push(obj);
  273. }
  274. //调用接口开始添加
  275. let url = `/planUser/savePlanUsers`;
  276. this.$http.post(url, data, (res) => {
  277. if (res && res.code == 200) {
  278. this.searchTarget();
  279. this.userSearchTarget();
  280. this.tableData = res.data.content;
  281. this.total = res.data.totalElements;
  282. } else {
  283. // this.$toast.fail(res.msg);
  284. this.$message.error(res.msg);
  285. }
  286. });
  287. },
  288. searchTarget() {
  289. this.pageNum = 1;
  290. this.searchList();
  291. },
  292. userSearchTarget() {
  293. this.userPageNum = 1;
  294. this.userSearchList();
  295. },
  296. //进来调用已选列表接口
  297. searchList() {
  298. //
  299. let url=''
  300. if(this.studentName==''){
  301. url = `/planUser/findUserProgressByPage?pageSize=${this.pageSize}&pageNum=${this.pageNum}&planId=${this.proDataLin.id}`;
  302. }else{
  303. url = `/planUser/findUserProgressByPage?pageSize=${this.pageSize}&pageNum=${this.pageNum}&planId=${this.proDataLin.id}&userName=${this.studentName}`;
  304. }
  305. this.$http.get(url, {}, (res) => {
  306. if (res && res.code == 200) {
  307. this.tableData = res.data.content;
  308. this.total = res.data.totalElements;
  309. } else {
  310. // this.$toast.fail(res.msg);
  311. this.$message.error(res.msg);
  312. }
  313. });
  314. },
  315. userSearchList() {
  316. let url = `/plan/planAddUser?pageSize=${this.userpageSize}&pageNum=${this.userPageNum}&planId=${this.proDataLin.id}&orgNo=${this.proDataLin.planOrgNo}`;
  317. this.$http.get(url, {}, (res) => {
  318. if (res && res.code == 200) {
  319. this.userTableData = res.data.content;
  320. this.userTotalotal = res.data.totalElements;
  321. } else {
  322. // this.$toast.fail(res.msg);
  323. this.$message.error(res.msg);
  324. }
  325. });
  326. },
  327. //每页多少条
  328. handleSizeChange(val) {
  329. //将首页重置为1时---且总条数变化
  330. //设置为当前总条数
  331. this.pageSize = val;
  332. this.searchList();
  333. },
  334. handleCurrentChange(val) {
  335. this.pageNum = val;
  336. this.searchList();
  337. },
  338. //已选选项
  339. handleSelectionChange(val) {
  340. this.multipleSelection = val;
  341. },
  342. resetForm(val) {
  343. this.cancle();
  344. },
  345. formatterTime(val) {
  346. let date = new Date(val);
  347. let year = date.getFullYear();
  348. let month = date.getMonth() + 1;
  349. month = this.formatterMon(month);
  350. let day = date.getDate();
  351. day = this.formatterMon(day);
  352. return year + "-" + month + "-" + day;
  353. },
  354. formatterMon(val) {
  355. if (val < 10) {
  356. return "0" + val;
  357. } else {
  358. return val;
  359. }
  360. },
  361. open(val) {
  362. // this.searchTarget();
  363. this.proDataLin = val;
  364. this.dialogVisible = true;
  365. this.searchTarget();
  366. },
  367. edit(val) {
  368. this.dialogVisible = true;
  369. this.isView = false;
  370. this.userDetailData = val;
  371. //调用查询详情的接口
  372. },
  373. //调用查询详情的接口
  374. disableFlagStatus() {
  375. setTimeout(() => {
  376. this.disableFlag = false;
  377. }, 1500);
  378. },
  379. register() {
  380. let that = this;
  381. this.$http.post(`/plan/addOrUpdate`, {}, (res) => {
  382. this.disableFlagStatus();
  383. // this.disableFlag = false;
  384. if (res && res.code == 200) {
  385. this.dialogVisible = false;
  386. // this.$toast.success({ message: "成功" });
  387. //调用父组件的查询方法
  388. that.$emit("search");
  389. } else {
  390. // this.$toast.fail({ message: res.msg });
  391. this.$message.error(res.msg);
  392. }
  393. //清空缓存
  394. this.cancle();
  395. });
  396. },
  397. },
  398. };
  399. </script>
  400. <style lang="less" scoped>
  401. .dig_update /deep/.el-cascader {
  402. position: relative;
  403. font-size: 14px;
  404. line-height: 40px;
  405. width: 100%;
  406. }
  407. .dig_update /deep/.el-dialog {
  408. box-shadow: none !important;
  409. background: transparent !important;
  410. }
  411. .demo-ruleForm /deep/ .el-form-item {
  412. margin-right: 10px;
  413. vertical-align: top;
  414. display: flex !important;
  415. flex-direction: column;
  416. }
  417. .demo-ruleForm /deep/.el-form-item__label {
  418. text-align: left;
  419. vertical-align: middle;
  420. float: left;
  421. font-size: 14px;
  422. color: #606266;
  423. line-height: 40px;
  424. padding: 0 12px 0 0;
  425. -webkit-box-sizing: border-box;
  426. box-sizing: border-box;
  427. }
  428. .demo-ruleForm /deep/.el-input {
  429. // width: 100% !important;
  430. }
  431. .demo-ruleForm /deep/.el-input__inner {
  432. width: 100% !important;
  433. background-color: #f7f7f7;
  434. border: 0px;
  435. }
  436. .dig_button {
  437. display: flex;
  438. width: 100%;
  439. justify-content: space-around;
  440. }
  441. .demo-ruleForm {
  442. background-color: #ffffff;
  443. // border-radius: 20px;
  444. margin-right: -10px;
  445. margin-top: -10px;
  446. padding-right: 100px;
  447. padding-left: 100px;
  448. border-radius: 20px;
  449. padding-top: 20px;
  450. padding-bottom: 40px;
  451. .dig_title {
  452. margin-bottom: 30px;
  453. text-align: center;
  454. font-weight: 700;
  455. }
  456. }
  457. .detail_button_out {
  458. display: flex;
  459. justify-content: center;
  460. .detail_button {
  461. display: flex;
  462. // margin-left: 20px;
  463. align-items: center;
  464. cursor: pointer;
  465. letter-spacing: 2px;
  466. img {
  467. width: 15px;
  468. margin-right: 5px;
  469. }
  470. span {
  471. color: #00bf78;
  472. // font-weight: 600;
  473. }
  474. }
  475. }
  476. </style>