index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <view class="registrationRecord-box">
  3. <view class="list-box">
  4. <u--form label-width="auto" ref="uForm" :model="form" labelAlign="right">
  5. <!-- <u-subsection :list="list" mode="subsection" :current="curNow" @change="sectionChange"></u-subsection> -->
  6. <u-tabs :list="tablist"
  7. :itemStyle="{
  8. width: '330rpx',
  9. height: '80rpx'
  10. }"
  11. :activeStyle="{
  12. color:'#4573FC'
  13. }"
  14. lineColor="#4573FC"
  15. @click="({index}) => {
  16. curNow = index
  17. anewQueryMyList()
  18. }"
  19. >
  20. </u-tabs>
  21. <u-cell-group customStyle="margin-top: 2px">
  22. <template>
  23. <u-cell title="申请时间" :border="true" :isLink="true"
  24. @click="$refs.startTimeRef.show()">
  25. <view slot="value">
  26. <u-form-item label="" prop="form.startTime">
  27. <template v-if="form.createTimeEnd">
  28. {{ form.createTimeBegin }} - {{ form.createTimeEnd }}</template>
  29. <template v-else></template>
  30. </u-form-item>
  31. </view>
  32. </u-cell>
  33. <tq-calendar ref="startTimeRef"
  34. @confirm="(e) => {
  35. form.createTimeBegin = e[0]
  36. form.createTimeEnd = e[1]
  37. anewQueryMyList()
  38. }">
  39. </tq-calendar>
  40. </template>
  41. <!-- 用车类型 -->
  42. <template>
  43. <u-cell title="用车类型" :border="true" :isLink="true"
  44. @click="$refs.dictSelectRef.show()">
  45. <view slot="value">
  46. <u-form-item label="" prop="form.applyTypeName">
  47. {{ form.applyTypeName }}
  48. </u-form-item>
  49. </view>
  50. </u-cell>
  51. <tq-dict-select
  52. ref="dictSelectRef"
  53. dictType="matter_type"
  54. @confirm="(data) => {
  55. form.applyType = data.dictValue
  56. form.applyTypeName = data.dictLabel
  57. anewQueryMyList()
  58. }">
  59. </tq-dict-select>
  60. </template>
  61. <template>
  62. <u-cell title="审核状态" :border="true" :isLink="true"
  63. @click="$refs.deptAuditStatusRef.show()">
  64. <view slot="value">
  65. <u-form-item label="" prop="form.endTime">
  66. {{ form.flowStatusName }}
  67. </u-form-item>
  68. </view>
  69. </u-cell>
  70. <tq-select ref="deptAuditStatusRef"
  71. :columns="deptAuditStatusList"
  72. @confirm="(data) => {
  73. form.flowStatus = data.value
  74. form.flowStatusName = data.label
  75. anewQueryMyList()
  76. }">
  77. </tq-select>
  78. </template>
  79. <!-- <template>
  80. <u-cell title="总经办审核状态" :border="true" :isLink="true"
  81. @click="$refs.officeAuditStatusRef.show()">
  82. <view slot="value">
  83. <u-form-item label="" prop="form.endTime">
  84. {{ form.officeAuditStatusName }}
  85. </u-form-item>
  86. </view>
  87. </u-cell>
  88. <tq-select ref="officeAuditStatusRef"
  89. :columns="officeAuditStatusList"
  90. @confirm="(data) => {
  91. form.officeAuditStatus = data.value
  92. form.officeAuditStatusName = data.label
  93. anewQueryMyList()
  94. }">
  95. </tq-select>
  96. </template> -->
  97. <template>
  98. <u-cell title="订单号" :border="true" :isLink="false"
  99. >
  100. <view slot="value">
  101. <u-input v-model="form.id" :type="'number'" placeholder="可输入订单号" clearable @confirm="anewQueryMyList" @clear="anewQueryMyList" :border="'none'"
  102. inputAlign="right"
  103. />
  104. </view>
  105. </u-cell>
  106. </template>
  107. </u-cell-group>
  108. </u--form>
  109. </view>
  110. <view class="item-list-box">
  111. <view class="info-box" v-for="(item, index) in queryMyListdata" :key="index">
  112. <!-- 状态 -->
  113. <view class="flowStatus">
  114. <!-- flowStatus 流程状态:1.进行中、2.已完成、3.已撤销、4.不通过 success / info / warning / error-->
  115. <u-tag v-if="item.flowStatus === 1" :text="item.flowStatusName" plain size="mini"></u-tag>
  116. <u-tag v-if="item.flowStatus === 2" :text="item.flowStatusName" type="success" plain
  117. size="mini"></u-tag>
  118. <u-tag v-if="item.flowStatus === 3" :text="item.flowStatusName" borderColor="#909399"
  119. color="#909399" plain
  120. size="mini"></u-tag>
  121. <u-tag v-if="item.flowStatus === 4" :text="item.flowStatusName" type="error" plain
  122. size="mini"></u-tag>
  123. </view>
  124. <u-row customStyle="margin-bottom: 10px">
  125. <u-col span="12">
  126. <view class="demo-layout bg-purple-light">单号:{{ item.id }}</view>
  127. </u-col>
  128. </u-row>
  129. <u-row customStyle="margin-bottom: 10px">
  130. <u-col span="6">
  131. <view class="demo-layout bg-purple-light">申请人:{{ item.applyName }}</view>
  132. </u-col>
  133. <u-col span="6">
  134. <view class="demo-layout bg-purple">部门:{{ item.deptName }}</view>
  135. </u-col>
  136. </u-row>
  137. <u-row customStyle="margin-bottom: 10px">
  138. <u-col span="12">
  139. <view class="demo-layout bg-purple-light">申请人联系电话:{{ item.applyTel }}</view>
  140. </u-col>
  141. </u-row>
  142. <u-row customStyle="margin-bottom: 10px">
  143. <u-col span="6">
  144. <view class="demo-layout bg-purple-light">联系人:{{ item.userName }}</view>
  145. </u-col>
  146. <u-col span="6">
  147. <view class="demo-layout bg-purple">联系人电话:{{ item.userTel }}</view>
  148. </u-col>
  149. </u-row>
  150. <u-row customStyle="margin-bottom: 10px">
  151. <u-col span="12">
  152. <view class="demo-layout bg-purple-light">申请时间:{{ item.createTime }}</view>
  153. </u-col>
  154. </u-row>
  155. <u-row customStyle="margin-bottom: 10px">
  156. <u-col span="12">
  157. <view class="demo-layout bg-purple">用车人数:{{ item.totalNum }}</view>
  158. </u-col>
  159. </u-row>
  160. <u-row customStyle="margin-bottom: 10px">
  161. <u-col span="12">
  162. <view class="demo-layout bg-purple-light">执行时间:{{ item.startPlanTime }} 至 {{ item.endPlanTime }}
  163. </view>
  164. </u-col>
  165. </u-row>
  166. <view class="hide-warp" v-if="item.openOther">
  167. <u-row customStyle="margin-bottom: 10px">
  168. <u-col span="12">
  169. <view class="demo-layout bg-purple-light">起止点:{{ pointAddrParse(item.pointAddr) }}</view>
  170. </u-col>
  171. </u-row>
  172. <u-row customStyle="margin-bottom: 10px">
  173. <u-col span="12">
  174. <view class="demo-layout bg-purple-light">用车类型:{{ item.matterType }}</view>
  175. </u-col>
  176. </u-row>
  177. <u-row customStyle="margin-bottom: 10px">
  178. <u-col span="12">
  179. <view class="demo-layout bg-purple-light">备注信息:{{ item.remark }}</view>
  180. </u-col>
  181. </u-row>
  182. <!-- 分割 -->
  183. <u-divider text="" customStyle="width: 100%;margin-bottom: 4px;margin-top: -6px;"></u-divider>
  184. <u-row customStyle="margin-bottom: 10px">
  185. <u-col span="12">
  186. <view class="demo-layout bg-purple-light">审核状态:{{ item.flowStatusName }}</view>
  187. </u-col>
  188. </u-row>
  189. <u-row customStyle="margin-bottom: 10px">
  190. <u-col span="12">
  191. <view class="demo-layout bg-purple-light">当前审批节点:{{ item.flowNodeName }}</view>
  192. </u-col>
  193. </u-row>
  194. <!-- 分割 -->
  195. <u-divider text="" customStyle="width: 100%;margin-bottom: 4px;margin-top: -6px;"></u-divider>
  196. <!-- <u-row customStyle="margin-bottom: 10px">
  197. <u-col span="12">
  198. <view class="demo-layout bg-purple-light">总经办调度人:{{ item.userName }}</view>
  199. </u-col>
  200. </u-row> -->
  201. <u-row customStyle="margin-bottom: 10px">
  202. <u-col span="6">
  203. <view class="demo-layout bg-purple-light">车辆:{{ item.plate }}</view>
  204. </u-col>
  205. <u-col span="6">
  206. <view class="demo-layout bg-purple-light">车辆类型:{{ item.vehTypeName }}</view>
  207. </u-col>
  208. </u-row>
  209. <u-row customStyle="margin-bottom: 10px">
  210. <u-col span="12">
  211. <view class="demo-layout bg-purple-light">司机:{{ item.driverName }}</view>
  212. </u-col>
  213. </u-row>
  214. <u-row customStyle="margin-bottom: 10px">
  215. <u-col span="12">
  216. <view class="demo-layout bg-purple-light">执行状态:{{ item.exStsName }}</view>
  217. </u-col>
  218. </u-row>
  219. <u-row customStyle="margin-bottom: 10px">
  220. <u-col span="12">
  221. <view class="demo-layout bg-purple-light">评价:{{ item.evaluate }}</view>
  222. </u-col>
  223. </u-row>
  224. </view>
  225. <view @click="item.openOther = !item.openOther" class="open-warp">
  226. {{ item.openOther?'收起':'展开' }}
  227. </view>
  228. <u-row customStyle="margin-bottom: 10px">
  229. <u-col span="12">
  230. <view style="display: flex; justify-content: center;">
  231. <u-button type="primary" icon="phone" @tap="phoneCall(item.driverTel)" :plain="true"
  232. color="#4573FC"
  233. customStyle="width: 200rpx;height:64rpx" shape="circle"
  234. text="司机"></u-button>
  235. <u-button type="warning" icon="phone" @tap="phoneCall(item.applyTel)" :plain="true"
  236. color="#F7A254"
  237. customStyle="width:200rpx;height:64rpx" shape="circle"
  238. text="申请人"></u-button>
  239. <u-button type="primary" icon="phone" @tap="phoneCall(item.userTel)" :plain="true"
  240. color="#4573FC"
  241. customStyle="width: 200rpx;height:64rpx" shape="circle"
  242. text="用车人"></u-button>
  243. </view>
  244. </u-col>
  245. </u-row>
  246. <u-row customStyle="margin-bottom: 10px;display: flex; justify-content: center;">
  247. <u-col span="12">
  248. <!-- originType 1流程申请2手动录入) flowStatus 流程状态:1.进行中、2.已完成、3.已撤销、4.不通过 -->
  249. <view style="display: flex; justify-content: center;padding:0 6px;">
  250. <u-button type="primary" @click="handleTakeBack(item)" :plain="true" v-if="item.flowStatus === 1 && curNow != 1"
  251. color="#4573FC"
  252. shape="circle"
  253. customStyle="height:64rpx"
  254. text="撤销"></u-button>
  255. <u-button type="warning" @click="handleRestartWorkflow(item)" :plain="true" v-if=" item.flowStatus === 3 && curNow != 1 && curNow != 2"
  256. color="#F7A254"
  257. customStyle="height:64rpx"
  258. shape="circle"
  259. text="重新申请"></u-button>
  260. </view>
  261. </u-col>
  262. </u-row>
  263. <!-- 评价状态:0.不需要评价、1.待评价、2.已评价 string-->
  264. <u-row customStyle="margin-bottom: 10px" v-if="curNow === 0&&item.evaluateStatus ==='1'">
  265. <u-col span="12 ">
  266. <u-button type="primary" text="出发" @click="$refs.ratePopupRef.show(item)">评价</u-button>
  267. </u-col>
  268. </u-row>
  269. </view>
  270. </view>
  271. <u-loadmore :status="status" />
  272. <u-toast ref="uToast" />
  273. <u-calendar :show="calendarShow" mode="range" :defaultDate="defaultDate" :maxDate="maxDate" minDate="2023-10-01"
  274. monthNum="24"
  275. @confirm="calendarChange" @close="calendarShow = false"></u-calendar>
  276. <!-- 评价 -->
  277. <tq-rate-popup ref="ratePopupRef" @confirm="(e) => { postEvaluate(e) }"></tq-rate-popup>
  278. </view>
  279. </template>
  280. <script>
  281. import { vehList, evaluate,recordtaskOperate } from "@/api/wfApi/index";
  282. export default {
  283. data() {
  284. return {
  285. calendarShow: false, // 日历
  286. calendarStart: this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'),// 开始时间
  287. calendarEnd: this.dayjs().subtract(0, 'day').format('YYYY-MM-DD'), // 结束时间
  288. defaultDate: [this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'), this.dayjs().subtract(0, 'day').format('YYYY-MM-DD')],
  289. maxDate: this.dayjs().add(365, 'day').format('YYYY-MM-DD'),
  290. list: ['我的', '全部'],
  291. tablist: [
  292. { name: '我的'},
  293. { name: '全部'},
  294. ],
  295. curNow: 0,
  296. queryMyListdata: [],
  297. form: {
  298. createTimeBegin: '',//开始时间
  299. createTimeEnd: '', //结束时间
  300. applyType: '',//用车类型(字典编码:matter_type)
  301. applyTypeName: '',
  302. flowStatus: '',//部门审核状态:1.审核通过、2.审核不通过
  303. flowStatusName: '',
  304. // officeAuditStatus: '',//总经办审核状态:1.审核通过、2.审核不通过
  305. // officeAuditStatusName: ''
  306. },
  307. // <!-- 状态:1.进行中、2.已完成、3.已撤销、4.不通过 -->
  308. deptAuditStatusList: [
  309. { label: '全部', value: '' },
  310. { label: '进行中', value: 1 },
  311. { label: '已完成', value: 2 },
  312. { label: '已撤销', value: 3 },
  313. { label: '不通过', value: 4 },
  314. ],
  315. // 总经办审核状态:1.审核通过、2.审核不通过
  316. // officeAuditStatusList: [
  317. // { label: '全部', value: '' },
  318. // { label: '审核通过', value: 1 },
  319. // { label: '审核不通过', value: 2 },
  320. // ],
  321. pageIndex: 1,
  322. total: 0,
  323. status: 'nomore', //loading nomore loadmore
  324. openOther:false,
  325. isLoad:true
  326. }
  327. },
  328. onShow(option) {
  329. if(!this.isLoad)return;
  330. this.queryMyListdata = []
  331. this.pageIndex = 1
  332. this.queryMyList();
  333. },
  334. methods: {
  335. handleRestartWorkflow(instance) {
  336. uni.navigateTo({
  337. url: `/pages/flow/diboot?routes=/workflow/mobile/startFlow&id=${instance.procDefId}&processInstanceId=${instance.processInstanceId}&defaultTitle=${instance.companyName}&name=${instance.companyName}&restart=true`,
  338. })
  339. },
  340. handleTakeBack({ processInstanceId }) { //撤销
  341. uni.showModal({
  342. title: '',
  343. content: `确认撤销?`,
  344. showCancel: true,
  345. confirmText: '确定',
  346. success: async (res) => {
  347. if (res.confirm) {
  348. let { code } = await recordtaskOperate({
  349. processInstanceId,
  350. taskOperate: 'cancel',
  351. validTask: false,
  352. })
  353. if (code == 0) {
  354. uni.showToast({
  355. title: '取消成功',
  356. icon: 'none',
  357. })
  358. this.anewQueryMyList()
  359. }
  360. }
  361. }
  362. })
  363. },
  364. calendarChange(e) {
  365. console.info('选择的时间', e)
  366. // 修改日期
  367. this.form.createTimeBegin = e[0]; // 开始时间
  368. this.form.createTimeEnd = e[e.length - 1]; // 结束时间
  369. this.defaultDate = [e[0], e[e.length - 1]]
  370. this.calendarShow = false;
  371. this.anewQueryMyList();
  372. },
  373. anewQueryMyList() {
  374. this.pageIndex = 1;
  375. this.queryMyListdata = [];
  376. this.queryMyList();
  377. },
  378. phoneCall(e) {
  379. uni.makePhoneCall({
  380. phoneNumber: e, //仅为示例
  381. complete: () => {
  382. this.isLoad = false
  383. }},
  384. );
  385. },
  386. pointAddrParse(e) {
  387. let arr = JSON.parse(e)
  388. let arrStg = ''
  389. for (let item of arr) {
  390. arrStg += item.address + '-'
  391. }
  392. return arrStg.slice(0, -1);
  393. },
  394. sectionChange(index) {
  395. this.curNow = index;
  396. this.anewQueryMyList()
  397. },
  398. toRealMap(item) {
  399. let obj = {
  400. routeId: item.routeId,
  401. classId: item.classId,
  402. startAndEnd: item.startAndEnd
  403. }
  404. let objst = encodeURIComponent(JSON.stringify(obj))
  405. uni.navigateTo({
  406. url: '/newdriversub/setClassPlan/details?item=' + objst
  407. });
  408. },
  409. async queryMyList() {
  410. this.loading = 'loading'
  411. let { createTimeBegin, createTimeEnd } = this.form
  412. let obj = {
  413. ...this.form,
  414. pageIndex: this.pageIndex,
  415. pageSize: 3,
  416. createTimeBegin: createTimeBegin ? createTimeBegin + ':00':'',
  417. createTimeEnd: createTimeEnd ? createTimeEnd + ':59':'',
  418. queryType: this.curNow + 1 //查询类型:1.本人、2.全部
  419. }
  420. for (let key in obj) {
  421. if (obj[key] === '') delete obj[key]
  422. }
  423. let { data, code, page } = await vehList(obj)
  424. if (code == "0") {
  425. let list = data.map(item=>
  426. {
  427. return {
  428. ...item,
  429. openOther:false
  430. }
  431. }
  432. )
  433. this.queryMyListdata = this.queryMyListdata.concat(list)
  434. this.total = Number(page.totalCount)
  435. this.loading = 'loadmore'
  436. if (this.queryMyListdata.length >= this.total) {
  437. this.status = 'nomore'
  438. }
  439. console.log('数据', this.queryMyListdata)
  440. }
  441. },
  442. // 操作
  443. async postEvaluate(e) {
  444. let { data, code, msg } = await evaluate(
  445. {
  446. evaluate: e.textarea,
  447. evaluateScore: e.rateNum,
  448. systemFlowVehId: e.item.id, //任务id
  449. })
  450. if (code == "0") {
  451. uni.showToast({
  452. title: msg || '评价成功',
  453. duration: 2000
  454. });
  455. this.anewQueryMyList();
  456. }
  457. }
  458. },
  459. // 触底
  460. onReachBottom() {
  461. console.log('当前条数', this.queryMyListdata.length, '总条数', this.total)
  462. if (this.queryMyListdata.length >= this.total) return;
  463. this.pageIndex++
  464. this.queryMyList();
  465. },
  466. }
  467. </script>
  468. <style lang="scss" scoped>
  469. .registrationRecord-box {
  470. padding: 0 0 10rpx 0;
  471. overflow: unset;
  472. .bg-purple-light{
  473. word-wrap: break-word;
  474. }
  475. .list-box {
  476. border-radius: 10rpx;
  477. background: #fff;
  478. // padding: 20rpx;
  479. position: sticky;
  480. // align-items: center;
  481. // display: flex;
  482. top: 0px;
  483. width: 100%;
  484. z-index: 999;
  485. /deep/ {
  486. .u-form-item__body {
  487. padding: 0;
  488. }
  489. }
  490. }
  491. .item-list-box {
  492. padding: 10rpx 16rpx 0 16rpx;
  493. // background: #fff;
  494. position: relative;
  495. .info-box {
  496. margin-bottom: 20rpx;
  497. border: none;
  498. width: 100%;
  499. // border-radius: 20rpx;
  500. box-shadow: 2rpx 2rpx 5rpx rgba(169, 169, 169, 0.34901960784313724);
  501. // height: 150rpx;
  502. background-color: rgba(255, 255, 255, 1);
  503. display: flex;
  504. align-items: center;
  505. flex-wrap: wrap;
  506. padding: 20rpx;
  507. box-sizing: border-box;
  508. position: relative;
  509. font-size: 24rpx;
  510. .flowStatus{
  511. position: absolute;
  512. right: 6px;
  513. top: 6px;
  514. /deep/ .u-tag--mini{
  515. height: 20px;
  516. line-height: 20px;
  517. }
  518. }
  519. }
  520. }
  521. .hide-warp{
  522. width: 100%;
  523. }
  524. .open-warp{
  525. width: 100%;
  526. padding: 20rpx;
  527. display: flex;
  528. justify-content: flex-end;
  529. color: #4573FC;
  530. }
  531. }
  532. </style>