working.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <template>
  2. <view class="box">
  3. <!-- <homenav :iStatusBarHeight="iStatusBarHeight" :title="'施工报告'"></homenav> -->
  4. <view class="topbox">
  5. <view class="IncoBox">
  6. <img src="../../static/img/icon_order_def.png" alt="" class="iconwg">
  7. <view class="wgTitle">施工报告</view>
  8. </view>
  9. </view>
  10. <view class="shopBox">
  11. <view class="shopleft">
  12. <img src="../../static/img/icon_store.png" alt="" class="shopIcon">
  13. <view class="shopNameBox">
  14. <view class="shopName">{{headInfo.shopName}}</view>
  15. <view class="shopAddress">{{headInfo.address?headInfo.address:''}}</view>
  16. </view>
  17. </view>
  18. <view class="shopRight" @click="call">
  19. <img src="../../static/img/icon_phone.png" alt="" class="wgCall">
  20. <view class="wgmobilePhone">电话</view>
  21. </view>
  22. </view>
  23. <view class="carBox">
  24. <view class="carLeft">
  25. <img src="../../static/img/icon_che.png" alt="" class="shopIcon">
  26. </view>
  27. <view class="carRight">
  28. <view class="carRtop">
  29. <view class="carCp">{{headInfo.plateNumber}}</view>
  30. <view class="carGongli" v-if="headInfo.currentMileage">{{headInfo.currentMileage}}km</view>
  31. </view>
  32. <view class="carMname">{{headInfo.carModel}}</view>
  33. </view>
  34. </view>
  35. <view class="newIiembox">
  36. <view class="newItime">
  37. <view class="newIname3">项目名称</view>
  38. <view class="newIname3">施工前照片</view>
  39. <view class="newIname3">施工后照片</view>
  40. <view class="newIname3">施工备注</view>
  41. </view>
  42. <view class="newItem" v-for="(v,i) in itemDetailList">
  43. <view class="newItemLine">
  44. <view class="newsectionName">{{v.sectionName}}</view>
  45. <view class="itemImgBox" >
  46. <view class="itemImghz" v-if="v.beforePhotoList" @click="sphotos(v.beforePhotoList.split(','))">
  47. <img :src="v.beforePhotoList.split(',')[0]" alt="" class="newcarPhotoImg">
  48. <view class="itemImgYy" v-if="v.beforePhotoList.split(',').length>1">
  49. <img src="../../static/timg/icon_pic.png" alt="" class="itemImgYyImg">
  50. <view class="itemImgYyNUm">{{v.beforePhotoList.split(',').length}}</view>
  51. </view>
  52. </view>
  53. <view class="itemImghz" v-else>
  54. <img src="../../static/timg/noimg.png" alt="" class="newcarPhotoImg">
  55. </view>
  56. </view>
  57. <view class="itemImgBox" >
  58. <view class="itemImghz" v-if="v.afterPhotoList" @click="sphotos(v.afterPhotoList.split(','))">
  59. <img :src="v.afterPhotoList.split(',')[0]" alt="" class="newcarPhotoImg">
  60. <view class="itemImgYy" v-if="v.afterPhotoList.split(',').length>1" >
  61. <img src=".../../static/timg/icon_pic.png" alt="" class="itemImgYyImg">
  62. <view class="itemImgYyNUm">{{v.afterPhotoList.split(',').length}}</view>
  63. </view>
  64. </view>
  65. <view class="itemImghz" v-else>
  66. <img src="../../static/timg/noimg.png" alt="" class="newcarPhotoImg">
  67. </view>
  68. </view>
  69. <view class="newsectionName">{{v.workComment?v.workComment:''}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. location: '',
  80. id: '',
  81. orderData: '',
  82. themeColor: '',
  83. authorizShow: false,
  84. userInfo: '',
  85. ext: '',
  86. wxOpenData: '',
  87. headInfo: {},
  88. itemDetailList: '',
  89. Photos:[],
  90. PhotosShow:false,
  91. demo01_index:0,
  92. iStatusBarHeight:'',
  93. }
  94. },
  95. onLoad(opt) {
  96. uni.setNavigationBarTitle({
  97. title: '施工报告' // 设定新标题
  98. });
  99. this.id = opt.id
  100. this.getData();
  101. },
  102. methods: {
  103. sphotos(img){
  104. console.log(img)
  105. // 预览图片
  106. uni.previewImage({
  107. urls: img,
  108. //current: img,
  109. longPressActions: {
  110. itemList: ['发送给朋友', '保存图片', '收藏'],
  111. success: function(data) {
  112. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  113. },
  114. fail: function(err) {
  115. console.log(err.errMsg);
  116. }
  117. }
  118. });
  119. },
  120. map() {
  121. console.log("打开地图")
  122. var that = this;
  123. if (!that.orderData.billsheet.lat || !that.orderData.billsheet.lng) {
  124. uni.showToast({
  125. title: '该店铺未设置定位',
  126. icon: 'none',
  127. duration: 3000
  128. });
  129. } else {
  130. uni.openLocation({
  131. latitude: Number(that.orderData.billsheet.lat),
  132. longitude: Number(that.orderData.billsheet.lng),
  133. name: that.orderData.billsheet.ShopName,
  134. address: that.orderData.billsheet.Address,
  135. success: function() {
  136. console.log('success');
  137. },
  138. fail(err) {
  139. console.log(err)
  140. }
  141. });
  142. }
  143. },
  144. call() {
  145. uni.makePhoneCall({
  146. phoneNumber: this.headInfo.mobilePhone
  147. });
  148. },
  149. getData() {
  150. let that = this
  151. uni.showLoading({
  152. title: '加载中'
  153. });
  154. this.$http('checkCarApi/workingReport', {
  155. sheetID:this.id,// '56D5F8C1-9F11-40BA-8937-B4AABD4666B5',
  156. }, 'GET').then(res => {
  157. uni.hideLoading();
  158. this.itemDetailList=res.data.itemDetailList;
  159. this.headInfo=res.data.headInfo;
  160. //console.log('data===', this.orderData);
  161. })
  162. },
  163. //时间对比
  164. getDateBeforeNow(stringTime) {
  165. console.log("传参未格式化", stringTime);
  166. stringTime = new Date(stringTime.replace(/-/g, '/'))
  167. // 统一单位换算
  168. var minute = 1000 * 60;
  169. var hour = minute * 60;
  170. var day = hour * 24;
  171. var week = day * 7;
  172. var month = day * 30;
  173. var year = month * 12;
  174. var time1 = new Date().getTime(); //当前的时间戳 console.log("当前时间", time1);
  175. // 对时间进行毫秒单位转换 var time2 = new Date(stringTime).getTime(); //指定时间的时间戳
  176. console.log("传过来的时间", time2);
  177. var time = time1 - time2;
  178. console.log("计算后的时间", time);
  179. var result =
  180. null; // if (time < 0) { // // alert("传过来的时间的时间不能晚于当前时间!"); // result = stringTime; // } else if (time / year >= 1) {
  181. // result = parseInt(time / year) + "年前";
  182. // } else if (time / month >= 1) {
  183. // result = parseInt(time / month) + "月前";
  184. // } else if (time / week >= 1) { // result = parseInt(time / week) + "周前"; // } else if (time / day >= 1) {
  185. // result = parseInt(time / day) + "天前";
  186. // } else if (time / hour >= 1) { // result = parseInt(time / hour) + "小时前";
  187. // } else if (time / minute >= 1) {
  188. // result = parseInt(time / minute) + "分钟前"; // } else {
  189. // result = "刚刚"; // }
  190. if (time < 0) {
  191. // alert("传过来的时间的时间不能晚于当前时间!");
  192. result = -1;
  193. } else if (time / day >= 0) {
  194. result = parseInt(time / day); //多少天前
  195. }
  196. console.log("多少天前", result);
  197. return result;
  198. },
  199. goback() {
  200. uni.navigateBack({})
  201. },
  202. },
  203. onPullDownRefresh() {
  204. this.getData()
  205. setTimeout(function() {
  206. uni.stopPullDownRefresh();
  207. }, 1000);
  208. },
  209. }
  210. </script>
  211. <style scoped>
  212. .box{
  213. width: 100vw;
  214. min-height: 100vh;
  215. background: #F4F5F7;
  216. }
  217. .topbox{
  218. width: 750rpx;
  219. height: 200rpx;
  220. background: #FF0000;
  221. }
  222. .carBox{
  223. width: 702rpx;
  224. padding-bottom: 30rpx;
  225. background: #FFFFFF;
  226. border-radius: 10rpx;
  227. margin-left:24rpx;
  228. margin-top:20rpx;
  229. display: flex;
  230. }
  231. .shopBox{
  232. width: 702rpx;
  233. padding-bottom: 30rpx;
  234. background: #FFFFFF;
  235. border-radius: 10rpx;
  236. margin-left:24rpx;
  237. margin-top:-70rpx;
  238. display: flex;
  239. justify-content: space-between;
  240. }
  241. .shopleft{
  242. display: flex;
  243. padding-top: 32rpx;
  244. padding-left: 20rpx;
  245. }
  246. .shopNameBox{
  247. padding-left: 20rpx;
  248. }
  249. .shopAddress{
  250. width: 450rpx;color: #999999;padding-top: 10rpx;font-size: 24rpx;
  251. }
  252. .shopName{
  253. font-size: 30rpx;
  254. font-family: PingFangSC-Medium, PingFang SC;
  255. font-weight: 500;
  256. color: #3C3C3C;
  257. }
  258. .wgCall{
  259. width:44rpx;
  260. height:44rpx;
  261. }
  262. .carIcon{
  263. width: 72rpx;
  264. height: 72rpx;
  265. border-radius: 36rpx;
  266. }
  267. .wgmobilePhone{
  268. color: #999999;
  269. font-size: 24rpx;
  270. padding-top: 10rpx;
  271. }
  272. .shopRight{
  273. text-align: center;padding-top: 30rpx;
  274. padding-right: 20rpx;
  275. }
  276. .carRtop{
  277. display: flex;
  278. }
  279. .carCp{
  280. font-size: 30rpx;
  281. font-family: PingFangSC-Medium, PingFang SC;
  282. font-weight: 500;
  283. color: #333333;
  284. line-height: 36rpx;
  285. padding-right: 30rpx;
  286. }
  287. .carGongli{
  288. font-weight: 500;
  289. color: #F19D01;
  290. font-size: 24rpx;
  291. line-height: 36rpx;
  292. background: #FFF8EB;
  293. border-radius: 5rpx;
  294. padding: 0 10rpx;
  295. }
  296. .carLeft{
  297. padding-left: 20rpx;
  298. padding-top: 30rpx;
  299. padding-right: 20rpx;
  300. }
  301. .carMname{
  302. font-weight: 400;
  303. color: #999999;
  304. line-height: 33rpx;
  305. font-size: 24rpx;
  306. width: 570rpx;
  307. padding: 10rpx 0;
  308. overflow: hidden; /*内容会被修剪,并且其余内容是不可见的*/
  309. text-overflow:ellipsis; /*显示省略符号来代表被修剪的文本。*/
  310. white-space: nowrap;
  311. }
  312. .carRight{
  313. padding-top: 30rpx;
  314. }
  315. .reception{
  316. display: flex;
  317. }
  318. .receptionImg{
  319. width: 27rpx;
  320. height: 29rpx;
  321. }
  322. .receptionName{
  323. font-weight: 400;
  324. color: #999999;
  325. font-size: 24rpx;
  326. line-height: 29rpx;
  327. padding-left: 12rpx;
  328. }
  329. .itemLIne{
  330. width: 662rpx;
  331. margin-top: 20rpx;
  332. margin-left: 24rpx;
  333. background: #FFFFFF;
  334. border-radius: 10rpx;
  335. padding: 0 20rpx 15rpx 20rpx;
  336. }
  337. .itemTitieBox{
  338. display: flex;
  339. justify-content: space-between;
  340. padding: 28rpx 0;
  341. border-bottom: 1rpx solid #EEEEEE;
  342. }
  343. .itemTitle{
  344. font-weight: 500;
  345. color: #333333;
  346. line-height: 42rpx;
  347. font-size: 30rpx;
  348. }
  349. .itemstate{
  350. font-weight: 400;
  351. color: #3F90F7;
  352. line-height: 42rpx;
  353. font-size: 28rpx;
  354. }
  355. .Construction{
  356. display: flex;
  357. padding-top: 29rpx;
  358. padding-bottom: 15rpx;
  359. }
  360. .itemMs{
  361. font-weight: 400;
  362. color: #666666;
  363. font-size: 28rpx;
  364. }
  365. .personnel{
  366. font-weight: 400;
  367. color: #3C3C3C;
  368. font-size: 28rpx;
  369. padding-left: 72rpx;
  370. }
  371. .carPhotoImg{
  372. width: 150rpx;
  373. height: 150rpx;
  374. border-radius: 5rpx;
  375. margin-right: 20rpx;
  376. margin-top: 16rpx;
  377. }
  378. .carPhoto{
  379. display: flex;
  380. flex-wrap: wrap;
  381. }
  382. .carPhotoImg:nth-child(4n){
  383. margin-right: 0;
  384. }
  385. .carPhotoBox{
  386. padding-top: 15rpx;
  387. padding-bottom: 15rpx;
  388. }
  389. .IncoBox{
  390. display: flex;
  391. justify-content: center;
  392. padding-top:43rpx;
  393. }
  394. .iconwg{
  395. width:44rpx;
  396. height:44rpx;
  397. }
  398. .wgTitle{
  399. color:#ffffff;
  400. line-height:44rpx;
  401. padding-left: 18rpx;
  402. font-size: 36rpx;
  403. }
  404. .shopIcon{
  405. width:44rpx;
  406. height:44rpx;
  407. }
  408. .newIiembox{
  409. background: #ffffff;
  410. margin-top:20rpx;
  411. width: 702rpx;
  412. margin-left:24rpx;
  413. }
  414. .newItime{
  415. display: flex; border-bottom:1rpx solid #EEEEEE;
  416. }
  417. .newIname1{
  418. width:338rpx;
  419. text-align: center;
  420. color: #999999;
  421. padding:20rpx 0;
  422. }
  423. .newIname2{
  424. width:182rpx;
  425. text-align: center;
  426. color: #999999;
  427. padding:20rpx 0;
  428. }
  429. .newItemName{
  430. width:318rpx;
  431. color: #333333;
  432. padding-left:20rpx;
  433. height:150rpx;
  434. display: flex;
  435. align-items: center;
  436. }
  437. .newcarPhotoImg{
  438. width: 150rpx;
  439. height: 150rpx;
  440. border-radius: 10rpx;
  441. }
  442. .itemImgBox{
  443. width: 150rpx;
  444. padding:0 16rpx;
  445. height: 150rpx;
  446. }
  447. .itemImghz{
  448. width: 150rpx;
  449. height: 150rpx;
  450. border-radius: 10rpx;
  451. overflow: hidden;
  452. position: relative;
  453. }
  454. .itemImgYy{
  455. position:absolute;
  456. width: 68rpx;
  457. height: 36rpx;
  458. background: rgba(0, 0, 0, 0.4);
  459. border-radius: 10rpx 0rpx 10rpx 0rpx;
  460. display: flex;
  461. justify-content: center;
  462. align-items: center;
  463. bottom:0;
  464. right:0;
  465. }
  466. .newItemLine{
  467. display: flex;
  468. padding:20rpx 0;
  469. border-bottom:1rpx solid #EEEEEE;
  470. }
  471. .itemImgYyImg{
  472. width: 26rpx;
  473. height: 26rpx;
  474. }
  475. .itemImgYyNUm{
  476. color: #FFFFFF;
  477. line-height: 26rpx;
  478. font-size: 22rpx;
  479. padding-left: 5rpx;
  480. }
  481. .lbImgBOx{
  482. position: fixed;
  483. width: 100%;
  484. height:100vh;
  485. background: rgba(0, 0, 0, 0.9);
  486. left: 0;
  487. top: 0;
  488. display: flex;
  489. justify-content: center;
  490. align-items: center;
  491. }
  492. .lbImgview{
  493. width:100%;
  494. }
  495. .newIname3{
  496. width:175rpx;
  497. text-align: center;
  498. color: #999999;
  499. padding:20rpx 0;
  500. font-size: 24rpx;
  501. }
  502. .newsectionName{
  503. width:155rpx;
  504. color: #333333;
  505. padding-left:20rpx;
  506. height:150rpx;
  507. display: flex;
  508. align-items: center;
  509. font-size: 26rpx;
  510. }
  511. .authorizBox{
  512. width: 100vw;
  513. height: 100vh;
  514. background: rgba(0, 0, 0, 0.5);
  515. position: fixed;
  516. top: 0;
  517. left: 0;
  518. }
  519. .authorizCont{
  520. margin-top: 30vh;
  521. width: 564rpx;
  522. height: 408rpx;
  523. background: #FFFFFF;
  524. border-radius: 24rpx;
  525. margin-left: 93rpx;
  526. position: relative;
  527. }
  528. .authorizCloseImg{
  529. width: 62rpx;
  530. height: 62rpx;
  531. }
  532. .sqLogoBox{
  533. width: 180rpx;
  534. height: 180rpx;
  535. background: #FFFFFF;
  536. border-radius: 90rpx;
  537. text-align: center;
  538. position: absolute;
  539. top: -50rpx;
  540. left: 192rpx;
  541. }
  542. .authorizName{
  543. color: #333333;
  544. line-height: 42rpx;
  545. font-size: 30rpx;
  546. text-align: center;
  547. padding-top: 58rpx;
  548. }
  549. .authorizMs{
  550. color: #999999;
  551. line-height: 36rpx;
  552. font-size: 26rpx;
  553. width: 452rpx;
  554. padding-top: 24rpx;
  555. text-align: center;
  556. margin-left: 56rpx;
  557. }
  558. .authorizContbutton{
  559. width: 422rpx;
  560. height: 88rpx;
  561. background: #D53533;
  562. border-radius: 44rpx;
  563. line-height: 88rpx;
  564. text-align: center;
  565. font-size:30rpx;
  566. color: #FFFFFF;
  567. margin-top: 62rpx;
  568. margin-left:71rpx;
  569. }
  570. </style>