working.vue 13 KB

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