|
|
@@ -126,6 +126,10 @@ |
|
|
|
placeholder="被核查人身份证号" |
|
|
|
:rules="[{ required: true, message: '请填写被核查人身份证号' }]" |
|
|
|
/> |
|
|
|
<van-row type="flex" justify="space-around"> |
|
|
|
<van-col span="9"><van-uploader v-model="fileList1" :after-read="afterRead1" @delete="remove(1)" :max-count="1" :accept="'image/*'" capture="camera"></van-uploader></van-col> |
|
|
|
<van-col span="9"><van-uploader v-model="fileList2" :after-read="afterRead2" @delete="remove(2)" :max-count="1" :accept="'image/*'" capture="camera"></van-uploader></van-col> |
|
|
|
</van-row> |
|
|
|
<h2 class="van-doc-demo-block__title">农村土地承包经营权证</h2> |
|
|
|
<van-field name="item1" label="是否有证书" label-width="200px"> |
|
|
|
<template #input> |
|
|
@@ -480,7 +484,7 @@ |
|
|
|
getInvestigate, |
|
|
|
listSampling, listSamplingDept, |
|
|
|
updateInvestigate, |
|
|
|
updateSampling, uploadFile |
|
|
|
updateSampling, uploadFile, uploadFileBase |
|
|
|
} from "../../api/authenticRight"; |
|
|
|
import {getDeptList} from "../../api/biddingHall"; |
|
|
|
import {Dialog} from "vant"; |
|
|
@@ -584,6 +588,8 @@ |
|
|
|
params: null, |
|
|
|
samplingId: null, |
|
|
|
searchValue: null, |
|
|
|
fileUrl1:[], |
|
|
|
fileUrl2:[], |
|
|
|
}, |
|
|
|
dhdcform:{ |
|
|
|
callPhone: null, |
|
|
@@ -619,7 +625,9 @@ |
|
|
|
userId :null, |
|
|
|
nickName:null, |
|
|
|
currentValue:null, |
|
|
|
fileList:[] |
|
|
|
fileList:[], |
|
|
|
fileList1:[], |
|
|
|
fileList2:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
created(){ |
|
|
@@ -639,8 +647,6 @@ |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
onOversize(file) { |
|
|
|
console.log(file); |
|
|
|
Toast('文件大小不能超过 16mb'); |
|
|
|
this.$toast({ |
|
|
|
icon: 'error', // 找到自己需要的图标 |
|
|
|
message: '上传失败!文件大小不能超过 16m', |
|
|
@@ -689,18 +695,79 @@ |
|
|
|
} |
|
|
|
this.fileList = [] |
|
|
|
}, |
|
|
|
/*afterRead(file) { |
|
|
|
afterRead1(file){ |
|
|
|
// 创建Canvas对象(画布) |
|
|
|
let canvas = document.createElement('canvas') |
|
|
|
// 获取对应的CanvasRenderingContext2D对象(画笔) |
|
|
|
let context = canvas.getContext('2d') |
|
|
|
// 创建新的图片对象 |
|
|
|
let img = new Image() |
|
|
|
// 指定图片的DataURL(图片的base64编码数据) |
|
|
|
img.src = file.content |
|
|
|
img.onload = () => { |
|
|
|
const h = img.height |
|
|
|
const w = img.width |
|
|
|
let ch = img.height/4 |
|
|
|
let cw = img.width/4 |
|
|
|
let canvas = document.createElement('canvas') |
|
|
|
let ctx = canvas.getContext('2d') |
|
|
|
canvas.height = ch |
|
|
|
canvas.width = cw |
|
|
|
ctx.clearRect(0,0,cw,ch) |
|
|
|
ctx.drawImage(img,0,0,cw,ch) |
|
|
|
let base_img = canvas.toDataURL('image/jpeg') |
|
|
|
const blobBin = atob(base_img.split(',')[1]) |
|
|
|
let d = [] |
|
|
|
for (let i=0;i<blobBin.length;i++){ |
|
|
|
d.push(blobBin.charCodeAt(i)) |
|
|
|
} |
|
|
|
const data2 = new FormData(); |
|
|
|
data2.append("file", file.file); |
|
|
|
uploadFile(data2).then(res => { |
|
|
|
if(res.code == 200){ |
|
|
|
this.xcdcform.idcardCheckedBy = res.idcardCheckedBy |
|
|
|
this.xcdcform.nameCheckedBy = res.nameCheckedBy |
|
|
|
this.xcdcform["fileUrl"] = res.url |
|
|
|
} |
|
|
|
data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'})); |
|
|
|
uploadFileBase(data2).then(res => { |
|
|
|
this.xcdcform.fileUrl1=res.url |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
afterRead2(file){ |
|
|
|
// 创建Canvas对象(画布) |
|
|
|
let canvas = document.createElement('canvas') |
|
|
|
// 获取对应的CanvasRenderingContext2D对象(画笔) |
|
|
|
let context = canvas.getContext('2d') |
|
|
|
// 创建新的图片对象 |
|
|
|
let img = new Image() |
|
|
|
// 指定图片的DataURL(图片的base64编码数据) |
|
|
|
img.src = file.content |
|
|
|
img.onload = () => { |
|
|
|
const h = img.height |
|
|
|
const w = img.width |
|
|
|
let ch = img.height/4 |
|
|
|
let cw = img.width/4 |
|
|
|
let canvas = document.createElement('canvas') |
|
|
|
let ctx = canvas.getContext('2d') |
|
|
|
canvas.height = ch |
|
|
|
canvas.width = cw |
|
|
|
ctx.clearRect(0,0,cw,ch) |
|
|
|
ctx.drawImage(img,0,0,cw,ch) |
|
|
|
let base_img = canvas.toDataURL('image/jpeg') |
|
|
|
const blobBin = atob(base_img.split(',')[1]) |
|
|
|
let d = [] |
|
|
|
for (let i=0;i<blobBin.length;i++){ |
|
|
|
d.push(blobBin.charCodeAt(i)) |
|
|
|
} |
|
|
|
const data2 = new FormData(); |
|
|
|
data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'})); |
|
|
|
uploadFileBase(data2).then(res => { |
|
|
|
this.xcdcform.fileUrl2=res.url |
|
|
|
}) |
|
|
|
this.fileList = [] |
|
|
|
},*/ |
|
|
|
} |
|
|
|
}, |
|
|
|
remove(val){ |
|
|
|
if(val==1){ |
|
|
|
this.xcdcform.fileUrl1="" |
|
|
|
}else { |
|
|
|
this.xcdcform.fileUrl2="" |
|
|
|
} |
|
|
|
}, |
|
|
|
changeFn(val) { |
|
|
|
}, |
|
|
|
confirmFn(){ |
|
|
@@ -830,6 +897,8 @@ |
|
|
|
samplingId: null, |
|
|
|
searchValue: null, |
|
|
|
updateBy: null, |
|
|
|
fileUrl1: [], |
|
|
|
fileUrl2: [], |
|
|
|
}; |
|
|
|
this.dhdcform={ |
|
|
|
countName: null, |
|
|
@@ -857,6 +926,9 @@ |
|
|
|
searchValue: null, |
|
|
|
updateBy: null, |
|
|
|
} |
|
|
|
this.fileList = [] |
|
|
|
this.fileList1 = [] |
|
|
|
this.fileList2 = [] |
|
|
|
}, |
|
|
|
onClickRight() { |
|
|
|
this.show = true |
|
|
@@ -929,7 +1001,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
selectType(val,data,index){ |
|
|
|
console.log(this.nickName,this.userId) |
|
|
|
if(val==1){ |
|
|
|
let _this = this |
|
|
|
let a ={ |
|
|
@@ -957,6 +1028,16 @@ |
|
|
|
getInvestigate(data.id).then(res => { |
|
|
|
if(res.data){ |
|
|
|
this.xcdcform = res.data |
|
|
|
if(this.xcdcform.fileUrl1){ |
|
|
|
this.fileList1.push({ |
|
|
|
"url":this.xcdcform.fileUrl1 |
|
|
|
}) |
|
|
|
} |
|
|
|
if(this.xcdcform.fileUrl2){ |
|
|
|
this.fileList2.push({ |
|
|
|
"url":this.xcdcform.fileUrl2 |
|
|
|
}) |
|
|
|
} |
|
|
|
this.xcdcform["countName"] = data.countName |
|
|
|
this.xcdcform["townName"] = data.townName |
|
|
|
this.xcdcform["villageName"] = data.villageName |
|
|
|