finished.vue 14 KB

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