123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view class="allpage">
- <view class="zhanline"></view>
- <view class="alllist">
- <!-- l列表 -->
- <project-list type='ldwritten' :datalist="list" :wtdt='wtdt' @getDetail="getDetail"></project-list>
-
- </view>
- <!-- 弹窗 -->
- <pop-up :type="type" :status="status" @getClose='getClose' :iteminfo="iteminfo" @getLinSubmit='getLinSubmit' @getldDelFn="getldDelFn"></pop-up>
- </view>
- </template>
- <script>
- import projectList from "@/components/projectlist/list.vue"
- import {getldwrlistFn,getldpsFn,getldpsputFn,getldpsdelFn} from "@/api/work/clue.js"
- import popUp from "@/components/popup/popup.vue"
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- export default{
- data(){
- return{
- pageSize: 10,
- pageNum: 1,
- reachflag:true,
- itemslist:[],
- wtdt:'',
- tabidx:0,
- date:'',
- list:[],
- year:'',
- name:'',
- census:'',
- type:0,
- iteminfo:{},
- status:'add',
- deptId:this.$store.state.user.deptId,
- datainfo:{
- xmId:'',
- xmbh:'',
- xmmc:'',
- }
- }
- },
- components:{
- projectList,popUp
- },
- onUnload(){
-
- },
- onLoad(e) {
- var newobj=JSON.parse(decodeURIComponent(e.data))
- this.datainfo=newobj;
- this.getDataFn();
- },
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- methods:{
- checkPermi, checkRole,
- getClose(){
- this.type=0;
- },
- getDetail(data){
- //判断权限
- if(checkPermi(['system:ldps:update'])||checkPermi(['system:ldps:delete'])){
- this.iteminfo=data;
- this.type=3;
- this.status='update'
- }
- },
- getLinSubmit(data){
- var that=this;
-
- var params={};
- var str=''
- if(data.type==0){//暂存
- params.zcpsnr=data.psnr;
- params.type=1;
- str='批示暂存成功'
- }else{
- params.psnr=data.psnr;
- params.type=2;
- str='批示提交成功'
- }
- params.xmId=this.datainfo.xmId;
- params.xmbh=this.datainfo.xmbh;
- // params.xmmc=this.datainfo.xmmc;
- //修改
- params.id=this.iteminfo.id
- getldpsputFn(params).then(res=>{
- if(res.code==200){
- that.$toast(str)
- setTimeout(function(){
- if(data.type!=0){
- uni.$emit('refreshdatalist','ldps');
- }
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.getDataFn();
- that.type=0;
- },1500)
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getldDelFn(){
- var params={};
- var that=this;
- params.id=this.iteminfo.id;
- params.xmId=this.datainfo.xmId;
- getldpsdelFn(params).then(res=>{
- if(res.code==200){
- that.$toast('批示撤回成功')
- setTimeout(function(){
- uni.$emit('refreshdatalist','ldps');
- that.pageNum=1;
- that.reachflag=true;
- that.list=[];
- that.getDataFn()
- that.type=0;
- },1500)
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- xmId:this.datainfo.xmId,
- xmbh:this.datainfo.xmbh
- }
- getldwrlistFn(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = '上拉加载更多'
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- }else{
- this.$toast(res.msg)
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .allpage{min-height: 100vh;background: #ffffff;box-sizing: border-box;}
- .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
- input{}
- image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
- .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
- }
- .listtopb{
- .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
- view{text-align: center;}
- .tits{color: #666666;}
- .txt{color: #aaaaaa;}
- &.act{
- &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
- .tits{color: #343434;}
- .txt{color: #FE5706;}
- }
- }
- }
- .alllist{padding-top:10rpx ;}
- // 操作按钮
- .cluebtn{
- 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;
- &.btn1{background-color: #1FB9F7;flex: 1;}
- &.btn2{background-color:#FF6400;flex: 1;}
- }
- </style>
|