working.vue 13 KB

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