资质图片查看代码提交

ywj_dev
郑明梁 2 years ago
parent b79bf155f9
commit 33ec07820d

@ -1,4 +1,4 @@
rd /s /q UDI_SPMS_NEW rd /s /q UDI_SPMS_CLIENT
npm run build:prod npm run build:prod

@ -231,6 +231,7 @@ export default {
if (this.$isNotBlank(this.formData.filePath)) { if (this.$isNotBlank(this.formData.filePath)) {
if (this.$refs.upload.uploadFiles.length > 0) { if (this.$refs.upload.uploadFiles.length > 0) {
this.$refs.upload.submit(); this.$refs.upload.submit();
this.onSubmit();
} else { } else {
this.onSubmit(); this.onSubmit();
} }
@ -326,7 +327,6 @@ export default {
uploadHandleSuccess(response, file, fileList) { uploadHandleSuccess(response, file, fileList) {
if (response.code === 20000) { if (response.code === 20000) {
this.formData.filePath = response.data.name; this.formData.filePath = response.data.name;
this.onSubmit();
} else { } else {
this.$message.error("文件上传失败:" + response.message); this.$message.error("文件上传失败:" + response.message);
} }

@ -523,7 +523,7 @@ export default {
var varindex= row.filePath.lastIndexOf("."); var varindex= row.filePath.lastIndexOf(".");
var varext = row.filePath.substring(varindex+1); var varext = row.filePath.substring(varindex+1);
var isImage=this.isAssetTypeAnImage(varext); var isImage=this.isAssetTypeAnImage(varext);
if(isImage=true){ if(isImage==true){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.imgList=[]; this.imgList=[];
previewImage({imageUrl:row.filePath,certFileUrl:this.certFileUrl}).then(response => { previewImage({imageUrl:row.filePath,certFileUrl:this.certFileUrl}).then(response => {

@ -286,7 +286,8 @@
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="证书文件:"> <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-form-item>
</el-col> </el-col>
@ -316,11 +317,12 @@ import {filterCompanyCert, deleteCompanyCert, auditSupCert} from "../../../api/p
import companyAddCert from "@/views/purchase/cert/supCertAddDialog"; import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import { import {
getSupComapnys, getSupComapnys, previewImage,
printSupCertManufacturer, printSupCertManufacturer,
verifyTemplateFile verifyTemplateFile
} from "@/api/purchase/supCompany"; } from '@/api/purchase/supCompany'
import {getUUID} from "@/utils/strUtil"; import {getUUID} from "@/utils/strUtil";
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
export default { export default {
name: "supManufacturerAuditDialog", name: "supManufacturerAuditDialog",
@ -346,6 +348,8 @@ export default {
classesDisplay: false, classesDisplay: false,
selectedOptions: [], selectedOptions: [],
selectedOptions2: [], selectedOptions2: [],
imgViewerVisible:false,
imgList:[],
options: regionDataPlus, options: regionDataPlus,
rules: { rules: {
@ -481,7 +485,7 @@ export default {
}, },
components: { components: {
draggable, draggable,
companyAddCert, companyAddCert,ElImageViewer
}, },
methods: { methods: {
@ -528,7 +532,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);
},
openFile() { openFile() {
window.open(this.fileUrl + this.inputQuery.filePath); window.open(this.fileUrl + this.inputQuery.filePath);

@ -227,29 +227,10 @@
<el-table-column label="备注" prop="remark"></el-table-column> <el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="250"> <el-table-column label="操作" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" size="small" @click.native="addCert(scope.row)">编辑</el-button>
type="text" <el-button type="text" size="mini" @click.native="showImgViewer(scope.row)">预览</el-button>
size="small" <el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList" />
@click.native="addCert(scope.row)" <el-button type="text" size="small" v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6" @click.native="deleteCompanyCert(scope.row)"></el-button>
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6"
@click.native="deleteCompanyCert(scope.row)"
>删除
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -308,9 +289,10 @@ import {provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus
import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "../../../api/purchase/companyCert"; import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "../../../api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog"; import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {getSupComapnys} from "@/api/purchase/supCompany"; import { getSupComapnys, previewImage } from '@/api/purchase/supCompany'
import {getUUID} from "@/utils/strUtil"; import {getUUID} from "@/utils/strUtil";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog"; import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
export default { export default {
@ -340,6 +322,8 @@ export default {
classesDisplay: false, classesDisplay: false,
selectedOptions: [], selectedOptions: [],
selectedOptions2: [], selectedOptions2: [],
imgViewerVisible:false,
imgList:[],
options: regionData, options: regionData,
rules: { rules: {
@ -482,7 +466,7 @@ export default {
}, },
components: { components: {
draggable, draggable,
companyAddCert, supCertSetSelectDialog companyAddCert, supCertSetSelectDialog, ElImageViewer
}, },
methods: { methods: {
onModifySubmit(type) { onModifySubmit(type) {
@ -581,7 +565,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);
},
disableCert(row, status) { disableCert(row, status) {
row.status = status; row.status = status;
updateCompanyCert(row).then(response => { updateCompanyCert(row).then(response => {

@ -322,7 +322,8 @@
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="证书文件:"> <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-form-item>
</el-col> </el-col>
@ -355,14 +356,15 @@ import {
} from "element-china-area-data"; } from "element-china-area-data";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import { import {
getSupComapnys, getSupComapnys, previewImage,
printSupCertProduction, printSupCertProduction,
verifyTemplateFile verifyTemplateFile
} from "@/api/purchase/supCompany"; } from '@/api/purchase/supCompany'
import {addOrModifyCompany, getCompanyList} from "@/api/purchase/supManufacturer"; import {addOrModifyCompany, getCompanyList} from "@/api/purchase/supManufacturer";
import {auditSupCert, deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert"; import {auditSupCert, deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog"; import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import {getUUID} from "@/utils/strUtil"; import {getUUID} from "@/utils/strUtil";
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
export default { export default {
@ -386,6 +388,8 @@ export default {
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
fromOptions: [], fromOptions: [],
fromPMOptions: [], fromPMOptions: [],
imgViewerVisible:false,
imgList:[],
pmQuery: { pmQuery: {
customerId: null, customerId: null,
companyName: null, companyName: null,
@ -518,7 +522,7 @@ export default {
}, },
components: { components: {
draggable, companyAddCert draggable, companyAddCert,ElImageViewer
}, },
methods: { methods: {
@ -542,7 +546,39 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
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);
},
onRejectSubmit() { onRejectSubmit() {
this.$prompt('请输入结果说明', '提示', { this.$prompt('请输入结果说明', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',

@ -282,13 +282,8 @@
>编辑 >编辑
</el-button </el-button
> >
<el-button <el-button type="text" size="mini" @click.native="showImgViewer(scope.row)">预览</el-button>
type="text" <el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList" />
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -383,14 +378,14 @@ import {
} from "../../../api/purchase/suppliersRegistrationBasic"; } from "../../../api/purchase/suppliersRegistrationBasic";
import {regionDataPlus} from "element-china-area-data"; import {regionDataPlus} from "element-china-area-data";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {getSupComapnys} from "@/api/purchase/supCompany"; import { getSupComapnys, previewImage } from '@/api/purchase/supCompany'
import {getCompanyList} from "@/api/purchase/supManufacturer"; import {getCompanyList} from "@/api/purchase/supManufacturer";
import {deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert"; import {deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog"; import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog"; import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
import companyProducts from "@/views/purchase/company/companyProducts"; import companyProducts from "@/views/purchase/company/companyProducts";
import {getUUID} from "@/utils/strUtil"; import {getUUID} from "@/utils/strUtil";
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
export default { export default {
name: "supProductEditDialog", name: "supProductEditDialog",
props: { props: {
@ -416,6 +411,8 @@ export default {
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
fromOptions: [], fromOptions: [],
fromPMOptions: [], fromPMOptions: [],
imgViewerVisible:false,
imgList:[],
pmQuery: { pmQuery: {
customerId: null, customerId: null,
companyName: null, companyName: null,
@ -554,7 +551,7 @@ export default {
}, },
components: { components: {
draggable, companyAddCert, supCertSetSelectDialog, companyProducts draggable, companyAddCert, supCertSetSelectDialog, companyProducts,ElImageViewer
}, },
methods: { methods: {
onModifySubmit(val) { onModifySubmit(val) {
@ -639,8 +636,40 @@ export default {
this.selectCertVisible = false; this.selectCertVisible = false;
this.getCompanyCertList(); this.getCompanyCertList();
}, },
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);
},
closeSelDialog(val) { closeSelDialog(val) {
if (val != null) { if (val != null) {
let query = { let query = {

@ -192,7 +192,8 @@
<el-table-column label="操作" width="180"> <el-table-column label="操作" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click.native="addCert(scope.row)">编辑</el-button> <el-button type="text" size="small" @click.native="addCert(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click.native="toViewCompanyCert(scope.row)">预览</el-button> <el-button type="text" size="small" @click.native="showImgViewer(scope.row)">预览</el-button>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList" />
<el-button type="text" size="small" <el-button type="text" size="small"
v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6" v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6"
@click.native="deleteCompanyCert(scope.row)">删除 @click.native="deleteCompanyCert(scope.row)">删除
@ -273,10 +274,11 @@ import {regionDataPlus, CodeToText,} from "element-china-area-data";
import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "@/api/purchase/companyCert"; import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "@/api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog"; import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog"; import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {getCompany} from "@/api/supplier/company"; import {getCompany} from "@/api/supplier/company";
import { previewImage } from '@/api/purchase/supCompany'
export default { export default {
@ -286,6 +288,8 @@ export default {
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
inputQuery: {}, inputQuery: {},
headers: {}, headers: {},
imgViewerVisible:false,
imgList:[],
classesDisplay: false, classesDisplay: false,
selectedOptions: [], selectedOptions: [],
options: regionDataPlus, options: regionDataPlus,
@ -433,7 +437,7 @@ export default {
}; };
}, },
components: { components: {
draggable, companyAddCert, supCertSetSelectDialog draggable, companyAddCert, supCertSetSelectDialog, ElImageViewer
}, },
methods: { methods: {
getCompanyInfo() { getCompanyInfo() {
@ -535,7 +539,38 @@ export default {
}); });
}, },
isAssetTypeAnImage(ext) {
return [
'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].
indexOf(ext.toLowerCase()) !== -1;
},
showImgViewer(row){
debugger
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() { cancelDialog() {
this.closeDialog(); this.closeDialog();

Loading…
Cancel
Save