complete.vue 14 KB

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