complete.vue 13 KB

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