|
|
|
@ -141,17 +141,18 @@
|
|
|
|
|
:limit="1"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:on-exceed="uploadHandleExceed"
|
|
|
|
|
accept=".jpg,.png,.pdf,.doc"
|
|
|
|
|
accept=".jpg,.png"
|
|
|
|
|
:on-change="uploadOnchange"
|
|
|
|
|
:on-success="uploadHandleSuccess"
|
|
|
|
|
: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">
|
|
|
|
|
{{ choiceFile }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<div>只能上传 jpg,png,pdf,doc 文件,且不超过 10 MB</div>
|
|
|
|
|
<div>只能上传 jpg,png 文件,且不超过 10 MB</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -172,6 +173,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</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-form>
|
|
|
|
|
|
|
|
|
@ -181,8 +237,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import draggable from "vuedraggable";
|
|
|
|
|
import store from "@/store";
|
|
|
|
|
import {updateById} from '@/api/inout/orderDetailBiz'
|
|
|
|
|
import {updateOrderDetailBiz} from '@/api/inout/order'
|
|
|
|
|
import {updateBizById, updateById} from '@/api/inout/orderDetailBiz'
|
|
|
|
|
import {previewImage} from '@/api/purchase/supCompany'
|
|
|
|
|
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
|
|
|
|
|
|
|
|
@ -208,9 +263,10 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
imgList: [],
|
|
|
|
|
imgListCold:[],
|
|
|
|
|
imgViewerVisible: false,
|
|
|
|
|
imgViewerVisibleCold:false,
|
|
|
|
|
BASE_URL: process.env.VUE_APP_BASE_API,
|
|
|
|
|
IMAGE_URL: process.env.VUE_APP_SYNC_API,
|
|
|
|
|
code: "",
|
|
|
|
|
formData: {
|
|
|
|
|
ggxh: "",
|
|
|
|
@ -235,6 +291,7 @@ export default {
|
|
|
|
|
fileList: [],
|
|
|
|
|
headers: {},
|
|
|
|
|
choiceFile: "选取文件",
|
|
|
|
|
choiceFile1: "选取文件",
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
@ -243,7 +300,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
submitUpload() {
|
|
|
|
|
updateById(this.inputQuery).then((res) => {
|
|
|
|
|
updateBizById(this.inputQuery).then((res) => {
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
@ -303,6 +360,11 @@ export default {
|
|
|
|
|
this.inputQuery.checkFileName = null;
|
|
|
|
|
console.log(file, fileList);
|
|
|
|
|
},
|
|
|
|
|
uploadHandleRemove1(file, fileList) {
|
|
|
|
|
this.inputQuery.coldFilePath = null;
|
|
|
|
|
this.inputQuery.checkColdFileName = null;
|
|
|
|
|
console.log(file, fileList);
|
|
|
|
|
},
|
|
|
|
|
uploadHandlePreview(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
console.log(this.fileList);
|
|
|
|
@ -337,6 +399,33 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.inputQuery.filePath = response.data.name;
|
|
|
|
@ -345,10 +434,26 @@ export default {
|
|
|
|
|
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() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
|
|
|
|
|
this.imgList = [];
|
|
|
|
@ -366,6 +471,24 @@ export default {
|
|
|
|
|
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() {
|
|
|
|
|
this.imgViewerVisible = false;
|
|
|
|
|
const m = (e) => {
|
|
|
|
@ -375,6 +498,12 @@ export default {
|
|
|
|
|
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: {},
|
|
|
|
@ -403,10 +532,16 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
this.choiceFile = "选取检验报告";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.inputQuery.coldFilePath != null) {
|
|
|
|
|
this.choiceFile1 = "更换冷链报告";
|
|
|
|
|
} else {
|
|
|
|
|
this.choiceFile1 = "选取冷链报告";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
|
|
.ao-text {
|
|
|
|
|
width: 100%;
|
|
|
|
|