发票上传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) { export function selectNew(query) {
return axios({ return axios({
url: "/admin/warehouse/inout/order/selectNew", 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 DialogInvoice from "@/views/inout/DialogInvoice";
import InvoiceRegister from "@/views/inout/InvoiceRegister"; 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 ElImageViewer from "element-ui/packages/image/src/image-viewer";
import store from "@/store"; import store from "@/store";
@ -613,8 +613,29 @@ export default {
); );
}, },
uploadHandlePreview(file) { uploadHandlePreview(file) {
console.log(file); // console.log(file.raw.type);
console.log(this.fileList); // 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) { uploadHandleRemove(file, fileList) {
this.inputQuery.licenseUrl = null; this.inputQuery.licenseUrl = null;
@ -698,18 +719,34 @@ export default {
showImgViewer(row) { showImgViewer(row) {
this.certFileUrl = this.certFileUrl =
this.BASE_URL + this.BASE_URL +
"/udiwms/image/register/file/getImage?type=image2&name="; "/udiwms/image/register/file/getImage?type=image2&name="+this.inputQuery.licenseUrl;
this.imgList = []; this.imgList = [];
previewImage({ this.imgList.push(this.certFileUrl)
imageUrl: this.inputQuery.licenseUrl, let index = this.inputQuery.licenseUrl.lastIndexOf('.');
certFileUrl: this.certFileUrl, if(index===-1){
}).then((response) => { this.$message.error("文件名异常!")
if (response.code === 20000) { return false
this.imgList = response.data; }
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
} }
console.log(this.imgList);
this.imgViewerVisible = true; this.imgViewerVisible = true;
}); // previewImage({
// imageUrl: this.inputQuery.licenseUrl,
// certFileUrl: this.certFileUrl,
// }).then((response) => {
// if (response.code === 20000) {
// }
// console.log(this.imgList);
// });
const m = (e) => { const m = (e) => {
e.preventDefault(); e.preventDefault();
}; };

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

Loading…
Cancel
Save