userPaperRecordList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <view class="registrationRecord-box">
  3. <!-- 头部筛选 -->
  4. <view class="page-head">
  5. <!-- <u-tabs :list="tablist"
  6. :itemStyle="{
  7. width: '330rpx',
  8. height: '80rpx'
  9. }"
  10. :activeStyle="{
  11. color: '#4573FC'
  12. }"
  13. lineWidth="40"
  14. lineColor="#4573FC"
  15. @click="({ index }) => {
  16. curNow = index
  17. anewQueryMyList()
  18. }">
  19. </u-tabs> -->
  20. <u-row>
  21. <u-col :span="12" style="padding: 16rpx 24rpx;">
  22. <view>
  23. <view class="input-wapper">
  24. <u--input
  25. v-model="form.queryParam"
  26. :disabled="false"
  27. :clearable="true"
  28. placeholder="请输入名称"
  29. prefixIcon="search"
  30. shape="circle"
  31. prefixIconStyle="font-size: 22px;color: #909399"
  32. inputAlign="center"
  33. fontSize="28rpx"
  34. disabledColor="#F2F2F2"
  35. border="none"
  36. :customStyle="{
  37. height: '62rpx',
  38. padding: '4rpx 28rpx',
  39. background: '#F2F2F2'
  40. }"
  41. @confirm="anewQueryMyList">
  42. </u--input>
  43. </view>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="box-container">
  49. <!-- @click="handleDetaisl(item)" -->
  50. <view class="box-body" @click="handleDetaisl(item)" v-for="(item, index) in queryMyListdata" :key="index">
  51. <u-row customStyle="margin-bottom: 0px">
  52. <u-col span="11">
  53. <view class="left">
  54. <view class="name">{{ item.name }}</view>
  55. <view class="status">
  56. <view class="time">考试成绩:{{item.score}}分,满分{{item.totalScore}}分</view>
  57. <view class="time">考试结果:{{item.viaStatusName}}</view>
  58. <view class="time">考试时间:{{item.startTime}}~{{item.endTime}}</view>
  59. <view class="time">考试用时:{{item.useTimeStr}}</view>
  60. </view>
  61. </view>
  62. </u-col>
  63. <u-icon class="arrow-right" name="arrow-right" color="#909399" size="22"></u-icon>
  64. </u-row>
  65. </view>
  66. </view>
  67. <view class="nodata-warp" v-if="!queryMyListdata.length">
  68. <image :src="$getImages('/assetsMobile/images/no-data.png')" class="nodata-image"></image>
  69. </view>
  70. <u-loadmore :status="status" />
  71. <u-toast ref="uToast" />
  72. <u-calendar :show="calendarShow" mode="range" :defaultDate="defaultDate" :maxDate="maxDate" minDate="2023-10-01"
  73. monthNum="24" @confirm="calendarChange" @close="calendarShow = false"></u-calendar>
  74. <!-- 评价 -->
  75. <!-- <tq-rate-popup ref="ratePopupRef" @confirm="(e) => { postEvaluate(e) }"></tq-rate-popup> -->
  76. </view>
  77. </template>
  78. <script>
  79. import { userPaperRecordList } from "@/api/learnMobile/index";
  80. export default {
  81. data() {
  82. return {
  83. calendarShow: false, // 日历
  84. calendarStart: this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'),// 开始时间
  85. calendarEnd: this.dayjs().subtract(0, 'day').format('YYYY-MM-DD'), // 结束时间
  86. defaultDate: [this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'), this.dayjs().subtract(0, 'day').format('YYYY-MM-DD')],
  87. maxDate: this.dayjs().add(365, 'day').format('YYYY-MM-DD'),
  88. tablist: [
  89. { name: '未作答' },
  90. { name: '已作答' },
  91. ],
  92. curNow: 0,
  93. queryMyListdata: [],
  94. form: {
  95. queryParam: '',
  96. // createTimeBegin: '',//开始时间
  97. // createTimeEnd: '', //结束时间
  98. // applyType: '',//用车类型(字典编码:matter_type)
  99. // applyTypeName: '',
  100. // flowStatus: '',//总经办部门领导审核状态:1.审核通过、2.审核不通过
  101. // flowStatusName: '',
  102. },
  103. pageIndex: 1,
  104. total: 0,
  105. status: 'nomore' //loading nomore loadmore
  106. }
  107. },
  108. onShow(option) {
  109. this.queryMyListdata = []
  110. this.pageIndex = 1
  111. this.queryMyList();
  112. },
  113. methods: {
  114. // http://tq.5000v.com:8025/workflow/mobile/dealTask?definitionId=system_cost:3:eb004fdf-4f0d-11ef-86fb-005056bb2bc2&category=undefined&taskId=&withDealTask=false&processInstanceId=61aef549-4f18-11ef-86fb-005056bb2bc2&fromMobile=true&authtoken=eyJhbGciOiJIUzUxMiJ9.eyJjbGllbnQiOiJUUS1IVy1NT0JJTEUiLCJsb2dpbl91c2VyX2tleSI6IjFkMTY1OGYzLThhOWMtNDM5Yy04Yzk3LTYwMjQyMDg2MzUyOCJ9.C0QYkgPxsjTPLOFTwrK6xjlzLLGMInzChQ7M1Rm6IupwLEI8HA1EK0HKm6y1IfWekmiybOyc3WSx838sRem-aQ
  115. handleDetaisl({ recordId }) {
  116. uni.navigateTo({
  117. url: `/learnMobile/paperList/paperQuestionInfo?recordId=${recordId}`,
  118. })
  119. },
  120. handleRestartWorkflow(instance) {
  121. // http://localhost:9529/workflow/mobile/startFlow?id=system_cost%3A1%3A0cc5fb50-3dd3-11ef-80a8-000c29425992&processInstanceId=7455d6f9-4018-11ef-80a8-000c29425992&defaultTitle=%E8%B4%B9%E7%94%A8%E6%B5%81%E7%A8%8B_admin_20240712&name=%E9%87%8D%E6%96%B0%E5%8F%91%E8%B5%B7%E3%80%90%E8%B4%B9%E7%94%A8%E6%B5%81%E7%A8%8B%E3%80%91&restart=true
  122. // instance = {
  123. // "procDefId": "system_cost:1:0cc5fb50-3dd3-11ef-80a8-000c29425992",
  124. // "companyName": "重新发起【费用流程】",
  125. // "id": "7455d6f9-4018-11ef-80a8-000c29425992"
  126. // }
  127. uni.navigateTo({
  128. url: `/pages/flow/diboot?routes=/workflow/mobile/startFlow&id=${instance.procDefId}&processInstanceId=${instance.processInstanceId}&defaultTitle=${instance.companyName}&name=${instance.companyName}&restart=true`,
  129. })
  130. },
  131. // handleTakeBack({ processInstanceId }) { //撤销
  132. // uni.showModal({
  133. // title: '',
  134. // content: `确认撤销?`,
  135. // showCancel: true,
  136. // confirmText: '确定',
  137. // success: async (res) => {
  138. // if (res.confirm) {
  139. // let { code } = await recordtaskOperate({
  140. // processInstanceId,
  141. // taskOperate: 'cancel',
  142. // validTask: false,
  143. // })
  144. // if (code == 0) {
  145. // uni.showToast({
  146. // title: '取消成功',
  147. // icon: 'none',
  148. // })
  149. // this.anewQueryMyList()
  150. // }
  151. // }
  152. // }
  153. // })
  154. // },
  155. calendarChange(e) {
  156. console.info('选择的时间', e)
  157. // 修改日期
  158. this.form.createTimeBegin = e[0]; // 开始时间
  159. this.form.createTimeEnd = e[e.length - 1]; // 结束时间
  160. this.defaultDate = [e[0], e[e.length - 1]]
  161. this.calendarShow = false;
  162. this.anewQueryMyList();
  163. },
  164. anewQueryMyList() {
  165. this.pageIndex = 1;
  166. this.queryMyListdata = [];
  167. this.queryMyList();
  168. },
  169. phoneCall(e) {
  170. uni.makePhoneCall({
  171. phoneNumber: e //仅为示例
  172. });
  173. },
  174. pointAddrParse(e) {
  175. let arr = JSON.parse(e)
  176. let arrStg = ''
  177. for (let item of arr) {
  178. arrStg += item.address + '-'
  179. }
  180. return arrStg.slice(0, -1);
  181. },
  182. sectionChange(index) {
  183. this.curNow = index;
  184. this.anewQueryMyList()
  185. },
  186. toRealMap(item) {
  187. let obj = {
  188. routeId: item.routeId,
  189. classId: item.classId,
  190. startAndEnd: item.startAndEnd
  191. }
  192. let objst = encodeURIComponent(JSON.stringify(obj))
  193. uni.navigateTo({
  194. url: '/newdriversub/setClassPlan/details?item=' + objst
  195. });
  196. },
  197. async queryMyList() {
  198. this.loading = 'loading'
  199. let { createTimeBegin, createTimeEnd } = this.form
  200. let obj = {
  201. ...this.form,
  202. page: this.pageIndex,
  203. size: 8,
  204. // createTimeBegin: createTimeBegin ? createTimeBegin + ' 00:00:00' : '',
  205. // createTimeEnd: createTimeEnd ? createTimeEnd + ' 23:59:59' : '',
  206. paperStatus: this.curNow //查询类型:作答状态:0.未作答 1.已作答
  207. }
  208. for (let key in obj) {
  209. if (obj[key] === '') delete obj[key]
  210. }
  211. let { data, code } = await userPaperRecordList(obj)
  212. if (code == "0") {
  213. let { list, total } = data
  214. this.queryMyListdata = this.queryMyListdata.concat(list)
  215. this.total = Number(total)
  216. this.loading = 'loadmore'
  217. if (this.queryMyListdata.length >= this.total) {
  218. this.status = 'nomore'
  219. }
  220. console.log('数据', this.queryMyListdata)
  221. }
  222. },
  223. // 操作
  224. // async postEvaluate(e) {
  225. // let { data, code, msg } = await evaluate(
  226. // {
  227. // evaluate: e.textarea,
  228. // evaluateScore: e.rateNum,
  229. // systemFlowVehId: e.item.id, //任务id
  230. // })
  231. // if (code == "0") {
  232. // uni.showToast({
  233. // title: msg || '评价成功',
  234. // duration: 2000
  235. // });
  236. // this.anewQueryMyList();
  237. // }
  238. // }
  239. },
  240. // 触底
  241. onReachBottom() {
  242. console.log('当前条数', this.queryMyListdata.length, '总条数', this.total)
  243. if (this.queryMyListdata.length >= this.total) return;
  244. this.pageIndex++
  245. this.queryMyList();
  246. }
  247. }
  248. </script>
  249. <style lang="scss" scoped>
  250. .registrationRecord-box {
  251. padding: 0 0 10rpx 0;
  252. overflow: unset;
  253. .page-head {
  254. background: #fff;
  255. }
  256. .bg-purple-light {
  257. word-wrap: break-word;
  258. }
  259. .list-box {
  260. border-radius: 10rpx;
  261. background: #fff;
  262. // padding: 20rpx;
  263. position: sticky;
  264. // align-items: center;
  265. // display: flex;
  266. top: 0px;
  267. width: 100%;
  268. z-index: 999;
  269. /deep/ {
  270. .u-form-item__body {
  271. padding: 0;
  272. }
  273. }
  274. }
  275. .item-list-box {
  276. padding: 10rpx 0 0 0;
  277. // background: #fff;
  278. position: relative;
  279. .info-box {
  280. margin-bottom: 20rpx;
  281. border: none;
  282. width: 100%;
  283. // border-radius: 20rpx;
  284. box-shadow: 2rpx 2rpx 5rpx rgba(169, 169, 169, 0.34901960784313724);
  285. // height: 150rpx;
  286. background-color: rgba(255, 255, 255, 1);
  287. display: flex;
  288. align-items: center;
  289. flex-wrap: wrap;
  290. padding: 20rpx;
  291. box-sizing: border-box;
  292. position: relative;
  293. font-size: 24rpx;
  294. }
  295. }
  296. }
  297. .box-container {
  298. // background: #fff;
  299. margin: 20rpx 10rpx;
  300. border-radius: 10rpx;
  301. font-size: 24rpx;
  302. .box-head {
  303. border-bottom: 1px solid #ddd;
  304. padding: 20rpx;
  305. font-weight: 700;
  306. display: flex;
  307. align-items: center;
  308. justify-content: space-between;
  309. }
  310. .box-body {
  311. background: #fff;
  312. padding: 20rpx;
  313. display: flex;
  314. align-items: center;
  315. position: relative;
  316. margin-bottom: 20rpx;
  317. // height: 180rpx;
  318. .left {
  319. display: flex;
  320. flex-direction: column;
  321. // height: 140rpx;
  322. justify-content: space-between;
  323. .name {
  324. font-size: 32rpx;
  325. font-weight: bold;
  326. }
  327. .status {
  328. // display: flex;
  329. // align-items: center;
  330. .time {
  331. margin: 10rpx 0 0 4rpx;
  332. color: #333;
  333. font-size: 24rpx;
  334. }
  335. }
  336. }
  337. .arrow-right{
  338. position: absolute;
  339. right: 10rpx;
  340. opacity: 0.6;
  341. }
  342. .nodata-image {
  343. width: 100%;
  344. height: 140rpx;
  345. }
  346. }
  347. .box-footer {
  348. border-top: 1px solid #ddd;
  349. // padding: 20rpx;
  350. }
  351. }
  352. .primary {
  353. color: $uni-color-primary;
  354. }
  355. .nodata-warp{
  356. display: flex;
  357. justify-content: center;
  358. align-items: center;
  359. padding: 100rpx 0;
  360. .nodata-image{
  361. width: 218rpx;
  362. height: 150rpx;
  363. }
  364. }
  365. </style>