paperList.vue 13 KB

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