editWork.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="content">
  3. <view class="suggestLine" v-for="(item,index) in list">
  4. <view class="suggestLineTop">建议({{index+1}})</view>
  5. <view class="suggestCont">{{item.suggest}}</view>
  6. <view class="suggestLineBottom">
  7. <view class="suggestLineBottomTxt">预计完成日期:{{item.orderFinishTime.slice(0,item.orderFinishTime.length-8)}}</view>
  8. <view class="suggestLineBottomTxt">负责人:{{item.managerName}}</view>
  9. </view>
  10. <image src="../../../static/img/report_weixiugai@2x.png" mode="" class="exeStateImg" v-if="item.exeState==0"></image>
  11. <image src="../../../static/img/_report_yixiugai@2x.png" mode="" class="exeStateImg" v-if="item.exeState==1"></image>
  12. <view class="lineBottom" v-if="item.exeState==0">
  13. <view class="goEditBtn" @click="edit(item)">修改作业</view>
  14. </view>
  15. <view class="workBox" v-if="item.exeState==1">
  16. <view class="workTitle">作业情况</view>
  17. <view class="exeContent">
  18. <view class="exeContent" v-if="item.exeContent">{{item.exeContent}}</view>
  19. </view>
  20. <view class="workImgBox">
  21. <image :src="img" mode="" v-for="(img,i) in item.exeImg.split(',')" class="workImg" @click="previewImage(img)"></image>
  22. </view>
  23. </view>
  24. <view v-if="item.exeState==1" class="suggestLineBottom">实际完成日期:{{item.exeTime.slice(0,item.exeTime.length-8)}}</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import nodata from '@/components/nodata/nodata.vue'
  30. export default {
  31. components: {
  32. nodata
  33. },
  34. data() {
  35. return {
  36. sheetID:'',
  37. list:'',
  38. type:0,
  39. }
  40. },
  41. onLoad(opt) {
  42. this.sheetID=opt.sheetID
  43. this.getData()
  44. },
  45. onShow() {
  46. if(this.sheetID){
  47. this.getData()
  48. }
  49. },
  50. methods: {
  51. previewImage(img){
  52. var arr=[];
  53. arr.push(img)
  54. // 预览图片
  55. uni.previewImage({
  56. urls: arr,
  57. longPressActions: {
  58. itemList: ['发送给朋友', '保存图片', '收藏'],
  59. success: function(data) {
  60. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  61. },
  62. fail: function(err) {
  63. console.log(err.errMsg);
  64. }
  65. }
  66. });
  67. },
  68. getData() {
  69. uni.showLoading({
  70. title: '加载中'
  71. })
  72. let url = 'accompany/SuperCheckSheet/querySuperCheckSheetSuggestList',
  73. params = {
  74. sheetID:this.sheetID
  75. }
  76. this.$http(url, params, 'GET').then(res => {
  77. var list=res.data;
  78. var list1=[];
  79. var list2=[];
  80. list.forEach(item=>{
  81. if(item.exeState==1){
  82. list2.push(item)
  83. }else{
  84. list1.push(item)
  85. }
  86. })
  87. this.list=list1.concat(list2)
  88. })
  89. },
  90. edit(item){
  91. this.type=0;
  92. this.list.forEach(item=>{
  93. if(item.exeState==0){
  94. this.type++
  95. }
  96. })
  97. uni.navigateTo({
  98. url:'editWorkDetail?id='+item.id+'&type='+this.type+'&sheetID='+this.sheetID
  99. })
  100. }
  101. },
  102. // 下拉刷新 上拉加载更多
  103. onPullDownRefresh() {
  104. this.getData()
  105. setTimeout(function() {
  106. uni.stopPullDownRefresh();
  107. }, 1000);
  108. },
  109. }
  110. </script>
  111. <style scoped>
  112. .content {
  113. background: #F4F5F7;
  114. min-height: 100vh;
  115. padding: 24rpx 20rpx;
  116. }
  117. /* #ifdef H5 */
  118. .content {
  119. background: #F4F5F7;
  120. min-height: calc(100vh - 44px);
  121. padding: 24rpx 20rpx;
  122. }
  123. /* #endif */
  124. .suggestLine{
  125. background: #FFFFFF;
  126. border-radius: 10rpx;
  127. margin-top: 20rpx;
  128. position: relative;
  129. }
  130. .suggestLineTop{
  131. height: 76rpx;
  132. background: linear-gradient(270deg, rgba(255, 255, 255, 0.1) 0%, #FFE2D5 100%);
  133. line-height: 76rpx;
  134. color: #3C3C3C;
  135. font-size: 28rpx;
  136. padding-left: 20rpx;
  137. }
  138. .suggestCont{
  139. color: #3C3C3C;
  140. font-size: 28rpx;
  141. line-height: 40rpx;
  142. padding: 30rpx 20rpx;
  143. }
  144. .suggestLineBottom{
  145. display: flex;
  146. justify-content: space-between;
  147. color: #999999;
  148. font-size: 26rpx;
  149. padding: 0 20rpx 30rpx 20rpx;
  150. border-bottom: 1px solid #EEEEEE;
  151. }
  152. .exeStateImg{
  153. width: 116rpx;
  154. height: 96rpx;
  155. position: absolute;
  156. top: 0;
  157. right: 0;
  158. z-index: 11;
  159. }
  160. .goEditBtn{
  161. width: 150rpx;
  162. height: 56rpx;
  163. border-radius: 36rpx;
  164. border: 2rpx solid #FF4F00;
  165. line-height: 56rpx;
  166. text-align: center;
  167. font-size: 28rpx;
  168. color: #FF4F00;
  169. }
  170. .lineBottom{
  171. display: flex;
  172. justify-content: flex-end;
  173. padding: 20rpx;
  174. }
  175. .workBox{
  176. padding: 20rpx;
  177. }
  178. .workTitle{
  179. font-size: 26rpx;
  180. color: #666666;
  181. padding-bottom: 16rpx;
  182. }
  183. .exeContent{
  184. font-size: 28rpx;
  185. color: #3C3C3C;
  186. line-height: 40rpx;
  187. }
  188. .workImg{
  189. width: 150rpx;
  190. height: 150rpx;
  191. margin-right: 16rpx;
  192. margin-top: 20rpx;
  193. }
  194. .workImgBox{
  195. display: flex;
  196. flex-wrap: wrap;
  197. }
  198. </style>