record.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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. <view class="name">{{ item.materialName }}</view>
  52. <view class="time">学习时间:{{ item.timeStr }}</view>
  53. <view class="time">学习用时:{{ item.useTimeStr }}</view>
  54. </view>
  55. </view>
  56. <view class="nodata-warp" v-if="!queryMyListdata.length">
  57. <image :src="$getImages('/assetsMobile/images/no-data.png')" class="nodata-image"></image>
  58. </view>
  59. <u-loadmore :status="status" />
  60. <u-toast ref="uToast" />
  61. <u-calendar :show="calendarShow" mode="range" :defaultDate="defaultDate" :maxDate="maxDate" minDate="2023-10-01"
  62. monthNum="24" @confirm="calendarChange" @close="calendarShow = false"></u-calendar>
  63. <!-- 评价 -->
  64. <!-- <tq-rate-popup ref="ratePopupRef" @confirm="(e) => { postEvaluate(e) }"></tq-rate-popup> -->
  65. </view>
  66. </template>
  67. <script>
  68. import { userMaterialRecord } from "@/api/learnMobile/index";
  69. export default {
  70. data() {
  71. return {
  72. calendarShow: false, // 日历
  73. calendarStart: this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'),// 开始时间
  74. calendarEnd: this.dayjs().subtract(0, 'day').format('YYYY-MM-DD'), // 结束时间
  75. defaultDate: [this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'), this.dayjs().subtract(0, 'day').format('YYYY-MM-DD')],
  76. maxDate: this.dayjs().add(365, 'day').format('YYYY-MM-DD'),
  77. tablist: [
  78. { name: '未学习' },
  79. { name: '已学习' },
  80. ],
  81. curNow: 0,
  82. queryMyListdata: [],
  83. form: {
  84. queryParam: '',
  85. // createTimeBegin: '',//开始时间
  86. // createTimeEnd: '', //结束时间
  87. // applyType: '',//用车类型(字典编码:matter_type)
  88. // applyTypeName: '',
  89. // flowStatus: '',//总经办部门领导审核状态:1.审核通过、2.审核不通过
  90. // flowStatusName: '',
  91. },
  92. pageIndex: 1,
  93. total: 0,
  94. status: 'nomore' //loading nomore loadmore
  95. }
  96. },
  97. onShow(option) {
  98. this.queryMyListdata = []
  99. this.pageIndex = 1
  100. this.queryMyList();
  101. },
  102. methods: {
  103. // 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
  104. handleDetaisl({ id }) {
  105. uni.navigateTo({
  106. url: `/learnMobile/userMaterialRecord/details?id=` + id,
  107. })
  108. },
  109. handleRestartWorkflow(instance) {
  110. // 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
  111. // instance = {
  112. // "procDefId": "system_cost:1:0cc5fb50-3dd3-11ef-80a8-000c29425992",
  113. // "companyName": "重新发起【费用流程】",
  114. // "id": "7455d6f9-4018-11ef-80a8-000c29425992"
  115. // }
  116. uni.navigateTo({
  117. url: `/pages/flow/diboot?routes=/workflow/mobile/startFlow&id=${instance.procDefId}&processInstanceId=${instance.processInstanceId}&defaultTitle=${instance.companyName}&name=${instance.companyName}&restart=true`,
  118. })
  119. },
  120. // handleTakeBack({ processInstanceId }) { //撤销
  121. // uni.showModal({
  122. // title: '',
  123. // content: `确认撤销?`,
  124. // showCancel: true,
  125. // confirmText: '确定',
  126. // success: async (res) => {
  127. // if (res.confirm) {
  128. // let { code } = await recordtaskOperate({
  129. // processInstanceId,
  130. // taskOperate: 'cancel',
  131. // validTask: false,
  132. // })
  133. // if (code == 0) {
  134. // uni.showToast({
  135. // title: '取消成功',
  136. // icon: 'none',
  137. // })
  138. // this.anewQueryMyList()
  139. // }
  140. // }
  141. // }
  142. // })
  143. // },
  144. calendarChange(e) {
  145. console.info('选择的时间', e)
  146. // 修改日期
  147. this.form.createTimeBegin = e[0]; // 开始时间
  148. this.form.createTimeEnd = e[e.length - 1]; // 结束时间
  149. this.defaultDate = [e[0], e[e.length - 1]]
  150. this.calendarShow = false;
  151. this.anewQueryMyList();
  152. },
  153. anewQueryMyList() {
  154. this.pageIndex = 1;
  155. this.queryMyListdata = [];
  156. this.queryMyList();
  157. },
  158. phoneCall(e) {
  159. uni.makePhoneCall({
  160. phoneNumber: e //仅为示例
  161. });
  162. },
  163. pointAddrParse(e) {
  164. let arr = JSON.parse(e)
  165. let arrStg = ''
  166. for (let item of arr) {
  167. arrStg += item.address + '-'
  168. }
  169. return arrStg.slice(0, -1);
  170. },
  171. sectionChange(index) {
  172. this.curNow = index;
  173. this.anewQueryMyList()
  174. },
  175. toRealMap(item) {
  176. let obj = {
  177. routeId: item.routeId,
  178. classId: item.classId,
  179. startAndEnd: item.startAndEnd
  180. }
  181. let objst = encodeURIComponent(JSON.stringify(obj))
  182. uni.navigateTo({
  183. url: '/newdriversub/setClassPlan/details?item=' + objst
  184. });
  185. },
  186. async queryMyList() {
  187. this.loading = 'loading'
  188. let { createTimeBegin, createTimeEnd } = this.form
  189. let obj = {
  190. ...this.form,
  191. page: this.pageIndex,
  192. size: 8,
  193. // createTimeBegin: createTimeBegin ? createTimeBegin + ' 00:00:00' : '',
  194. // createTimeEnd: createTimeEnd ? createTimeEnd + ' 23:59:59' : '',
  195. learnStatus: this.curNow //查询类型:学习状态:0.未学习 1.已学习
  196. }
  197. for (let key in obj) {
  198. if (obj[key] === '') delete obj[key]
  199. }
  200. let { data, code } = await userMaterialRecord(obj)
  201. if (code == "0") {
  202. let { list, total } = data
  203. this.queryMyListdata = this.queryMyListdata.concat(list)
  204. this.total = Number(total)
  205. this.loading = 'loadmore'
  206. if (this.queryMyListdata.length >= this.total) {
  207. this.status = 'nomore'
  208. }
  209. console.log('数据', this.queryMyListdata)
  210. }
  211. },
  212. // 操作
  213. // async postEvaluate(e) {
  214. // let { data, code, msg } = await evaluate(
  215. // {
  216. // evaluate: e.textarea,
  217. // evaluateScore: e.rateNum,
  218. // systemFlowVehId: e.item.id, //任务id
  219. // })
  220. // if (code == "0") {
  221. // uni.showToast({
  222. // title: msg || '评价成功',
  223. // duration: 2000
  224. // });
  225. // this.anewQueryMyList();
  226. // }
  227. // }
  228. },
  229. // 触底
  230. onReachBottom() {
  231. console.log('当前条数', this.queryMyListdata.length, '总条数', this.total)
  232. if (this.queryMyListdata.length >= this.total) return;
  233. this.pageIndex++
  234. this.queryMyList();
  235. }
  236. }
  237. </script>
  238. <style lang="scss" scoped>
  239. .registrationRecord-box {
  240. padding: 0 0 10rpx 0;
  241. overflow: unset;
  242. .page-head {
  243. background: #fff;
  244. }
  245. .bg-purple-light {
  246. word-wrap: break-word;
  247. }
  248. .list-box {
  249. border-radius: 10rpx;
  250. background: #fff;
  251. // padding: 20rpx;
  252. position: sticky;
  253. // align-items: center;
  254. // display: flex;
  255. top: 0px;
  256. width: 100%;
  257. z-index: 999;
  258. /deep/ {
  259. .u-form-item__body {
  260. padding: 0;
  261. }
  262. }
  263. }
  264. .item-list-box {
  265. padding: 10rpx 0 0 0;
  266. // background: #fff;
  267. position: relative;
  268. .info-box {
  269. margin-bottom: 20rpx;
  270. border: none;
  271. width: 100%;
  272. // border-radius: 20rpx;
  273. box-shadow: 2rpx 2rpx 5rpx rgba(169, 169, 169, 0.34901960784313724);
  274. // height: 150rpx;
  275. background-color: rgba(255, 255, 255, 1);
  276. display: flex;
  277. align-items: center;
  278. flex-wrap: wrap;
  279. padding: 20rpx;
  280. box-sizing: border-box;
  281. position: relative;
  282. font-size: 24rpx;
  283. }
  284. }
  285. }
  286. .box-container {
  287. background: #fff;
  288. margin: 20rpx 10rpx;
  289. border-radius: 10rpx;
  290. font-size: 24rpx;
  291. .box-head {
  292. border-bottom: 1px solid #ddd;
  293. padding: 20rpx;
  294. font-weight: 700;
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. }
  299. .box-body {
  300. padding:32rpx 20rpx;
  301. // display: flex;
  302. // align-items: center;
  303. position: relative;
  304. .name {
  305. font-size: 36rpx;
  306. font-weight: bolder;
  307. }
  308. .time {
  309. color: #333;
  310. margin-top: 8rpx;
  311. font-size: 28;
  312. }
  313. }
  314. .box-footer {
  315. border-top: 1px solid #ddd;
  316. // padding: 20rpx;
  317. }
  318. }
  319. .primary {
  320. color: $uni-color-primary;
  321. }
  322. .nodata-warp{
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. padding: 100rpx 0;
  327. .nodata-image{
  328. width: 218rpx;
  329. height: 150rpx;
  330. }
  331. }
  332. </style>