clientReparirDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <template>
  2. <view class="container padding-t-30">
  3. <view class="itemBox">
  4. <view v-if='item.car' class="flex item">
  5. <view class="title">
  6. 报修车辆:
  7. </view>
  8. <view class="content">
  9. {{item.car.car_name}}
  10. </view>
  11. </view>
  12. <view class="flex item">
  13. <view class="title">
  14. 维修单号:
  15. </view>
  16. <view class="content">
  17. {{id}}
  18. </view>
  19. </view>
  20. <view class="flex item" @click="openAddress(item)">
  21. <view class="title">
  22. 维修地点:
  23. </view>
  24. <view class="content flex">
  25. <image class="icon" src="../../../static/icon/shopAddress.png" mode="widthFix"></image>
  26. <text class="margin-l-10">{{item.address}}</text>
  27. </view>
  28. </view>
  29. <view class="flex item" @click="openPhone(item.phone)">
  30. <view class="title">
  31. 联系电话:
  32. </view>
  33. <view class="content flex">
  34. <image class="icon" src="../../../static/icon/shopPhone.png" mode="widthFix"></image>
  35. <text class="margin-l-10">
  36. {{item.phone}}
  37. </text>
  38. </view>
  39. </view>
  40. <view class="flex item">
  41. <view class="title">
  42. 申报时间:
  43. </view>
  44. <view class="content">
  45. {{item.add_time}}
  46. </view>
  47. </view>
  48. <view class="flex item">
  49. <view class="title">
  50. 故障概述:
  51. </view>
  52. <view class="content">
  53. {{item.content}}
  54. </view>
  55. </view>
  56. <view class="flex item" v-if="item.status>1">
  57. <view class="title">
  58. 维修师傅:
  59. </view>
  60. <view class="content">
  61. {{item.processor_user.staff_name}}
  62. </view>
  63. </view>
  64. <view class="flex item" @click="openPhone(item.processor_user.phone)" v-if="item.status>1">
  65. <view class="title">
  66. 师傅电话:
  67. </view>
  68. <view class="content flex">
  69. <image class="icon" src="../../../static/icon/shopPhone.png" mode="widthFix"></image>
  70. <text class="margin-l-10">
  71. {{item.processor_user.phone}}
  72. </text>
  73. </view>
  74. </view>
  75. <view class="flex item" v-if="item.status>1">
  76. <view class="title">
  77. 处理结果:
  78. </view>
  79. <view class="content">
  80. {{item.processor_result}}
  81. </view>
  82. </view>
  83. <view class="flex item" v-if="item.status>1">
  84. <view class="title">
  85. 处理时间:
  86. </view>
  87. <view class="content">
  88. {{item.processor_time}}
  89. </view>
  90. </view>
  91. <view class="item ">
  92. <view class="title">
  93. 已传图片:
  94. </view>
  95. <view class="content margin-t-20">
  96. <image @click="showImage(ls)" v-for="(ls,ind) in item.images" class="img margin-r-20" :src="ls"
  97. mode="scaleToFill">
  98. </image>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="order-item" v-if="item.status==3">
  103. <view class="masterWorker flex">
  104. <image class="imgUser" src="../../../static/error/missing-face.png" mode="scaleToFill"></image>
  105. <view class="padding-l-30">
  106. <view class="masterName">
  107. {{item.processor_user.staff_name}}
  108. </view>
  109. <view class="masterTime margin-t-20">
  110. 完成时间: {{item.processor_time}}
  111. </view>
  112. </view>
  113. </view>
  114. <view class="flex_item zhil">
  115. <view>响应速度:</view>
  116. <view>
  117. <uni-rate :readonly='true' text="1" size="20" margin="10" :value="item.response_score" >
  118. </uni-rate>
  119. </view>
  120. </view>
  121. <view class="flex_item zhil">
  122. <view>技术评分:</view>
  123. <view>
  124. <uni-rate :readonly='true' text="1" size="20" margin="10" :value="item.skill_score" >
  125. </uni-rate>
  126. </view>
  127. </view>
  128. <view class="flex_item zhil">
  129. <view>服务态度:</view>
  130. <view>
  131. <uni-rate :readonly='true' text="1" size="20" margin="10" :value="item.attitude_score" >
  132. </uni-rate>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="buttom flex" v-if="loadStatus==0">
  137. <view v-if="item.type==0" class="btn success" @click="showPopup">
  138. 安排人员前往
  139. </view>
  140. <view v-if="item.type==1&&item.processor_user" class="btn action" @click="showPopup">
  141. 已安排{{item.processor_user.staff_name}}前往维修
  142. </view>
  143. </view>
  144. <view class="buttom flex" v-if="loadStatus==1&&item.status==1">
  145. <view class="btn success" @click="onSetRw">
  146. 处理任务
  147. </view>
  148. </view>
  149. <view class="buttom flex" v-if="loadStatus==1&&item.status==2">
  150. <view class="btn action">
  151. 已处理完成
  152. </view>
  153. </view>
  154. <uni-popup ref="popup" type="bottom">
  155. <view class="alertBox">
  156. <view class="popupTitle">
  157. <text>安排维修人员</text>
  158. <image @click="outPopup" class="exitIcon" src="../../../static/icon/goodsExit.png" mode="widthFix">
  159. </image>
  160. </view>
  161. <scroll-view scroll-y="true" class="list">
  162. <view class="flex" v-for="(item,index) in mastList">
  163. <view class="avatarBox flex">
  164. <image class="avatar" :src="item.avatar" mode="scaleToFill"></image>
  165. <view class="padding-l-20 nameBox">
  166. <view class="name">
  167. {{item.staff_name}}
  168. </view>
  169. <view class="ordNum">
  170. 进行中任务:100
  171. </view>
  172. </view>
  173. </view>
  174. <view class="alertButtom bgGree" @click="setKfOrder(item)">
  175. 安排
  176. </view>
  177. <!-- <view class="alertButtom bgYellow" v-if="item.type==0">
  178. 更换
  179. </view> -->
  180. <!-- <view class="alertButtom bgGray" v-if="item.type==3">
  181. 取消
  182. </view> -->
  183. </view>
  184. </scroll-view>
  185. </view>
  186. </uni-popup>
  187. <uni-popup ref="popupImg" type="center">
  188. <image @click="hideShowImg" class="actionImgShow" :src="actionImg" mode="aspectFit"></image>
  189. </uni-popup>
  190. <uni-popup ref="popupDialog" type="dialog">
  191. <uni-popup-dialog mode="input" title='处理结果' confirmText='提交' placeholder="请输入处理结果" :duration="2000"
  192. @confirm="confirmSet">
  193. </uni-popup-dialog>
  194. </uni-popup>
  195. </view>
  196. </template>
  197. <script>
  198. import {
  199. questionInfo,
  200. adminKf,
  201. schedule_task,
  202. tasksave
  203. } from '@/api/shop.js';
  204. export default {
  205. data() {
  206. return {
  207. id: '', //保存orderid
  208. item: {},
  209. rateValue: [{
  210. text: '响应速度',
  211. value: 0,
  212. }, {
  213. text: '技术评分',
  214. value: 0,
  215. }, {
  216. text: '服务态度',
  217. value: 0,
  218. }],
  219. // 师父人数
  220. mastList: [],
  221. actionImg: '', //选中的图片
  222. loadStatus: 0, //默认可以查看安排维修按钮
  223. };
  224. },
  225. onLoad(opt) {
  226. if (opt.type) {
  227. this.loadStatus = opt.type;
  228. }
  229. this.id = opt.id;
  230. this.loadData();
  231. // 获取员工列表
  232. this.adminKf();
  233. },
  234. methods: {
  235. // 开始处理任务
  236. onSetRw() {
  237. this.$refs.popupDialog.open();
  238. },
  239. // 提交处理结果
  240. confirmSet(data) {
  241. if (!(data.trim())) {
  242. uni.showModal({
  243. title: '错误',
  244. content: '请输入处理结果',
  245. showCancel: false,
  246. });
  247. return
  248. }
  249. tasksave({
  250. id: this.item.id,
  251. processor_result: data,
  252. }).then((e) => {
  253. uni.showToast({
  254. title: e.msg
  255. })
  256. this.loadData();
  257. console.log(e);
  258. }).catch((e) => {
  259. console.log(e);
  260. })
  261. },
  262. // 拨打电话
  263. openPhone(item) {
  264. uni.makePhoneCall({
  265. phoneNumber: item //仅为示例
  266. });
  267. },
  268. // 显示图片弹窗
  269. showImage(item) {
  270. this.actionImg = item;
  271. this.$refs.popupImg.open();
  272. },
  273. // 隐藏图片显示弹窗
  274. hideShowImg() {
  275. this.$refs.popupImg.close();
  276. },
  277. // 安排维修人员
  278. setKfOrder(item) {
  279. const that = this;
  280. uni.showLoading({
  281. title: '安排中',
  282. mask: true
  283. });
  284. schedule_task({
  285. id: this.item.id,
  286. uid: item.uid
  287. }).then((e) => {
  288. uni.hideLoading()
  289. uni.showToast({
  290. title: e.msg
  291. });
  292. // 关闭弹窗
  293. that.outPopup();
  294. // 刷新页面
  295. that.loadData();
  296. console.log(e);
  297. }).catch((e) => {
  298. uni.hideLoading()
  299. uni.hideToast();
  300. uni.showModal({
  301. title: '错误',
  302. content: e.msg,
  303. showCancel: false,
  304. });
  305. console.log(e);
  306. })
  307. },
  308. // 员工列表
  309. adminKf() {
  310. adminKf().then((e) => {
  311. this.mastList = e.data;
  312. console.log(e);
  313. }).catch(() => {
  314. console.log(e);
  315. })
  316. },
  317. // 关闭弹窗
  318. outPopup() {
  319. this.$refs.popup.close()
  320. },
  321. loadData() {
  322. questionInfo({
  323. order_id: this.id
  324. }).then((e) => {
  325. this.item = e.data;
  326. this.item.images = this.item.images.split(',')
  327. this.item.type = e.data.status;
  328. console.log(e);
  329. }).catch((e) => {
  330. console.log(e);
  331. })
  332. },
  333. // 显示底部弹窗
  334. showPopup() {
  335. console.log('点击');
  336. if (this.item.type == 0) {
  337. this.$refs.popup.open()
  338. }
  339. if (this.item.type == 1) {
  340. uni.showModal({
  341. title: '提示',
  342. content: '已安排了工作人员无法重新安排',
  343. showCancel: false,
  344. });
  345. }
  346. }
  347. }
  348. };
  349. </script>
  350. <style lang="scss">
  351. .order-item {
  352. display: flex;
  353. flex-direction: column;
  354. padding: 30rpx 0;
  355. border-radius: 20rpx;
  356. background: #fff;
  357. margin: 0 $page-row-spacing;
  358. .masterWorker {
  359. padding: 0 30rpx;
  360. border-bottom: 1px solid $page-color-light;
  361. padding-bottom: 30rpx;
  362. justify-content: flex-start;
  363. .masterTime {
  364. font-size: 22rpx;
  365. color: $font-color-light;
  366. }
  367. .masterName {
  368. color: $font-color-base;
  369. font-size: 28rpx;
  370. font-weight: bold;
  371. }
  372. .imgUser {
  373. width: 120rpx;
  374. height: 120rpx;
  375. border-radius: 100rpx;
  376. }
  377. }
  378. .flex_item {
  379. margin: 0 30rpx;
  380. color: $font-color-base;
  381. font-size: $font-base;
  382. &.zhil {
  383. font-size: 28rpx !important;
  384. padding: 15rpx 0;
  385. }
  386. }
  387. }
  388. .actionImgShow {
  389. height: 100vh;
  390. width: 750rpx;
  391. }
  392. .alertBox {
  393. border-top-left-radius: 20rpx;
  394. border-top-right-radius: 20rpx;
  395. background-color: #FFF;
  396. height: 1000rpx;
  397. .popupTitle {
  398. font-size: $font-lg;
  399. position: relative;
  400. font-weight: bold;
  401. line-height: 1;
  402. height: 130rpx;
  403. line-height: 130rpx;
  404. text-align: center;
  405. .exitIcon {
  406. width: 50rpx;
  407. position: absolute;
  408. top: 40rpx;
  409. right: 50rpx;
  410. }
  411. }
  412. .list {
  413. height: 870rpx;
  414. padding: 0 50rpx;
  415. .avatar {
  416. width: 100rpx;
  417. height: 100rpx;
  418. border-radius: 100rpx;
  419. }
  420. .alertButtom {
  421. width: 160rpx;
  422. height: 60rpx;
  423. color: #FFFFFF;
  424. border-radius: 100rpx;
  425. font-size: 24rpx;
  426. line-height: 60rpx;
  427. text-align: center;
  428. &.bgGree {
  429. background-color: $color-green;
  430. }
  431. &.bgYellow {
  432. background-color: $uni-color-warning;
  433. }
  434. &.bgGray {
  435. background-color: $font-color-disabled;
  436. }
  437. }
  438. .nameBox {
  439. .name {
  440. font-size: $font-base;
  441. color: $font-base;
  442. }
  443. .ordNum {
  444. font-size: 22rpx;
  445. color: $font-color-light;
  446. }
  447. }
  448. }
  449. }
  450. .itemBox {
  451. margin: 0 $page-row-spacing;
  452. margin-bottom: $page-row-spacing;
  453. background-color: #FFFFFF;
  454. border-radius: 20rpx;
  455. padding-top: 30rpx;
  456. padding-bottom: 10rpx;
  457. .item {
  458. justify-content: flex-start;
  459. padding: 30rpx;
  460. padding-top: 0;
  461. font-size: $font-base;
  462. .title {
  463. flex-shrink: 0;
  464. color: $font-color-base;
  465. }
  466. .content {
  467. color: $font-color-light;
  468. .img {
  469. width: 120rpx;
  470. height: 120rpx;
  471. border-radius: 20rpx;
  472. }
  473. .icon {
  474. width: 32rpx;
  475. }
  476. }
  477. }
  478. }
  479. .buttom {
  480. justify-content: space-around;
  481. padding-top: 50rpx;
  482. .btn {
  483. height: 80rpx;
  484. line-height: 80rpx;
  485. text-align: center;
  486. border-radius: 99rpx;
  487. color: #FFFFFF;
  488. flex-grow: 1;
  489. margin: 0 30rpx;
  490. &.success {
  491. background-color: $color-green;
  492. }
  493. &.action {
  494. background-color: $font-color-disabled;
  495. }
  496. // &.warning {
  497. // background-color: $uni-color-warning;
  498. // }
  499. }
  500. .borderGray {
  501. border: 1px solid $font-color-disabled;
  502. color: $font-color-disabled;
  503. }
  504. .borderGreed {
  505. border: 1px solid $color-green;
  506. color: $color-green;
  507. }
  508. }
  509. </style>