maintenanceTaks.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <view class="jpmain " >
  3. <u-navbar title="维修结果" title-color="#101010"></u-navbar>
  4. <view class="list" >
  5. <view class="item">
  6. <view class="name">
  7. 问题类型
  8. </view>
  9. <view class="value">
  10. {{floorlockErrorRecord.errorCodeText}}
  11. </view>
  12. </view>
  13. <view class="item item-plus" v-if="floorlockErrorRecord.errorDesc">
  14. <view class="name">
  15. 问题描述
  16. </view>
  17. <view class="value">
  18. {{floorlockErrorRecord.errorDesc}}
  19. </view>
  20. </view>
  21. <view class="item item-plus" v-if="imgList.length">
  22. <view class="name">
  23. 照片
  24. </view>
  25. <view class="value" style="display: block;">
  26. <img class="viewImg" v-for="(item,i) in imgList"
  27. @click="previewImage(i,'imgList')"
  28. :key="i"
  29. :src="item" mode=""></img>
  30. </view>
  31. </view>
  32. <view class="item">
  33. <view class="name">
  34. 创建时间
  35. </view>
  36. <view class="value">
  37. {{floorlockErrorRecord.createTime}}
  38. </view>
  39. </view>
  40. </view>
  41. <view class="list" >
  42. <view class="item" @click="gotoUrl('/pages/lockTab/dataLock?id='+floorlockInfo.id)" >
  43. <view class="name">
  44. 地锁编号
  45. </view>
  46. <view class="value">
  47. {{floorlockInfo.lockNo}}
  48. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  49. </view>
  50. </view>
  51. <view class="item">
  52. <view class="name">
  53. 地锁名称
  54. </view>
  55. <view class="value">
  56. {{floorlockInfo.name}}
  57. </view>
  58. </view>
  59. <view class="item">
  60. <view class="name">
  61. 所属停车场
  62. </view>
  63. <view class="value" @click="navigate">
  64. <view>{{parkingInfo.name}}</view>
  65. <image class="img" v-if="parkingInfo.latitude&&parkingInfo.longitude"
  66. src="@/assets/img/daohuang.png" mode=""></image>
  67. </view>
  68. </view>
  69. <view class="item" v-if="parkingInfo.address">
  70. <view class="name">
  71. 详细地址
  72. </view>
  73. <view class="value">
  74. {{parkingInfo.address}}
  75. </view>
  76. </view>
  77. </view>
  78. <view class="list" >
  79. <view class="item" v-if="floorlockErrorRecord.status!=0">
  80. <view class="name">
  81. 处理时间
  82. </view>
  83. <view class="value">
  84. {{floorlockErrorRecord.updateTime}}
  85. </view>
  86. </view>
  87. <view class="item item-plus" >
  88. <view class="name">
  89. 处理结果
  90. </view>
  91. <view class="value" v-if="floorlockErrorRecord.status==0" >
  92. <textarea placeholder="请记录处理步骤及结果"
  93. placeholder-class="textareaclass"
  94. v-model="taskInfo.desc"
  95. class="textarea"></textarea>
  96. </view>
  97. <view class="value" v-else >
  98. <textarea placeholder="请记录处理步骤及结果"
  99. placeholder-class="textareaclass"
  100. v-model="floorlockErrorRecord.repairDesc"
  101. class="textarea"></textarea>
  102. </view>
  103. </view>
  104. <view class="item item-plus" >
  105. <view class="name">
  106. 现场照片
  107. </view>
  108. <view class="value" v-if="floorlockErrorRecord.status==0" >
  109. <u-upload name="photoFile"
  110. ref="uUpload"
  111. :form-data="formData" :header="header" :action="action"
  112. :file-list="listPic" ></u-upload>
  113. </view>
  114. <view class="value" v-else >
  115. <img class="viewImg" v-for="(item,i) in repairImageList"
  116. @click="previewImage(i,'repairImageList')"
  117. :key="i"
  118. :src="item" mode=""></img>
  119. </view>
  120. </view>
  121. <view class="item" v-if="floorlockErrorRecord.status!=0">
  122. <view class="name">
  123. 处理人
  124. </view>
  125. <view class="value">
  126. {{floorlockErrorRecord.updateByName}}
  127. </view>
  128. </view>
  129. </view>
  130. <view class="floating-button" v-if="floorlockErrorRecord.status==0" >
  131. <view class="button" @click="submit" >
  132. 提交
  133. </view>
  134. </view>
  135. </view>
  136. </template>
  137. <script>
  138. import * as API from '@/apis/pagejs/pagesTask.js'
  139. import * as WxJsApi from '@/apis/utils/wxJsApi.js'
  140. export default {
  141. data() {
  142. return {
  143. listPic: [],
  144. action:"",
  145. formData:{
  146. },
  147. header:{
  148. },
  149. codeN:"",
  150. selectTaskInfoCode:false,
  151. selectTaskInfoCodeValue:[0],
  152. lockNo:"",
  153. lockName:"",
  154. floorlockInfo:{},
  155. floorlockErrorRecord:{},
  156. parkingInfo:{},
  157. taskInfo:{
  158. id:"",
  159. desc:"",
  160. images:"",
  161. },
  162. codeList:[],
  163. id:"",
  164. imgList:[],
  165. repairImageList:[],
  166. };
  167. },
  168. onLoad(op) {
  169. this.action=process.jphelp.BASE_URL+"uploadPicture"
  170. this.formData.subFolder="/floorlock/inspection/updateErr"
  171. var token=this.jphelp.getToken()
  172. this.header={
  173. 'Authorization':token
  174. }
  175. this.id=op.id
  176. this.errDetails()
  177. },
  178. onReady() {
  179. WxJsApi.getWxConfig([ 'openLocation']).then((res) => {
  180. // //(res)
  181. }).catch(error => {
  182. //(res)
  183. })
  184. },
  185. methods:{
  186. previewImage(i,name) {
  187. let imgs = this[name];
  188. //imgs.push(img);
  189. uni.previewImage({
  190. urls: imgs,
  191. current: i
  192. })
  193. },
  194. navigate() {
  195. var item=this.parkingInfo
  196. if(!(this.parkingInfo.latitude&&this.parkingInfo.longitude)){
  197. return
  198. }
  199. //console.log(item)
  200. uni.showLoading({
  201. })
  202. setTimeout(()=>{
  203. uni.hideLoading()
  204. },3*1000)
  205. WxJsApi.openLocation({
  206. latitude: parseFloat(item.latitude), //目的地latitude
  207. longitude: parseFloat(item.longitude), //目的地longitude
  208. name: item.name,
  209. address: item.address,
  210. scale: 15, //地图缩放大小,可根据情况具体调整
  211. success(res) {
  212. uni.hideLoading()
  213. },
  214. complete() {
  215. // uni.hideLoading()
  216. }
  217. });
  218. // //('station'+JSON.stringify(_self.stationDetail.station))
  219. // window.location.href = "https://uri.amap.com/marker?position=" + _self.stationDetail.station.longitude +
  220. // "," + _self.stationDetail.station.latitude + "&name=" + _self.stationDetail.station.name;
  221. },
  222. errDetails(){
  223. uni.showLoading({
  224. title: "加载中",
  225. mask: true,
  226. })
  227. API.errDetails({
  228. id:this.id
  229. }).then((res) => {
  230. this.floorlockErrorRecord=res.data.floorlockErrorRecord
  231. this.floorlockInfo=res.data.floorlockInfo
  232. this.parkingInfo=res.data.parkingInfo
  233. if(this.floorlockErrorRecord.errorImage){
  234. this.imgList=this.floorlockErrorRecord.errorImage.split(',')
  235. }
  236. if(this.floorlockErrorRecord.repairImage){
  237. this.repairImageList=this.floorlockErrorRecord.repairImage.split(',')
  238. }
  239. uni.hideLoading();
  240. }).catch(error => {
  241. uni.hideLoading();
  242. uni.showToast({
  243. title: error,
  244. icon: "none"
  245. })
  246. })
  247. },
  248. submit(){
  249. let files = [];
  250. // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
  251. files = this.$refs.uUpload.lists.filter(val => {
  252. return val.progress == 100;
  253. })
  254. // 如果您不需要进行太多的处理,直接如下即可
  255. // files = this.$refs.uUpload.lists;
  256. //(files);
  257. var imgUrl=files.map(item=>{
  258. return item.response.data;
  259. })
  260. //(imgUrl);
  261. this.taskInfo.images = imgUrl.join(',');
  262. this.taskInfo.id=this.id;
  263. uni.showLoading({
  264. title: "加载中",
  265. mask: true,
  266. })
  267. API.updateErr(this.taskInfo).then((res) => {
  268. const eventChannel = this.getOpenerEventChannel();
  269. eventChannel.emit('acceptDataFromOpenerPage', {})
  270. uni.showModal({
  271. title: '提示',
  272. showCancel: false,
  273. content: "操作成功",
  274. success: res1 => {
  275. if (res1.confirm) {
  276. uni.navigateBack()
  277. } else if (res1.cancel) {
  278. //('用户点击取消');
  279. }
  280. }
  281. })
  282. uni.hideLoading();
  283. }).catch(error => {
  284. uni.hideLoading();
  285. uni.showToast({
  286. title: error,
  287. icon: "none"
  288. })
  289. })
  290. },
  291. }
  292. }
  293. </script>
  294. <style lang="scss">
  295. .jpmain{padding-bottom: 120rpx;}
  296. .list{
  297. background-color: rgba(255,255,255,1);
  298. margin: 20rpx 0;
  299. .item:not(:last-child) {
  300. border-bottom:1px solid rgba(232,232,232,1);
  301. }
  302. .item{
  303. padding: 24rpx;
  304. display: flex;
  305. justify-content: space-between;
  306. .name{
  307. width: 40%;
  308. font-size: 32rpx;
  309. color: #777777;
  310. span{
  311. color:red
  312. }
  313. white-space: pre;
  314. }
  315. .value{
  316. font-size: 32rpx;
  317. width: 60%;
  318. display: flex;
  319. justify-content: space-between;
  320. input::placeholder{
  321. color:#AAAAAA;
  322. }
  323. .img{
  324. width: 40rpx;
  325. height: 40rpx;
  326. }
  327. .textarea{
  328. background-color: rgba(241,242,245,1);
  329. width: 100%;
  330. border-radius: 4px;
  331. }
  332. }
  333. }
  334. .item-plus{
  335. flex-direction: column;
  336. .value,.name{
  337. width: 100%;
  338. }
  339. .name{
  340. padding-bottom: 32rpx;
  341. }
  342. }
  343. }
  344. .textareaclass{
  345. padding:16rpx
  346. }
  347. .floating-button {
  348. position: fixed;
  349. bottom: 0; /* 距离底部 20px */
  350. width: 100%;
  351. display: flex;
  352. height: 120rpx;
  353. justify-content: center;
  354. background-color: rgba(255,255,255,1);
  355. .button{
  356. margin-top: 24rpx;
  357. border-radius: 50px;
  358. height: 80rpx;
  359. width: 80%;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. padding:12rpx;
  364. background-color: rgba(22,119,255,1);
  365. color: rgba(255,255,255,1);
  366. font-size: 36rpx;
  367. }
  368. }
  369. .viewImg{
  370. width: 160rpx;
  371. height: 160rpx;
  372. }
  373. </style>