ldwritten.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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" fromstr='zdldps' :status="status" @getClose='getClose' :iteminfo="iteminfo" @getLinSubmit='getLinSubmit' @getldDelFn="getldDelFn"></pop-up>
  10. </view>
  11. </template>
  12. <script>
  13. import projectList from "@/components/projectlist/zdlist.vue"
  14. import {getlistzdldpsFn,getldpsFn,getputzdldpsFn,getdelzdldpsFn} from "@/api/zdwork/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(['fgw:ldps:edit'])||checkPermi(['fgw:ldps:remove'])){
  66. this.iteminfo=data;
  67. this.type=7;
  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. getputzdldpsFn(params).then(res=>{
  90. if(res.code==200){
  91. that.$toast(str)
  92. setTimeout(function(){
  93. that.pageNum=1;
  94. that.reachflag=true;
  95. that.list=[];
  96. that.getDataFn();
  97. // 刷新列表数据
  98. if(data.type!=0){
  99. uni.$emit('refreshdatalistzd','ldps');
  100. }
  101. that.type=0;
  102. },1500)
  103. }else{
  104. this.$toast(res.msg)
  105. }
  106. })
  107. },
  108. getldDelFn(){
  109. var params={};
  110. var that=this;
  111. params.id=this.iteminfo.id;
  112. params.xmId=this.datainfo.xmId
  113. getdelzdldpsFn(params).then(res=>{
  114. if(res.code==200){
  115. that.$toast('批示撤回成功')
  116. setTimeout(function(){
  117. uni.$emit('refreshdatalistzd','ldps');;
  118. that.pageNum=1;
  119. that.reachflag=true;
  120. that.list=[];
  121. that.getDataFn()
  122. that.type=0;
  123. },1500)
  124. }else{
  125. this.$toast(res.msg)
  126. }
  127. })
  128. },
  129. getDataFn(){
  130. var params={
  131. pageSize:this.pageSize,
  132. pageNum: this.pageNum,
  133. xmId:this.datainfo.xmId,
  134. // xmbh:this.datainfo.xmbh
  135. }
  136. getlistzdldpsFn(params).then(res=>{
  137. if(res.code==200){
  138. if (res.rows.length < this.pageSize) {
  139. this.reachflag = false
  140. this.wtdt = '到底了~';
  141. } else {
  142. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  143. if (num < res.total) {
  144. this.reachflag = true
  145. this.wtdt = '上拉加载更多'
  146. } else {
  147. this.reachflag = false
  148. this.wtdt = '到底了~';
  149. }
  150. }
  151. if (this.pageNum == 1) {
  152. this.list = res.rows;
  153. } else {
  154. this.list = this.list.concat(res.rows)
  155. }
  156. }else{
  157. this.$toast(res.msg)
  158. }
  159. })
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .allpage{min-height: 100vh;background: #ffffff;box-sizing: border-box;}
  166. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  167. input{}
  168. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  169. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  170. }
  171. .listtopb{
  172. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  173. view{text-align: center;}
  174. .tits{color: #666666;}
  175. .txt{color: #aaaaaa;}
  176. &.act{
  177. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  178. .tits{color: #343434;}
  179. .txt{color: #FE5706;}
  180. }
  181. }
  182. }
  183. .alllist{padding-top:10rpx ;}
  184. // 操作按钮
  185. .cluebtn{
  186. 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;
  187. &.btn1{background-color: #1FB9F7;flex: 1;}
  188. &.btn2{background-color:#FF6400;flex: 1;}
  189. }
  190. </style>