|
@@ -62,14 +62,18 @@
|
|
|
<view class="section-title">备注</view>
|
|
|
<textarea type="text" v-model="remark" placeholder="请填写备注"></textarea>
|
|
|
</view>
|
|
|
- <view class="section white-wrap" v-if="radioVal==='系统合同'&&ContractfileUrl">
|
|
|
+ <view class="section white-wrap" v-if="radioVal==='系统合同'&&file">
|
|
|
<view class="section-title require">合同附件</view>
|
|
|
- <image src="../static/pdf.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;"></image>
|
|
|
+ <image src="../static/pdf.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;" @click="handlePreviewFiles(file)"></image>
|
|
|
</view>
|
|
|
<view class="section white-wrap" v-if="radioVal==='上传附件'">
|
|
|
<view class="section-title require">附件上传</view>
|
|
|
- <image :src="img" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0" v-for="img in fileUrlArr" :key="img"></image>
|
|
|
- <image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0"></image>
|
|
|
+ <!-- <image :src="img" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0" v-for="img in fileUrlArr" :key="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.img+')'" 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>
|
|
|
|
|
|
<!-- 流程模块 -->
|
|
@@ -151,7 +155,8 @@
|
|
|
<script>
|
|
|
import steps from '../components/steps.vue'
|
|
|
import {apiFlowDetail,apiSealEdit,apiSearchCustome,apiSearchContract,apiSealDetail} from '@/api/approve/seal.js'
|
|
|
- import {uploadImg} from '@/utils/uploadFile.js'
|
|
|
+ import {uploadFiles} from '@/utils/uploadFile.js'
|
|
|
+ import {preViewFile} from '../utils/util.js'
|
|
|
export default{
|
|
|
components:{
|
|
|
steps
|
|
@@ -180,9 +185,15 @@
|
|
|
|
|
|
UseCompanyName:'',//实际使用方客户名称
|
|
|
ContractId:0,//合同id
|
|
|
- ContractfileUrl:'',//合同文件地址 pdf
|
|
|
+ // ContractfileUrl:'',//合同文件地址 pdf
|
|
|
|
|
|
- fileUrlArr:[],//上传附件 文件地址
|
|
|
+ // fileUrlArr:[],//上传附件 文件地址
|
|
|
+
|
|
|
+ file:{
|
|
|
+ type:'',
|
|
|
+ img:'',
|
|
|
+ url:''
|
|
|
+ },
|
|
|
|
|
|
processData:null,//流程数据
|
|
|
|
|
@@ -199,6 +210,26 @@
|
|
|
this.getDetail({ContractApprovalId,ContractApprovalRecordId})
|
|
|
},
|
|
|
methods: {
|
|
|
+ //删除上传的附件
|
|
|
+ handleDeleteCheckFile(){
|
|
|
+ this.file={
|
|
|
+ type:'',
|
|
|
+ img:'',
|
|
|
+ url:''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //预览文件
|
|
|
+ handlePreviewFiles(e){
|
|
|
+ if (e.type === "pdf") {
|
|
|
+ preViewFile(e.url)
|
|
|
+ } else {
|
|
|
+ uni.previewImage({
|
|
|
+ urls: [e.url]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 获取详情
|
|
|
async getDetail({ContractApprovalId,ContractApprovalRecordId}){
|
|
|
const res=await apiSealDetail({
|
|
@@ -208,7 +239,6 @@
|
|
|
if(res.code===200){
|
|
|
if(res.data.SealDetail.ContractId>0){
|
|
|
this.radioVal='系统合同'
|
|
|
-
|
|
|
}else{
|
|
|
this.radioVal='上传附件'
|
|
|
}
|
|
@@ -221,16 +251,48 @@
|
|
|
this.remark=res.data.SealDetail.Remark
|
|
|
this.CreditCode=res.data.SealDetail.CreditCode
|
|
|
this.UseCompanyName=res.data.SealDetail.UseCompanyName
|
|
|
- this.ContractfileUrl=res.data.SealDetail.FileUrl
|
|
|
+ // this.ContractfileUrl=res.data.SealDetail.FileUrl
|
|
|
+ this.handleFile(res.data.SealDetail.FileUrl)
|
|
|
this.ContractId=res.data.SealDetail.ContractId
|
|
|
this.getProcessData()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ //处理文件
|
|
|
+ handleFile(filesUrl){
|
|
|
+ const reg = /\.(pdf)$/;
|
|
|
+ if(reg.test(filesUrl)){
|
|
|
+ this.file={
|
|
|
+ type: "pdf",
|
|
|
+ url: filesUrl,
|
|
|
+ img: require("../static/pdf.png"),
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.file={
|
|
|
+ type: "img",
|
|
|
+ url: filesUrl,
|
|
|
+ img: filesUrl,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
//上传附件
|
|
|
async handleUpload(){
|
|
|
- const res=await uploadImg()
|
|
|
- this.fileUrlArr=res
|
|
|
+ const res=await uploadFiles({type:'all'})
|
|
|
+ const reg = /\.(pdf)$/;
|
|
|
+ if(reg.test(res[0])){
|
|
|
+ this.file={
|
|
|
+ type:'pdf',
|
|
|
+ url:res[0],
|
|
|
+ img:require('../static/pdf.png')
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.file={
|
|
|
+ type:'img',
|
|
|
+ url:res[0],
|
|
|
+ img:res[0]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 客户搜索
|
|
@@ -316,18 +378,12 @@
|
|
|
|
|
|
// 提交申请
|
|
|
async handleSubmit(){
|
|
|
- let fileUrl=''
|
|
|
- if(this.radioVal==='系统合同'){
|
|
|
- fileUrl=this.ContractfileUrl
|
|
|
- }else{
|
|
|
- fileUrl=this.fileUrlArr.join('#')
|
|
|
- }
|
|
|
|
|
|
let params={
|
|
|
CompanyName:this.customeName,
|
|
|
ContractId:this.ContractId,
|
|
|
CreditCode:this.CreditCode,
|
|
|
- FileUrl:fileUrl,
|
|
|
+ FileUrl:this.file.url,
|
|
|
FileNum:Number(this.fileNum),
|
|
|
Remark:this.remark,
|
|
|
SealType:this.type,
|
|
@@ -412,6 +468,20 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+ .check-file-box{
|
|
|
+ width: 102rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ background-size: cover;
|
|
|
+ background-position: center;
|
|
|
+ position: relative;
|
|
|
+ .del-icon{
|
|
|
+ position: absolute;
|
|
|
+ width: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ top: -15rpx;
|
|
|
+ right: -15rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
.add-page{
|
|
|
width: 100%;
|
|
|
min-height: 100vh;
|