ldwritten.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="allpage">
  3. <view class="zhanline"></view>
  4. <view class="alllist">
  5. <!-- l列表 -->
  6. <project-list type='ldwritten' :datalist="list" :wtdt='wtdt' @getDetail="getDetail"></project-list>
  7. </view>
  8. <!-- 弹窗 -->
  9. <pop-up :type="type" :status="status" @getClose='getClose' :iteminfo="iteminfo" @getLinSubmit='getLinSubmit' @getldDelFn="getldDelFn"></pop-up>
  10. </view>
  11. </template>
  12. <script>
  13. import projectList from "@/components/projectlist/list.vue"
  14. import {getldwrlistFn,getldpsFn,getldpsputFn,getldpsdelFn} from "@/api/work/clue.js"
  15. import popUp from "@/components/popup/popup.vue"
  16. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  17. export default{
  18. data(){
  19. return{
  20. pageSize: 10,
  21. pageNum: 1,
  22. reachflag:true,
  23. itemslist:[],
  24. wtdt:'',
  25. tabidx:0,
  26. date:'',
  27. list:[],
  28. year:'',
  29. name:'',
  30. census:'',
  31. type:0,
  32. iteminfo:{},
  33. status:'add',
  34. deptId:this.$store.state.user.deptId,
  35. datainfo:{
  36. xmId:'',
  37. xmbh:'',
  38. xmmc:'',
  39. }
  40. }
  41. },
  42. components:{
  43. projectList,popUp
  44. },
  45. onUnload(){
  46. },
  47. onLoad(e) {
  48. var newobj=JSON.parse(decodeURIComponent(e.data))
  49. this.datainfo=newobj;
  50. this.getDataFn();
  51. },
  52. onReachBottom() {
  53. if (this.reachflag) {
  54. this.pageNum++
  55. this.getDataFn()
  56. }
  57. },
  58. methods:{
  59. checkPermi, checkRole,
  60. getClose(){
  61. this.type=0;
  62. },
  63. getDetail(data){
  64. //判断权限
  65. if(checkPermi(['system:ldps:update'])||checkPermi(['system:ldps:delete'])){
  66. this.iteminfo=data;
  67. this.type=3;
  68. this.status='update'
  69. }
  70. },
  71. getLinSubmit(data){
  72. var that=this;
  73. var params={};
  74. var str=''
  75. if(data.type==0){//暂存
  76. params.zcpsnr=data.psnr;
  77. params.type=1;
  78. str='批示暂存成功'
  79. }else{
  80. params.psnr=data.psnr;
  81. params.type=2;
  82. str='批示提交成功'
  83. }
  84. params.xmId=this.datainfo.xmId;
  85. params.xmbh=this.datainfo.xmbh;
  86. // params.xmmc=this.datainfo.xmmc;
  87. //修改
  88. params.id=this.iteminfo.id
  89. getldpsputFn(params).then(res=>{
  90. if(res.code==200){
  91. that.$toast(str)
  92. setTimeout(function(){
  93. if(data.type!=0){
  94. uni.$emit('refreshdatalist','ldps');
  95. }
  96. that.pageNum=1;
  97. that.reachflag=true;
  98. that.list=[];
  99. that.getDataFn();
  100. that.type=0;
  101. },1500)
  102. }else{
  103. this.$toast(res.msg)
  104. }
  105. })
  106. },
  107. getldDelFn(){
  108. var params={};
  109. var that=this;
  110. params.id=this.iteminfo.id;
  111. params.xmId=this.datainfo.xmId;
  112. getldpsdelFn(params).then(res=>{
  113. if(res.code==200){
  114. that.$toast('批示撤回成功')
  115. setTimeout(function(){
  116. uni.$emit('refreshdatalist','ldps');
  117. that.pageNum=1;
  118. that.reachflag=true;
  119. that.list=[];
  120. that.getDataFn()
  121. that.type=0;
  122. },1500)
  123. }else{
  124. this.$toast(res.msg)
  125. }
  126. })
  127. },
  128. getDataFn(){
  129. var params={
  130. pageSize:this.pageSize,
  131. pageNum: this.pageNum,
  132. xmId:this.datainfo.xmId,
  133. xmbh:this.datainfo.xmbh
  134. }
  135. getldwrlistFn(params).then(res=>{
  136. if(res.code==200){
  137. if (res.rows.length < this.pageSize) {
  138. this.reachflag = false
  139. this.wtdt = '到底了~';
  140. } else {
  141. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  142. if (num < res.total) {
  143. this.reachflag = true
  144. this.wtdt = '上拉加载更多'
  145. } else {
  146. this.reachflag = false
  147. this.wtdt = '到底了~';
  148. }
  149. }
  150. if (this.pageNum == 1) {
  151. this.list = res.rows;
  152. } else {
  153. this.list = this.list.concat(res.rows)
  154. }
  155. }else{
  156. this.$toast(res.msg)
  157. }
  158. })
  159. },
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .allpage{min-height: 100vh;background: #ffffff;box-sizing: border-box;}
  165. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  166. input{}
  167. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  168. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  169. }
  170. .listtopb{
  171. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  172. view{text-align: center;}
  173. .tits{color: #666666;}
  174. .txt{color: #aaaaaa;}
  175. &.act{
  176. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  177. .tits{color: #343434;}
  178. .txt{color: #FE5706;}
  179. }
  180. }
  181. }
  182. .alllist{padding-top:10rpx ;}
  183. // 操作按钮
  184. .cluebtn{
  185. display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 32rpx;color: #ffff;height: 100rpx;position: fixed;left: 0;right: 0;bottom: 0;z-index: 3;
  186. &.btn1{background-color: #1FB9F7;flex: 1;}
  187. &.btn2{background-color:#FF6400;flex: 1;}
  188. }
  189. </style>