资质图片查看代码提交

ywj_dev
郑明梁 2 years ago
parent d71ea319b5
commit 6deee3bd8f

@ -164,6 +164,15 @@ export function printSupCertProduction(data) {
});
}
export function previewImage(data) {
return axios({
url: "/udiwms/image/register/file",
method: "post",
data: data
});
}

@ -121,7 +121,7 @@
:on-error="uploadHandleError"
:file-list="fileList"
:data="{type:'image2'}"
:auto-upload="false">
:auto-upload="true">
<el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1">
{{ choiceFile }}
</el-button>

@ -250,7 +250,8 @@
<el-row>
<el-col :span="11">
<el-form-item label="证书文件:">
<el-button type="primary" size="mini" @click.native="toViewCompanyCert(currentAudit)">证书预览</el-button>
<el-button type="primary" size="mini" @click.native="showImgViewer(currentAudit)">证书预览</el-button>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList" />
</el-form-item>
</el-col>
@ -273,7 +274,14 @@
</template>
<script>
import {modifyCompany, auditCompany, printSupCert, verifyTemplateFile, getRoId} from "../../../api/purchase/supCompany";
import {
modifyCompany,
auditCompany,
printSupCert,
verifyTemplateFile,
getRoId,
previewImage
} from '../../../api/purchase/supCompany'
import {
provinceAndCityData,
regionData,
@ -286,6 +294,8 @@ import {filterCompanyCert, deleteCompanyCert, auditSupCert} from "../../../api/p
import draggable from "vuedraggable";
import {customerlist} from '@/api/system/role'
import store from '@/store'
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
export default {
@ -311,6 +321,8 @@ export default {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
imgViewerVisible:false,
imgList:[],
classesDisplay: false,
selectedOptions: [],
options: regionDataPlus,
@ -455,7 +467,8 @@ export default {
},
components: {
draggable
draggable,
ElImageViewer
},
methods: {
@ -501,8 +514,39 @@ export default {
});
}
,
isAssetTypeAnImage(ext) {
return [
'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].
indexOf(ext.toLowerCase()) !== -1;
},
showImgViewer(row){
var varindex= row.filePath.lastIndexOf(".");
var varext = row.filePath.substring(varindex+1);
var isImage=this.isAssetTypeAnImage(varext);
if(isImage=true){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.imgList=[];
previewImage({imageUrl:row.filePath,certFileUrl:this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgList.push(response.data);
}
});
this.imgViewerVisible = true;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
}else{
this.toViewCompanyCert(row);
}
},
closeImgViewer(){
this.imgViewerVisible = false;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
cancelDialog() {
this.closeDialog();
}
@ -552,6 +596,10 @@ export default {
this.currentAudit.auditStatus = 2;
this.auditSupCert(this.currentAudit);
},
notAuditCert() {
this.currentAudit.auditStatus = 6;
this.auditSupCert(this.currentAudit);
},
auditSupCert(inputQuery) {
@ -719,6 +767,7 @@ export default {
});
},
confirm() {
debugger
if (this.confirmStatus == null) {
this.$message.error("请选择确认状态");
return;
@ -728,6 +777,8 @@ export default {
this.passAuditCert();
} else if (this.confirmStatus == 2) {
this.rejectAuditCert();
} else if (this.confirmStatus == 6) {
this.notAuditCert();
}
},
cancel() {

Loading…
Cancel
Save