25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PartyevaluateTopicZP.vue 9.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <view v-if="ready" class="box" style="padding-top: 0; ">
  3. <view class="contents">
  4. <view class="progress">
  5. <view class="shade" :style="{width:100/total*(num+1)+'%'}"></view>
  6. <p></p>
  7. <b>{{total}}</b>
  8. </view>
  9. <view class="topic">
  10. <view class="title">
  11. <p><span>{{num+1}}</span></p>
  12. <div> {{ data[num].Assessment }} <span> ( {{data[num].scorePre}}分 ) </span></div>
  13. </view>
  14. <view class="topicCon">
  15. <h1>{{data[num].ConductRequirements}}</h1>
  16. <p>{{data[num].CRRemark}}</p>
  17. <ul>
  18. <li><b>{{data[num].gradetitle}}</b><span>({{data[num].gradenum}})</span></li>
  19. <p>{{data[num].ScoringCriteria}}</p>
  20. </ul>
  21. </view>
  22. <view class="footer">
  23. <ol>
  24. <li>分值:<span class="scorenum">{{data[num].MaxScore}}</span></li>
  25. <li>
  26. <!-- <input type="text" class="inputvalue" id="inputvalue" value=""+{{data[num].Score}}+""> -->
  27. <l-input
  28. @input="setValue('', $event)"
  29. :value="getValue('')"
  30. class="inputvalue"
  31. id="inputvalue"
  32. style="min-height: 48rpx;text-align: center;border-bottom: none;padding-right: 45%;"
  33. type="number"
  34. />
  35. </li>
  36. </ol>
  37. <view class="buttons">
  38. <p class="last" @click="action('last')" v-if="lastIf">上一题</p>
  39. <view style="width: 10px;"></view>
  40. <p class="next" @click="action('next')" v-if="nextIf">下一题</p>
  41. </view>
  42. <view class="lookButton" >
  43. <p @click="action('seeTotal')" v-if="seeTotalIf">查看总分</p>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. /*
  52. * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
  53. * Copyright (c) 2013-2020 上海力软信息技术有限公司
  54. * 创建人:超级管理员
  55. * 日 期:2020-10-20 09:37
  56. * 描 述:班级工作记事
  57. */
  58. /**
  59. * 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
  60. * 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
  61. * { "path": "pages/partyevaluatzp/single", "style": { "navigationBarTitleText": "表单详情页" } }
  62. *
  63. * (navigationBarTitleText 字段为本页面的标题文本,可以修改)
  64. * (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
  65. */
  66. import get from 'lodash/get'
  67. import set from 'lodash/set'
  68. import moment from 'moment'
  69. import customPageMixins from '@/common/custompage.js'
  70. export default {
  71. mixins: [customPageMixins],
  72. data() {
  73. return {
  74. // 页面相关参数
  75. ScoreYear: null,
  76. ScoreQuarter: null,
  77. ready: false,
  78. seeTotalIf:false,
  79. lastIf:true,
  80. nextIf:true,
  81. //题目数据
  82. data:[],
  83. //题目分值数据
  84. valList:[],
  85. //题目总数量
  86. total:0,
  87. //当前题目
  88. num:0,
  89. }
  90. },
  91. async onLoad({ ScoreYear, ScoreQuarter }) {
  92. await this.init(ScoreYear, ScoreQuarter)
  93. },
  94. methods: {
  95. // 页面初始化
  96. async init(ScoreYear, ScoreQuarter) {
  97. this.LOADING('加载数据中...')
  98. this.ScoreYear = ScoreYear
  99. this.ScoreQuarter = ScoreQuarter
  100. //请求题目数据
  101. const result = await this.HTTP_GET(
  102. 'learun/adms/evaluatingindicator/getevaluationlistforzp',
  103. {
  104. ScoreYear:this.ScoreYear,
  105. ScoreQuarter:this.ScoreQuarter,
  106. BeAssessed: this.GET_GLOBAL('loginUser').account
  107. },
  108. '加载数据时出错'
  109. )
  110. if (!result) { return }
  111. this.data=result
  112. this.total=result.length
  113. result.forEach((item)=>{this.valList.push(item.Score)})
  114. //计算显示按钮
  115. await this.calcShowBtn()
  116. this.ready = true
  117. this.HIDE_LOADING()
  118. },
  119. //计算显示按钮
  120. async calcShowBtn(){
  121. if(this.num < this.total-1){
  122. this.nextIf=true;
  123. this.seeTotalIf=false;
  124. }else{
  125. this.nextIf=false;
  126. this.seeTotalIf=true;
  127. }
  128. if(this.num <= 0){
  129. this.lastIf=false;
  130. }else{
  131. this.lastIf=true;
  132. }
  133. },
  134. // 点击 「查看总分」、「上一题」、「下一题」、 按钮
  135. async action(type) {
  136. switch (type) {
  137. case 'seeTotal':
  138. if(this.getValue() == ""){
  139. this.TOAST("分数不能为空!");
  140. return
  141. }
  142. if(this.getValue() > this.data[this.num].MaxScore){
  143. this.TOAST("分数不能大于最大值!");
  144. return
  145. }
  146. this.NAV_TO(`./AnswerTotalZP?sumScore=${this.sum(this.valList)}&data=${JSON.stringify(this.data)}`)
  147. break
  148. case 'last':
  149. this.num--
  150. await this.calcShowBtn()
  151. break
  152. case 'next':
  153. if(this.getValue() == ""){
  154. this.TOAST("分数不能为空!");
  155. return
  156. }
  157. if(this.getValue() > this.data[this.num].MaxScore){
  158. this.TOAST("分数不能大于最大值!");
  159. return
  160. }
  161. this.num++
  162. await this.calcShowBtn()
  163. break
  164. default: break
  165. }
  166. },
  167. // 获取表单值
  168. getValue(path) {
  169. return this.data[this.num].Score;
  170. }, // 设置表单值
  171. setValue(path, val) {
  172. this.data[this.num].Score=val;
  173. this.valList[this.num]=val;
  174. // console.log(this.data);
  175. // console.log(this.valList);
  176. },
  177. // 计算数组和
  178. sum(arr) {
  179. var s = 0;
  180. for (var i=arr.length-1; i>=0; i--) {
  181. s += Number(arr[i]);
  182. }
  183. return s;
  184. },
  185. }
  186. }
  187. </script>
  188. <style lang="less">
  189. uni-page-body{
  190. height: 100%;
  191. }
  192. ul,
  193. ol,
  194. li {
  195. list-style: none;
  196. padding: 0;
  197. margin: 0;
  198. }
  199. .box{
  200. height: 100%;
  201. width: 100%;
  202. background: url(../../common/images/content.png);
  203. background-repeat: no-repeat;
  204. background-size: 100% 100%;
  205. }
  206. .contents {
  207. position: relative;
  208. top: 300rpx;
  209. width: 93%;
  210. margin: 0 auto;
  211. }
  212. .progress {
  213. height: 65rpx;
  214. position: relative;
  215. }
  216. .progress p {
  217. height: 15rpx;
  218. width: 100%;
  219. background-color: #EFEFEF;
  220. position: absolute;
  221. top: 50%;
  222. left: 50%;
  223. transform: translate(-50%, -50%);
  224. opacity: .3;
  225. }
  226. .progress .shade {
  227. height: 25rpx;
  228. width: 10%;
  229. position: absolute;
  230. top: 50%;
  231. left: 0%;
  232. transform: translate(0%, -50%);
  233. background: url(../../common/images/jd.png);
  234. background-size: 100% 100%;
  235. border-radius: 100rpx;
  236. }
  237. .progress b {
  238. position: absolute;
  239. width: 95rpx;
  240. height: 60rpx;
  241. border-top-left-radius: 100rpx;
  242. border-bottom-left-radius: 100rpx;
  243. background-color: #f4df81;
  244. background-image: linear-gradient(#f4df81, #d19f31);
  245. top: 0;
  246. right: -3.7%;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. color: #FFFFFF;
  251. font-size: 36rpx;
  252. }
  253. .topic {
  254. position: relative;
  255. background-color: #FFFFFF;
  256. border-radius: 50rpx;
  257. margin-top: 70rpx;
  258. }
  259. .title>div {
  260. height: 75rpx;
  261. width: 75%;
  262. margin: 0 auto;
  263. background: #FFFFFF;
  264. border-radius: 40rpx;
  265. line-height: 75rpx;
  266. font-size: 24rpx;
  267. color: #404040;
  268. text-align: center;
  269. font-weight: 800;
  270. position: absolute;
  271. top: -4%;
  272. left: 52%;
  273. transform: translate(-50%, 0%);
  274. box-shadow: #d6d4d4 0rpx 12rpx 40rpx 10rpx; //边框阴影
  275. }
  276. .title>div span {
  277. color: #a6a6a6;
  278. }
  279. .title>p {
  280. background-color: #FFFFFF;
  281. height: 115rpx;
  282. width: 115rpx;
  283. border-radius: 50%;
  284. position: absolute;
  285. top: -7%;
  286. left: 70rpx;
  287. z-index: 90;
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. box-shadow: #d6d4d4 0rpx 12rpx 40rpx 10rpx; //边框阴影
  292. }
  293. .title>p span {
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. height: 80rpx;
  298. width: 80rpx;
  299. border: 12rpx solid #e17465;
  300. border-radius: 50%;
  301. font-size: 40rpx;
  302. }
  303. .topicCon {
  304. padding-top: 90rpx;
  305. margin-bottom: 20rpx;
  306. padding: 0 50rpx;
  307. padding-top: 100rpx;
  308. }
  309. .topicCon h1 {
  310. font-size: 36rpx;
  311. color: #404040;
  312. }
  313. .topicCon p {
  314. font-size: 28rpx;
  315. color: #404040;
  316. line-height: 2;
  317. }
  318. .topicCon ul {
  319. background: #efefef;
  320. border-radius: 16rpx;
  321. padding: 30rpx;
  322. margin-top: 40rpx;
  323. }
  324. .topicCon ul li b {
  325. font-size: 24rpx;
  326. color: #404040;
  327. font-weight: 800;
  328. margin-right: 20rpx;
  329. }
  330. .topicCon ul li span {
  331. font-size: 28rpx;
  332. color: #404040;
  333. }
  334. .topicCon ul p {
  335. font-size: 24rpx;
  336. color: #404040;
  337. }
  338. .footer {
  339. border-top: 4rpx solid #efefef;
  340. padding: 50rpx;
  341. }
  342. .footer ol {
  343. border: 2rpx solid #c8c8c8;
  344. border-radius: 16rpx;
  345. display: flex;
  346. justify-content: flex-start;
  347. align-items: center;
  348. height: 80rpx;
  349. color: #404040;
  350. font-size: 24rpx;
  351. margin-bottom: 40rpx;
  352. }
  353. .footer ol li {
  354. height: 50rpx;
  355. width: 100%;
  356. display: flex;
  357. align-items: center;
  358. justify-content: center;
  359. }
  360. .footer ol li span {
  361. color: #be1211;
  362. }
  363. .footer ol li:first-child {
  364. width: 30%;
  365. border-right: 2rpx solid #c8c8c8;
  366. }
  367. .footer ol li input {
  368. width: 100%;
  369. height: 40rpx;
  370. border: none;
  371. font-size: 32rpx;
  372. text-align: center;
  373. outline: none;
  374. padding: 0;
  375. margin: 0;
  376. }
  377. .buttons {
  378. display: flex;
  379. justify-content: space-around;
  380. align-items: center;
  381. height: 80rpx;
  382. margin-top: 35rpx;
  383. margin-bottom: 20rpx;
  384. }
  385. .buttons p {
  386. border: 4rpx solid #e1bb53;
  387. border-radius: 50rpx;
  388. font-size: 36rpx;
  389. color: #FFFFFF;
  390. width: 40%;
  391. height: 72rpx;
  392. display: flex;
  393. justify-content: space-around;
  394. align-items: center;
  395. color: #e1bb53;
  396. flex: 1;
  397. }
  398. .buttons p:hover {
  399. background-color: #e1bb53;
  400. color: #FFFFFF;
  401. }
  402. .lookButton p {
  403. background-color: #e1bb53;
  404. margin: 0 auto;
  405. color: #FFFFFF;
  406. border-radius: 50rpx;
  407. font-size: 36rpx;
  408. color: #FFFFFF;
  409. //width: 80%;
  410. height: 80rpx;
  411. text-align: center;
  412. line-height: 80rpx;
  413. // display: none;
  414. }
  415. .homebuttom {
  416. background-color: #e1bb53;
  417. color: #FFFFFF !important;
  418. }
  419. </style>