|
@@ -1,379 +0,0 @@
|
|
-<template>
|
|
|
|
- <view>
|
|
|
|
- <!-- 弹窗 -->
|
|
|
|
- <view class="bgbox" @click="getClose" v-if="type"></view>
|
|
|
|
- <!-- 指派 -->
|
|
|
|
- <view v-if="type=='assign'" class="assignbox">
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- import config from '@/config'
|
|
|
|
- const baseUrl = config.baseUrl
|
|
|
|
- import { getToken } from '@/utils/auth'
|
|
|
|
- import {uploadmore} from '@/utils/common.js'
|
|
|
|
- export default{
|
|
|
|
- components:{},
|
|
|
|
- props:{
|
|
|
|
- type: {
|
|
|
|
- type: String,
|
|
|
|
- default () {
|
|
|
|
- return ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- finshtype:{
|
|
|
|
- type: [String,Number],
|
|
|
|
- default () {
|
|
|
|
- return ''
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- data(){
|
|
|
|
- return{
|
|
|
|
- //附件
|
|
|
|
- option: {
|
|
|
|
- // 上传服务器地址,需要替换为你的接口地址
|
|
|
|
- url: baseUrl+'/common/uploadNew', // 该地址非真实路径,需替换为你项目自己的接口地址
|
|
|
|
- // 上传附件的key
|
|
|
|
- name: 'file',
|
|
|
|
- // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
|
|
|
|
- header: {
|
|
|
|
- // 示例参数可删除
|
|
|
|
- 'Authorization': 'Bearer ' + getToken(),
|
|
|
|
- },
|
|
|
|
- // 根据你接口需求自定义body参数
|
|
|
|
- formData: {
|
|
|
|
- loanApplicationNumber:'',
|
|
|
|
- loanApplicationId:'',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 借据上传
|
|
|
|
- jjoption: {
|
|
|
|
- // 上传服务器地址,需要替换为你的接口地址
|
|
|
|
- url: baseUrl+'/common/uploadNewOcr', // 该地址非真实路径,需替换为你项目自己的接口地址
|
|
|
|
- // 上传附件的key
|
|
|
|
- name: 'file',
|
|
|
|
- // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
|
|
|
|
- header: {
|
|
|
|
- // 示例参数可删除
|
|
|
|
- 'Authorization': 'Bearer ' + getToken(),
|
|
|
|
- },
|
|
|
|
- // 根据你接口需求自定义body参数
|
|
|
|
- formData: {
|
|
|
|
- loanApplicationNumber:'',
|
|
|
|
- loanApplicationId:'',
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 选择文件后是否立即自动上传,true=选择后立即上传
|
|
|
|
- instantly: true,
|
|
|
|
- // 必传宽高且宽高应与slot宽高保持一致
|
|
|
|
- width: '',
|
|
|
|
- height: '40rpx',
|
|
|
|
- // 限制允许上传的格式,空串=不限制,默认为空
|
|
|
|
- formats: 'doc,docx,xls,xlsx,ppt,txt,pdf,zip,rar,word,png,jpg,jpeg',
|
|
|
|
- // 文件上传大小限制
|
|
|
|
- size: 100,
|
|
|
|
- // 文件数量限制 默认10
|
|
|
|
- count: 5,
|
|
|
|
- // 文件回显列表
|
|
|
|
- files: new Map(),
|
|
|
|
- // 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
|
|
|
|
- wxFiles: [],
|
|
|
|
- // 是否打印日志
|
|
|
|
- debug: false,
|
|
|
|
- filelist:[{name:"123"}],
|
|
|
|
- filico:require('@/work/static/filico.png'),
|
|
|
|
- fdelimg:require('@/work/static/fjdel.png'),
|
|
|
|
-
|
|
|
|
- baseUrl:config.baseUrl,
|
|
|
|
- closeimg:require("@/static/images/close.png"),
|
|
|
|
- syqxidx:'',
|
|
|
|
- datainfo:{
|
|
|
|
- iszc:""
|
|
|
|
- },
|
|
|
|
- sexs: [{
|
|
|
|
- text: '男',
|
|
|
|
- value: 1
|
|
|
|
- }, {
|
|
|
|
- text: '女',
|
|
|
|
- value: 2
|
|
|
|
- }],
|
|
|
|
- peoval:0,
|
|
|
|
- peolist:[]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted() {
|
|
|
|
- this.baseUrl=baseUrl
|
|
|
|
- },
|
|
|
|
- watch:{
|
|
|
|
- loanApplicationNumber(val){
|
|
|
|
- this.option.formData.loanApplicationNumber=val
|
|
|
|
- this.jjoption.formData.loanApplicationNumber=val
|
|
|
|
- },
|
|
|
|
- loanApplicationId(val){
|
|
|
|
- this.option.formData.loanApplicationId=val
|
|
|
|
- this.jjoption.formData.loanApplicationId=val
|
|
|
|
- },
|
|
|
|
- type(val){
|
|
|
|
- // this.filelist=[];
|
|
|
|
- // this.shtext='';
|
|
|
|
- // this.isty='2';
|
|
|
|
- // this.phofile=[];
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods:{
|
|
|
|
- bindDateChange(){
|
|
|
|
- var val=e.detail.value;
|
|
|
|
- },
|
|
|
|
- getClose(){
|
|
|
|
- this.$emit('getClose')
|
|
|
|
- },
|
|
|
|
- getSure(){
|
|
|
|
- this.$emit('getSure')
|
|
|
|
- },
|
|
|
|
- getChose(val){
|
|
|
|
- this.peoval=val
|
|
|
|
- },
|
|
|
|
- getPreviewImage(arr,idx){
|
|
|
|
- var newArr=[];
|
|
|
|
- arr.forEach(ite=>{
|
|
|
|
- var ds=this.baseUrl+ite
|
|
|
|
- newArr.push(ds)
|
|
|
|
- })
|
|
|
|
- uni.previewImage({
|
|
|
|
- urls: newArr,
|
|
|
|
- current:idx,
|
|
|
|
- success: function(data) {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- fail: function(err) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 上传
|
|
|
|
- onuploadEnd(item,fileVal,bigType) {
|
|
|
|
- var newobj={}
|
|
|
|
- var responseText=JSON.parse(item.responseText)
|
|
|
|
- if(responseText.code==200){
|
|
|
|
- if(fileVal=='qtfj'){
|
|
|
|
- newobj.name=responseText.originalFilename;
|
|
|
|
- }else{
|
|
|
|
- newobj.name=responseText.newFileName;
|
|
|
|
- }
|
|
|
|
- newobj.oldName=responseText.originalFilename;
|
|
|
|
- newobj.url=responseText.fileName;
|
|
|
|
- newobj.type=fileVal;
|
|
|
|
- newobj.bigType=bigType;
|
|
|
|
- newobj.loanApplicationId=this.loanApplicationId;
|
|
|
|
- newobj.loanApplicationNumber=this.loanApplicationNumber;
|
|
|
|
- this.filelist.push(newobj)
|
|
|
|
- }else{
|
|
|
|
- this.$toast(responseText.msg)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- getDelFj(idx){
|
|
|
|
- var that=this;
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '确认删除',
|
|
|
|
- content: "是否确认删除",
|
|
|
|
- cancelText: '取消',
|
|
|
|
- confirmText: '确认',
|
|
|
|
- success: function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- that.filelist.splice(idx,1)
|
|
|
|
- } else if (res.cancel) {
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- getDown(path,name){
|
|
|
|
- console.log(path,name)
|
|
|
|
- // #ifdef APP-PLUS
|
|
|
|
- self.getFilePermissions(function(res){
|
|
|
|
- if(res==1){
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '加载中'
|
|
|
|
- });
|
|
|
|
- var url = baseUrl + path;
|
|
|
|
- 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();
|
|
|
|
- }else{
|
|
|
|
- uni.hideLoading();
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '无法获取权限,文件下载将出错!',
|
|
|
|
- icon: 'none',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- // #endif
|
|
|
|
- // #ifndef APP-PLUS
|
|
|
|
- this.getDownloader(path)
|
|
|
|
- // #endif
|
|
|
|
- },
|
|
|
|
- getDownloader(e){
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '加载中'
|
|
|
|
- });
|
|
|
|
- var url=baseUrl+e;
|
|
|
|
- let index1 = e.lastIndexOf("."); // 得到一个索引值
|
|
|
|
- let index2 = e.length;
|
|
|
|
- let type = e.substring(index1, index2);
|
|
|
|
- if ((type.indexOf('jpg') > -1 || type.indexOf('jpeg') > -1 || type.indexOf('png') > -1)) {
|
|
|
|
- uni.previewImage({
|
|
|
|
- current: 0,
|
|
|
|
- urls: [url],
|
|
|
|
- // background: '#ffffff'
|
|
|
|
- });
|
|
|
|
- uni.hideLoading();
|
|
|
|
- } else {
|
|
|
|
- uni.downloadFile({
|
|
|
|
- url: url,//文件的下载路径
|
|
|
|
- success(result) {
|
|
|
|
- uni.hideLoading()
|
|
|
|
- var filePath = result.tempFilePath;
|
|
|
|
- uni.openDocument({
|
|
|
|
- filePath: filePath,
|
|
|
|
- showMenu: true,
|
|
|
|
- success: function (res) {
|
|
|
|
- // console.log('打开文档成功');
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- fail(res) {uni.hideLoading()}
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- getDelFn(){
|
|
|
|
- var that=this;
|
|
|
|
- uni.showModal({
|
|
|
|
- title: '确认删除',
|
|
|
|
- content: "是否确认删除",
|
|
|
|
- cancelText: '取消',
|
|
|
|
- confirmText: '确认',
|
|
|
|
- success: function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- // that.filelist.splice(idx,1)
|
|
|
|
- } else if (res.cancel) {
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- getaddImage(e){
|
|
|
|
- let that = this;
|
|
|
|
- let file =[],count=9
|
|
|
|
- uni.chooseImage({
|
|
|
|
- count: 1,
|
|
|
|
- success:function(res){
|
|
|
|
- let img= res.tempFilePaths;
|
|
|
|
- if(img.length + file.length > count){
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '最多上传'+count+'张图片',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- let imglen = res.tempFilePaths.length;
|
|
|
|
- var fuwufile = [];
|
|
|
|
- uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
|
|
|
|
- var resurl=rs[0];
|
|
|
|
- // if(e=='front'){
|
|
|
|
- // that.datainfo.front=resurl.fileName;
|
|
|
|
- // }else{
|
|
|
|
- // that.datainfo.back=resurl.fileName;
|
|
|
|
- // }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
-// 指派
|
|
|
|
-.assignbox{background: #FFFFFF;border-radius: 20rpx;position: fixed;left:56rpx;right:54rpx;z-index: 10;top: 50%;transform: translateY(-50%);padding: 32rpx 38rpx 36rpx;
|
|
|
|
- .assbox{max-height: calc(100vh - 300rpx);overflow: auto;}
|
|
|
|
- .asstit{font-weight: bold;font-size: 30rpx;color: #272727;text-align: center;padding-left: 16rpx;margin-bottom: 28rpx;}
|
|
|
|
- .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
|
|
|
|
- image{width: 100%;height: 100%;}
|
|
|
|
- }
|
|
|
|
- .asline{border-bottom: 2rpx solid #E5E5E5;padding: 30rpx 0;margin-bottom: 40rpx;}
|
|
|
|
- .tabtit{font-weight: bold;font-size: 26rpx;color: #272727;line-height: 36rpx;margin-bottom: 24rpx;padding-left: 14rpx;}
|
|
|
|
- .asslists{display: flex;flex-wrap: wrap;
|
|
|
|
- .asslist{width: 252rpx;height: 76rpx;border-radius: 20rpx;border: 2rpx solid #DADADA;position: relative;display: flex;align-items: center;box-sizing: border-box;padding: 0 22rpx;margin: 0 14rpx 24rpx 14rpx;overflow: hidden;
|
|
|
|
- &.act{border-color: #0256FD;
|
|
|
|
- .altit{color: #0256FD;}
|
|
|
|
- }
|
|
|
|
- image{position: absolute;right: -2rpx;bottom: -2rpx;width: 34rpx;height: 32rpx;}
|
|
|
|
- .altit{font-weight: bold;font-size: 26rpx;color: #666666;flex: 1;}
|
|
|
|
- .altxt{font-weight: bold;font-size: 22rpx;flex: 0 0 auto;}
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 上传图片
|
|
|
|
- &.pra{left: 100rpx;right: 100rpx;}
|
|
|
|
- .assadd{display: flex;flex-direction: column;align-items: center;justify-content: center;border-radius: 10rpx;height: 192rpx;
|
|
|
|
-border: 2rpx dashed #A7A7A7;box-sizing: border-box;margin-bottom: 32rpx;
|
|
|
|
- image{width:48rpx;height: 40rpx;margin-bottom: 16rpx;}
|
|
|
|
- view{font-weight: bold;font-size: 26rpx;color: #272727;}
|
|
|
|
- }
|
|
|
|
- .assimgs{display: flex;align-items: center;flex-wrap: wrap;margin-bottom: 8rpx;
|
|
|
|
- .assimg{width: 140rpx;height: 140rpx;position: relative;overflow: hidden;margin: 0 24rpx 24rpx 0;
|
|
|
|
- &:nth-of-type(3n){margin-right: 0;}
|
|
|
|
- .img{width: 100%;height: 100%;}
|
|
|
|
- .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-.voice{font-weight: 500;display: flex;justify-content:flex-end;align-items: center;margin-top: 40rpx;
|
|
|
|
-font-size: 24rpx;
|
|
|
|
-color: #45CB99;
|
|
|
|
- image{width: 24rpx;height: 24rpx;margin-right: 8rpx;}
|
|
|
|
- }
|
|
|
|
-// 附件
|
|
|
|
- .fjlists {display: flex;align-items: flex-start;justify-content: space-between;margin-bottom: 20rpx;
|
|
|
|
- &:last-child{margin-bottom: 0;}
|
|
|
|
- .imgl{width: 40rpx;height: 40rpx;display: flex;align-items: center;flex: 0 0 auto;
|
|
|
|
- image{width: 26rpx;height: 24rpx;}
|
|
|
|
- }
|
|
|
|
- .tit{font-size: 26rpx;color: #222327;font-weight: 500;margin-top: 4rpx;word-break: break-all;}
|
|
|
|
- .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;flex: 0 0 auto;
|
|
|
|
- image{width: 24rpx;height: 24rpx;}
|
|
|
|
- }
|
|
|
|
- .txta{color: #28C529;font-weight: 500;line-height: 40rpx;flex: 0 0 auto;margin-left: 18rpx;padding: 0 6rpx;}
|
|
|
|
- }
|
|
|
|
-.closeimg{width: 32rpx;height: 32rpx;position: absolute;bottom: -62rpx;left: 50%;margin-left: -16rpx;}
|
|
|
|
-</style>
|
|
|