index.vue 21 KB

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