123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <template>
- <view class="listbox">
- <view class="fixedt">
- <!-- 选择器 -->
- <view class="flexc checkbox">
- <picker mode="date" fields="year" @change='bindDateChangea'>
- <view class="chekt">
- <view>{{sbsj|| "申报时间"}}</view>
- <image :src="upimg"></image>
- </view>
- </picker>
- <!-- <picker range-key='label' :value="shidx" :range="shlist" @change='bindDateChangeb'>
- <view class="chekt">
- <view>{{shzt || "申贷次数"}}</view>
- <image :src="upimg"></image>
- </view>
- </picker> -->
- <view class="reset" @click="getResetFn">
- <image :src="resetimg"></image>
- </view>
- <view class="topc flexc">
- <image :src="secimg"></image>
- <input placeholder="请输入企业名称" confirm-type="search" v-model="usename" @confirm="getConfirm"/>
- </view>
- </view>
- </view>
- <!-- 列表 -->
- <view class="plr18">
- <bus-list :datalist="list" :wtdt="wtdt" :type="type" @getXzFn="getXzFn"></bus-list>
- </view>
- <view class="scanbox flexcc">
- <image :src="scanimg"></image>
- 扫码查看
- </view>
- </view>
- </template>
- <script>
- import config from '@/config'
- const baseUrl = config.baseUrl
- const baseName = config.baseName
- import busList from "@/work/components/business/list.vue"
- import {getListOss} from "@/api/common.js"
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- export default{
- components:{busList},
- data(){
- return{
- secimg:require("@/static/images/home/hsearch.png"),
- upimg:require('@/work/static/images/sup.png'),
- resetimg:require('@/work/static/images/reset.png'),
- scanimg:require('@/work/static/images/scan.png'),
- list:[],
- pageSize: 10,
- pageNum: 1,
- reachflag: true,
- wtdt:'',
- // limit:''
- type:'nfiles',//file 老版, nfiles新版
- sbsj:'',
- usename:'',
- // type:'//file ',
- }
- },
- // 上拉触底加载更多触发事件
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getDataFn()
- }
- },
- onLoad() {
- this.getDataFn()
- },
- methods:{
- checkPermi, checkRole,
- getDetail(e){
- this.$tab.navigateTo("/work/pages/file/wjdetails?id="+e)
- },
- getConfirm(){
- this.getrefreshData()
- },
- getTabFn(val){
- this.tabval=val
- },
- bindDateChangea(e){
- var val=e.detail.value;
- this.sbsj=val;
- this.getrefreshData()
- },
- bindDateChangeb(e){
- var val=e.detail.value;
- this.shzt=this.shlist[val].label;
- this.shztid=this.shlist[val].value;
- this.getrefreshData()
- },
- getResetFn(){
- // 重置
- this.sbsj='';
- this.usename='';
- this.getrefreshData()
- },
- getrefreshData(){
- this.pageNum=1;
- this.list=[];
- this.reachflag=true;
- this.getDataFn()
- },
- getXzFn(ite){
- // 本地路径开头使用file://,跟上手机文件本地目录storage/emulated/0,
- // 后缀是用于文件命名和格式修改,大家可以使用变量。
- var url = baseUrl + ite.url;
- var name=ite.name;
- let dtask = plus.downloader.createDownload(url, {
- filename: 'file://storage/emulated/0/'+baseName+'/' + name
- }, (d, status) => {
- //d为下载的文件对象
- if (status == 200) {
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- mask: true,
- title: '已保存到文件夹:/'+baseName+'/'+ name, //保存路径
- duration: 3000,
- });
-
- //下载成功,d.filename是文件在保存在本地的相对路径,使用下面的API可转为平台绝对路径
- let fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
- setTimeout(() => {
- plus.runtime.openFile(d.filename); //选择软件打开文件
- }, 1500)
- } else {
- //下载失败
- uni.hideLoading();
- plus.downloader.clear(); //清除下载任务
- uni.showToast({
- icon: 'none',
- mask: true,
- title: '下载失败,请稍后重试',
- });
- }
- })
- dtask.start();
- },
- getDataFn(){
- var params={
- pageSize:this.pageSize,
- pageNum: this.pageNum,
- // loanApplicationType:4,
- }
- if(this.sbsj){
- params['params[beginTime]']=this.sbsj
- }
-
- if(this.usename){
- params.enterpriseName=this.usename
- }
- getListOss(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>
- .fixedt{position: fixed;left: 0;right: 0;top: 0;z-index: 2;}
- // .fixedt /deep/ uni-picker{flex: 1;}
- .checkbox{padding:16rpx 32rpx;background-color: #efefef;
- .chekt{display: flex;align-items: center;margin-right: 12rpx;height:88rpx;
- view{text-align: center;
- font-weight: bold;font-size: 26rpx;color: #374B61;width: 136rpx;word-break: break-all;text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;white-space: normal;}
- image{width: 16rpx;height: 12rpx;flex: 0 0 auto;margin-left: 4rpx;}
- }
- }
- .reset{width:56rpx; height: 88rpx;display: flex;align-items: center;justify-content: center;
- image{width: 26rpx;height: 30rpx;}
- }
- .topc{border-radius: 34rpx;height:68rpx;box-sizing: border-box;padding:0 28rpx;position: relative;flex:1;background-color:rgba(90, 135, 186, 0.2);width: 260rpx;
- margin-left: 20rpx;
- input{font-weight: 500;font-size: 26rpx;color: #222327;}
- image{width: 30rpx;height: 30rpx;margin-right: 16rpx;flex: 0 0 auto;}
- }
- .listbox{padding-top: 120rpx;padding-bottom: 100rpx;}
- .scanbox{position: fixed;left: 0;right: 0;bottom: 0;height: 100rpx;
- background: #00A9F0;font-weight: bold;font-size: 30rpx;color: #FFFFFF;
- image{width: 26rpx;height: 26rpx;margin-right: 24rpx;}
- }
- </style>
|