index.vue 17 KB

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