mainPage.vue 20 KB

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