myReport.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view>
  3. <!-- 头部-->
  4. <cu-custom bgColor="bg-blue" :isBack="true">
  5. <block slot="backText">我的填报</block>
  6. <block slot="content"></block>
  7. <block slot="right">
  8. <view class=" flex justify-center" >
  9. <button class="margin-top-ssm cu-btn round line-blue bg-blue"><text class="cuIcon-add"></text>新建任务</button>
  10. </view>
  11. </block>
  12. </cu-custom>
  13. <!-- 切换卡-->
  14. <view class="nav_b solid-bottom">
  15. <view style="height:90rpx ;"></view>
  16. <view class="nav_b_1">
  17. <view :class="index==TabCur?'nav_one':'nav_1'" v-for="(item,index) in menuList" :key="index" @tap="tabSelect" :data-id="index">
  18. {{item}}
  19. <view :class="index==TabCur?'nav_zwf':''"></view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 内容 -->
  24. <scroll-view scroll-y="true">
  25. <!-- 已上报 -->
  26. <view v-if="TabCur==0">
  27. <view class="list_b">
  28. <view v-for="item in data" :key="item.id" class="list_1">
  29. <view class="list_tex">
  30. <!-- <image src="../../static/task/noTask.png"></image> -->
  31. <view class="list_right">
  32. <view class="list_right_2" style="color:#101010;margin-bottom: 20rpx;">
  33. {{item.title}}
  34. </view>
  35. <view class="list_right_1">
  36. {{item.nodePath}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="list_tex2">
  41. <text class="list_time">{{ item.reportDate}}</text>
  42. <!-- <text class="list_time">{{ item.report_date}}</text> -->
  43. <view class="list_button">
  44. <button class="list_button_1" @click="preview(item)">预览</button>
  45. <button class="list_button_2 " @click="navTo(item)">编辑</button>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 未上报 -->
  52. <view v-if="TabCur==1">
  53. <view class="list_b">
  54. <view class="list_1" v-for="item in data" :key="item.id">
  55. <view class="list_tex">
  56. <!-- <image src="../../static/task/noTask.png"></image> -->
  57. <view class="list_right">
  58. <view class="list_right_2" style="color:#101010;margin-bottom: 20rpx; ">
  59. {{item.title}}
  60. </view>
  61. <view class="list_right_1">
  62. {{item.nodePath}}
  63. </view>
  64. </view>
  65. </view>
  66. <view class="list_tex2">
  67. <text class="list_time">{{ item.createTime | timeStamp }}</text>
  68. <view class="list_button">
  69. <button class="list_button_0" @click="modelShow(item)">删除</button>
  70. <button class="list_button_1" @click="preview(item)">预览</button>
  71. <button class="list_button_2" @click="navTo(item)">编辑</button>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view v-if="data.length>0 && show" class="list_no">没有更多内容了~</view>
  78. <view v-if="data.length==0 && show" class="list_no">暂时没有填报内容~</view>
  79. </scroll-view>
  80. <view class="cu-modal" :class="modalName==true?'shows':''" style="z-index: 9999999999;">
  81. <view class="cu-dialog bg-white">
  82. <view class="padding-xl" style="color: black !important;">
  83. 您确定要删除当前资料吗?
  84. </view>
  85. <view class="cu-bar bg-white justify-end solid-top">
  86. <view class="action">
  87. <view style="color: black !important;" class=" text-sm margin-right" @click="modalName=false">取消</view>
  88. <view class="text-blue text-sm margin-left" @click="deleteData()" >确定删除</view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data() {
  98. return {
  99. TabCur:0,
  100. scrollLeft: 0,
  101. menuList:['已上报','未上报'],
  102. data:[],
  103. show:false,
  104. modalName:false,
  105. delData:[]
  106. }
  107. },
  108. onLoad() {
  109. this.findFormInstance(this.TabCur);
  110. },
  111. methods: {
  112. tabSelect(e) {
  113. this.data=[];
  114. this.TabCur = e.currentTarget.dataset.id;
  115. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  116. this.show=false;
  117. this.findFormInstance(this.TabCur);
  118. },
  119. navTo(data){
  120. //console.log(data)
  121. uni.navigateTo({
  122. url:"/pages/personBaseIndex/personBaseIndex?id="+data.processId
  123. })
  124. },
  125. findFormInstance(type){
  126. var that =this;
  127. if(type==1){
  128. type=0
  129. }else{
  130. type=1
  131. }
  132. var userId = uni.getStorageSync("userInfo").id;
  133. that.http.request("/app/myReport",{userId:userId,type:type}).then((res)=>{
  134. //返回来的数据和tab状态匹配才赋值
  135. if(that.TabCur != res.datas[0].isReport){
  136. that.data = res.datas;
  137. that.show=true;
  138. }
  139. //console.log(that.data)
  140. })
  141. },
  142. modelShow(data){
  143. this.modalName=true;
  144. this.delData = data;
  145. },
  146. deleteData(){
  147. var that =this;
  148. var userId = uni.getStorageSync("userInfo").id;
  149. that.http.request("/app/deleteInstance",{userId:userId,id:that.delData.id}).then((res)=>{
  150. if(res.result=="1"){
  151. that.$prompt.none("删除成功");
  152. setTimeout(function(){
  153. that.findFormInstance(that.TabCur);
  154. },1000)
  155. }
  156. });
  157. that.modalName=false;
  158. },
  159. preview(data){
  160. var that =this;
  161. that.http.request("/app/showOutView",{processId:data.processId}).then((res)=>{
  162. if(res.result=="1"){
  163. //console.log(res.data)
  164. if(res.datas.length <1){
  165. that.$prompt.none("无法生成预览");
  166. return
  167. }
  168. var encode=encodeURIComponent(res.data);
  169. uni.navigateTo({
  170. url:"/pages/view/preview/preview?preview="+ encode
  171. })
  172. }
  173. });
  174. // uni.navigateTo({
  175. // url:"/pages/view/preview/preview?processId="+data.formDataId
  176. // })
  177. }
  178. },
  179. filters: {
  180. timeStamp: function(value) {
  181. if (!value) return '';
  182. var now = new Date(value);
  183. var year = now.getFullYear();
  184. var month = now.getMonth() + 1;
  185. var hour = now.getHours() >=10 ? now.getHours() : "0"+now.getHours() ;
  186. var minutes = now.getMinutes() >=10 ? now.getMinutes() : "0"+now.getMinutes();
  187. var time = hour+":"+minutes;
  188. if (month < 10) {
  189. month = '0' + month
  190. }
  191. var date = now.getDate();
  192. if (date < 10) {
  193. date = '0' + date
  194. }
  195. return year + "-" + month + "-" + date+" "+time
  196. },
  197. }
  198. }
  199. </script>
  200. <style>
  201. page{
  202. background-color: white;
  203. }
  204. .nav_b{z-index: 5;background: #fff;position: fixed;left: 0;top:var(--status-bar-height);width: 750rpx; padding: 0 130rpx;}
  205. .nav_b_1{display: flex;align-items: center;justify-content: space-between;height: 100rpx;width: 490rpx;}
  206. .nav_one{font-size: 30rpx;color: #0A8CD5;font-weight: bold;position: relative;width: 170rpx;text-align: center;}
  207. .nav_1{font-size: 30rpx;color: #101010;font-weight: bold;width: 170rpx;text-align: center;}
  208. .nav_zwf{width: 170rpx;height: 4rpx;background-color: #0A8CD5;position: absolute;bottom: -24rpx;left: 0;border-radius: 20rpx;}
  209. .list_b{padding-top: 100rpx;}
  210. .list_1{padding: 30rpx 22rpx;border-bottom: 2rpx solid #E3E1E1;}
  211. /* .list_1:last-child{border-bottom: none;} */
  212. .list_tex{display: flex;align-items: center;}
  213. .list_tex image{width: 140rpx;height: 140rpx;margin-right: 22rpx;}
  214. /* .list_right{width: 544rpx;} */
  215. .list_right_1{
  216. font-size: 30rpx;
  217. color: #8A8A8A;
  218. overflow:hidden;
  219. text-overflow:ellipsis;
  220. display:-webkit-box;
  221. -webkit-box-orient:vertical;
  222. -webkit-line-clamp:2;
  223. }
  224. .list_right_2{font-size: 30rpx;color: #101010;line-height: 38rpx;text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical;}
  225. .list_tex2{display: flex;align-items: center;justify-content: space-between;padding-top: 18rpx;}
  226. .list_time{font-size: 26rpx;color: #8A8A8A;}
  227. .list_button{display: flex;}
  228. .list_button button{width: 140rpx;height: 60rpx;line-height: 60rpx;font-size: 26rpx;color: #fff;border-radius: 100rpx;}
  229. .list_button .list_button_0{color: #999;margin-right: 18rpx;}
  230. .list_button_1{background-color: #EF9D1E;margin-right: 18rpx;}
  231. .list_button_2{background-color: #0A8CD5;}
  232. uni-button:after{border: none;}
  233. .list_no{text-align: center;font-size: 26rpx;color: #AEAEAE;padding: 60rpx 0 200rpx;}
  234. .nav_one {
  235. margin-top: 4px !important;
  236. }
  237. .nav_1{
  238. margin-top: 4px !important;
  239. }
  240. .cu-dialog {
  241. width: 60% !important;
  242. }
  243. .cu-modal.shows {
  244. opacity: 1;
  245. transition-duration: 0.1s;
  246. /* -ms-transform: scale(1) !important;
  247. transform: scale(1) ; */
  248. overflow-x: hidden;
  249. overflow-y: auto;
  250. pointer-events: auto;
  251. }
  252. </style>