|
@@ -75,15 +75,10 @@
|
|
</view>
|
|
</view>
|
|
<view class="section white-wrap" v-if="radioVal==='上传附件'">
|
|
<view class="section white-wrap" v-if="radioVal==='上传附件'">
|
|
<view class="section-title require">附件上传</view>
|
|
<view class="section-title require">附件上传</view>
|
|
- <image
|
|
|
|
- :src="img.img"
|
|
|
|
- mode="aspectFill"
|
|
|
|
- style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0"
|
|
|
|
- v-for="img in fileUrlArr"
|
|
|
|
- :key="img"
|
|
|
|
- @click="handlePreviewFiles(img)">
|
|
|
|
- </image>
|
|
|
|
- <image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0"></image>
|
|
|
|
|
|
+ <div class="check-file-box" :style="'background-image:url('+file.url+')'" v-if="file.url" @click="handlePreviewFiles(file)">
|
|
|
|
+ <image class="del-icon" src="../static/del-icon.png" @click.stop="handleDeleteCheckFile"></image>
|
|
|
|
+ </div>
|
|
|
|
+ <image v-else @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;"></image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 流程模块 -->
|
|
<!-- 流程模块 -->
|
|
@@ -168,7 +163,7 @@
|
|
<script>
|
|
<script>
|
|
import steps from '../components/steps.vue'
|
|
import steps from '../components/steps.vue'
|
|
import {apiFlowDetail,apiSealAdd,apiSearchCustome,apiSearchContract} from '@/api/approve/seal.js'
|
|
import {apiFlowDetail,apiSealAdd,apiSearchCustome,apiSearchContract} from '@/api/approve/seal.js'
|
|
- import {uploadImg,uploadFiles} from '@/utils/uploadFile.js'
|
|
|
|
|
|
+ import {uploadFiles} from '@/utils/uploadFile.js'
|
|
import {preViewFile} from '../utils/util.js'
|
|
import {preViewFile} from '../utils/util.js'
|
|
export default{
|
|
export default{
|
|
components:{
|
|
components:{
|
|
@@ -207,7 +202,11 @@
|
|
ContractId:0,//合同id
|
|
ContractId:0,//合同id
|
|
ContractfileUrl:'',//合同文件地址 pdf
|
|
ContractfileUrl:'',//合同文件地址 pdf
|
|
|
|
|
|
- fileUrlArr:[],//上传附件 文件地址
|
|
|
|
|
|
+ file:{
|
|
|
|
+ type:'',
|
|
|
|
+ img:'',
|
|
|
|
+ url:''
|
|
|
|
+ },//上传附件 文件
|
|
|
|
|
|
processData:null,//流程数据
|
|
processData:null,//流程数据
|
|
|
|
|
|
@@ -220,6 +219,15 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //删除上传的附件
|
|
|
|
+ handleDeleteCheckFile(){
|
|
|
|
+ this.file={
|
|
|
|
+ type:'',
|
|
|
|
+ img:'',
|
|
|
|
+ url:''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
//预览文件
|
|
//预览文件
|
|
handlePreviewFiles(e){
|
|
handlePreviewFiles(e){
|
|
if (e.type === "pdf") {
|
|
if (e.type === "pdf") {
|
|
@@ -235,22 +243,19 @@
|
|
async handleUpload(){
|
|
async handleUpload(){
|
|
const res=await uploadFiles({type:'all'})
|
|
const res=await uploadFiles({type:'all'})
|
|
const reg = /\.(pdf)$/;
|
|
const reg = /\.(pdf)$/;
|
|
- let temarr=res.map((item) => {
|
|
|
|
- if (reg.test(item)) {
|
|
|
|
- return {
|
|
|
|
- type: "pdf",
|
|
|
|
- url: item,
|
|
|
|
- img: require("@/pages-approve/static/pdf.png"),
|
|
|
|
- };
|
|
|
|
- } else {
|
|
|
|
- return {
|
|
|
|
- type: "img",
|
|
|
|
- url: item,
|
|
|
|
- img: item,
|
|
|
|
- };
|
|
|
|
|
|
+ if(reg.test(res[0])){
|
|
|
|
+ this.file={
|
|
|
|
+ type:'pdf',
|
|
|
|
+ url:res[0],
|
|
|
|
+ img:require('../static/pdf.png')
|
|
}
|
|
}
|
|
- });
|
|
|
|
- this.fileUrlArr=[...this.fileUrlArr,...temarr]
|
|
|
|
|
|
+ }else{
|
|
|
|
+ this.file={
|
|
|
|
+ type:'img',
|
|
|
|
+ url:res[0],
|
|
|
|
+ img:res[0]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 客户搜索
|
|
// 客户搜索
|
|
@@ -448,6 +453,20 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
|
+ .check-file-box{
|
|
|
|
+ width: 102rpx;
|
|
|
|
+ height: 120rpx;
|
|
|
|
+ background-size: cover;
|
|
|
|
+ position: relative;
|
|
|
|
+ .del-icon{
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 30rpx;
|
|
|
|
+ height: 30rpx;
|
|
|
|
+ top: -15rpx;
|
|
|
|
+ right: -15rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
.add-page{
|
|
.add-page{
|
|
width: 100%;
|
|
width: 100%;
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|