mainPage.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class="page_report">
  3. <div class="report_module">
  4. <div class="introduction">
  5. <img src="@/assets/studentCase/banner.webp" />
  6. </div>
  7. <div class="module_common">
  8. <div class="module_common_title question_1">1.请填写你对各科的目标分数和目标排名。</div>
  9. <div class="module_common_content module_table">
  10. <el-table :data="tableData" border stripe align="center">
  11. <el-table-column align="center" prop="target" label="目标" width="148" v-if="tableData.length > 0"></el-table-column>
  12. <!-- 各科列 -->
  13. <el-table-column align="center" v-for="subject in subjects" :key="subject" :label="subject">
  14. <template slot-scope="scope">
  15. <template v-if="!isEdit">
  16. {{ scope.row[subject] }}
  17. </template>
  18. <el-input v-else v-model="scope.row[subject]" style="width: 100%;" @input="ValidateNumber(scope.row,subject)" />
  19. </template>
  20. </el-table-column>
  21. </el-table>
  22. </div>
  23. </div>
  24. <div class="module_common">
  25. <div class="module_common_title question_2">2.请选择你认为的第1个薄弱学科,并填写你对该学科的计划和困惑。</div>
  26. <div class="module_common_content text_padding">
  27. <div class="common_content_title">薄弱学科1</div>
  28. <div class="common_content_select">
  29. <el-select v-model="firstWeakSubject.subjectName" placeholder="请选择科目" @change="ChangeFirstWeakSubject">
  30. <el-option v-for="(item,index) in subjects" :key="`subject_1_${index}`" :label="item" :value="item"></el-option>
  31. </el-select>
  32. </div>
  33. <div class="common_content_subtitle">计划和困惑</div>
  34. <div class="common_content_text">
  35. <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="firstWeakSubject.textValue" :rows="9" maxlength="1000" show-word-limit></el-input>
  36. <template v-else>
  37. <!-- <p>一、现状分析</p> -->
  38. {{ firstWeakSubject.textValue }}
  39. </template>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="module_common">
  44. <div class="module_common_title question_3">3.请选择你认为的第2个薄弱学科,并填写你对该学科的计划和困惑。</div>
  45. <div class="module_common_content text_padding">
  46. <div class="common_content_title">薄弱学科2</div>
  47. <div class="common_content_select">
  48. <el-select v-model="secondWeakSubject.subjectName" placeholder="请选择科目" @change="ChangeSecondWeakSubject">
  49. <el-option v-for="(item,index) in subjects" :key="`subject_2_${index}`" :label="item" :value="item"></el-option>
  50. </el-select>
  51. </div>
  52. <div class="common_content_subtitle">计划和困惑</div>
  53. <div class="common_content_text">
  54. <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="secondWeakSubject.textValue" :rows="9" maxlength="1000" show-word-limit></el-input>
  55. <template v-else>
  56. <!-- <p>一、现状分析</p> -->
  57. {{ secondWeakSubject.textValue }}
  58. </template>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="module_common">
  63. <div class="module_common_title question_4">4.针对学习上的问题,你最想与哪位老师沟通?并想让老师提供什么帮助?</div>
  64. <div class="module_common_content text_padding">
  65. <div class="common_content_text">
  66. <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="needTeacherValue" :rows="9" maxlength="1000" show-word-limit></el-input>
  67. <template v-else>
  68. {{ needTeacherValue }}
  69. </template>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <GotoTop></GotoTop>
  75. </div>
  76. </template>
  77. <script>
  78. import GotoTop from '@/views/analysisReport/components/GotoTop' //分析报告页面底部回到顶部组件
  79. export default {
  80. name: 'oneStudOneCase',
  81. components: {
  82. GotoTop
  83. },
  84. data() {
  85. return {
  86. subjects:[],//科目
  87. subjectsCode:[],//科目code
  88. tableData: [],//表格数据
  89. id: '',
  90. examId: '',
  91. schoolId: '',
  92. studentName: '',
  93. studentNo: '',
  94. studentCode: '',
  95. firstWeakSubject:{
  96. subjectCode: 10,
  97. subjectName: '',
  98. textValue: ''
  99. },//第一个薄弱学科
  100. secondWeakSubject:{
  101. subjectCode: 10,
  102. subjectName: '',
  103. textValue: ''
  104. },//第二个薄弱学科
  105. needTeacherValue:'',//
  106. isEdit:false,//是否可编辑
  107. }
  108. },
  109. computed: {
  110. reportParam() {
  111. return {
  112. examId: this.$store.state.report.filterObject.examId, //考试id
  113. }
  114. },
  115. },
  116. mounted() {
  117. this.GetOneStudentOneCase();
  118. },
  119. methods: {
  120. ValidateNumber(row,subject) {
  121. // 只允许数字输入
  122. row[subject] = row[subject].replace(/[^0-9.]/g, '');
  123. },
  124. // 查询学生一生一案数据
  125. GetOneStudentOneCase() {
  126. this.$api.reportStudent.jointSchoolReport.getOneStudentOneCase(this.reportParam).then(res => {
  127. if (res.code == 200 && res.data) {
  128. const {id,examId,schoolId,studentName,studentNo,studentCode,subjectVoList,studentGoalVoList,firstWeakSubject,secondWeakSubject,needTeacherValue} = res.data;
  129. if(studentGoalVoList){
  130. const studentGoalList = studentGoalVoList || [];
  131. this.subjects = [];
  132. this.subjectsCode = [];
  133. this.tableData = [];
  134. let obj1 = {target: '目标分数'},obj2 = {target: '目标排名'};
  135. studentGoalList.forEach(item => {
  136. this.subjects.push(item.subjectName);
  137. this.subjectsCode.push(item.subjectCode);
  138. obj1[item.subjectName] = item?.goalScore || '-';
  139. obj2[item.subjectName] = item?.goalRank || '-';
  140. });
  141. this.tableData.push(obj1,obj2)
  142. }else{
  143. const subjectList = subjectVoList || [];
  144. this.subjects = [];
  145. this.subjectsCode = [];
  146. this.tableData = [];
  147. let obj1 = {target: '目标分数'},obj2 = {target: '目标排名'};
  148. subjectList.forEach(item => {
  149. this.subjects.push(item.subjectName);
  150. this.subjectsCode.push(item.subjectCode);
  151. obj1[item.subjectName] = '-';
  152. obj2[item.subjectName] = '-';
  153. });
  154. this.tableData.push(obj1,obj2)
  155. }
  156. this.id = id;
  157. this.examId = examId;
  158. this.schoolId = schoolId;
  159. this.studentName = studentName;
  160. this.studentNo = studentNo;
  161. this.studentCode = studentCode;
  162. this.firstWeakSubject = {
  163. subjectCode: firstWeakSubject?.subjectCode || '',
  164. subjectName: firstWeakSubject?.subjectName || '',
  165. textValue: firstWeakSubject?.textValue || '暂无'
  166. };//第一个薄弱学科
  167. this.secondWeakSubject = {
  168. subjectCode: secondWeakSubject?.subjectCode || '',
  169. subjectName: secondWeakSubject?.subjectName || '',
  170. textValue: secondWeakSubject?.textValue || '暂无'
  171. };//第二个薄弱学科
  172. this.needTeacherValue = needTeacherValue || '暂无';
  173. } else {
  174. this.subjects = [];//科目
  175. this.subjectsCode = [];//科目code
  176. this.tableData = [];//表格数据
  177. this.id = '';
  178. this.examId = '';
  179. this.schoolId = '';
  180. this.studentName = '';
  181. this.studentNo = '';
  182. this.studentCode = '';
  183. this.firstWeakSubject = {
  184. subjectCode: '',
  185. subjectName: '',
  186. textValue: '暂无'
  187. };//第一个薄弱学科
  188. this.secondWeakSubject = {
  189. subjectCode: '',
  190. subjectName: '',
  191. textValue: '暂无'
  192. };//第二个薄弱学科
  193. this.needTeacherValue = '暂无';
  194. }
  195. })
  196. },
  197. //编辑
  198. EditOneStudOneCase(isEdit){
  199. this.isEdit = isEdit;
  200. if(!isEdit){
  201. const studentGoalVoList = this.subjects.map((item,index)=>{
  202. return {
  203. subjectCode: this.subjectsCode[index],
  204. subjectName: item,
  205. goalScore: this.tableData[0][item],
  206. goalRank: this.tableData[1][item]
  207. }
  208. });
  209. this.$api.reportStudent.jointSchoolReport.changeOneStudentOneCase({
  210. id:this.id,
  211. examId:this.examId,
  212. schoolId:this.schoolId,
  213. studentName:this.studentName,
  214. studentNo:this.studentNo,
  215. studentCode:this.studentCode,
  216. studentGoalVoList:studentGoalVoList,
  217. firstWeakSubject:this.firstWeakSubject,
  218. secondWeakSubject:this.secondWeakSubject,
  219. needTeacherValue:this.needTeacherValue
  220. }).then(res => {
  221. if(res.code == 200){
  222. this.$message.success(res.msg);
  223. }else{
  224. this.$message.error(res.msg);
  225. }
  226. })
  227. }
  228. },
  229. ChangeFirstWeakSubject(val){
  230. const index = this.subjects.indexOf(val);
  231. this.firstWeakSubject.subjectCode = this.subjectsCode?.[index] || '';
  232. },
  233. ChangeSecondWeakSubject(val){
  234. const index = this.subjects.indexOf(val);
  235. this.secondWeakSubject.subjectCode = this.subjectsCode?.[index] || '';
  236. }
  237. }
  238. }
  239. </script>
  240. <style lang="scss" scoped>
  241. .report_module {
  242. padding: 20px;
  243. box-sizing: border-box;
  244. .introduction {
  245. width: 100%;
  246. // height: 200px;
  247. // background: url('@/assets/studentCase/banner.webp') left top no-repeat;
  248. background-size: cover;
  249. // background: linear-gradient( 281deg, #007EFF 0%, #1F8FFE 10.96%, #89C8FB 34.86%, #CFE8FE 73.44%, #E5ECFC 100%);
  250. border-radius: 20px 20px;
  251. overflow: hidden;
  252. img {
  253. width: 100%;
  254. }
  255. }
  256. .module_common {
  257. margin-top: 40px;
  258. width: 100%;
  259. padding-top: 40px;
  260. position: relative;
  261. .module_common_title {
  262. position: absolute;
  263. z-index: 2;
  264. left: 0;
  265. top: 0;
  266. font-weight: 600;
  267. font-size: 16px;
  268. line-height: 40px;
  269. color: #FFFFFF;
  270. padding-left: 24px;
  271. &.question_1 {
  272. width: 367px;
  273. height: 50px;
  274. background: url('@/assets/studentCase/question_1.webp') left top no-repeat;
  275. background-size: 100% 100%;
  276. }
  277. &.question_2 {
  278. width: 556px;
  279. height: 50px;
  280. background: url('@/assets/studentCase/question_2.webp') left top no-repeat;
  281. background-size: 100% 100%;
  282. }
  283. &.question_3 {
  284. width: 556px;
  285. height: 50px;
  286. background: url('@/assets/studentCase/question_3.webp') left top no-repeat;
  287. background-size: 100% 100%;
  288. }
  289. &.question_4 {
  290. width: 596px;
  291. height: 50px;
  292. background: url('@/assets/studentCase/question_4.webp') left top no-repeat;
  293. background-size: 100% 100%;
  294. }
  295. }
  296. .module_common_content {
  297. width: 100%;
  298. background: #F4F9FF;
  299. border-radius: 0px 10px 10px 10px;
  300. &.module_table {
  301. padding: 40px;
  302. box-sizing: border-box;
  303. :deep(.el-table) {
  304. border-radius: 6px;
  305. border: 1px solid #5AAFFF;
  306. border-right: 0px solid #5AAFFF;
  307. border-bottom: 0px solid #5AAFFF;
  308. .el-table__header th {
  309. background-color: #EEF7FF;
  310. color: #303133;
  311. font-weight: 500;
  312. font-size: 16px;
  313. .cell {
  314. color: #303133;
  315. font-weight: 500;
  316. font-size: 16px;
  317. }
  318. }
  319. .el-table__body-wrapper {
  320. table {
  321. tr {
  322. td {
  323. border-right: 1px solid #5AAFFF;
  324. border-bottom: 1px solid #5AAFFF;
  325. &:first-child{
  326. background-color: #EEF7FF;
  327. }
  328. .el-input__inner{
  329. height: 36px;
  330. line-height: 36px;
  331. font-weight: 400;
  332. font-size: 16px;
  333. color: #333333;
  334. text-align: center;
  335. }
  336. }
  337. td:nth-last-child(2) {
  338. border-right: 1px solid #5AAFFF;
  339. }
  340. td:last-child,
  341. th:last-child {
  342. border-right: 0px solid #5AAFFF;
  343. }
  344. }
  345. }
  346. }
  347. thead {
  348. color: #333333 !important;
  349. font-weight: 500;
  350. font-size: 16px;
  351. height: 50px;
  352. }
  353. .cell {
  354. font-size: 16px;
  355. color: #333333;
  356. line-height: normal !important;
  357. }
  358. .el-table__cell {
  359. padding: 0;
  360. height: 50px;
  361. }
  362. }
  363. }
  364. .el-table::before, .el-table--group::after, .el-table--border::after{
  365. background-color:#5AAFFF;
  366. }
  367. :deep(.el-table__fixed)::before, :deep(.el-table__fixed-right)::before{
  368. background-color:#5AAFFF;
  369. }
  370. :deep(.el-table--border) .el-table__cell{
  371. border-right: 1px solid #5AAFFF;
  372. }
  373. :deep(.el-table) th.el-table__cell.is-leaf, :deep(.el-table) td.el-table__cell{
  374. border-bottom: 1px solid #5AAFFF;
  375. }
  376. &.text_padding{
  377. min-height: 240px;
  378. padding: 30px 20px 20px;
  379. box-sizing: border-box;
  380. .common_content_title{
  381. display: flex;
  382. width: 100%;
  383. font-weight: 600;
  384. font-size: 16px;
  385. color: #333333;
  386. line-height: 22px;
  387. }
  388. .common_content_select{
  389. display: flex;
  390. width: 100%;
  391. margin-top: 10px;
  392. :deep(.el-input__inner){
  393. height: 36px;
  394. line-height: 36px;
  395. padding:0 12px;
  396. background-color: #F4F9FF;
  397. border-radius: 4px;
  398. border: 1px solid #DCDFE6;
  399. }
  400. :deep(.el-input__icon){
  401. line-height: 36px;
  402. }
  403. }
  404. .common_content_subtitle{
  405. display: flex;
  406. width: 100%;
  407. margin: 30px 0 10px;
  408. font-weight: 600;
  409. font-size: 16px;
  410. color: #333333;
  411. line-height: 22px;
  412. }
  413. .common_content_text{
  414. display: flex;
  415. width: 100%;
  416. flex-direction: column;
  417. :deep(.el-textarea__inner){
  418. border-radius: 10px;
  419. border: 1px solid #DCDFE6;
  420. font-weight: 400;
  421. font-size: 14px;
  422. color: #333333;
  423. line-height: 24px;
  424. }
  425. p{
  426. width: 100%;
  427. font-weight: 400;
  428. font-size: 14px;
  429. color: #333333;
  430. line-height: 24px;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. </style>