detail.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='工单详情'></cus-header>
  4. <div class="otitle">报修信息</div>
  5. <div class="form">
  6. <div class="item">
  7. <div class="left">报修时间</div>
  8. <div class="right">{{order.createDate||''}}</div>
  9. </div>
  10. <div class="item">
  11. <div class="left">报修位置</div>
  12. <div class="right">{{order.repairPosition||''}}</div>
  13. </div>
  14. <div class="item">
  15. <div class="left">报修区域</div>
  16. <div class="right">{{order.repairRegion==1?'公共区域':(order.repairRegion==2?'室内':'')}}</div>
  17. </div>
  18. <div class="item">
  19. <div class="left">报修类型</div>
  20. <div class="right">{{RepairType[order.repairType]||''}}</div>
  21. </div>
  22. <div class="item">
  23. <div class="left">联系人</div>
  24. <div class="right">{{order.contactPerson||''}}</div>
  25. </div>
  26. <div class="item">
  27. <div class="left">联系电话</div>
  28. <div class="right">{{order.contactPhone||''}}</div>
  29. </div>
  30. <div class="pre">
  31. <div class="title">故障描述</div>
  32. <div class="desc">{{order.faultDes||''}}</div>
  33. </div>
  34. </div>
  35. <div class="photos">
  36. <div class="title">照片</div>
  37. <div class="list">
  38. <div class="item" v-for="(item,index) in picList" :key="index">
  39. <image :src="item" style="width: 100%;height: 100%;"></image>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="otitle" v-if="order.status!=1">维修信息</div>
  44. <div class="form" v-if="order.status!=1">
  45. <div class="item">
  46. <div class="left">紧急程度</div>
  47. <div class="right">{{urgencyCfg[order.urgency]||''}}</div>
  48. </div>
  49. <div class="item">
  50. <div class="left">维修人员</div>
  51. <div class="right">{{order.repairPersonName||''}}</div>
  52. </div>
  53. <div class="item">
  54. <div class="left">联系电话</div>
  55. <div class="right">{{order.contactPhone||''}}</div>
  56. </div>
  57. <div class="item" v-if="order.status==3">
  58. <div class="left">维修完成时间</div>
  59. <div class="right">{{order.repairFinishTime||''}}</div>
  60. </div>
  61. </div>
  62. <div class="bottom">
  63. <div class="btn" v-if="order.status==1" @tap="show = true">指派维修人员</div>
  64. <div class="btn" v-else @tap="back">返回</div>
  65. </div>
  66. <u-popup :show="show" @cencel="close">
  67. <div class="popupbox">
  68. <div class="title">
  69. 指派
  70. <div class="close"><u-icon name="close" color="#B9C0C8" size="42"></u-icon></div>
  71. </div>
  72. <div class="pform">
  73. <div class="pitem">
  74. <div class="left">维修人员</div>
  75. <div class="right" @tap="userShow = true">
  76. <text v-if="order.repairPerson">{{order.repairPerson}} ></text>
  77. <div class="tip" v-else>请选择 <u-icon name="arrow-right" color="#B9C0C8" size="26"></u-icon></div>
  78. </div>
  79. </div>
  80. <div class="pitem">
  81. <div class="left">紧急程度</div>
  82. <div class="right" @tap="engreShow = true">
  83. <text v-if="order.engreLevel">{{order.engreLevel}} ></text>
  84. <div class="tip" v-else>请选择 <u-icon name="arrow-right" color="#B9C0C8" size="26"></u-icon></div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="btn" @tap="submit">提交</div>
  89. </div>
  90. </u-popup>
  91. <u-picker :show="userShow" :columns="userColumns" keyName="label" @cancel="userShow=false" @confirm="e=>orderConfirm(e,'renyuanid','repairPerson')"></u-picker>
  92. <u-picker :show="engreShow" :columns="engreColumns" keyName="label" @cancel="engreShow=false" @confirm="e=>orderConfirm(e,'jjcd','engreLevel')"></u-picker>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data(){
  98. return {
  99. companyOrgId:'',
  100. renyuanid:'',
  101. jjcd:'',
  102. order:{},
  103. RepairType:{},
  104. urgencyCfg:{
  105. 1:'非常紧急',
  106. 2:'紧急',
  107. 3:'普通'
  108. },
  109. show:false,
  110. userShow:false,
  111. userColumns:[
  112. []
  113. ],
  114. engreShow:false,
  115. engreColumns:[
  116. [{id:1,label:'非常紧急'},{id:2,label:'紧急'},{id:3,label:'普通'}]
  117. ],
  118. picList:[]
  119. }
  120. },
  121. async onLoad(option) {
  122. this.companyOrgId = option.id;
  123. await this.getRepairTypeData();
  124. this.getUserList();
  125. this.getDetail(option.id);
  126. },
  127. methods:{
  128. async getRepairTypeData(){
  129. let res = await this.$api.get('/sys/dict/data/getListByType/RepairType');
  130. if(res.data.code===0){
  131. res.data.data.forEach(d=>{
  132. this.RepairType[d.dictValue]=d.dictLabel;
  133. })
  134. }else this.$showToast(res.data.msg)
  135. },
  136. getUserList(){
  137. this.$api.get('/user/list',{page:1,limit:9999}).then(res=>{
  138. if(res.data.code===0){
  139. res.data.data.forEach(d=>{
  140. this.userColumns[0].push({id:d.id,label:d.realName})
  141. })
  142. }else this.$showToast(res.data.msg)
  143. })
  144. },
  145. getDetail(id){
  146. this.$api.get('/repairorder/'+id).then(res=>{
  147. if(res.data.code===0){
  148. this.order = res.data.data;
  149. this.picList = this.order.faultPics.split(',');
  150. }else this.$showToast(res.data.msg)
  151. })
  152. },
  153. close(){
  154. this.show = false;
  155. this.order = {};
  156. },
  157. back(){
  158. uni.navigateBack();
  159. },
  160. orderConfirm(e,key1,key2){
  161. this[key1] = e.value[0].id;
  162. this.order[key2] = e.value[0].label;
  163. this.userShow = this.engreShow = false;
  164. },
  165. submit(){
  166. if(!this.renyuanid) return this.$showToast('请选择维修人员')
  167. if(!this.jjcd) return this.$showToast('请选择紧急程度')
  168. this.$api.put('/repairorder',{
  169. id: this.companyOrgId,
  170. repairPersonId: this.renyuanid,
  171. urgency: this.jjcd,
  172. }).then(res=>{
  173. if(res.data.code===0){
  174. this.$showToast('提交成功');
  175. setTimeout(()=>{
  176. uni.redirectTo({
  177. url:'/pagesInspection/waitOrder/index?status=2'
  178. })
  179. },1500)
  180. }else this.$showToast(res.data.msg)
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style scoped lang="less">
  187. ::v-deep .u-popup__content{
  188. border-radius: 40rpx 40rpx 0 0 !important;
  189. }
  190. .page{
  191. padding-bottom: 168rpx;
  192. background: #F4F8FB;
  193. box-sizing: border-box;
  194. .otitle{
  195. font-family: PingFang-SC, PingFang-SC;
  196. font-weight: bold;
  197. font-size: 32rpx;
  198. color: #1D2129;
  199. line-height: 36rpx;
  200. margin-top: 40rpx;
  201. padding-left: 24rpx;
  202. }
  203. .form{
  204. width: 100%;
  205. background: #FFFFFF;
  206. margin-top: 24rpx;
  207. .item{
  208. height: 98rpx;
  209. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EDF4FF;
  210. padding: 0 30rpx;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. .left{
  215. font-family: PingFangSC, PingFang SC;
  216. font-weight: 400;
  217. font-size: 30rpx;
  218. color: #1D2129;
  219. line-height: 42rpx;
  220. }
  221. .right{
  222. font-family: PingFangSC, PingFang SC;
  223. font-weight: 400;
  224. font-size: 30rpx;
  225. color: #4E5969;
  226. line-height: 42rpx;
  227. text-align: right;
  228. }
  229. }
  230. .pre{
  231. padding: 28rpx 24rpx 56rpx;
  232. .title{
  233. font-family: PingFangSC, PingFang SC;
  234. font-weight: 400;
  235. font-size: 30rpx;
  236. color: #1D2129;
  237. line-height: 42rpx;
  238. }
  239. .desc{
  240. font-family: PingFangSC, PingFang SC;
  241. font-weight: 400;
  242. font-size: 30rpx;
  243. color: #4E5969;
  244. line-height: 42rpx;
  245. margin-top: 28rpx;
  246. }
  247. }
  248. }
  249. .photos{
  250. width: 100%;
  251. padding: 28rpx 30rpx 36rpx;
  252. box-sizing: border-box;
  253. margin-top: 20rpx;
  254. background: #FFFFFF;
  255. .title{
  256. font-family: PingFangSC, PingFang SC;
  257. font-weight: 400;
  258. font-size: 30rpx;
  259. color: #1D2129;
  260. line-height: 42rpx;
  261. }
  262. .list{
  263. display: flex;
  264. flex-wrap: wrap;
  265. justify-content: space-between;
  266. .item{
  267. width: calc(100% / 3 - 30rpx);
  268. height: 220rpx;
  269. margin-top: 24rpx;
  270. }
  271. }
  272. }
  273. .bottom{
  274. width: 100%;
  275. height: 148rpx;
  276. background: #FFFFFF;
  277. padding: 20rpx 48rpx 0;
  278. box-sizing: border-box;
  279. position: fixed;
  280. left: 0;
  281. bottom: 0;
  282. .btn{
  283. width: 100%;
  284. height: 88rpx;
  285. background: #198CFF;
  286. border-radius: 16rpx;
  287. font-family: PingFang-SC, PingFang-SC;
  288. font-weight: bold;
  289. font-size: 32rpx;
  290. color: #FFFFFF;
  291. line-height: 88rpx;
  292. text-align: center;
  293. letter-spacing: 2rpx;
  294. }
  295. }
  296. .popupbox{
  297. width: 100%;
  298. border-radius: 40rpx 40rpx 0 0;
  299. padding: 42rpx 24rpx 94rpx;
  300. box-sizing: border-box;
  301. background: #FFFFFF;
  302. .title{
  303. font-family: PingFang-SC, PingFang-SC;
  304. font-weight: bold;
  305. font-size: 32rpx;
  306. color: #1D2129;
  307. line-height: 36rpx;
  308. text-align: center;
  309. position: relative;
  310. .close{
  311. position: absolute;
  312. right: 0;
  313. top: 0;
  314. }
  315. }
  316. .pform{
  317. margin-top: 40rpx;
  318. .pitem{
  319. height: 90rpx;
  320. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECECEC;
  321. display: flex;
  322. align-items: center;
  323. justify-content: space-between;
  324. .left{
  325. font-family: PingFangSC, PingFang SC;
  326. font-weight: 400;
  327. font-size: 30rpx;
  328. color: #1D2129;
  329. line-height: 42rpx;
  330. }
  331. .right{
  332. font-family: PingFangSC, PingFang SC;
  333. font-weight: 400;
  334. font-size: 28rpx;
  335. color: #1D2129;
  336. line-height: 40rpx;
  337. text-align: right;
  338. .tip{
  339. color: #B9C0C8;
  340. display: flex;
  341. align-items: center;
  342. }
  343. }
  344. }
  345. }
  346. .btn{
  347. width: calc(100% - 48rpx);
  348. height: 88rpx;
  349. background: #198CFF;
  350. border-radius: 16rpx;
  351. margin: 80rpx 24rpx 0;
  352. font-family: PingFang-SC, PingFang-SC;
  353. font-weight: bold;
  354. font-size: 32rpx;
  355. color: #FFFFFF;
  356. line-height: 88rpx;
  357. text-align: center;
  358. letter-spacing: 2rpx;
  359. }
  360. }
  361. }
  362. </style>