冷链报告

prod
wangwei 2 years ago
parent 2b2b45cb78
commit fb725bba03

@ -41,6 +41,14 @@ export function updateById(data) {
}); });
} }
export function updateBizById(data) {
return axios({
url: "/udiwms/inout/bizDetail/updateById",
method: "post",
data: data
});
}
export function insertInvoice(params) { export function insertInvoice(params) {
return axios({ return axios({
url: "/udiwms/inout/biz/insertInvoice", url: "/udiwms/inout/biz/insertInvoice",

@ -141,17 +141,18 @@
:limit="1" :limit="1"
:headers="headers" :headers="headers"
:on-exceed="uploadHandleExceed" :on-exceed="uploadHandleExceed"
accept=".jpg,.png,.pdf,.doc" accept=".jpg,.png"
:on-change="uploadOnchange" :on-change="uploadOnchange"
:on-success="uploadHandleSuccess" :on-success="uploadHandleSuccess"
:on-error="uploadHandleError" :on-error="uploadHandleError"
:on-before="uploadHandleBefore"
:file-list="fileList" :file-list="fileList"
:data="{type:'image2'}" :data="{type:'image2'}"
:auto-upload="true"> :auto-upload="true">
<el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1"> <el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1">
{{ choiceFile }} {{ choiceFile }}
</el-button> </el-button>
<div>只能上传 jpg,png,pdf,doc 文件且不超过 10 MB</div> <div>只能上传 jpg,png 文件且不超过 10 MB</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -172,6 +173,61 @@
</el-row> </el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>冷链报告上传</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item>
<el-upload
:disabled="formData.auditStatus == 1"
class="upload-demo"
ref="upload"
:action="this.uploadUrl"
:on-preview="uploadHandlePreview"
:on-remove="uploadHandleRemove1"
:limit="1"
:headers="headers"
:on-exceed="uploadHandleExceed"
accept=".jpg,.png"
:on-change="uploadOnchange1"
:on-success="uploadHandleSuccess1"
:on-error="uploadHandleError"
:on-before="uploadHandleBefore"
:file-list="fileList"
:data="{type:'image2'}"
:auto-upload="true">
<el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1">
{{ choiceFile1 }}
</el-button>
<div>只能上传 jpg,png 文件且不超过 10 MB</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text" v-if="this.inputQuery.coldFilePath!=null">
<span>冷链报告预览</span>
</div>
</el-col>
<el-col :span="8">
<el-button type="primary" size="mini" icon="search" v-if="this.inputQuery.coldFilePath!=null"
style="text-align:right" @click="showImgViewerCold">
冷链报告预览
</el-button>
<el-image-viewer v-if="imgViewerVisibleCold" style="z-index:9999" :on-close="closeImgViewerCold" :url-list="imgListCold"/>
</el-col>
</el-row>
</el-card> </el-card>
</el-form> </el-form>
@ -181,8 +237,7 @@
<script> <script>
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import store from "@/store"; import store from "@/store";
import {updateById} from '@/api/inout/orderDetailBiz' import {updateBizById, updateById} from '@/api/inout/orderDetailBiz'
import {updateOrderDetailBiz} from '@/api/inout/order'
import {previewImage} from '@/api/purchase/supCompany' import {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";
@ -208,9 +263,10 @@ export default {
data() { data() {
return { return {
imgList: [], imgList: [],
imgListCold:[],
imgViewerVisible: false, imgViewerVisible: false,
imgViewerVisibleCold:false,
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
IMAGE_URL: process.env.VUE_APP_SYNC_API,
code: "", code: "",
formData: { formData: {
ggxh: "", ggxh: "",
@ -235,6 +291,7 @@ export default {
fileList: [], fileList: [],
headers: {}, headers: {},
choiceFile: "选取文件", choiceFile: "选取文件",
choiceFile1: "选取文件",
}; };
}, },
@ -243,7 +300,7 @@ export default {
}, },
methods: { methods: {
submitUpload() { submitUpload() {
updateById(this.inputQuery).then((res) => { updateBizById(this.inputQuery).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message({ this.$message({
type: "success", type: "success",
@ -303,6 +360,11 @@ export default {
this.inputQuery.checkFileName = null; this.inputQuery.checkFileName = null;
console.log(file, fileList); console.log(file, fileList);
}, },
uploadHandleRemove1(file, fileList) {
this.inputQuery.coldFilePath = null;
this.inputQuery.checkColdFileName = null;
console.log(file, fileList);
},
uploadHandlePreview(file) { uploadHandlePreview(file) {
console.log(file); console.log(file);
console.log(this.fileList); console.log(this.fileList);
@ -337,6 +399,33 @@ export default {
} }
return isLt; return isLt;
}, },
uploadOnchange1(file, fileList) {
this.inputQuery.checkColdFileName = file.name;
let fileName = file.name;
let uid = file.uid
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png" && lastName.toLowerCase() !== ".doc" && lastName.toLowerCase() !== ".pdf") {
this.$message.error("上传文件只能是 jpg,png,doc,pdf 格式");
for (let i = 0; i < fileList.length; i++) {//list
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
return;
}
//
const isLt = file.size / 1024 / 1024 / 30 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 30MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
}
return isLt;
},
uploadHandleSuccess(response, file, fileList) { uploadHandleSuccess(response, file, fileList) {
if (response.code === 20000) { if (response.code === 20000) {
this.inputQuery.filePath = response.data.name; this.inputQuery.filePath = response.data.name;
@ -345,10 +434,26 @@ export default {
this.$message.error("文件上传失败:" + response.message); this.$message.error("文件上传失败:" + response.message);
} }
}, },
uploadHandleSuccess1(response, file, fileList) {
if (response.code === 20000) {
this.inputQuery.coldFilePath = response.data.name;
// this.onSubmit();
} else {
this.$message.error("文件上传失败:" + response.message);
}
},
uploadHandleError() { uploadHandleError() {
}, },
uploadHandleBefore(file) {
console.log(file)
let isJPG = file.type === 'image/jpeg';
let isPNG = file.type === 'image/png';
if (!isJPG && !isPNG) {
this.$message.error('只能上传jpg或png格式');
}
return isJPG || isPNG;
},
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=";
this.imgList = []; this.imgList = [];
@ -366,6 +471,24 @@ export default {
document.addEventListener("touchmove", m, false); // document.addEventListener("touchmove", m, false); //
}, },
showImgViewerCold(row){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.imgList = [];
previewImage({imageUrl: this.inputQuery.coldFilePath, certFileUrl: this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgList = response.data;
}
console.log(this.imgList)
this.imgViewerVisible = true;
});
const m = (e) => {
e.preventDefault()
};
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() { closeImgViewer() {
this.imgViewerVisible = false; this.imgViewerVisible = false;
const m = (e) => { const m = (e) => {
@ -375,6 +498,12 @@ export default {
document.removeEventListener("touchmove", m, true); document.removeEventListener("touchmove", m, true);
}, },
closeImgViewerCold(){
this.imgViewerVisibleCold = false;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
}, },
filters: {}, filters: {},
@ -403,10 +532,16 @@ export default {
} else { } else {
this.choiceFile = "选取检验报告"; this.choiceFile = "选取检验报告";
} }
if (this.inputQuery.coldFilePath != null) {
this.choiceFile1 = "更换冷链报告";
} else {
this.choiceFile1 = "选取冷链报告";
}
}, },
}; };
</script> </script>
<style scoped> <style>
.ao-text { .ao-text {
width: 100%; width: 100%;

@ -199,13 +199,13 @@
<el-button type="text" :disabled="scope.row.checkStatus==1" size="small" <el-button type="text" :disabled="scope.row.checkStatus==1" size="small"
@click.native.stop="determine(scope.row)">确认 @click.native.stop="determine(scope.row)">确认
</el-button> </el-button>
<!--<el-button--> <el-button
<!-- type="text"--> type="text"
<!-- size="small"--> size="small"
<!-- @click.native.stop="InvoiceRegister1(scope.row)"--> @click.native.stop="InvoiceRegister1(scope.row)"
<!--&gt;发票登记--> >发票登记
<!--</el-button--> </el-button
<!--&gt;--> >
<el-button <el-button
type="text" type="text"
@click="getNewInv(scope.row)" @click="getNewInv(scope.row)"

@ -273,6 +273,40 @@
prop="manufacturer" prop="manufacturer"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column
label="检验报告"
width="160"
prop="filePath"
show-overflow-tooltip
>
<template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.checkFileName }}</div>
</template>
</el-table-column>
<el-table-column
label="冷链报告"
width="160"
prop="coldFilePath"
show-overflow-tooltip
>
<template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewerCold(scope.row)">{{ scope.row.checkColdFileName }}</div>
</template>
</el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="upload(scope.row)"
v-if="scope.row.checkFileName != null"
>预览
</el-button
>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="bizTotal>0" v-show="bizTotal>0"
@ -364,6 +398,27 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
<el-image-viewer v-if="imgViewerVisibleCold" style="z-index:9999" :on-close="closeImgViewerCold" :url-list="imgListCold"/>
<el-dialog
title="检验报告"
:visible.sync="Upinvoice"
:before-close="freshen"
width="60%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="Upinvoice"
>
<DialogCheck
:closeDialog="closeCheckDialog"
:inputQuery="currentManufacturer"
></DialogCheck>
</el-dialog>
<el-dialog <el-dialog
title="根据当前单据生成新单据" title="根据当前单据生成新单据"
@ -397,6 +452,10 @@ import {getCodeDetailList} from "@/api/inout/orderDetailCode";
import {getCodeList} from "@/api/inout/code"; import {getCodeList} from "@/api/inout/code";
import {inspectionOrderPDFFromTemplateFile, orderPDFFromTemplateFile} from "@/api/itextpdf/orderPrint" import {inspectionOrderPDFFromTemplateFile, orderPDFFromTemplateFile} from "@/api/itextpdf/orderPrint"
import DialogcChangeNewOrder from "@/views/inout/DialogcChangeNewOrder"; import DialogcChangeNewOrder from "@/views/inout/DialogcChangeNewOrder";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import DialogCheck from "@/views/inout/DialogCheck";
const formJson = { const formJson = {
@ -410,7 +469,14 @@ export default {
name: "IoAuditedOrder", name: "IoAuditedOrder",
data() { data() {
return { return {
BASE_URL: process.env.VUE_APP_BASE_API,
imgViewerVisible:false,
imgViewerVisibleCold:false,
currentManufacturer:{},
imgList:[],
imgListCold:[],
showSearch: true, showSearch: true,
Upinvoice:false,
filterQuery: { filterQuery: {
id: "", id: "",
billNo: null, billNo: null,
@ -529,7 +595,7 @@ export default {
curRow: null, curRow: null,
}; };
}, },
components: {DialogcChangeNewOrder}, components: {DialogcChangeNewOrder,ElImageViewer,DialogCheck},
methods: { methods: {
onReset() { onReset() {
this.$router.push({ this.$router.push({
@ -572,6 +638,72 @@ export default {
this.filterQuery.page = 1; this.filterQuery.page = 1;
this.getList(); this.getList();
}, },
showImgViewer(row){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
console.log(this.certFileUrl+"========");
this.imgList=[];
previewImage({imageUrl:row.filePath,certFileUrl:this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgList=response.data;
}
console.log(this.imgList)
this.imgViewerVisible = true;
});
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
},
showImgViewerCold(row){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
console.log(this.certFileUrl+"========");
this.imgListCold=[];
previewImage({imageUrl:row.coldFilePath,certFileUrl:this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgListCold=response.data;
}
console.log(this.imgListCold)
this.imgViewerVisibleCold = true;
});
const m = (e) => { e.preventDefault() };
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);
},
closeImgViewerCold(){
this.imgViewerVisibleCold = false;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
upload(row){
this.currentManufacturer = row;
this.Upinvoice = true;
},
freshen(){
this.Upinvoice = false;
this.getOrderDetails();
},
closeCheckDialog(){
this.Upinvoice = false;
this.getOrderDetails();
},
hideSearch() { hideSearch() {
this.showSearch = !this.showSearch; this.showSearch = !this.showSearch;
}, },

@ -259,13 +259,25 @@
<el-table-column <el-table-column
label="检验报告" label="检验报告"
width="160" width="160"
prop="checkFileName" prop="filePath"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.checkFileName }}</div> <div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.checkFileName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="冷链报告"
width="160"
prop="coldFilePath"
show-overflow-tooltip
>
<template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewerCold(scope.row)">{{ scope.row.checkColdFileName }}</div>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -281,6 +293,9 @@
</el-table> </el-table>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/> <el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
<el-image-viewer v-if="imgViewerVisibleCold" style="z-index:9999" :on-close="closeImgViewerCold" :url-list="imgListCold"/>
<pagination <pagination
v-show="bizTotal>0" v-show="bizTotal>0"
:total="bizTotal" :total="bizTotal"
@ -526,7 +541,9 @@ export default {
data() { data() {
return { return {
imgList: [], imgList: [],
imgListCold:[],
imgViewerVisible: false, imgViewerVisible: false,
imgViewerVisibleCold:false,
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
IMAGE_URL: process.env.VUE_APP_SYNC_API, IMAGE_URL: process.env.VUE_APP_SYNC_API,
showSearch: true, showSearch: true,
@ -722,6 +739,22 @@ export default {
document.addEventListener("touchmove", m, false); // document.addEventListener("touchmove", m, false); //
}, },
showImgViewerCold(row){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
console.log(this.certFileUrl+"========");
this.imgListCold=[];
previewImage({imageUrl:row.coldFilePath,certFileUrl:this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgListCold=response.data;
}
console.log(this.imgListCold)
this.imgViewerVisibleCold = true;
});
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() { closeImgViewer() {
this.imgViewerVisible = false; this.imgViewerVisible = false;
const m = (e) => { const m = (e) => {
@ -731,6 +764,13 @@ export default {
document.removeEventListener("touchmove", m, true); document.removeEventListener("touchmove", m, true);
}, },
closeImgViewerCold(){
this.imgViewerVisibleCold = false;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
invChange() { invChange() {
this.filterQuery.action = null; this.filterQuery.action = null;
this.busTypes = []; this.busTypes = [];

@ -246,20 +246,34 @@
<el-table-column <el-table-column
label="检验报告" label="检验报告"
width="160" width="160"
prop="checkFileName" prop="filePath"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.checkFileName }}</div> <div style="color: #1890ff;" @click="showImgViewer(scope.row)">{{ scope.row.checkFileName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="冷链报告"
width="160"
prop="coldFilePath"
show-overflow-tooltip
>
<template slot-scope="scope">
<div style="color: #1890ff;" @click="showImgViewerCold(scope.row)">{{ scope.row.checkColdFileName }}</div>
</template>
</el-table-column>
<el-table-column label="操作" width="160" fixed="right"> <el-table-column label="操作" width="160" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="upload(scope.row)" @click.native.stop="upload(scope.row)"
>检验报告 >预览
</el-button </el-button
> >
</template> </template>
@ -354,10 +368,12 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/> <el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer" :url-list="imgList"/>
<el-image-viewer v-if="imgViewerVisibleCold" style="z-index:9999" :on-close="closeImgViewerCold" :url-list="imgListCold"/>
<el-dialog <el-dialog
title="编辑" title="检验报告"
:visible.sync="Upinvoice" :visible.sync="Upinvoice"
:before-close="freshen" :before-close="freshen"
width="60%" width="60%"
@ -422,7 +438,9 @@ export default {
return { return {
BASE_URL: process.env.VUE_APP_BASE_API, BASE_URL: process.env.VUE_APP_BASE_API,
imgList: [], imgList: [],
imgListCold:[],
imgViewerVisible: false, imgViewerVisible: false,
imgViewerVisibleCold:false,
showSearch: true, showSearch: true,
Upinvoice: false, Upinvoice: false,
currentManufacturer: {}, currentManufacturer: {},
@ -615,6 +633,24 @@ export default {
document.addEventListener("touchmove", m, false); // document.addEventListener("touchmove", m, false); //
}, },
showImgViewerCold(row){
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
console.log(this.certFileUrl+"========");
this.imgListCold=[];
previewImage({imageUrl:row.coldFilePath,certFileUrl:this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgListCold=response.data;
}
console.log(this.imgListCold)
this.imgViewerVisibleCold = true;
});
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() { closeImgViewer() {
this.imgViewerVisible = false; this.imgViewerVisible = false;
const m = (e) => { const m = (e) => {
@ -624,15 +660,24 @@ export default {
document.removeEventListener("touchmove", m, true); document.removeEventListener("touchmove", m, true);
}, },
closeImgViewerCold(){
this.imgViewerVisibleCold = false;
const m = (e) => { e.preventDefault() };
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
upload(row) { upload(row) {
this.currentManufacturer = row; this.currentManufacturer = row;
this.Upinvoice = true; this.Upinvoice = true;
}, },
closeCheckDialog() { closeCheckDialog() {
this.Upinvoice = false; this.Upinvoice = false;
this.getOrderDetails(); this.getOrderDetails();
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.currentRow.billNo = val.billNo; this.currentRow.billNo = val.billNo;
this.getOrderDetails(); this.getOrderDetails();
@ -857,6 +902,7 @@ export default {
this.Upinvoice = false; this.Upinvoice = false;
this.getOrderDetails(); this.getOrderDetails();
}, },
onResultReset() { onResultReset() {
this.resultQuery = { this.resultQuery = {
orderId: null, orderId: null,

Loading…
Cancel
Save