detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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">{{ dispatchUserId2 }}</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.remark == "null" || detail.remark == "undefind" ? "暂无" : detail.remark }}
  95. </div>
  96. </div>
  97. </div>
  98. <div class="block-cell-item">
  99. <p class="label">
  100. 处理后拍照{{ detail.status }}<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" :show-upload="true">
  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" direction="horizontal" @change="getConfirmFormStatus"
  138. bind:change="getConfirmStatus">
  139. <van-radio name="3">通过</van-radio>
  140. <van-radio name="4">退回</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"
  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==4&&(!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. this.confirmForm.status = det.status
  302. }
  303. });
  304. },
  305. getItemJson: function (item) {
  306. // const fileUrls = item.fileUrl ? item.fileUrl.split(",") : [];
  307. //
  308. // const fileUrlViews = [];
  309. // if (fileUrls !== null && fileUrls.length > 0) {
  310. // fileUrls.forEach((item) => {
  311. // item =
  312. // this.$constant.BASE_URI + "/wx/fileController/download/" + item;
  313. // fileUrlViews.push(item);
  314. // });
  315. // }
  316. // item.fileUrlViewList = fileUrlViews;
  317. if (!item.handleTime) {
  318. item.handleTime = this.$common.transServDate(new Date());
  319. }
  320. const handleUrls = item.handleUrl ? item.handleUrl.split(",") : [];
  321. const handleUrlViews = [];
  322. if (handleUrls !== null && handleUrls.length > 0) {
  323. handleUrls.forEach((item) => {
  324. handleUrlViews.push({
  325. url:
  326. this.$constant.BASE_URI + "/wx/fileController/download/" + item,
  327. isImage: true,
  328. });
  329. });
  330. }
  331. item.handleUrlList = handleUrlViews;
  332. console.log(item);
  333. item.serviceType =
  334. this.dic_SelectList.QUICK_SELECTION[item.serviceType - 1].label;
  335. switch (item.status) {
  336. // console.log(status)
  337. case "0":
  338. this.stepActive = 0;
  339. break;
  340. case "1":
  341. this.stepActive = 1;
  342. break;
  343. case "2":
  344. this.stepActive = 2;
  345. break;
  346. case "3":
  347. this.stepActive = 3;
  348. case "4":
  349. this.stepActive = 4;
  350. case "5":
  351. this.stepActive = 5;
  352. break;
  353. }
  354. return item;
  355. },
  356. afterRead(event) {
  357. let that = this;
  358. const { file } = event.detail;
  359. try {
  360. uni.uploadFile({
  361. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  362. filePath: file.url,
  363. name: "file",
  364. formData: { user: "test" },
  365. success(res) {
  366. // 上传完成需要更新 fileList
  367. let { data } = JSON.parse(res.data);
  368. console.log(data[0]);
  369. that.handleUrlList.push({
  370. id: data[0],
  371. url:
  372. that.$constant.BASE_URI + "/FileController/download/" + data[0],
  373. isImage: true,
  374. });
  375. that.handleUrlList = [...that.handleUrlList];
  376. that.$forceUpdate();
  377. console.log(that.fileUrlList);
  378. },
  379. fail(res) { },
  380. });
  381. } catch (error) { }
  382. },
  383. beforeDelete(file, detail) {
  384. // this.handleImagUrlList = []
  385. const vm = this;
  386. // name.index代表图片的索引
  387. vm.handleUrls.splice(detail.index, 1);
  388. return (file, name) => {
  389. const fileIndex = name.index;
  390. vm.handleUrls[detail.index].splice(fileIndex, 1);
  391. };
  392. },
  393. /**
  394. * 上传图片
  395. */
  396. uploadImg(file) {
  397. const _this = this;
  398. const formParam = new FormData(); // 创建form对象
  399. formParam.append("file", file.file); // 通过append向form对象添加数据
  400. console.log(formParam.get("file")); // FormData私有类对象,访问不到,可以通过get判断值是否传进去
  401. // upload(formParam).then((res) => {
  402. //
  403. // })
  404. const config = {
  405. headers: {
  406. "Content-Type": "multipart/form-data",
  407. "MVVM-Key": String(new Date().getTime()),
  408. xx: "anything",
  409. }, // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
  410. }; // 添加请求头
  411. return new Promise((resolve, reject) => {
  412. axios
  413. .post(
  414. "/smartParkH5Server/wx/fileController/upload",
  415. formParam,
  416. config
  417. )
  418. .then((response) => {
  419. let files = response.data.data.substring(
  420. 1,
  421. response.data.data.length
  422. );
  423. files = files.substring(0, files.length - 1);
  424. _this.handleUrls.push(_this.$common.castEval(files));
  425. })
  426. .catch((err, x) => {
  427. reject(err, x);
  428. });
  429. });
  430. },
  431. },
  432. };
  433. </script>
  434. <style lang="scss">
  435. .infoUpload{
  436. .van-uploader__upload--disabled{
  437. display: none;
  438. }
  439. }
  440. .bottom-button {
  441. position: fixed;
  442. bottom: 0;
  443. left: 0;
  444. width: 100%;
  445. z-index: 100;
  446. height: 160rpx;
  447. padding: 35rpx 30rpx;
  448. background-color: #fff;
  449. display: flex;
  450. align-items: center;
  451. justify-content: center;
  452. box-sizing: border-box;
  453. .btn {
  454. height: 100%;
  455. line-height: 80rpx;
  456. width: 100%;
  457. color: #fff;
  458. background-color: #6600ff;
  459. font-size: 34rpx;
  460. border-radius: 10rpx;
  461. }
  462. }
  463. .repair-detail-box {
  464. .page-4 {
  465. .evaluate-box {
  466. padding: 20rpx 30rpx;
  467. background: $page-color-base;
  468. border: 1rpx solid #ebedf0;
  469. border-radius: 100rpx;
  470. display: flex;
  471. align-items: center;
  472. justify-content: space-between;
  473. box-sizing: border-box;
  474. }
  475. }
  476. width: 100%;
  477. height: 100%;
  478. .page-1 {
  479. .textarea {
  480. padding: 20rpx;
  481. border-radius: 10rpx;
  482. background: $page-color-base;
  483. box-sizing: border-box;
  484. }
  485. }
  486. .page-3 {
  487. padding-bottom: 100rpx;
  488. .input-item {
  489. padding: 0;
  490. }
  491. .custom-item-tit {
  492. height: 13.333vw;
  493. font-size: 4.267vw;
  494. color: #333;
  495. padding: 2.667vw 0;
  496. position: relative;
  497. display: -webkit-box;
  498. display: -ms-flexbox;
  499. display: flex;
  500. -webkit-box-pack: justify;
  501. -ms-flex-pack: justify;
  502. justify-content: space-between;
  503. -webkit-box-align: center;
  504. -ms-flex-align: center;
  505. align-items: center;
  506. -webkit-box-sizing: border-box;
  507. box-sizing: border-box;
  508. .tit {
  509. &::after {
  510. content: "";
  511. width: 0.8vw;
  512. height: 90%;
  513. background-color: #976dec;
  514. border-radius: 0.4vw;
  515. position: absolute;
  516. left: 0;
  517. top: 50%;
  518. -webkit-transform: translateY(-50%);
  519. transform: translateY(-50%);
  520. }
  521. }
  522. }
  523. .tit {
  524. // padding-left: 2.667vw;
  525. position: relative;
  526. }
  527. }
  528. .page-4 {
  529. .custom-item-tit {
  530. height: 13.333vw;
  531. font-size: 4.267vw;
  532. color: #333;
  533. padding: 2.667vw 0;
  534. position: relative;
  535. display: -webkit-box;
  536. display: -ms-flexbox;
  537. display: flex;
  538. -webkit-box-pack: justify;
  539. -ms-flex-pack: justify;
  540. justify-content: space-between;
  541. -webkit-box-align: center;
  542. -ms-flex-align: center;
  543. align-items: center;
  544. -webkit-box-sizing: border-box;
  545. box-sizing: border-box;
  546. .tit {
  547. &::after {
  548. content: "";
  549. width: 0.8vw;
  550. height: 90%;
  551. background-color: #976dec;
  552. border-radius: 0.4vw;
  553. position: absolute;
  554. left: 0;
  555. top: 50%;
  556. -webkit-transform: translateY(-50%);
  557. transform: translateY(-50%);
  558. }
  559. }
  560. }
  561. .tit {
  562. padding-left: 2.667vw;
  563. position: relative;
  564. }
  565. s .evaluate-box {
  566. padding: 20px 30px;
  567. background: $page-color-base;
  568. border: 1px solid #ebedf0;
  569. border-radius: 100px;
  570. display: flex;
  571. align-items: center;
  572. justify-content: space-between;
  573. box-sizing: border-box;
  574. }
  575. }
  576. .annex-list-box {
  577. display: flex;
  578. // flex-wrap: wrap;
  579. // justify-content: space-between;
  580. &::after {
  581. display: block;
  582. content: "";
  583. width: 30%;
  584. height: 0px;
  585. }
  586. .annex-item {
  587. width: 240rpx;
  588. height: 240rpx;
  589. border: 1px solid $text4;
  590. margin-bottom: 20px;
  591. position: relative;
  592. overflow: hidden;
  593. >img {
  594. width: 240rpx;
  595. height: 240rpx;
  596. position: absolute;
  597. top: 0;
  598. left: 0;
  599. right: 0;
  600. bottom: 0;
  601. margin: auto;
  602. display: block;
  603. }
  604. video {
  605. width: 100%;
  606. height: 100%;
  607. }
  608. }
  609. }
  610. .tel-box {
  611. display: flex;
  612. align-items: center;
  613. /deep/ .custom-tel-component {
  614. margin-left: 20px;
  615. }
  616. }
  617. }
  618. </style>
  619. <style lang="scss">
  620. .image-repairDispatch-box {
  621. .van-image-preview__close-icon {
  622. color: #fff;
  623. font-size: 64px;
  624. }
  625. }
  626. </style>s