发票上传pdf 不从缓存中获取CustomerId

master
wangwei 2 years ago
parent c3f3d1d48f
commit 4158871127

@ -156,6 +156,14 @@ export function filterOrderList(query) {
});
}
export function getUserBean(query) {
return axios({
url: "/udiwms/inout/order/getUserBean",
method: "get",
params: query
});
}
export function selectNew(query) {
return axios({
url: "/admin/warehouse/inout/order/selectNew",

@ -172,6 +172,14 @@ export function previewImage(data) {
});
}
export function previewFile(url) {
return axios({
url: url,
method: "get",
responseType: 'arraybuffer'
});
}

@ -273,7 +273,7 @@ import AcceptOrder from "@/views/inout/DialogReviewOrder";
import DialogInvoice from "@/views/inout/DialogInvoice";
import InvoiceRegister from "@/views/inout/InvoiceRegister";
import {previewImage} from "@/api/purchase/supCompany";
import {previewImage,previewFile} from "@/api/purchase/supCompany";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import store from "@/store";
@ -613,8 +613,29 @@ export default {
);
},
uploadHandlePreview(file) {
console.log(file);
console.log(this.fileList);
// console.log(file.raw.type);
// console.log(this.fileList);
// let pdf = "application/pdf"
// let type = file.raw.type
// if(type==pdf){
//
// this.certFileUrl =
// this.BASE_URL +
// "/udiwms/image/register/file/getImage?type=image2&name=";
// this.imgList = [];
// previewImage({
// imageUrl: this.inputQuery.licenseUrl,
// certFileUrl: this.certFileUrl,
// }).then((response) => {
// if (response.code === 20000) {
// this.imgList = response.data;
// window.open(this.imgList[0])
// }
// console.log(this.imgList);
// });
// }else{
//
// }
},
uploadHandleRemove(file, fileList) {
this.inputQuery.licenseUrl = null;
@ -698,18 +719,34 @@ export default {
showImgViewer(row) {
this.certFileUrl =
this.BASE_URL +
"/udiwms/image/register/file/getImage?type=image2&name=";
"/udiwms/image/register/file/getImage?type=image2&name="+this.inputQuery.licenseUrl;
this.imgList = [];
previewImage({
imageUrl: this.inputQuery.licenseUrl,
certFileUrl: this.certFileUrl,
}).then((response) => {
if (response.code === 20000) {
this.imgList = response.data;
}
console.log(this.imgList);
this.imgViewerVisible = true;
});
this.imgList.push(this.certFileUrl)
let index = this.inputQuery.licenseUrl.lastIndexOf('.');
if(index===-1){
this.$message.error("文件名异常!")
return false
}
if(this.inputQuery.licenseUrl.substr(index+1)==='pdf'){
let pdf = "application/pdf"
let binaryData = [];
previewFile(this.certFileUrl).then(res=>{
binaryData.push(res);
let URL = window.URL.createObjectURL(new Blob(binaryData, {type: pdf}));
window.open(URL);
})
// window.open(this.imgList[0])
return false
}
this.imgViewerVisible = true;
// previewImage({
// imageUrl: this.inputQuery.licenseUrl,
// certFileUrl: this.certFileUrl,
// }).then((response) => {
// if (response.code === 20000) {
// }
// console.log(this.imgList);
// });
const m = (e) => {
e.preventDefault();
};

@ -529,7 +529,7 @@
<script>
import {
deleteByOrderId,
getOrderList, rollUnReceivebackOrder, filterInvoice, filterOrder, filterOrderList
getOrderList, rollUnReceivebackOrder, filterInvoice, filterOrder, filterOrderList, getUserBean
} from '../../api/inout/order'
import {getLocalJoinByUser} from "@/api/basic/busType";
import {getInvListByUser} from "@/api/system/invWarehouse";
@ -552,7 +552,7 @@ import InvoiceRegistrationDetermine from "@/views/inout/InvoiceRegistrationDeter
import {inspectionOrderPDFFromTemplateFile, orderPDFFromTemplateFile} from "@/api/itextpdf/orderPrint"
import {getDeptListByUser} from "@/api/auth/authDept";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {previewImage} from '@/api/purchase/supCompany'
import {previewFile, previewImage} from '@/api/purchase/supCompany'
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
@ -567,6 +567,7 @@ export default {
name: "IoCheckSuccessOrder",
data() {
return {
users:{},
defaultSort: {prop: 'createTime', order: 'desc'},
savebillno: null,
invoiceRow: [],
@ -795,29 +796,42 @@ export default {
this.showSearch = !this.showSearch;
},
showImgViewer(row) {
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="+row.licenseUrl;
this.imgList = [];
previewImage({imageUrl: row.licenseUrl, certFileUrl: this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgList = response.data;
}
console.log(this.imgList)
this.imgViewerVisible = true;
});
this.imgList.push(this.certFileUrl)
let index = row.licenseUrl.lastIndexOf('.');
if(index===-1){
this.$message.error("文件名异常!")
return false
}
if(row.licenseUrl.substr(index+1)==='pdf'){
let pdf = "application/pdf"
let binaryData = [];
previewFile(this.certFileUrl).then(res=>{
binaryData.push(res);
let URL = window.URL.createObjectURL(new Blob(binaryData, {type: pdf}));
window.open(URL);
})
// window.open(this.imgList[0])
return false
}
this.imgViewerVisible = true;
// previewImage({
// imageUrl: this.inputQuery.licenseUrl,
// certFileUrl: this.certFileUrl,
// }).then((response) => {
// if (response.code === 20000) {
// }
// console.log(this.imgList);
// });
const m = (e) => {
e.preventDefault()
e.preventDefault();
};
document.body.style.overflow = 'hidden';
document.body.style.overflow = "hidden";
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() {
this.imgViewerVisible = false;
const m = (e) => {
e.preventDefault()
};
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
@ -915,6 +929,17 @@ export default {
this.getList();
},
getUser(){
getUserBean()
.then((res) => {
if(res.code == 20000){
if ( res.data.customerId == "110") {
this.showSup = true;
}
}
})
},
//
getList() {
@ -1195,10 +1220,7 @@ export default {
,
created() {
let supId = this.$store.getters.customerId;
if (supId == "110") {
this.showSup = true;
}
this.getUser();
this.getInvList();
this.getDeptList();
this.getBusType();

Loading…
Cancel
Save