detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <template>
  2. <div class="repair-detail-box">
  3. <div :class="[
  4. 'repair-content',
  5. detailStatus === 'unAcceptance' ? 'fixed-page-content' : 'page-content',
  6. ]">
  7. <div class="white-box page-1">
  8. <div class="cell-item">
  9. <p class="label">当前企业</p>
  10. <p class="tit">{{ detail.companyName }}</p>
  11. </div>
  12. <!-- <div class="cell-item">
  13. <p class="label">您是想</p>
  14. <div class="tit">{{ detail.type === "1" ? "报事" : "咨询" }}</div>
  15. </div> -->
  16. <div class="cell-item">
  17. <p class="label">快捷选择</p>
  18. <div class="tit">{{ detail.serviceType }}</div>
  19. </div>
  20. <div class="block-cell-item">
  21. <p class="label">工单描述</p>
  22. <div class="tit">
  23. <div class="textarea">
  24. {{ !detail.description ? "暂无" : detail.description }}
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="white-box page-2">
  30. <!-- <div class="cell-item">
  31. <p class="label">位置</p>
  32. <div class="tit">{{ detail.position === "1" ? "室内" : "公区" }}</div>
  33. </div> -->
  34. <div class="block-cell-item">
  35. <p class="label">补充说明</p>
  36. <div class="tit">
  37. <van-uploader :file-list="explainAnnexList" disabled class="infoUpload"/>
  38. <!-- <ul class="annex-list-box">-->
  39. <!-- <li class="annex-item" v-for="(item, index) in explainAnnexList" :key="index">-->
  40. <!-- {{ item }}-->
  41. <!-- <img :src="item" alt="" />-->
  42. <!-- </li>-->
  43. <!-- </ul>-->
  44. </div>
  45. </div>
  46. <div class="cell-item flex-item">
  47. <p class="label">联系方式</p>
  48. <p class="tit tel-box">
  49. <span>{{ detail.contact }}</span>
  50. <!-- {{ detail.phone }} -->
  51. <TelNum :num="detail.contact" :showTel="false" v-if="detail.contact && detail.contact.length > 0" />
  52. </p>
  53. </div>
  54. <div class="cell-item flex-item">
  55. <p class="label">报事人</p>
  56. <p class="tit tel-box">
  57. <span>{{ detail.reporter }}</span>
  58. <!-- {{ detail.phone }} -->
  59. <!-- <TelNum :num="detail.phone" :showTel="false" /> -->
  60. </p>
  61. </div>
  62. <div class="cell-item">
  63. <p class="label">报事时间</p>
  64. <p class="tit">{{ detail.createdAt }}</p>
  65. </div>
  66. </div>
  67. <div class="white-box page-3 form-part" style="padding-bottom: 120px">
  68. <div class="custom-item-tit">
  69. <div class="tit">
  70. <div style="padding-left: 15rpx;">
  71. 处理情况
  72. </div>
  73. </div>
  74. </div>
  75. <div class="block-cell-item">
  76. <p class="label">处理进展</p>
  77. <div>
  78. <van-steps :active="stepActive" :active-color="'#6600FF'" :steps="processSteps">
  79. </van-steps>
  80. </div>
  81. </div>
  82. <div class="cell-item">
  83. <p class="label">派单人</p>
  84. <p class="tit">{{ detail.dispatchUserName }}</p>
  85. </div>
  86. <div class="cell-item">
  87. <p class="label">派单时间</p>
  88. <p class="tit">{{ detail.dispatchTime }}</p>
  89. </div>
  90. <div class="block-cell-item">
  91. <p class="label">派单备注</p>
  92. <div class="tit">
  93. <div class="textarea">
  94. {{ !detail.dispatchRemark || detail.dispatchRemark == "null" || detail.dispatchRemark == "undefind" ? "暂无" : detail.dispatchRemark }}
  95. </div>
  96. </div>
  97. </div>
  98. <div class="block-cell-item">
  99. <p class="label">
  100. 处理后拍照<span class="tips">(支持图片上传限20M内,最多6张)</span>
  101. </p>
  102. <div class="tit">
  103. <van-uploader @delete="deleteRYXXZP" :file-list="handleUrlList" :max-count="6" @after-read="afterRead"
  104. :disabled="detail.status == 3||detail.status == 5" :show-upload="false" :deletable="false">
  105. </van-uploader>
  106. </div>
  107. </div>
  108. <div class="custom-item-tit">
  109. <div class="tit">
  110. <div style="margin-left: 15rpx;">
  111. 处理说明
  112. </div>
  113. </div>
  114. </div>
  115. <div class="custom-textarea-box">
  116. <uni-easyinput :disabled="detail.status !== '1'" type="textarea" class="bgcF9F9F9 height218rpx"
  117. v-model="detail.handleExplain" autoHeight placeholder="请填写" show-word-limit>
  118. </uni-easyinput>
  119. </div>
  120. <div class="cell-item">
  121. <p class="label">结案人</p>
  122. <p class="tit">{{ handleUserId2 }}</p>
  123. </div>
  124. <div class="cell-item">
  125. <p class="label">结案时间</p>
  126. <p class="tit">{{ detail.handleTime ? detail.handleTime : "" }}</p>
  127. </div>
  128. <div class="custom-item-tit">
  129. <div class="tit">
  130. <div style="margin-left: 15rpx;">
  131. 服务确认
  132. </div>
  133. </div>
  134. </div>
  135. <div>
  136. <div style="margin-bottom: 15rpx;">
  137. <van-radio-group :value="confirmForm.status" :disabled="detail.status == 3||detail.status == 4||detail.status == 5" direction="horizontal" @change="getConfirmFormStatus"
  138. bind:change="getConfirmStatus">
  139. <van-radio name="3">通过</van-radio>
  140. <van-radio name="5">退回</van-radio>
  141. </van-radio-group>
  142. </div>
  143. <div class="custom-textarea-box">
  144. <uni-easyinput type="textarea" class="bgcF9F9F9 height218rpx" :disabled="detail.status == 3||detail.status == 4||detail.status == 5"
  145. v-model="confirmForm.confirmRemark" autoHeight placeholder="请填写" show-word-limit>
  146. </uni-easyinput>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="repair-bottom bottom-button">
  152. <button class=" btn" @click="onConfirm" v-if="detail.status == 2">提交</button>
  153. </div>
  154. </div>
  155. </template>
  156. <script>
  157. import TelNum from "../../subPackages/components/tel-number";
  158. import vanRate from "../../../wxcomponents/weapp/dist/rate";
  159. import {
  160. editRepair,
  161. getHandleInfoById,
  162. getByCodes,
  163. getUserLocalStorageInfo, confirmReport
  164. } from "@/js_sdk/http";
  165. // import Base from '@/pages/base/base'
  166. // import { editRepair } from '@/service/api_repair'
  167. // import { Toast } from 'vant'
  168. // import auth from '@/service/auth'
  169. // import axios from 'axios'
  170. export default {
  171. components: {
  172. TelNum,
  173. vanRate,
  174. },
  175. data() {
  176. return {
  177. handleUserId2: "",
  178. userId2: "",
  179. dispatchUserId2: "",
  180. dic_key: ["QUICK_SELECTION", "REPAIR_STATUS"],
  181. dic_SelectList: {},
  182. detailId: "", // 详情id
  183. handleUrlList: [],
  184. confirmForm: {
  185. status: '3'
  186. },
  187. fileUrls: [],
  188. handleUrls: [],
  189. detailStatus: "1", // 1 待派单 2已派单
  190. explainAnnexList: [], // 说明附件 type image、图片 video、视频
  191. processedAnnexList: [], // 附件 type image、图片 video、视频
  192. stepActive: 0, // 当前处理到哪一步
  193. processSteps: [
  194. {
  195. id: 1,
  196. status: 1,
  197. text: "上报",
  198. },
  199. {
  200. id: 2,
  201. status: 1,
  202. text: "已受理",
  203. },
  204. {
  205. id: 3,
  206. status: 1,
  207. text: "已处理",
  208. },
  209. {
  210. id: 4,
  211. status: 0,
  212. text: "已确认",
  213. },
  214. ], // 处理流程
  215. evaluateVal: 0, // 评分
  216. id: "",
  217. detail: {},
  218. fileUrlList: [],
  219. params: {
  220. id: "",
  221. handleUrl: "",
  222. handleTime: "",
  223. status: "processed",
  224. },
  225. };
  226. },
  227. onLoad(option) {
  228. this.id = option.id;
  229. this.getByCodes();
  230. },
  231. methods: {
  232. getConfirmFormStatus(e){
  233. console.log(e)
  234. this.confirmForm.status = e.detail;
  235. },
  236. getConfirmStatus(e) {
  237. console.log(e)
  238. },
  239. async getByCodes() {
  240. let data = await getByCodes(JSON.stringify(this.dic_key));
  241. this.dic_SelectList = this.$common.handleDicList(data);
  242. this.getDetailById();
  243. },
  244. onSelect(val) {
  245. this.value = val.text;
  246. this.params.handleUserId = val.value + "-" + val.text;
  247. this.showPicker = false;
  248. },
  249. async onConfirm() {
  250. let that = this
  251. if(that.confirmForm.status==5&&(!that.confirmForm.confirmRemark||that.confirmForm.confirmRemark.length==0)){
  252. that.$showToast('如选择退回派单请填写原因')
  253. return
  254. }
  255. console.log(that.confirmForm)
  256. let confirmForm = {
  257. ...that.confirmForm,
  258. userId: getUserLocalStorageInfo().user.id,
  259. id: that.id,
  260. reportRepairId: that.detail.reportRepairId,
  261. confirmRemark: that.confirmForm.confirmRemark
  262. }
  263. let data = await confirmReport(confirmForm)
  264. console.log(data)
  265. if (data.code == 200) {
  266. that.$showToast("提交成功");
  267. uni.navigateBack({});
  268. }
  269. },
  270. getDetailById() {
  271. const _this = this;
  272. getHandleInfoById(_this.id).then((res) => {
  273. console.log(res.data);
  274. if (res.data) {
  275. let det = _this.getItemJson(res.data);
  276. this.detail = det;
  277. this.detail.handleExplain = det.handleExplain;
  278. if (det.dispatchUserId != null && det.dispatchUserId !== "") {
  279. const test = det.dispatchUserId.split("-");
  280. this.dispatchUserId2 = test[1] + "-" + test[2];
  281. }
  282. if (det.handleUserId != null && det.handleUserId !== "") {
  283. this.handleUserId2 = det.handleUserName;
  284. }
  285. this.handleUrlList = det.handleUrlList;
  286. console.log("asodmqowndonq", this.handleUrlList);
  287. // this.explainAnnexList = det.fileUrlViewList;
  288. if(det.fileUrl&&det.fileUrl.length > 0) {
  289. this.explainAnnexList = det.fileUrl.split(',').map(e => {
  290. return{
  291. url:this.$constant.BASE_URI + "/wx/fileController/download/" + e,
  292. isImage: true,
  293. deletable: false,
  294. }
  295. });
  296. }
  297. // this.processedAnnexList = det.handleUrlList;
  298. this.detailStatus = det.status;
  299. this.params.remark = det.remark;
  300. this.confirmForm.confirmRemark = det.confirmRemark=='null'?'':det.confirmRemark
  301. // console.log('det.remark;',det.remark)
  302. if(det.status==3||det.status==5){
  303. this.confirmForm.status = det.status
  304. }
  305. }
  306. });
  307. },
  308. getItemJson: function (item) {
  309. // const fileUrls = item.fileUrl ? item.fileUrl.split(",") : [];
  310. //
  311. // const fileUrlViews = [];
  312. // if (fileUrls !== null && fileUrls.length > 0) {
  313. // fileUrls.forEach((item) => {
  314. // item =
  315. // this.$constant.BASE_URI + "/wx/fileController/download/" + item;
  316. // fileUrlViews.push(item);
  317. // });
  318. // }
  319. // item.fileUrlViewList = fileUrlViews;
  320. if (!item.handleTime) {
  321. item.handleTime = this.$common.transServDate(new Date());
  322. }
  323. const handleUrls = item.handleUrl ? item.handleUrl.split(",") : [];
  324. const handleUrlViews = [];
  325. if (handleUrls !== null && handleUrls.length > 0) {
  326. handleUrls.forEach((item) => {
  327. handleUrlViews.push({
  328. url:
  329. this.$constant.BASE_URI + "/wx/fileController/download/" + item,
  330. isImage: true,
  331. });
  332. });
  333. }
  334. item.handleUrlList = handleUrlViews;
  335. console.log(item);
  336. item.serviceType =
  337. this.dic_SelectList.QUICK_SELECTION[item.serviceType - 1].label;
  338. switch (item.status) {
  339. // console.log(status)
  340. case "0":
  341. this.stepActive = 0;
  342. break;
  343. case "1":
  344. this.stepActive = 1;
  345. break;
  346. case "2":
  347. this.stepActive = 2;
  348. break;
  349. case "3":
  350. this.stepActive = 3;
  351. case "4":
  352. this.stepActive = 4;
  353. case "5":
  354. this.stepActive = 5;
  355. break;
  356. }
  357. return item;
  358. },
  359. afterRead(event) {
  360. let that = this;
  361. const { file } = event.detail;
  362. try {
  363. uni.uploadFile({
  364. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  365. filePath: file.url,
  366. name: "file",
  367. formData: { user: "test" },
  368. success(res) {
  369. // 上传完成需要更新 fileList
  370. let { data } = JSON.parse(res.data);
  371. console.log(data[0]);
  372. that.handleUrlList.push({
  373. id: data[0],
  374. url:
  375. that.$constant.BASE_URI + "/FileController/download/" + data[0],
  376. isImage: true,
  377. });
  378. that.handleUrlList = [...that.handleUrlList];
  379. that.$forceUpdate();
  380. console.log(that.fileUrlList);
  381. },
  382. fail(res) { },
  383. });
  384. } catch (error) { }
  385. },
  386. beforeDelete(file, detail) {
  387. // this.handleImagUrlList = []
  388. const vm = this;
  389. // name.index代表图片的索引
  390. vm.handleUrls.splice(detail.index, 1);
  391. return (file, name) => {
  392. const fileIndex = name.index;
  393. vm.handleUrls[detail.index].splice(fileIndex, 1);
  394. };
  395. },
  396. /**
  397. * 上传图片
  398. */
  399. uploadImg(file) {
  400. const _this = this;
  401. const formParam = new FormData(); // 创建form对象
  402. formParam.append("file", file.file); // 通过append向form对象添加数据
  403. console.log(formParam.get("file")); // FormData私有类对象,访问不到,可以通过get判断值是否传进去
  404. // upload(formParam).then((res) => {
  405. //
  406. // })
  407. const config = {
  408. headers: {
  409. "Content-Type": "multipart/form-data",
  410. "MVVM-Key": String(new Date().getTime()),
  411. xx: "anything",
  412. }, // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
  413. }; // 添加请求头
  414. return new Promise((resolve, reject) => {
  415. axios
  416. .post(
  417. "/smartParkH5Server/wx/fileController/upload",
  418. formParam,
  419. config
  420. )
  421. .then((response) => {
  422. let files = response.data.data.substring(
  423. 1,
  424. response.data.data.length
  425. );
  426. files = files.substring(0, files.length - 1);
  427. _this.handleUrls.push(_this.$common.castEval(files));
  428. })
  429. .catch((err, x) => {
  430. reject(err, x);
  431. });
  432. });
  433. },
  434. },
  435. };
  436. </script>
  437. <style lang="scss">
  438. .infoUpload{
  439. .van-uploader__upload--disabled{
  440. display: none;
  441. }
  442. }
  443. .bottom-button {
  444. position: fixed;
  445. bottom: 0;
  446. left: 0;
  447. width: 100%;
  448. z-index: 100;
  449. height: 160rpx;
  450. padding: 35rpx 30rpx;
  451. background-color: #fff;
  452. display: flex;
  453. align-items: center;
  454. justify-content: center;
  455. box-sizing: border-box;
  456. .btn {
  457. height: 100%;
  458. line-height: 80rpx;
  459. width: 100%;
  460. color: #fff;
  461. background-color: #6600ff;
  462. font-size: 34rpx;
  463. border-radius: 10rpx;
  464. }
  465. }
  466. .repair-detail-box {
  467. .page-4 {
  468. .evaluate-box {
  469. padding: 20rpx 30rpx;
  470. background: $page-color-base;
  471. border: 1rpx solid #ebedf0;
  472. border-radius: 100rpx;
  473. display: flex;
  474. align-items: center;
  475. justify-content: space-between;
  476. box-sizing: border-box;
  477. }
  478. }
  479. width: 100%;
  480. height: 100%;
  481. .page-1 {
  482. .textarea {
  483. padding: 20rpx;
  484. border-radius: 10rpx;
  485. background: $page-color-base;
  486. box-sizing: border-box;
  487. }
  488. }
  489. .page-3 {
  490. padding-bottom: 100rpx;
  491. .input-item {
  492. padding: 0;
  493. }
  494. .custom-item-tit {
  495. height: 13.333vw;
  496. font-size: 4.267vw;
  497. color: #333;
  498. padding: 2.667vw 0;
  499. position: relative;
  500. display: -webkit-box;
  501. display: -ms-flexbox;
  502. display: flex;
  503. -webkit-box-pack: justify;
  504. -ms-flex-pack: justify;
  505. justify-content: space-between;
  506. -webkit-box-align: center;
  507. -ms-flex-align: center;
  508. align-items: center;
  509. -webkit-box-sizing: border-box;
  510. box-sizing: border-box;
  511. .tit {
  512. &::after {
  513. content: "";
  514. width: 0.8vw;
  515. height: 90%;
  516. background-color: #976dec;
  517. border-radius: 0.4vw;
  518. position: absolute;
  519. left: 0;
  520. top: 50%;
  521. -webkit-transform: translateY(-50%);
  522. transform: translateY(-50%);
  523. }
  524. }
  525. }
  526. .tit {
  527. // padding-left: 2.667vw;
  528. position: relative;
  529. }
  530. }
  531. .page-4 {
  532. .custom-item-tit {
  533. height: 13.333vw;
  534. font-size: 4.267vw;
  535. color: #333;
  536. padding: 2.667vw 0;
  537. position: relative;
  538. display: -webkit-box;
  539. display: -ms-flexbox;
  540. display: flex;
  541. -webkit-box-pack: justify;
  542. -ms-flex-pack: justify;
  543. justify-content: space-between;
  544. -webkit-box-align: center;
  545. -ms-flex-align: center;
  546. align-items: center;
  547. -webkit-box-sizing: border-box;
  548. box-sizing: border-box;
  549. .tit {
  550. &::after {
  551. content: "";
  552. width: 0.8vw;
  553. height: 90%;
  554. background-color: #976dec;
  555. border-radius: 0.4vw;
  556. position: absolute;
  557. left: 0;
  558. top: 50%;
  559. -webkit-transform: translateY(-50%);
  560. transform: translateY(-50%);
  561. }
  562. }
  563. }
  564. .tit {
  565. padding-left: 2.667vw;
  566. position: relative;
  567. }
  568. s .evaluate-box {
  569. padding: 20px 30px;
  570. background: $page-color-base;
  571. border: 1px solid #ebedf0;
  572. border-radius: 100px;
  573. display: flex;
  574. align-items: center;
  575. justify-content: space-between;
  576. box-sizing: border-box;
  577. }
  578. }
  579. .annex-list-box {
  580. display: flex;
  581. // flex-wrap: wrap;
  582. // justify-content: space-between;
  583. &::after {
  584. display: block;
  585. content: "";
  586. width: 30%;
  587. height: 0px;
  588. }
  589. .annex-item {
  590. width: 240rpx;
  591. height: 240rpx;
  592. border: 1px solid $text4;
  593. margin-bottom: 20px;
  594. position: relative;
  595. overflow: hidden;
  596. >img {
  597. width: 240rpx;
  598. height: 240rpx;
  599. position: absolute;
  600. top: 0;
  601. left: 0;
  602. right: 0;
  603. bottom: 0;
  604. margin: auto;
  605. display: block;
  606. }
  607. video {
  608. width: 100%;
  609. height: 100%;
  610. }
  611. }
  612. }
  613. .tel-box {
  614. display: flex;
  615. align-items: center;
  616. /deep/ .custom-tel-component {
  617. margin-left: 20px;
  618. }
  619. }
  620. }
  621. </style>
  622. <style lang="scss">
  623. .image-repairDispatch-box {
  624. .van-image-preview__close-icon {
  625. color: #fff;
  626. font-size: 64px;
  627. }
  628. }
  629. </style>s